summaryrefslogtreecommitdiff
path: root/supervisor/shared/flash.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-03-20 12:58:34 -0700
committerScott Shawcroft <scott@tannewt.org>2020-03-20 12:58:34 -0700
commit2623022c846698d8a6b9cfab8617aa569c5aef2f (patch)
tree1caf31eda829fb1c8c22b91650642919598ff9bf /supervisor/shared/flash.c
parent6db11cf68ba2d5e17c6267f36f516bc0abce4643 (diff)
Initial work for STM32. Need to fix us delay and PulseIn still.
Diffstat (limited to 'supervisor/shared/flash.c')
-rw-r--r--supervisor/shared/flash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c
index e0bf83490..298e7d83e 100644
--- a/supervisor/shared/flash.c
+++ b/supervisor/shared/flash.c
@@ -111,7 +111,7 @@ mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_bloc
return supervisor_flash_read_blocks(dest, block_num - PART1_START_BLOCK, num_blocks);
}
-volatile bool filesystem_dirty;
+volatile bool filesystem_dirty = false;
mp_uint_t flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) {
if (block_num == 0) {
@@ -137,7 +137,9 @@ void supervisor_flash_flush(void) {
supervisor_external_flash_flush();
#endif
// Turn off ticks now that our filesystem has been flushed.
- supervisor_disable_tick();
+ if (filesystem_dirty) {
+ supervisor_disable_tick();
+ }
filesystem_dirty = false;
}