File tree Expand file tree Collapse file tree 6 files changed +13
-3
lines changed Expand file tree Collapse file tree 6 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ STATIC void stop_mp(void) {
184
184
#endif
185
185
186
186
background_callback_reset ();
187
+ usb_background ();
187
188
188
189
gc_deinit ();
189
190
}
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
11
11
CIRCUITPY_FULL_BUILD = 0
12
12
13
13
SUPEROPT_GC = 0
14
+ SUPEROPT_VM = 0
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
11
11
CIRCUITPY_FULL_BUILD = 0
12
12
13
13
SUPEROPT_GC = 0
14
+ SUPEROPT_VM = 0
Original file line number Diff line number Diff line change 33
33
#include "supervisor/shared/tick.h"
34
34
#include "shared-bindings/microcontroller/__init__.h"
35
35
36
- STATIC volatile background_callback_t * callback_head , * callback_tail ;
36
+ STATIC volatile background_callback_t * volatile callback_head , * volatile callback_tail ;
37
37
38
38
#define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts())
39
39
#define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts())
@@ -50,7 +50,6 @@ void background_callback_add_core(background_callback_t *cb) {
50
50
cb -> prev = (background_callback_t * )callback_tail ;
51
51
if (callback_tail ) {
52
52
callback_tail -> next = cb ;
53
- cb -> prev = (background_callback_t * )callback_tail ;
54
53
}
55
54
if (!callback_head ) {
56
55
callback_head = cb ;
Original file line number Diff line number Diff line change @@ -111,9 +111,14 @@ static void usb_background_do(void* unused) {
111
111
usb_background ();
112
112
}
113
113
114
+ void usb_background_schedule (void )
115
+ {
116
+ background_callback_add (& usb_callback , usb_background_do , NULL );
117
+ }
118
+
114
119
void usb_irq_handler (void ) {
115
120
tud_int_handler (0 );
116
- background_callback_add ( & usb_callback , usb_background_do , NULL );
121
+ usb_background_schedule ( );
117
122
}
118
123
119
124
//--------------------------------------------------------------------+
Original file line number Diff line number Diff line change 35
35
// it may be necessary to call it directly.
36
36
void usb_background (void );
37
37
38
+ // Schedule usb background
39
+ void usb_background_schedule (void );
40
+
38
41
// Ports must call this from their particular USB IRQ handler
39
42
void usb_irq_handler (void );
40
43
You can’t perform that action at this time.
0 commit comments