summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2019-03-26 13:47:43 -0700
committerGitHub <noreply@github.com>2019-03-26 13:47:43 -0700
commit2c93ce5a28a12e2a59d84f602c97b24ff06b72fb (patch)
tree4e2fcaf24a03bc54bbeb6804c0e0da6cf8449587 /ports
parent952c9c56b20a65b865c21a6e66e2b4baa82377d8 (diff)
parent2229f17911bae7f6db386aad96ac3fa077a46862 (diff)
Merge pull request #1672 from dhalbert/regular-fs-flush
flush flash filesystem once a second
Diffstat (limited to 'ports')
-rw-r--r--ports/atmel-samd/background.c2
-rw-r--r--ports/nrf/background.c2
-rw-r--r--ports/nrf/tick.c14
3 files changed, 13 insertions, 5 deletions
diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c
index 519d0eeec..a8c4e3891 100644
--- a/ports/atmel-samd/background.c
+++ b/ports/atmel-samd/background.c
@@ -27,6 +27,7 @@
#include "audio_dma.h"
#include "tick.h"
+#include "supervisor/filesystem.h"
#include "supervisor/usb.h"
#include "py/runtime.h"
@@ -53,6 +54,7 @@ void run_background_tasks(void) {
#if CIRCUITPY_NETWORK
network_module_background();
#endif
+ filesystem_background();
usb_background();
assert_heap_ok();
diff --git a/ports/nrf/background.c b/ports/nrf/background.c
index 69c76fd06..ea6e846b3 100644
--- a/ports/nrf/background.c
+++ b/ports/nrf/background.c
@@ -25,6 +25,7 @@
*/
#include "py/runtime.h"
+#include "supervisor/filesystem.h"
#include "supervisor/usb.h"
#include "supervisor/shared/stack.h"
@@ -33,6 +34,7 @@
#endif
void run_background_tasks(void) {
+ filesystem_background();
usb_background();
#ifdef CIRCUITPY_DISPLAYIO
diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c
index cdd329f71..6d8fd13e0 100644
--- a/ports/nrf/tick.c
+++ b/ports/nrf/tick.c
@@ -27,6 +27,7 @@
#include "tick.h"
#include "supervisor/shared/autoreload.h"
+#include "supervisor/filesystem.h"
#include "shared-module/gamepad/__init__.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "nrf.h"
@@ -39,14 +40,17 @@ void SysTick_Handler(void) {
// (every millisecond).
ticks_ms += 1;
- #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
- autoreload_tick();
- #endif
- #ifdef CIRCUITPY_GAMEPAD_TICKS
+#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0
+ filesystem_tick();
+#endif
+#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
+ autoreload_tick();
+#endif
+#ifdef CIRCUITPY_GAMEPAD_TICKS
if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) {
gamepad_tick();
}
- #endif
+#endif
}
void tick_init() {