From 3cb64d984ac574f3e98c1d41e37bc809c3bbf0f0 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 27 Aug 2016 17:05:56 +0200 Subject: [PATCH] [Taranis] EEPROM async write was disabled --- radio/src/main_arm.cpp | 7 +++++-- radio/src/storage/eeprom_rlc.cpp | 4 ++-- radio/src/storage/eeprom_rlc.h | 13 +++---------- radio/src/targets/common/avr/eeprom_driver.cpp | 1 - 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/radio/src/main_arm.cpp b/radio/src/main_arm.cpp index 29aec647a..ea36ff816 100644 --- a/radio/src/main_arm.cpp +++ b/radio/src/main_arm.cpp @@ -84,7 +84,7 @@ void checkEeprom() eepromWriteProcess(); else if (TIME_TO_WRITE()) storageCheck(false); - } + } } #else void checkEeprom() @@ -399,7 +399,10 @@ void perMain() DEBUG_TIMER_STOP(debugTimerPerMain1); event_t evt = getEvent(false); - if (evt && (g_eeGeneral.backlightMode & e_backlight_mode_keys)) backlightOn(); // on keypress turn the light on + if (evt && (g_eeGeneral.backlightMode & e_backlight_mode_keys)) { + // on keypress turn the light on + backlightOn(); + } doLoopCommonActions(); #if defined(NAVIGATION_STICKS) uint8_t sticks_evt = getSticksNavigationEvent(); diff --git a/radio/src/storage/eeprom_rlc.cpp b/radio/src/storage/eeprom_rlc.cpp index db1db4256..65e9b867a 100644 --- a/radio/src/storage/eeprom_rlc.cpp +++ b/radio/src/storage/eeprom_rlc.cpp @@ -29,10 +29,10 @@ EeFs eeFs; #if defined(CPUARM) blkid_t freeBlocks = 0; -#else -uint8_t s_sync_write = false; #endif +uint8_t s_sync_write = false; + static uint8_t EeFsRead(blkid_t blk, uint8_t ofs) { uint8_t byte; diff --git a/radio/src/storage/eeprom_rlc.h b/radio/src/storage/eeprom_rlc.h index b16789650..f687a6b9e 100644 --- a/radio/src/storage/eeprom_rlc.h +++ b/radio/src/storage/eeprom_rlc.h @@ -117,19 +117,12 @@ class EFile #define ERR_NONE 0 #define ERR_FULL 1 -extern uint8_t s_write_err; // error reasons +extern uint8_t s_write_err; // error reasons +inline uint8_t write_errno() { return s_write_err; } -#if defined(CPUARM) -#define ENABLE_SYNC_WRITE(val) -#define IS_SYNC_WRITE_ENABLE() true -#else +extern uint8_t s_sync_write; #define ENABLE_SYNC_WRITE(val) s_sync_write = val; #define IS_SYNC_WRITE_ENABLE() s_sync_write -#endif - - -///deliver current errno, this is reset in open -inline uint8_t write_errno() { return s_write_err; } class RlcFile: public EFile { diff --git a/radio/src/targets/common/avr/eeprom_driver.cpp b/radio/src/targets/common/avr/eeprom_driver.cpp index 30a56fcb2..c803255dd 100644 --- a/radio/src/targets/common/avr/eeprom_driver.cpp +++ b/radio/src/targets/common/avr/eeprom_driver.cpp @@ -74,7 +74,6 @@ uint8_t eepromIsTransferComplete() return eeprom_buffer_size == 0; } -extern uint8_t s_sync_write; void eepromWriteBlock(uint8_t * buffer, size_t address, size_t size) { eepromStartWrite(buffer, address, size);