File tree Expand file tree Collapse file tree 6 files changed +21
-9
lines changed Expand file tree Collapse file tree 6 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -190,9 +190,7 @@ void reset_displays(void) {
190
190
common_hal_displayio_epaperdisplay_show (display , NULL );
191
191
#if CIRCUITPY_FRAMEBUFFERIO
192
192
} else if (displays [i ].framebuffer_display .base .type == & framebufferio_framebufferdisplay_type ) {
193
- framebufferio_framebufferdisplay_obj_t * display = & displays [i ].framebuffer_display ;
194
- display -> auto_refresh = true;
195
- common_hal_framebufferio_framebufferdisplay_show (display , NULL );
193
+ framebufferio_framebufferdisplay_reset (& displays [i ].framebuffer_display );
196
194
#endif
197
195
}
198
196
}
Original file line number Diff line number Diff line change @@ -318,3 +318,8 @@ void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisp
318
318
gc_collect_ptr (self -> framebuffer );
319
319
displayio_display_core_collect_ptrs (& self -> core );
320
320
}
321
+
322
+ void framebufferio_framebufferdisplay_reset (framebufferio_framebufferdisplay_obj_t * self ) {
323
+ common_hal_framebufferio_framebufferdisplay_set_auto_refresh (self , true);
324
+ common_hal_framebufferio_framebufferdisplay_show (self , NULL );
325
+ }
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ typedef struct {
55
55
void framebufferio_framebufferdisplay_background (framebufferio_framebufferdisplay_obj_t * self );
56
56
void release_framebufferdisplay (framebufferio_framebufferdisplay_obj_t * self );
57
57
void reset_framebufferdisplay (framebufferio_framebufferdisplay_obj_t * self );
58
+ void framebufferio_framebufferdisplay_reset (framebufferio_framebufferdisplay_obj_t * self );
58
59
59
60
void framebufferio_framebufferdisplay_collect_ptrs (framebufferio_framebufferdisplay_obj_t * self );
60
61
Original file line number Diff line number Diff line change 24
24
* THE SOFTWARE.
25
25
*/
26
26
27
+ #include <string.h>
28
+
27
29
#include "py/gc.h"
28
30
#include "py/mpconfig.h"
29
31
#include "supervisor/background_callback.h"
@@ -101,6 +103,12 @@ void background_callback_end_critical_section() {
101
103
102
104
void background_callback_reset () {
103
105
CALLBACK_CRITICAL_BEGIN ;
106
+ background_callback_t * cb = (background_callback_t * )callback_head ;
107
+ while (cb ) {
108
+ background_callback_t * next = cb -> next ;
109
+ memset (cb , 0 , sizeof (* cb ));
110
+ cb = next ;
111
+ }
104
112
callback_head = NULL ;
105
113
callback_tail = NULL ;
106
114
in_background_callback = false;
Original file line number Diff line number Diff line change 66
66
67
67
static volatile uint64_t PLACE_IN_DTCM_BSS (background_ticks );
68
68
69
- static background_callback_t callback ;
69
+ static background_callback_t tick_callback ;
70
70
71
71
volatile uint64_t last_finished_tick = 0 ;
72
72
@@ -119,7 +119,7 @@ void supervisor_tick(void) {
119
119
#endif
120
120
}
121
121
#endif
122
- background_callback_add (& callback , supervisor_background_tasks , NULL );
122
+ background_callback_add (& tick_callback , supervisor_background_tasks , NULL );
123
123
}
124
124
125
125
uint64_t supervisor_ticks_ms64 () {
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ void usb_init(void) {
64
64
tusb_init ();
65
65
66
66
#if MICROPY_KBD_EXCEPTION
67
- // Set Ctrl+C as wanted char, tud_cdc_rx_wanted_cb() callback will be invoked when Ctrl+C is received
68
- // This callback always got invoked regardless of mp_interrupt_char value since we only set it once here
67
+ // Set Ctrl+C as wanted char, tud_cdc_rx_wanted_cb() usb_callback will be invoked when Ctrl+C is received
68
+ // This usb_callback always got invoked regardless of mp_interrupt_char value since we only set it once here
69
69
tud_cdc_set_wanted_char (CHAR_CTRL_C );
70
70
#endif
71
71
@@ -83,14 +83,14 @@ void usb_background(void) {
83
83
}
84
84
}
85
85
86
- static background_callback_t callback ;
86
+ static background_callback_t usb_callback ;
87
87
static void usb_background_do (void * unused ) {
88
88
usb_background ();
89
89
}
90
90
91
91
void usb_irq_handler (void ) {
92
92
tud_int_handler (0 );
93
- background_callback_add (& callback , usb_background_do , NULL );
93
+ background_callback_add (& usb_callback , usb_background_do , NULL );
94
94
}
95
95
96
96
//--------------------------------------------------------------------+
You can’t perform that action at this time.
0 commit comments