File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -160,4 +160,8 @@ extern const struct _mp_obj_module_t uheap_module;
160
160
mp_obj_t mp_kbd_exception; \
161
161
FLASH_ROOT_POINTERS \
162
162
163
+ bool udi_msc_process_trans (void );
164
+ #define MICROPY_VM_HOOK_LOOP udi_msc_process_trans();
165
+ #define MICROPY_VM_HOOK_RETURN udi_msc_process_trans();
166
+
163
167
#endif // __INCLUDED_MPCONFIGPORT_H
Original file line number Diff line number Diff line change @@ -154,10 +154,9 @@ int receive_usb(void) {
154
154
155
155
int mp_hal_stdin_rx_chr (void ) {
156
156
for (;;) {
157
- // Process any mass storage transfers.
158
- if (mp_msc_enabled ) {
159
- udi_msc_process_trans ();
160
- }
157
+ #ifdef MICROPY_VM_HOOK_LOOP
158
+ MICROPY_VM_HOOK_LOOP
159
+ #endif
161
160
#ifdef USB_REPL
162
161
if (reset_next_character ) {
163
162
return CHAR_CTRL_D ;
@@ -211,9 +210,9 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) {
211
210
}
212
211
}
213
212
start += transmit ;
214
- if ( mp_msc_enabled ) {
215
- udi_msc_process_trans ();
216
- }
213
+ #ifdef MICROPY_VM_HOOK_LOOP
214
+ MICROPY_VM_HOOK_LOOP
215
+ #endif
217
216
duration = (common_hal_time_monotonic () - start_tick );
218
217
}
219
218
}
@@ -236,7 +235,9 @@ void mp_hal_delay_ms(mp_uint_t delay) {
236
235
uint64_t start_tick = common_hal_time_monotonic ();
237
236
uint64_t duration = 0 ;
238
237
while (duration < delay ) {
239
- udi_msc_process_trans ();
238
+ #ifdef MICROPY_VM_HOOK_LOOP
239
+ MICROPY_VM_HOOK_LOOP
240
+ #endif
240
241
// Check to see if we've been CTRL-Ced by autoreset or the user.
241
242
if (MP_STATE_VM (mp_pending_exception ) == MP_STATE_PORT (mp_kbd_exception )) {
242
243
break ;
You can’t perform that action at this time.
0 commit comments