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
This commit is contained in:
Scott Shawcroft 2019-09-10 10:37:26 -07:00 committed by GitHub
commit 9d95cc7ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -29,6 +29,7 @@
#include "peripheral_clk_config.h" #include "peripheral_clk_config.h"
#include "supervisor/shared/autoreload.h" #include "supervisor/shared/autoreload.h"
#include "supervisor/filesystem.h"
#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h"
@ -52,6 +53,9 @@ void SysTick_Handler(void) {
(void) SysTick->CTRL; (void) SysTick->CTRL;
common_hal_mcu_enable_interrupts(); common_hal_mcu_enable_interrupts();
#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0
filesystem_tick();
#endif
#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
autoreload_tick(); autoreload_tick();
#endif #endif

View File

@ -428,6 +428,7 @@ static bool flush_ram_cache(bool keep_cache) {
} }
// Delegates to the correct flash flush method depending on the existing 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) { static void spi_flash_flush_keep_cache(bool keep_cache) {
#ifdef MICROPY_HW_LED_MSC #ifdef MICROPY_HW_LED_MSC
port_pin_set_output_level(MICROPY_HW_LED_MSC, true); port_pin_set_output_level(MICROPY_HW_LED_MSC, true);

View File

@ -266,9 +266,15 @@ void temp_status_color(uint32_t rgb) {
void clear_temp_status() { void clear_temp_status() {
#ifdef MICROPY_HW_NEOPIXEL #ifdef MICROPY_HW_NEOPIXEL
if (neopixel_in_use) {
return;
}
common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3); common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3);
#endif #endif
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) #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 #if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH); shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
#else #else