8000 Merge pull request #2136 from dhalbert/filesystem-tick-status-fixes · adafruit/circuitpython@9d95cc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d95cc7

Browse files
authored
Merge pull request #2136 from dhalbert/filesystem-tick-status-fixes
fix atmel-samd filesystem_tick'ing; clear_temp_status() should check for status indicator in use
2 parents 2b56001 + b8200d7 commit 9d95cc7

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

ports/atmel-samd/tick.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "peripheral_clk_config.h"
3030

3131
#include "supervisor/shared/autoreload.h"
32+
#include "supervisor/filesystem.h"
3233
#include "shared-bindings/microcontroller/__init__.h"
3334
#include "shared-bindings/microcontroller/Processor.h"
3435

@@ -52,10 +53,13 @@ void SysTick_Handler(void) {
5253
(void) SysTick->CTRL;
5354
common_hal_mcu_enable_interrupts();
5455

55-
#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
56+
#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0
57+
filesystem_tick();
58+
#endif
59+
#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
5660
autoreload_tick();
57-
#endif
58-
#ifdef CIRCUITPY_GAMEPAD_TICKS
61+
#endif
62+
#ifdef CIRCUITPY_GAMEPAD_TICKS
5963
if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) {
6064
#if CIRCUITPY_GAMEPAD
6165
gamepad_tick();
@@ -64,7 +68,7 @@ void SysTick_Handler(void) {
6468
gamepadshift_tick();
6569
#endif
6670
}
67-
#endif
71+
#endif
6872
}
6973

7074
void tick_init() {

supervisor/shared/external_flash/external_flash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ static bool flush_ram_cache(bool keep_cache) {
428428
}
429429

430430
// Delegates to the correct flash flush method depending on the existing cache.
431+
// TODO Don't blink the status indicator if we don't actually do any writing (hard to tell right now).
431432
static void spi_flash_flush_keep_cache(bool keep_cache) {
432433
#ifdef MICROPY_HW_LED_MSC
433434
port_pin_set_output_level(MICROPY_HW_LED_MSC, true);

supervisor/shared/rgb_led_status.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,15 @@ void temp_status_color(uint32_t rgb) {
266266

267267
void clear_temp_status() {
268268
#ifdef MICROPY_HW_NEOPIXEL
269+
if (neopixel_in_use) {
270+
return;
271+
}
269272
common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3);
270273
#endif
271274
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
275+
if (apa102_mosi_in_use || apa102_sck_in_use) {
276+
return;
277+
}
272278
#if CIRCUITPY_BITBANG_APA102
273279
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
274280
#else

0 commit comments

Comments
 (0)
0