summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2019-09-10 10:37:26 -0700
committerGitHub <noreply@github.com>2019-09-10 10:37:26 -0700
commit9d95cc7ef92a9922af5462b9e7bec14e60504857 (patch)
treea8ad2084b47638399a04659c08da47ea0b13e5ea
parent2b560015c9e0874c4f320ccb039b4e1197437bdb (diff)
parentb8200d72950f4d360a29e2f62d49773954942e5f (diff)
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
-rw-r--r--ports/atmel-samd/tick.c12
-rw-r--r--supervisor/shared/external_flash/external_flash.c1
-rw-r--r--supervisor/shared/rgb_led_status.c6
3 files changed, 15 insertions, 4 deletions
diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c
index dde473375..4d7bb9dca 100644
--- a/ports/atmel-samd/tick.c
+++ b/ports/atmel-samd/tick.c
@@ -29,6 +29,7 @@
#include "peripheral_clk_config.h"
#include "supervisor/shared/autoreload.h"
+#include "supervisor/filesystem.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Processor.h"
@@ -52,10 +53,13 @@ void SysTick_Handler(void) {
(void) SysTick->CTRL;
common_hal_mcu_enable_interrupts();
- #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
+#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0
+ filesystem_tick();
+#endif
+#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
autoreload_tick();
- #endif
- #ifdef CIRCUITPY_GAMEPAD_TICKS
+#endif
+#ifdef CIRCUITPY_GAMEPAD_TICKS
if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) {
#if CIRCUITPY_GAMEPAD
gamepad_tick();
@@ -64,7 +68,7 @@ void SysTick_Handler(void) {
gamepadshift_tick();
#endif
}
- #endif
+#endif
}
void tick_init() {
diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c
index ad10bab51..99df553e1 100644
--- a/supervisor/shared/external_flash/external_flash.c
+++ b/supervisor/shared/external_flash/external_flash.c
@@ -428,6 +428,7 @@ static bool flush_ram_cache(bool keep_cache) {
}
// Delegates to the correct flash flush method depending on the existing cache.
+// TODO Don't blink the status indicator if we don't actually do any writing (hard to tell right now).
static void spi_flash_flush_keep_cache(bool keep_cache) {
#ifdef MICROPY_HW_LED_MSC
port_pin_set_output_level(MICROPY_HW_LED_MSC, true);
diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c
index fd356cb48..4d9371516 100644
--- a/supervisor/shared/rgb_led_status.c
+++ b/supervisor/shared/rgb_led_status.c
@@ -266,9 +266,15 @@ void temp_status_color(uint32_t rgb) {
void clear_temp_status() {
#ifdef MICROPY_HW_NEOPIXEL
+ if (neopixel_in_use) {
+ return;
+ }
common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3);
#endif
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
+ if (apa102_mosi_in_use || apa102_sck_in_use) {
+ return;
+ }
#if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
#else