diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 625837d70..535337c75 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -468,5 +468,11 @@ if(CPU_FAMILY STREQUAL STM32) DEPENDS firmware WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) + + add_custom_target(jtag-flash + COMMAND st-flash --reset write firmware.bin 0x8000000 + DEPENDS firmware + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) endif() endif() diff --git a/radio/src/debug.h b/radio/src/debug.h index de2e4dc51..7ced8d202 100644 --- a/radio/src/debug.h +++ b/radio/src/debug.h @@ -335,7 +335,7 @@ extern const char * debugTimerNames[DEBUG_TIMERS_COUNT]; #endif // #if defined(__cplusplus) #define DEBUG_TIMER_START(timer) debugTimers[timer].start() -#define DEBUG_TIMER_STOP(timer) debugTimers[timer].stop() +#define DEBUG_TIMER_STOP(timer) debugTimers[timer].stop() #define DEBUG_TIMER_SAMPLE(timer) debugTimers[timer].sample() diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 353ae5bfa..27081b5d2 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -1497,7 +1497,7 @@ union ReusableBuffer } sdmanager; #endif -#if defined(PCBTARANIS) +#if defined(CPUSTM32) struct { char id[27]; diff --git a/radio/src/switches.cpp b/radio/src/switches.cpp index c7edb330e..3c40ab682 100644 --- a/radio/src/switches.cpp +++ b/radio/src/switches.cpp @@ -151,28 +151,6 @@ void getSwitchesPosition(bool startup) CHECK_2POS(SW_SE); CHECK_3POS(1, SW_SF); switchesPos = newPos; - - int i = 0; - StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1+i]; - if (calib->count>0 && calib->countcount); - uint8_t previousPos = potsPos[i] >> 4; - uint8_t previousStoredPos = potsPos[i] & 0x0F; - if (startup) { - potsPos[i] = (pos << 4) | pos; - } - else if (pos != previousPos) { - potsLastposStart[i] = get_tmr10ms(); - potsPos[i] = (pos << 4) | previousStoredPos; - } - else if (g_eeGeneral.switchesDelay==SWITCHES_DELAY_NONE || (tmr10ms_t)(get_tmr10ms() - potsLastposStart[i]) > SWITCHES_DELAY()) { - potsLastposStart[i] = 0; - potsPos[i] = (pos << 4) | pos; - if (previousStoredPos != pos) { - PLAY_SWITCH_MOVED(SWSRC_LAST_SWITCH+i*XPOTS_MULTIPOS_COUNT+pos); - } - } - } } #endif diff --git a/radio/src/targets/horus/diskio.cpp b/radio/src/targets/horus/diskio.cpp index b7157abcb..f0d0776d3 100644 --- a/radio/src/targets/horus/diskio.cpp +++ b/radio/src/targets/horus/diskio.cpp @@ -25,8 +25,8 @@ /*-----------------------------------------------------------------------*/ #include "diskio.h" -#include // memcpy -#include "../../opentx.h" +#include +#include "opentx.h" #include "sdio_sd.h" #define BLOCK_SIZE 512 /* Block Size in Bytes */ diff --git a/radio/src/targets/horus/sdio_sd.c b/radio/src/targets/horus/sdio_sd.c index 7b494848b..cd19c1a10 100644 --- a/radio/src/targets/horus/sdio_sd.c +++ b/radio/src/targets/horus/sdio_sd.c @@ -18,9 +18,7 @@ * GNU General Public License for more details. */ -/* Includes ------------------------------------------------------------------*/ -#include "../horus/sdio_sd.h" - +#include "sdio_sd.h" #include "../../debug.h" /** @addtogroup Utilities @@ -1152,12 +1150,10 @@ OPTIMIZE("O0") SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint1 SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, BlockSize); #endif - if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) { + if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) BlockSize = 512; - } - else { + else ReadAddr *= 512; - } /* Set Block Size for Card */ SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize; @@ -1281,12 +1277,10 @@ OPTIMIZE("O0") SD_Error SD_ReadMultiBlocks(uint8_t *readbuff, uint32_t ReadAddr, SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, (NumberOfBlocks * BlockSize)); SDIO_DMACmd(ENABLE); - if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) { + if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) BlockSize = 512; - } - else { + else ReadAddr *= 512; - } /*!< Set Block Size for Card */ SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize; @@ -1417,12 +1411,10 @@ OPTIMIZE("O0") SD_Error SD_WriteBlock(uint8_t *writebuff, uint32_t WriteAddr, ui SDIO_DMACmd(ENABLE); #endif - if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) { + if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) BlockSize = 512; - } - else { + else WriteAddr *= 512; - } /* Set Block Size for Card */ SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize; diff --git a/radio/src/telemetry/telemetry.h b/radio/src/telemetry/telemetry.h index bd27b6aca..7dcfc9d22 100644 --- a/radio/src/telemetry/telemetry.h +++ b/radio/src/telemetry/telemetry.h @@ -136,12 +136,7 @@ extern uint8_t telemetryProtocol; #define IS_FRSKY_SPORT_PROTOCOL() (false) #endif -#if defined(PCBFLAMENCO) -inline uint8_t modelTelemetryProtocol() -{ - return g_model.telemetryProtocol; -} -#elif defined(CPUSTM32) +#if defined(PCBTARANIS) || defined(PCBHORUS) inline uint8_t modelTelemetryProtocol() { #if defined(CROSSFIRE) diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index d572364ca..598276c69 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -1074,8 +1074,13 @@ #define TR_SCRIPT "Script" #define TR_INPUTS "Inputs" #define TR_OUTPUTS "Outputs" +#if defined(COLORLCD) +#define TR_EEBACKUP "EEPROM backup" +#define TR_FACTORYRESET "Factory reset" +#else #define TR_EEBACKUP "\012[ENTER Long]: EEPROM backup" #define TR_FACTORYRESET "\012[MENU Long]: Factory reset" +#endif #define TR_CONFIRMRESET "Erase ALL models and settings?" #define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"