File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,4 +160,8 @@ extern const struct _mp_obj_module_t uheap_module;
160160 mp_obj_t mp_kbd_exception; \
161161 FLASH_ROOT_POINTERS \
162162
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+
163167#endif // __INCLUDED_MPCONFIGPORT_H
Original file line number Diff line number Diff line change @@ -154,10 +154,9 @@ int receive_usb(void) {
154154
155155int mp_hal_stdin_rx_chr (void ) {
156156 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
161160 #ifdef USB_REPL
162161 if (reset_next_character ) {
163162 return CHAR_CTRL_D ;
@@ -211,9 +210,9 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) {
211210 }
212211 }
213212 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
217216 duration = (common_hal_time_monotonic () - start_tick );
218217 }
219218 }
@@ -236,7 +235,9 @@ void mp_hal_delay_ms(mp_uint_t delay) {
236235 uint64_t start_tick = common_hal_time_monotonic ();
237236 uint64_t duration = 0 ;
238237 while (duration < delay ) {
239- udi_msc_process_trans ();
238+ #ifdef MICROPY_VM_HOOK_LOOP
239+ MICROPY_VM_HOOK_LOOP
240+ #endif
240241 // Check to see if we've been CTRL-Ced by autoreset or the user.
241242 if (MP_STATE_VM (mp_pending_exception ) == MP_STATE_PORT (mp_kbd_exception )) {
242243 break ;
You can’t perform that action at this time.
0 commit comments