diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index ba185a1a5..07d77de41 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -40,7 +40,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI int modesCount = firmware->getCapability(FlightModes); - // Phase name + // Flight mode name QRegExp rx(CHAR_FOR_NAMES_REGEX); if (modesCount) { ui->name->setValidator(new QRegExpValidator(rx, this)); @@ -51,7 +51,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI ui->name->setDisabled(true); } - // Phase switch + // Flight mode switch if (phaseIdx > 0) { ui->swtch->setModel(switchModel); connect(ui->swtch, SIGNAL(activated(int)), this, SLOT(phaseSwitchChanged(int))); diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 8097b7170..85b0f88a9 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -430,10 +430,12 @@ if(NOT MSVC) # these are in addition to CMAKE_CXX_FLAGS set(CMAKE_EXE_LINKER_FLAGS "-lm -T${RADIO_SRC_DIRECTORY}/${LINKER_SCRIPT} -Wl,-Map=firmware.map,--cref,--no-warn-mismatch,--gc-sections") + if(SEMIHOSTING) add_definitions(-DSEMIHOSTING) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --specs=rdimon.specs") endif() + # Use newlib nano, which saves a few kilobytes. if(NOT NANO STREQUAL NO) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --specs=nano.specs") @@ -446,7 +448,6 @@ if(NOT MSVC) set(SRC ${SRC} bin_allocator.cpp) endif() - if(PCB STREQUAL XLITE OR PCB STREQUAL X9D OR PCB STREQUAL X9D+ OR PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL X10 OR PCB STREQUAL X12S) add_subdirectory(targets/common/arm/stm32/bootloader) include_directories(${CMAKE_CURRENT_BINARY_DIR}/targets/common/arm/stm32/bootloader) @@ -462,6 +463,8 @@ if(NOT MSVC) endif() endif() + add_definitions(-DRTOS_COOS) + add_executable(firmware ${SRC} ${FIRMWARE_HEADERS}) link_libraries(firmware -lstdc++) add_dependencies(firmware ${FIRMWARE_DEPENDENCIES}) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index 8d95c141f..6bcc8a550 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -21,7 +21,7 @@ #include "opentx.h" #include -extern OS_MutexID audioMutex; +extern RTOS_MUTEX_HANDLE audioMutex; const int16_t sineValues[] = { @@ -223,7 +223,7 @@ const char * const audioFilenames[] = { }; BitField<(AU_SPECIAL_SOUND_FIRST)> sdAvailableSystemAudioFiles; -BitField<(MAX_FLIGHT_MODES * 2/*on, off*/)> sdAvailablePhaseAudioFiles; +BitField<(MAX_FLIGHT_MODES * 2/*on, off*/)> sdAvailableFlightmodeAudioFiles; BitField<(SWSRC_LAST_SWITCH+NUM_XPOTS*XPOTS_MULTIPOS_COUNT)> sdAvailableSwitchAudioFiles; BitField<(MAX_LOGICAL_SWITCHES * 2/*on, off*/)> sdAvailableLogicalSwitchAudioFiles; @@ -294,10 +294,10 @@ char * getModelAudioPath(char * path) return result; } -void getPhaseAudioFile(char * filename, int index, unsigned int event) +void getFlightmodeAudioFile(char * filename, int index, unsigned int event) { char * str = getModelAudioPath(filename); - char * tmp = strcat_phasename(str, index); + char * tmp = strcatFlightmodeName(str, index); strcpy(tmp, suffixes[event]); strcat(tmp, SOUNDS_EXT); } @@ -360,7 +360,7 @@ void referenceModelAudioFiles() FILINFO fno; DIR dir; - sdAvailablePhaseAudioFiles.reset(); + sdAvailableFlightmodeAudioFiles.reset(); sdAvailableSwitchAudioFiles.reset(); sdAvailableLogicalSwitchAudioFiles.reset(); @@ -379,13 +379,13 @@ void referenceModelAudioFiles() if (len < 5 || strcasecmp(fno.fname+len-4, SOUNDS_EXT) || (fno.fattrib & AM_DIR)) continue; TRACE("referenceModelAudioFiles(): using file: %s", fno.fname); - // Phases Audio Files -[on|off].wav + // Flight modes Audio Files -[on|off].wav for (int i=0; i 0) { @@ -848,7 +848,7 @@ void AudioQueue::playTone(uint16_t freq, uint16_t len, uint16_t pause, uint8_t f return; #endif - CoEnterMutexSection(audioMutex); + RTOS_LOCK_MUTEX(audioMutex); freq = limit(BEEP_MIN_FREQ, freq, BEEP_MAX_FREQ); @@ -871,7 +871,7 @@ void AudioQueue::playTone(uint16_t freq, uint16_t len, uint16_t pause, uint8_t f } } - CoLeaveMutexSection(audioMutex); + RTOS_UNLOCK_MUTEX(audioMutex); } #if defined(SDCARD) @@ -899,7 +899,7 @@ void AudioQueue::playFile(const char * filename, uint8_t flags, uint8_t id) return; } - CoEnterMutexSection(audioMutex); + RTOS_LOCK_MUTEX(audioMutex); if (flags & PLAY_BACKGROUND) { backgroundContext.clear(); @@ -909,7 +909,7 @@ void AudioQueue::playFile(const char * filename, uint8_t flags, uint8_t id) fragmentsFifo.push(AudioFragment(filename, flags & 0x0f, id)); } - CoLeaveMutexSection(audioMutex); + RTOS_UNLOCK_MUTEX(audioMutex); } void AudioQueue::stopPlay(uint8_t id) @@ -922,12 +922,12 @@ void AudioQueue::stopPlay(uint8_t id) return; #endif - CoEnterMutexSection(audioMutex); + RTOS_LOCK_MUTEX(audioMutex); fragmentsFifo.removePromptById(id); backgroundContext.stop(id); - CoLeaveMutexSection(audioMutex); + RTOS_UNLOCK_MUTEX(audioMutex); } void AudioQueue::stopSD() @@ -942,19 +942,19 @@ void AudioQueue::stopSD() void AudioQueue::stopAll() { flush(); - CoEnterMutexSection(audioMutex); + RTOS_LOCK_MUTEX(audioMutex); priorityContext.clear(); normalContext.clear(); - CoLeaveMutexSection(audioMutex); + RTOS_UNLOCK_MUTEX(audioMutex); } void AudioQueue::flush() { - CoEnterMutexSection(audioMutex); + RTOS_LOCK_MUTEX(audioMutex); fragmentsFifo.clear(); varioContext.clear(); backgroundContext.clear(); - CoLeaveMutexSection(audioMutex); + RTOS_UNLOCK_MUTEX(audioMutex); } void audioPlay(unsigned int index, uint8_t id) diff --git a/radio/src/buzzer.cpp b/radio/src/buzzer.cpp index e61b6cf9b..0948bf2cb 100644 --- a/radio/src/buzzer.cpp +++ b/radio/src/buzzer.cpp @@ -28,7 +28,7 @@ bool warble = false; bool warbleC; // The various "beep" tone lengths -static const pm_uint8_t beepTab[] PROGMEM = { +static const uint8_t beepTab[] = { // key, trim, warn2, warn1, error 1, 1, 2, 10, 60, //xShort 1, 1, 4, 20, 80, //short @@ -54,7 +54,7 @@ void beep(uint8_t val) #endif if (g_eeGeneral.beepMode>0 || (g_eeGeneral.beepMode==0 && val!=0) || (g_eeGeneral.beepMode==-1 && val>=3)) { - _beep(pgm_read_byte(beepTab+5*(2+g_eeGeneral.beepLength)+val)); + _beep(*(beepTab+5*(2+g_eeGeneral.beepLength)+val)); } } diff --git a/radio/src/cli.cpp b/radio/src/cli.cpp index 7897138e6..67e4b632c 100644 --- a/radio/src/cli.cpp +++ b/radio/src/cli.cpp @@ -28,7 +28,7 @@ #define CLI_COMMAND_MAX_LEN 256 OS_TID cliTaskId; -TaskStack _ALIGNED(8) cliStack; // stack must be aligned to 8 bytes otherwise printf for %f does not work! +TaskStack __ALIGNED(8) cliStack; // stack must be aligned to 8 bytes otherwise printf for %f does not work! Fifo cliRxFifo; uint8_t cliTracesEnabled = true; char cliLastLine[CLI_COMMAND_MAX_LEN+1]; @@ -308,7 +308,7 @@ int cliTestNew() { char * tmp = 0; serialPrint("Allocating 1kB with new()"); - CoTickDelay(100); + RTOS_WAIT_MS(200); tmp = new char[1024]; if (tmp) { serialPrint("\tsuccess"); @@ -320,7 +320,7 @@ int cliTestNew() } serialPrint("Allocating 10MB with (std::nothrow) new()"); - CoTickDelay(100); + RTOS_WAIT_MS(200); tmp = new (std::nothrow) char[1024*1024*10]; if (tmp) { serialPrint("\tFAILURE, tmp = %p", tmp); @@ -332,7 +332,7 @@ int cliTestNew() } serialPrint("Allocating 10MB with new()"); - CoTickDelay(100); + RTOS_WAIT_MS(200); tmp = new char[1024*1024*10]; if (tmp) { serialPrint("\tFAILURE, tmp = %p", tmp); @@ -437,14 +437,14 @@ float runGraphicsTest(graphichTestFunc func, const char * name, uint32_t runtime uint32_t actualRuntime = (uint32_t)CoGetOSTime() - start; float result = (noRuns * 500.0f) / (float)actualRuntime; // runs/second serialPrint("Test %s speed: %0.2f, (%d runs in %d ms)", name, result, noRuns, actualRuntime*2); - CoTickDelay(100); + RTOS_WAIT_MS(200); return result; } int cliTestGraphics() { serialPrint("Starting graphics performance test..."); - CoTickDelay(100); + RTOS_WAIT_MS(200); watchdogSuspend(6000/*60s*/); if (pulsesStarted()) { @@ -581,7 +581,7 @@ float runMemoryTest(graphichTestFunc func, const char * name, uint32_t runtime) uint32_t actualRuntime = (uint32_t)CoGetOSTime() - start; float result = (noRuns * 500.0f) / (float)actualRuntime; // runs/second serialPrint("Test %s speed: %0.2f, (%d runs in %d ms)", name, result, noRuns, actualRuntime*2); - CoTickDelay(100); + RTOS_WAIT_MS(200); return result; } @@ -589,7 +589,7 @@ float runMemoryTest(graphichTestFunc func, const char * name, uint32_t runtime) int cliTestMemorySpeed() { serialPrint("Starting memory speed test..."); - CoTickDelay(100); + RTOS_WAIT_MS(200); watchdogSuspend(6000/*60s*/); if (pulsesStarted()) { @@ -610,7 +610,7 @@ int cliTestMemorySpeed() LTDC_Cmd(DISABLE); serialPrint("Disabling LCD..."); - CoTickDelay(100); + RTOS_WAIT_MS(200); result += RUN_GRAPHICS_TEST(testMemoryReadFrom_RAM_8bit, 200); result += RUN_GRAPHICS_TEST(testMemoryReadFrom_RAM_32bit, 200); @@ -936,7 +936,7 @@ void printDebugTimers() #endif #include "OsMutex.h" -extern OS_MutexID audioMutex; +extern RTOS_MUTEX_HANDLE audioMutex; void printAudioVars() { @@ -1124,7 +1124,7 @@ int cliRepeat(const char ** argv) counter = interval; uint8_t c; while (!cliRxFifo.pop(c) || !(c == '\r' || c == '\n' || c == ' ')) { - CoTickDelay(10); // 20ms + RTOS_WAIT_MS(20); // 20ms if (++counter >= interval) { cliExecCommand(&argv[2]); counter = 0; @@ -1299,7 +1299,7 @@ void cliTask(void * pdata) uint8_t c; while (!cliRxFifo.pop(c)) { - CoTickDelay(10); // 20ms + RTOS_WAIT_MS(20); // 20ms } if (c == 12) { diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 348e413b0..44eb39f6a 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -612,8 +612,6 @@ PACK(struct TrainerData { #if defined(PCBHORUS) #define SPLASH_MODE uint8_t splashSpares:3 -#elif defined(FSPLASH) - #define SPLASH_MODE uint8_t splashMode:3 #else #define SPLASH_MODE int8_t splashMode:3 #endif diff --git a/radio/src/debug.cpp b/radio/src/debug.cpp index af883134e..e0fda135a 100644 --- a/radio/src/debug.cpp +++ b/radio/src/debug.cpp @@ -94,7 +94,7 @@ void dumpTraceBuffer() #if !defined(SIMU) if ((n % 5) == 0) { while (!serial2TxFifo.isEmpty()) { - CoTickDelay(1); + RTOS_WAIT_TICKS(1); } } #endif diff --git a/radio/src/definitions.h b/radio/src/definitions.h index 6145fd175..c7d01a3f3 100644 --- a/radio/src/definitions.h +++ b/radio/src/definitions.h @@ -21,27 +21,33 @@ #ifndef _DEFINITIONS_H_ #define _DEFINITIONS_H_ +#include + +#if !defined(UNUSED) + #define UNUSED(x) ((void)(x)) /* to avoid warnings */ +#endif + #if defined(SIMU) && __GNUC__ - #define __ALIGNED __attribute__((aligned(32))) + #define __ALIGNED(x) __attribute__((aligned(x))) #define __SECTION_USED(s) __attribute__((used)) #elif defined(SIMU) - #define __ALIGNED + #define __ALIGNED(x) __declspec(align(x)) #define __SECTION_USED(s) #else - #define __ALIGNED __attribute__((aligned(32))) - #define __SECTION_USED(s) __attribute__ ((section(s), used)) + #define __ALIGNED(x) __attribute__((aligned(x))) + #define __SECTION_USED(s) __attribute__((section(s), used)) #endif #if defined(SIMU) #define __DMA -#elif (defined(STM32F4) && !defined(BOOT)) || defined(PCBHORUS) - #define __DMA __attribute__((section(".ram"), aligned(32))) +#elif (defined(STM32F4) && !defined(BOOT)) || defined(SDRAM) + #define __DMA __attribute__((section(".ram"), aligned(4))) #else - #define __DMA __ALIGNED + #define __DMA __ALIGNED(4) #endif -#if defined(PCBHORUS) && !defined(SIMU) - #define __SDRAM __attribute__((section(".sdram"), aligned(32))) +#if defined(SDRAM) && !defined(SIMU) + #define __SDRAM __attribute__((section(".sdram"), aligned(4))) #define __NOINIT __attribute__((section(".noinit"))) #else #define __SDRAM __DMA @@ -55,17 +61,9 @@ #endif #if defined(SIMU) - #if !defined(FORCEINLINE) - #define FORCEINLINE inline - #endif - #if !defined(NOINLINE) - #define NOINLINE - #endif #define CONVERT_PTR_UINT(x) ((uint32_t)(uint64_t)(x)) #define CONVERT_UINT_PTR(x) ((uint32_t*)(uint64_t)(x)) #else - #define FORCEINLINE inline __attribute__ ((always_inline)) - #define NOINLINE __attribute__ ((noinline)) #define SIMU_SLEEP(x) #define SIMU_SLEEP_NORET(x) #define CONVERT_PTR_UINT(x) ((uint32_t)(x)) diff --git a/radio/src/fonts.h b/radio/src/fonts.h index d102cf67e..a839d48ee 100644 --- a/radio/src/fonts.h +++ b/radio/src/fonts.h @@ -38,21 +38,21 @@ void loadFonts(); #else -extern const pm_uchar font_5x7[]; -extern const pm_uchar font_10x14[]; +extern const unsigned char font_5x7[]; +extern const unsigned char font_10x14[]; -#if defined(BOLD_FONT) && ((!defined(CPUM64) && !defined(PCBMEGA2560)) || defined(TELEMETRY_NONE)) && !defined(BOOT) - #define BOLD_SPECIFIC_FONT - extern const pm_uchar font_5x7_B[]; +#if defined(BOLD_FONT) && !defined(BOOT) + #define BOLD_SPECIFIC_FONT + extern const unsigned char font_5x7_B[]; #endif -extern const pm_uchar font_3x5[]; -extern const pm_uchar font_4x6[]; -extern const pm_uchar font_8x10[]; -extern const pm_uchar font_22x38_num[]; -extern const pm_uchar font_5x7_extra[]; -extern const pm_uchar font_10x14_extra[]; -extern const pm_uchar font_4x6_extra[]; +extern const unsigned char font_3x5[]; +extern const unsigned char font_4x6[]; +extern const unsigned char font_8x10[]; +extern const unsigned char font_22x38_num[]; +extern const unsigned char font_5x7_extra[]; +extern const unsigned char font_10x14_extra[]; +extern const unsigned char font_4x6_extra[]; #endif diff --git a/radio/src/functions.cpp b/radio/src/functions.cpp index d46766dfd..5142df59c 100644 --- a/radio/src/functions.cpp +++ b/radio/src/functions.cpp @@ -269,7 +269,6 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext break; #endif -#if defined(MASTER_VOLUME) case FUNC_VOLUME: { getvalue_t raw = getValue(CFN_PARAM(cfn)); @@ -280,7 +279,6 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext requiredSpeakerVolume = ((1024 + requiredSpeakerVolumeRawLast) * VOLUME_LEVEL_MAX) / 2048; break; } -#endif #if defined(SDCARD) case FUNC_PLAY_SOUND: diff --git a/radio/src/gui/128x64/fonts.cpp b/radio/src/gui/128x64/fonts.cpp index 798a2ca61..5d1c02382 100644 --- a/radio/src/gui/128x64/fonts.cpp +++ b/radio/src/gui/128x64/fonts.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -const pm_uchar font_5x7[] PROGMEM = { +const unsigned char font_5x7[] = { #include "font_05x07.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_05x07.lbm" @@ -44,13 +44,13 @@ const pm_uchar font_5x7[] PROGMEM = { }; #if defined(BOLD_SPECIFIC_FONT) -const pm_uchar font_5x7_B[] PROGMEM = { +const unsigned char font_5x7_B[] = { #include "font_05x07_B_compressed.lbm" }; #endif #if !defined(BOOT) -const pm_uchar font_10x14[] PROGMEM = { +const unsigned char font_10x14[] = { #include "font_10x14_compressed.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_10x14.lbm" @@ -75,10 +75,10 @@ const pm_uchar font_10x14[] PROGMEM = { #endif #if !defined(BOOT) -const pm_uchar font_3x5[] PROGMEM = { +const unsigned char font_3x5[] = { #include "font_03x05.lbm" }; -const pm_uchar font_4x6[] PROGMEM = { +const unsigned char font_4x6[] = { #include "font_04x06.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_04x06.lbm" @@ -101,7 +101,7 @@ const pm_uchar font_4x6[] PROGMEM = { #endif }; -const pm_uchar font_8x10[] PROGMEM = { +const unsigned char font_8x10[] = { #include "font_08x10.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_08x10.lbm" @@ -124,19 +124,19 @@ const pm_uchar font_8x10[] PROGMEM = { #endif }; -const pm_uchar font_22x38_num[] PROGMEM = { +const unsigned char font_22x38_num[] = { #include "font_22x38_num.lbm" }; -const pm_uchar font_4x6_extra[] PROGMEM = { +const unsigned char font_4x6_extra[] = { #include "font_04x06_extra.lbm" }; -const pm_uchar font_5x7_extra[] PROGMEM = { +const unsigned char font_5x7_extra[] = { #include "font_05x07_extra.lbm" }; -const pm_uchar font_10x14_extra[] PROGMEM = { +const unsigned char font_10x14_extra[] = { #include "font_10x14_extra.lbm" }; diff --git a/radio/src/gui/128x64/gui.h b/radio/src/gui/128x64/gui.h index cdf890c0a..98b3fc235 100644 --- a/radio/src/gui/128x64/gui.h +++ b/radio/src/gui/128x64/gui.h @@ -160,11 +160,11 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla #define CURSOR_ON_LINE() (0) #endif -void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow); +void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow); void check_simple(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t maxrow); void check_submenu_simple(event_t event, uint8_t maxrow); -void title(const pm_char * s); +void title(const char * s); #define TITLE(str) title(str) #define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__ @@ -225,8 +225,8 @@ void title(const pm_char * s); typedef int choice_t; -choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event); -uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char * label, LcdFlags attr, event_t event); +choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event); +uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event); int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, event_t event); #define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event) @@ -258,17 +258,17 @@ void gvarWeightItem(coord_t x, coord_t y, MixData * md, LcdFlags attr, event_t e void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, uint8_t active, LcdFlags attr=ZCHAR); -void editSingleName(coord_t x, coord_t y, const pm_char * label, char * name, uint8_t size, event_t event, uint8_t active); +void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8_t size, event_t event, uint8_t active); -uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const pm_char * str, uint8_t delay); +uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay); #define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(y, event, attr, str, delay) #define WARNING_TYPE_ASTERISK 0 #define WARNING_TYPE_CONFIRM 1 #define WARNING_TYPE_INPUT 2 -extern const pm_char * warningText; -extern const pm_char * warningInfoText; +extern const char * warningText; +extern const char * warningInfoText; extern uint8_t warningInfoLength; extern uint8_t warningResult; extern uint8_t warningType; @@ -361,7 +361,7 @@ void deleteExpoMix(uint8_t expo, uint8_t idx); void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr); -extern const pm_uchar sticks[] PROGMEM; +extern const unsigned char sticks[] ; void drawSplash(); void drawSecondSplash(); @@ -376,10 +376,10 @@ void drawSleepBitmap(); void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible); #if defined(PCBTARANIS) -void drawAlertBox(const pm_char * title, const pm_char * text, const char * action); +void drawAlertBox(const char * title, const char * text, const char * action); #endif -void showAlertBox(const pm_char * title, const pm_char * text, const char * action , uint8_t sound); +void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound); #define SET_SCROLLBAR_X(x) #define LOAD_MODEL_BITMAP() diff --git a/radio/src/gui/128x64/lcd.cpp b/radio/src/gui/128x64/lcd.cpp index 0f05b4836..fa1cd058c 100644 --- a/radio/src/gui/128x64/lcd.cpp +++ b/radio/src/gui/128x64/lcd.cpp @@ -67,7 +67,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width, else if (i<=width) { uint8_t skip = true; for (uint8_t j=0; j= displayBuf && (p) < DISPLAY_END) - #if defined(PCBSKY9X) extern volatile uint8_t lcdLock ; extern volatile uint32_t lcdInputs ; #endif -#if defined(BOOT) -// TODO quick & dirty :( -typedef const unsigned char pm_uchar; -typedef const char pm_char; -#endif - void lcdDrawChar(coord_t x, coord_t y, const unsigned char c); void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags); -void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags); -void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s, uint8_t idx, LcdFlags flags); -void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, unsigned char len, LcdFlags flags); -void lcdDrawText(coord_t x, coord_t y, const pm_char * s); -void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, unsigned char len); -void lcdDrawTextAlignedLeft(coord_t y, const pm_char * s); +void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags); +void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s, uint8_t idx, LcdFlags flags); +void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len, LcdFlags flags); +void lcdDrawText(coord_t x, coord_t y, const char * s); +void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len); +void lcdDrawTextAlignedLeft(coord_t y, const char * s); #define lcdDrawTextAlignedCenter(y, s) lcdDrawText((LCD_W-sizeof(TR_##s)*FW+FW+1)/2, y, STR_##s) @@ -137,7 +130,7 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags mode, uint8_t le void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags mode=0); void lcdDraw8bitsNumber(coord_t x, coord_t y, int8_t val); -void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx, LcdFlags att=0); +void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags att=0); void putsModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att); #if !defined(BOOT) // TODO not here ... void drawSwitch(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0); @@ -202,7 +195,7 @@ void drawTelemetryTopBar(); void lcdClear(void); -void lcdDraw1bitBitmap(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0); +void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att=0); inline void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * bitmap) { lcdDraw1bitBitmap(x, y, bitmap, 0); diff --git a/radio/src/gui/128x64/menu_model.cpp b/radio/src/gui/128x64/menu_model.cpp index b2ebba5b0..8d4f80dd0 100644 --- a/radio/src/gui/128x64/menu_model.cpp +++ b/radio/src/gui/128x64/menu_model.cpp @@ -21,7 +21,7 @@ #include "opentx.h" -uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const pm_char * str, uint8_t delay) +uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay) { lcdDrawTextAlignedLeft(y, str); lcdDrawNumber(MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT); @@ -39,7 +39,7 @@ uint8_t s_copySrcCh; uint8_t editNameCursorPos = 0; -void editSingleName(coord_t x, coord_t y, const pm_char * label, char * name, uint8_t size, event_t event, uint8_t active) +void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8_t size, event_t event, uint8_t active) { lcdDrawTextAlignedLeft(y, label); editName(x, y, name, size, event, active); diff --git a/radio/src/gui/128x64/menus.h b/radio/src/gui/128x64/menus.h index e51504314..2a0a565d6 100644 --- a/radio/src/gui/128x64/menus.h +++ b/radio/src/gui/128x64/menus.h @@ -93,7 +93,7 @@ void menuRadioDiagAnalogs(event_t event); void menuRadioHardware(event_t event); void menuRadioCalibration(event_t event); -static const MenuHandlerFunc menuTabGeneral[] PROGMEM = { +static const MenuHandlerFunc menuTabGeneral[] = { menuRadioSetup, CASE_SDCARD(menuRadioSdManager) menuRadioSpecialFunctions, @@ -144,7 +144,7 @@ void menuModelDisplay(event_t event); void menuModelTemplates(event_t event); void menuModelGVarOne(event_t event); -static const MenuHandlerFunc menuTabModel[] PROGMEM = { +static const MenuHandlerFunc menuTabModel[] = { menuModelSelect, menuModelSetup, CASE_HELI(menuModelHeli) diff --git a/radio/src/gui/128x64/model_curve_edit.cpp b/radio/src/gui/128x64/model_curve_edit.cpp index 42abb30ea..3a0112109 100644 --- a/radio/src/gui/128x64/model_curve_edit.cpp +++ b/radio/src/gui/128x64/model_curve_edit.cpp @@ -166,9 +166,9 @@ void menuModelCurveOne(event_t event) lcdDrawFilledRect(3, 2*FH+4, 7*FW-2, 4*FH-2, SOLID, ERASE); lcdDrawRect(3, 2*FH+4, 7*FW-2, 4*FH-2); drawStringWithIndex(7, 3*FH, STR_PT, i+1, LEFT); - lcdDrawText(7, 4*FH, PSTR("x=")); + lcdDrawText(7, 4*FH, "x="); lcdDrawNumber(7+2*FW+1, 4*FH, x, LEFT|(selectionMode==1?attr:0)); - lcdDrawText(7, 5*FH, PSTR("y=")); + lcdDrawText(7, 5*FH, "y="); lcdDrawNumber(7+2*FW+1, 5*FH, points[i], LEFT|(selectionMode==2?attr:0)); // Selection square diff --git a/radio/src/gui/128x64/model_display.cpp b/radio/src/gui/128x64/model_display.cpp index 5c4f60759..3da6c10ff 100644 --- a/radio/src/gui/128x64/model_display.cpp +++ b/radio/src/gui/128x64/model_display.cpp @@ -123,7 +123,7 @@ void menuModelDisplay(event_t event) uint8_t screenIndex = TELEMETRY_CURRENT_SCREEN(k); drawStringWithIndex(0*FW, y, STR_SCREEN, screenIndex+1); TelemetryScreenType oldScreenType = TELEMETRY_SCREEN_TYPE(screenIndex); - TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, PSTR(""), STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event); + TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, "", STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event); if (newScreenType != oldScreenType) { g_model.frsky.screensType = (g_model.frsky.screensType & (~(0x03 << (2*screenIndex)))) | (newScreenType << (2*screenIndex)); memset(&g_model.frsky.screens[screenIndex], 0, sizeof(g_model.frsky.screens[screenIndex])); diff --git a/radio/src/gui/128x64/model_flightmodes.cpp b/radio/src/gui/128x64/model_flightmodes.cpp index 8654a955e..f6f46800b 100644 --- a/radio/src/gui/128x64/model_flightmodes.cpp +++ b/radio/src/gui/128x64/model_flightmodes.cpp @@ -67,12 +67,12 @@ void menuModelFlightModeOne(event_t event) #if defined(GVARS) && !defined(GVARS_IN_CURVES_SCREEN) #if defined(PCBTARANIS) #define VERTICAL_SHIFT (ITEM_MODEL_FLIGHT_MODE_FADE_IN-ITEM_MODEL_FLIGHT_MODE_TRIMS) - static const pm_uint8_t mstate_tab_fm1[] PROGMEM = {0, 3, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1, 1}; + static const uint8_t mstate_tab_fm1[] = {0, 3, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1, 1}; #else #define VERTICAL_SHIFT (ITEM_MODEL_FLIGHT_MODE_FADE_IN-ITEM_MODEL_FLIGHT_MODE_SWITCH) - static const pm_uint8_t mstate_tab_fm1[] PROGMEM = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1}; + static const uint8_t mstate_tab_fm1[] = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1}; #endif - static const pm_uint8_t mstate_tab_others[] PROGMEM = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2}; + static const uint8_t mstate_tab_others[] = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2}; check(event, 0, NULL, 0, (s_currIdx == 0) ? mstate_tab_fm1 : mstate_tab_others, DIM(mstate_tab_others)-1, ITEM_MODEL_FLIGHT_MODE_MAX - HEADER_LINE - (s_currIdx==0 ? (ITEM_MODEL_FLIGHT_MODE_FADE_IN-ITEM_MODEL_FLIGHT_MODE_SWITCH-1) : 0)); diff --git a/radio/src/gui/128x64/model_gvars.cpp b/radio/src/gui/128x64/model_gvars.cpp index 9fc3b5fbc..5e80cf582 100644 --- a/radio/src/gui/128x64/model_gvars.cpp +++ b/radio/src/gui/128x64/model_gvars.cpp @@ -107,7 +107,7 @@ void menuModelGVarOne(event_t event) break; default: - drawStringWithIndex(0, y, STR_FP, k-GVAR_FIELD_FM0); + drawStringWithIndex(0, y, STR_FM, k-GVAR_FIELD_FM0); editGVarValue(GVAR_2ND_COLUMN, y, event, s_currIdx, k-GVAR_FIELD_FM0, LEFT|attr); break; } diff --git a/radio/src/gui/128x64/model_inputs_mixes.cpp b/radio/src/gui/128x64/model_inputs_mixes.cpp index 0478723a2..6535b8821 100644 --- a/radio/src/gui/128x64/model_inputs_mixes.cpp +++ b/radio/src/gui/128x64/model_inputs_mixes.cpp @@ -460,7 +460,7 @@ void menuModelMixOne(event_t event) } } else { - lcdDrawText(COLUMN_X+MIXES_2ND_COLUMN, y, PSTR("Diff"), menuHorizontalPosition==0 ? attr : 0); + lcdDrawText(COLUMN_X+MIXES_2ND_COLUMN, y, "Diff", menuHorizontalPosition==0 ? attr : 0); md2->curveParam = GVAR_MENU_ITEM(COLUMN_X+MIXES_2ND_COLUMN+5*FW, y, curveParam, -100, 100, LEFT|(menuHorizontalPosition==1 ? attr : 0), 0, editMode>0 ? event : 0); if (attr && editMode>0 && menuHorizontalPosition==0) { int8_t tmp = 0; @@ -508,7 +508,7 @@ void menuModelMixOne(event_t event) } } -#define _STR_MAX(x) PSTR("/" #x) +#define _STR_MAX(x) "/" #x #define STR_MAX(x) _STR_MAX(x) #define EXPO_LINE_WEIGHT_POS 7*FW+1 diff --git a/radio/src/gui/128x64/model_outputs_arm.cpp b/radio/src/gui/128x64/model_outputs_arm.cpp index 970cfc1b6..e3e27b387 100644 --- a/radio/src/gui/128x64/model_outputs_arm.cpp +++ b/radio/src/gui/128x64/model_outputs_arm.cpp @@ -266,7 +266,6 @@ void menuModelLimits(event_t event) } for (uint8_t j=0; j0 || p1valdiff)) STICK_SCROLL_DISABLE(); switch (j) { case ITEM_OUTPUTS_OFFSET: #if defined(PPM_UNIT_US) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 7e70bdce9..4647a225f 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -493,7 +493,7 @@ void menuModelSetup(event_t event) #if defined(PCBTARANIS) { #define FIRSTSW_STR STR_VSRCRAW+(MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1)*length - uint8_t length = pgm_read_byte(STR_VSRCRAW); + uint8_t length = STR_VSRCRAW[0]; horzpos_t l_posHorz = menuHorizontalPosition; if (i>=NUM_BODY_LINES-2 && getSwitchWarningsCount() > 5*(NUM_BODY_LINES-i)) { @@ -606,14 +606,14 @@ void menuModelSetup(event_t event) else { if ((states & 0x01) && swactive) attr = INVERS; - c = pgm_read_byte(STR_VSWITCHES - 2 + 9 + (3*(i+1))); + c = *(STR_VSWITCHES - 2 + 9 + (3*(i+1))); states >>= 1; } if (line && (menuHorizontalPosition == i)) { attr = BLINK | INVERS; } lcdDrawChar(MODEL_SETUP_2ND_COLUMN+i*FW, y, (swactive) ? c : '-', attr); - lcdDrawText(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, PSTR("<]"), (menuHorizontalPosition == NUM_SWITCHES-1 && !NO_HIGHLIGHT()) ? line : 0); + lcdDrawText(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, "<]", (menuHorizontalPosition == NUM_SWITCHES-1 && !NO_HIGHLIGHT()) ? line : 0); } #endif break; @@ -621,7 +621,7 @@ void menuModelSetup(event_t event) #if defined(PCBTARANIS) case ITEM_MODEL_POTS_WARNING: lcdDrawTextAlignedLeft(y, STR_POTWARNING); - lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0); + lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, "\004""OFF\0""Man\0""Auto", g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0); if (attr && (menuHorizontalPosition == 0)) { CHECK_INCDEC_MODELVAR(event, g_model.potsWarnMode, POTS_WARN_OFF, POTS_WARN_AUTO); storageDirty(EE_MODEL); @@ -1269,7 +1269,7 @@ void menuModelSetup(event_t event) #if 0 case ITEM_MODEL_PPM2_PROTOCOL: - lcdDrawTextAlignedLeft(y, PSTR("Port2")); + lcdDrawTextAlignedLeft(y, "Port2"); lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0); lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW+3, y, STR_CH, menuHorizontalPosition<=0 ? attr : 0); lcdDrawNumber(lcdLastRightPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (menuHorizontalPosition<=0 ? attr : 0)); diff --git a/radio/src/gui/128x64/model_telemetry.cpp b/radio/src/gui/128x64/model_telemetry.cpp index 861ce008b..5e763fd5c 100644 --- a/radio/src/gui/128x64/model_telemetry.cpp +++ b/radio/src/gui/128x64/model_telemetry.cpp @@ -545,10 +545,10 @@ void menuModelTelemetryFrsky(event_t event) #if defined(MULTIMODULE) if (telemetryProtocol == PROTOCOL_MULTIMODULE && g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A) - lcdDrawTextAlignedLeft(y, PSTR("RSNR")); + lcdDrawTextAlignedLeft(y, "RSNR"); else #endif - lcdDrawTextAlignedLeft(y, PSTR("RSSI")); + lcdDrawTextAlignedLeft(y, "RSSI"); break; case ITEM_TELEMETRY_RSSI_ALARM1: diff --git a/radio/src/gui/128x64/popups.cpp b/radio/src/gui/128x64/popups.cpp index 11bd4f924..25b9e28a3 100644 --- a/radio/src/gui/128x64/popups.cpp +++ b/radio/src/gui/128x64/popups.cpp @@ -20,8 +20,8 @@ #include "opentx.h" -const pm_char * warningText = NULL; -const pm_char * warningInfoText; +const char * warningText = NULL; +const char * warningInfoText; uint8_t warningInfoLength; uint8_t warningType; uint8_t warningResult = 0; @@ -39,7 +39,7 @@ void drawMessageBox() // could be a place for a warningInfoText } -void showMessageBox(const pm_char * str) +void showMessageBox(const char * str) { warningText = str; drawMessageBox(); @@ -47,11 +47,11 @@ void showMessageBox(const pm_char * str) lcdRefresh(); } -const pm_uchar ASTERISK_BITMAP[] PROGMEM = { +const unsigned char ASTERISK_BITMAP[] = { #include "asterisk.lbm" }; -void drawAlertBox(const pm_char * title, const pm_char * text, const char * action) +void drawAlertBox(const char * title, const char * text, const char * action) { lcdClear(); lcdDraw1bitBitmap(2, 0, ASTERISK_BITMAP, 0, 0); @@ -77,7 +77,7 @@ void drawAlertBox(const pm_char * title, const pm_char * text, const char * acti #undef MESSAGE_LCD_OFFSET } -void showAlertBox(const pm_char * title, const pm_char * text, const char * action , uint8_t sound) +void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound) { drawAlertBox(title, text, action); diff --git a/radio/src/gui/128x64/popups.h b/radio/src/gui/128x64/popups.h index ff429d489..bc413305e 100644 --- a/radio/src/gui/128x64/popups.h +++ b/radio/src/gui/128x64/popups.h @@ -29,7 +29,7 @@ #define WARNING_LINE_Y 3*FH void drawMessageBox(); -void showMessageBox(const pm_char * title); +void showMessageBox(const char * title); void runPopupWarning(event_t event); #define DRAW_MESSAGE_BOX(title) (warningText = title, drawMessageBox(), warningText = NULL) diff --git a/radio/src/gui/128x64/radio_calibration.cpp b/radio/src/gui/128x64/radio_calibration.cpp index cb4c092d6..de1a5e3c7 100644 --- a/radio/src/gui/128x64/radio_calibration.cpp +++ b/radio/src/gui/128x64/radio_calibration.cpp @@ -118,7 +118,6 @@ void menuCommonCalib(event_t event) case CALIB_MOVE_STICKS: // MOVE STICKS/POTS - STICK_SCROLL_DISABLE(); lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS); lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE); for (uint8_t i=0; i 9 coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH; @@ -45,7 +43,7 @@ void menuRadioDiagAnalogs(event_t event) #else coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH; uint8_t x = (i & 1) ? LCD_W/2+FW : 0; - drawStringWithIndex(x, y, PSTR("A"), i+1); + drawStringWithIndex(x, y, "A", i+1); lcdDrawChar(lcdNextPos, y, ':'); #endif lcdDrawHexNumber(x+3*FW-1, y, anaIn(i)); diff --git a/radio/src/gui/128x64/radio_hardware.cpp b/radio/src/gui/128x64/radio_hardware.cpp index d261abaa9..85bb01e33 100644 --- a/radio/src/gui/128x64/radio_hardware.cpp +++ b/radio/src/gui/128x64/radio_hardware.cpp @@ -52,7 +52,7 @@ void menuRadioHardware(event_t event) break; case ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS: - lcdDrawTextAlignedLeft(y, PSTR("Sticks")); + lcdDrawTextAlignedLeft(y, "Sticks"); break; case ITEM_RADIO_HARDWARE_STICK_LV_GAIN: @@ -60,8 +60,8 @@ void menuRadioHardware(event_t event) case ITEM_RADIO_HARDWARE_STICK_RV_GAIN: case ITEM_RADIO_HARDWARE_STICK_RH_GAIN: { - lcdDrawTextAtIndex(INDENT_WIDTH, y, PSTR("\002LVLHRVRH"), k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN, 0); - lcdDrawText(INDENT_WIDTH+3*FW, y, PSTR("Gain")); + lcdDrawTextAtIndex(INDENT_WIDTH, y, "\002LVLHRVRH", k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN, 0); + lcdDrawText(INDENT_WIDTH+3*FW, y, "Gain"); uint8_t mask = (1<<(k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN)); uint8_t val = (g_eeGeneral.sticksGain & mask ? 1 : 0); lcdDrawChar(HW_SETTINGS_COLUMN, y, val ? '2' : '1', attr); @@ -77,13 +77,13 @@ void menuRadioHardware(event_t event) #if defined(ROTARY_ENCODERS) case ITEM_RADIO_HARDWARE_ROTARY_ENCODER: - g_eeGeneral.rotarySteps = editChoice(HW_SETTINGS_COLUMN, y, PSTR("Rotary Encoder"), PSTR("\0062steps4steps"), g_eeGeneral.rotarySteps, 0, 1, attr, event); + g_eeGeneral.rotarySteps = editChoice(HW_SETTINGS_COLUMN, y, "Rotary Encoder", "\0062steps4steps", g_eeGeneral.rotarySteps, 0, 1, attr, event); break; #endif #if defined(BLUETOOTH) case ITEM_RADIO_HARDWARE_BT_BAUDRATE: - g_eeGeneral.bluetoothBaudrate = editChoice(HW_SETTINGS_COLUMN, y, STR_BAUDRATE, PSTR("\005115k 9600 19200"), g_eeGeneral.bluetoothBaudrate, 0, 2, attr, event); + g_eeGeneral.bluetoothBaudrate = editChoice(HW_SETTINGS_COLUMN, y, STR_BAUDRATE, "\005115k 9600 19200", g_eeGeneral.bluetoothBaudrate, 0, 2, attr, event); if (attr && checkIncDec_Ret) { btInit(); } @@ -235,7 +235,7 @@ void menuRadioHardware(event_t event) pauseMixerCalculations(); pausePulses(); EXTERNAL_MODULE_OFF(); - CoTickDelay(10); // 20ms so that the pulses interrupt will reinit the frame rate + RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate telemetryProtocol = 255; // force telemetry port + module reinitialization EXTERNAL_MODULE_ON(); resumePulses(); diff --git a/radio/src/gui/128x64/radio_setup.cpp b/radio/src/gui/128x64/radio_setup.cpp index 2ec1246b3..785df9271 100644 --- a/radio/src/gui/128x64/radio_setup.cpp +++ b/radio/src/gui/128x64/radio_setup.cpp @@ -22,7 +22,7 @@ #include "opentx.h" -const pm_uchar sticks[] PROGMEM = { +const unsigned char sticks[] = { #include "sticks.lbm" }; @@ -36,7 +36,7 @@ const pm_uchar sticks[] PROGMEM = { value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \ } -#if defined(SPLASH) && !defined(FSPLASH) +#if defined(SPLASH) #define CASE_SPLASH_PARAM(x) x, #else #define CASE_SPLASH_PARAM(x) @@ -166,8 +166,8 @@ void menuRadioSetup(event_t event) { int16_t year = TM_YEAR_BASE + t.tm_year; int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0); - static const pm_uint8_t dmon[] PROGMEM = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - dlim += pgm_read_byte(&dmon[t.tm_mon]); + static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + dlim += dmon[t.tm_mon]; lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2); if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0); break; @@ -451,7 +451,7 @@ void menuRadioSetup(event_t event) break; #endif -#if defined(SPLASH) && !defined(FSPLASH) +#if defined(SPLASH) case ITEM_SETUP_DISABLE_SPLASH: { lcdDrawTextAlignedLeft(y, STR_SPLASHSCREEN); @@ -467,7 +467,7 @@ void menuRadioSetup(event_t event) } #endif -#if defined(TELEMETRY_FRSKY) && defined(FRSKY_HUB) && defined(GPS) +#if defined(TELEMETRY_FRSKY) && defined(GPS) case ITEM_SETUP_TIMEZONE: lcdDrawTextAlignedLeft(y, STR_TIMEZONE); lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT); @@ -507,12 +507,12 @@ void menuRadioSetup(event_t event) #if defined(FAI_CHOICE) case ITEM_SETUP_FAI: - editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, PSTR("FAI Mode"), attr, event); + editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, "FAI Mode", attr, event); if (attr && checkIncDec_Ret) { if (g_eeGeneral.fai) - POPUP_WARNING(PSTR("FAI\001mode blocked!")); + POPUP_WARNING("FAI\001mode blocked!"); else - POPUP_CONFIRMATION(PSTR("FAI mode?")); + POPUP_CONFIRMATION("FAI mode?"); } break; #endif @@ -559,7 +559,7 @@ void menuRadioSetup(event_t event) case ITEM_SETUP_STICK_MODE: lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr); for (uint8_t i=0; i0) { CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3); diff --git a/radio/src/gui/128x64/radio_version.cpp b/radio/src/gui/128x64/radio_version.cpp index 1c826aa4f..66c27cbef 100644 --- a/radio/src/gui/128x64/radio_version.cpp +++ b/radio/src/gui/128x64/radio_version.cpp @@ -37,11 +37,11 @@ void menuRadioVersion(event_t event) #if defined(COPROCESSOR) if (Coproc_valid == 1) { - lcdDrawTextAlignedLeft(6*FH, PSTR("CoPr:")); + lcdDrawTextAlignedLeft(6*FH, "CoPr:"); lcdDraw8bitsNumber(10*FW, 6*FH, Coproc_read); } else { - lcdDrawTextAlignedLeft(6*FH, PSTR("CoPr: ---")); + lcdDrawTextAlignedLeft(6*FH, "CoPr: ---"); } #elif defined(EEPROM_RLC) lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+5*FH+1, STR_EEBACKUP); diff --git a/radio/src/gui/128x64/splash.cpp b/radio/src/gui/128x64/splash.cpp index 6ae46334e..f322c2603 100644 --- a/radio/src/gui/128x64/splash.cpp +++ b/radio/src/gui/128x64/splash.cpp @@ -20,33 +20,13 @@ #include "opentx.h" -#if !defined GET_FAR_ADDRESS -#define GET_FAR_ADDRESS(var) \ -({ \ - uint32_t tmp; \ - \ - __asm__ __volatile__( \ - \ - "ldi %A0, lo8(%1)" "\n\t" \ - "ldi %B0, hi8(%1)" "\n\t" \ - "ldi %C0, hh8(%1)" "\n\t" \ - "clr %D0" "\n\t" \ - : \ - "=d" (tmp) \ - : \ - "p" (&(var)) \ - ); \ - tmp; \ -}) -#endif - #if defined(SPLASH) -const pm_uchar splashdata[] PROGMEM = { +const unsigned char splashdata[] = { 'S','P','S',0, #include "bitmaps/128x64/splash.lbm" 'S','P','E',0 }; -const pm_uchar * const splash_lbm = splashdata+4; +const unsigned char * const splash_lbm = splashdata+4; void drawSplash() { @@ -65,12 +45,12 @@ void drawSplash() #endif #if defined(SPLASH_FRSKY) -const pm_uchar splashdata2[] PROGMEM = { +const unsigned char splashdata2[] = { 'S','F','S',0, #include "bitmaps/128x64/splash_frsky.lbm" 'S','F','E',0 }; -const pm_uchar * const splash2_lbm = splashdata2+4; +const unsigned char * const splash2_lbm = splashdata2+4; void drawSecondSplash() { diff --git a/radio/src/gui/128x64/view_about.cpp b/radio/src/gui/128x64/view_about.cpp index e5af021d4..dec2f7f94 100644 --- a/radio/src/gui/128x64/view_about.cpp +++ b/radio/src/gui/128x64/view_about.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -const pm_uchar about_bmp[] PROGMEM = { +const unsigned char about_bmp[] = { #include "about.lbm" }; diff --git a/radio/src/gui/128x64/view_main.cpp b/radio/src/gui/128x64/view_main.cpp index 4411ba95b..43401c55e 100644 --- a/radio/src/gui/128x64/view_main.cpp +++ b/radio/src/gui/128x64/view_main.cpp @@ -173,7 +173,7 @@ void displayTrims(uint8_t phase) } } -FORCEINLINE void drawTimerWithMode(coord_t x, coord_t y, uint8_t index) +void drawTimerWithMode(coord_t x, coord_t y, uint8_t index) { const TimerData & timer = g_model.timers[index]; if (timer.mode) { @@ -303,8 +303,6 @@ void onMainViewMenu(const char *result) void menuMainView(event_t event) { - STICK_SCROLL_DISABLE(); - uint8_t view = g_eeGeneral.view; uint8_t view_base = view & 0x0f; @@ -564,12 +562,12 @@ void menuMainView(event_t event) warningText = STR_GLOBAL_VAR; drawMessageBox(); lcdDrawSizedText(16, 5*FH, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR); - lcdDrawText(16+6*FW, 5*FH, PSTR("["), BOLD); + lcdDrawText(16+6*FW, 5*FH, "[", BOLD); drawGVarValue(lcdLastRightPos, 5*FH, gvarLastChanged, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)), LEFT|BOLD); if (g_model.gvars[gvarLastChanged].unit) { lcdDrawText(lcdLastRightPos, 5*FH, "%", BOLD); } - lcdDrawText(lcdLastRightPos, 5*FH, PSTR("]"), BOLD); + lcdDrawText(lcdLastRightPos, 5*FH, "]", BOLD); warningText = NULL; } #endif @@ -577,7 +575,7 @@ void menuMainView(event_t event) #if defined(DSM2) if (moduleFlag[0] == MODULE_BIND) { // Issue 98 - lcdDrawText(15*FW, 0, PSTR("BIND"), 0); + lcdDrawText(15*FW, 0, "BIND", 0); } #endif } diff --git a/radio/src/gui/128x64/view_statistics.cpp b/radio/src/gui/128x64/view_statistics.cpp index 4ab6d57a8..73c1c7370 100644 --- a/radio/src/gui/128x64/view_statistics.cpp +++ b/radio/src/gui/128x64/view_statistics.cpp @@ -187,13 +187,13 @@ void menuStatisticsDebug(event_t event) lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, STR_COPROC_TEMP); if (Coproc_read==0) { - lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Co Proc NACK"),INVERS); + lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, "Co Proc NACK",INVERS); } else if (Coproc_read==0x81) { - lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Inst.TinyApp"),INVERS); + lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, "Inst.TinyApp",INVERS); } else if (Coproc_read<3) { - lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Upgr.TinyApp"),INVERS); + lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, "Upgr.TinyApp",INVERS); } else { drawValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, Coproc_temp, UNIT_TEMPERATURE, LEFT); diff --git a/radio/src/gui/128x64/view_telemetry.cpp b/radio/src/gui/128x64/view_telemetry.cpp index 5b09f5543..f76bc9769 100644 --- a/radio/src/gui/128x64/view_telemetry.cpp +++ b/radio/src/gui/128x64/view_telemetry.cpp @@ -23,10 +23,6 @@ #define STATUS_BAR_Y (7*FH+1) #define TELEM_2ND_COLUMN (10*FW) -#if defined(FRSKY_HUB) && defined(GAUGES) -bar_threshold_t barsThresholds[THLD_MAX]; -#endif - uint8_t s_frsky_view = 0; #define BAR_LEFT 25 @@ -168,11 +164,9 @@ bool displayCustomTelemetryScreen(uint8_t index) { FrSkyScreenData & screen = g_model.frsky.screens[index]; -#if defined(GAUGES) if (IS_BARS_SCREEN(s_frsky_view)) { return displayGaugesTelemetryScreen(screen); } -#endif displayNumbersTelemetryScreen(screen); diff --git a/radio/src/gui/128x64/widgets.cpp b/radio/src/gui/128x64/widgets.cpp index f69c042e0..cec799981 100644 --- a/radio/src/gui/128x64/widgets.cpp +++ b/radio/src/gui/128x64/widgets.cpp @@ -65,12 +65,12 @@ void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uin lcdDrawVerticalLine(x, y + yofs, yhgt, SOLID, FORCE); } -void title(const pm_char * s) +void title(const char * s) { lcdDrawText(0, 0, s, INVERS); } -choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event) +choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event) { drawFieldLabel(x, y, label); if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr); @@ -78,7 +78,7 @@ choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char * return value; } -uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, event_t event ) +uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event ) { #if defined(GRAPHICS) drawCheckBox(x, y, value, attr); @@ -246,7 +246,7 @@ void drawProgressBar(const char * label, int num, int den) lcdRefresh(); } -const pm_uchar SLEEP_BITMAP[] PROGMEM = { +const unsigned char SLEEP_BITMAP[] = { #include "sleep.lbm" }; diff --git a/radio/src/gui/212x64/fonts.cpp b/radio/src/gui/212x64/fonts.cpp index 94197cfcd..a83d04ae6 100644 --- a/radio/src/gui/212x64/fonts.cpp +++ b/radio/src/gui/212x64/fonts.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -const pm_uchar font_5x7[] PROGMEM = { +const unsigned char font_5x7[] = { #include "font_05x07.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_05x07.lbm" @@ -43,12 +43,12 @@ const pm_uchar font_5x7[] PROGMEM = { #endif }; -const pm_uchar font_5x7_B[] PROGMEM = { +const unsigned char font_5x7_B[] = { #include "font_05x07_B_compressed.lbm" }; #if !defined(BOOT) -const pm_uchar font_10x14[] PROGMEM = { +const unsigned char font_10x14[] = { #include "font_10x14_compressed.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_10x14.lbm" @@ -71,11 +71,11 @@ const pm_uchar font_10x14[] PROGMEM = { #endif }; -const pm_uchar font_3x5[] PROGMEM = { +const unsigned char font_3x5[] = { #include "font_03x05.lbm" }; -const pm_uchar font_4x6[] PROGMEM = { +const unsigned char font_4x6[] = { #include "font_04x06.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_04x06.lbm" @@ -98,7 +98,7 @@ const pm_uchar font_4x6[] PROGMEM = { #endif }; -const pm_uchar font_8x10[] PROGMEM = { +const unsigned char font_8x10[] = { #include "font_08x10.lbm" #if defined(TRANSLATIONS_DE) #include "font_de_08x10.lbm" @@ -121,19 +121,19 @@ const pm_uchar font_8x10[] PROGMEM = { #endif }; -const pm_uchar font_22x38_num[] PROGMEM = { +const unsigned char font_22x38_num[] = { #include "font_22x38_num.lbm" }; -const pm_uchar font_4x6_extra[] PROGMEM = { +const unsigned char font_4x6_extra[] = { #include "font_04x06_extra.lbm" }; -const pm_uchar font_5x7_extra[] PROGMEM = { +const unsigned char font_5x7_extra[] = { #include "font_05x07_extra.lbm" }; -const pm_uchar font_10x14_extra[] PROGMEM = { +const unsigned char font_10x14_extra[] = { #include "font_10x14_extra.lbm" }; diff --git a/radio/src/gui/212x64/gui.h b/radio/src/gui/212x64/gui.h index b0db1e2ef..843cc41d9 100644 --- a/radio/src/gui/212x64/gui.h +++ b/radio/src/gui/212x64/gui.h @@ -178,11 +178,11 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla #define CURSOR_ON_LINE() (menuHorizontalPosition<0) #define CHECK_FLAG_NO_SCREEN_INDEX 1 -void check(const char * title, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0); +void check(const char * title, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0); void check_simple(const char *title, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t maxrow); void check_submenu_simple(const char * title, event_t event, uint8_t maxrow); -void title(const pm_char * s); +void title(const char * s); #define TITLE(str) title(str) #define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__ @@ -224,8 +224,8 @@ void title(const pm_char * s); typedef int choice_t; -choice_t editChoice(coord_t x, coord_t y, const pm_char *label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event); -uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, event_t event); +choice_t editChoice(coord_t x, coord_t y, const char *label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event); +uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event); swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event); #define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event) @@ -249,7 +249,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlag extern uint8_t editNameCursorPos; void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, uint8_t active, LcdFlags attr=ZCHAR); -void editSingleName(coord_t x, coord_t y, const pm_char * label, char * name, uint8_t size, event_t event, uint8_t active); +void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8_t size, event_t event, uint8_t active); uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay); #define EDIT_DELAY(y, event, attr, str, delay) editDelay(y, event, attr, str, delay) @@ -260,8 +260,8 @@ uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint void copySelection(char * dst, const char * src, uint8_t size); -extern const pm_char * warningText; -extern const pm_char * warningInfoText; +extern const char * warningText; +extern const char * warningInfoText; extern uint8_t warningInfoLength; extern uint8_t warningResult; extern uint8_t warningType; @@ -326,7 +326,7 @@ uint8_t switchToMix(uint8_t source); extern coord_t scrollbar_X; #define SET_SCROLLBAR_X(x) scrollbar_X = (x); -extern const pm_uchar sticks[] PROGMEM; +extern const unsigned char sticks[] ; #if defined(FLIGHT_MODES) void displayFlightModes(coord_t x, coord_t y, FlightModesType value); diff --git a/radio/src/gui/212x64/lcd.cpp b/radio/src/gui/212x64/lcd.cpp index 9d22ca982..104bbcc34 100644 --- a/radio/src/gui/212x64/lcd.cpp +++ b/radio/src/gui/212x64/lcd.cpp @@ -103,7 +103,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width, else if (i<=width) { uint8_t skip = true; for (uint8_t j=0; j= displayBuf && (p) < DISPLAY_END) -#if defined(BOOT) -// TODO quick & dirty :( -typedef const unsigned char pm_uchar; -typedef const char pm_char; -#endif - void lcdDrawChar(coord_t x, coord_t y, const unsigned char c); void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags mode); -void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags mode); -void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags mode); -void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags mode); -void lcdDrawText(coord_t x, coord_t y, const pm_char * s); -void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, unsigned char len); -void lcdDrawTextAlignedLeft(coord_t y, const pm_char * s); +void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags mode); +void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags mode); +void lcdDrawSizedText(coord_t x, coord_t y, const char * s,unsigned char len, LcdFlags mode); +void lcdDrawText(coord_t x, coord_t y, const char * s); +void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len); +void lcdDrawTextAlignedLeft(coord_t y, const char * s); #define lcdDrawTextAlignedCenter(y, s) lcdDrawText((LCD_W-sizeof(TR_##s)*FW+FW+1)/2, y, STR_##s) @@ -125,7 +119,7 @@ void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags mode=0); void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode, uint8_t len); void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode=0); -void drawStringWithIndex(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att=0); +void drawStringWithIndex(coord_t x, coord_t y, const char *str, uint8_t idx, LcdFlags att=0); void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att); void drawSwitch(coord_t x, coord_t y, int32_t swtch, LcdFlags att=0); void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0); @@ -182,7 +176,7 @@ void drawTelemetryTopBar(); lcdDrawSolidVerticalLine(xx ,yy-ll,ll); \ lcdDrawSolidVerticalLine(xx+1,yy-ll,ll) -void lcdDraw1bitBitmap(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0); +void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att=0); void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0); #define LCD_ICON(x, y, icon) lcdDrawBitmap(x, y, icons, icon) diff --git a/radio/src/gui/212x64/menu_model.cpp b/radio/src/gui/212x64/menu_model.cpp index 547c76cd8..94829aee5 100644 --- a/radio/src/gui/212x64/menu_model.cpp +++ b/radio/src/gui/212x64/menu_model.cpp @@ -60,7 +60,7 @@ uint8_t s_copySrcCh; uint8_t editNameCursorPos = 0; -void editSingleName(coord_t x, coord_t y, const pm_char * label, char *name, uint8_t size, event_t event, uint8_t active) +void editSingleName(coord_t x, coord_t y, const char * label, char *name, uint8_t size, event_t event, uint8_t active) { lcdDrawTextAlignedLeft(y, label); editName(x, y, name, size, event, active); diff --git a/radio/src/gui/212x64/model_display.cpp b/radio/src/gui/212x64/model_display.cpp index 323b2ed45..42520142a 100644 --- a/radio/src/gui/212x64/model_display.cpp +++ b/radio/src/gui/212x64/model_display.cpp @@ -125,7 +125,7 @@ void menuModelDisplay(event_t event) uint8_t screenIndex = TELEMETRY_CURRENT_SCREEN(k); drawStringWithIndex(0*FW, y, STR_SCREEN, screenIndex+1); TelemetryScreenType oldScreenType = TELEMETRY_SCREEN_TYPE(screenIndex); - TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, PSTR(""), STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event); + TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, "", STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event); if (newScreenType != oldScreenType) { g_model.frsky.screensType = (g_model.frsky.screensType & (~(0x03 << (2*screenIndex)))) | (newScreenType << (2*screenIndex)); memset(&g_model.frsky.screens[screenIndex], 0, sizeof(g_model.frsky.screens[screenIndex])); diff --git a/radio/src/gui/212x64/model_flightmodes.cpp b/radio/src/gui/212x64/model_flightmodes.cpp index 8d7851e5a..2b7eb05c9 100644 --- a/radio/src/gui/212x64/model_flightmodes.cpp +++ b/radio/src/gui/212x64/model_flightmodes.cpp @@ -22,7 +22,7 @@ void displayFlightModes(coord_t x, coord_t y, FlightModesType value) { - lcdDrawText(x, y, STR_FP); + lcdDrawText(x, y, STR_FM); x = lcdNextPos + 1; for (uint8_t p=0; p0) ? BLINK|INVERS : INVERS) : 0); uint8_t active = (attr && s_editMode>0) ; - if (active) STICK_SCROLL_DISABLE(); switch(j) { case ITEM_LIMITS_CH_NAME: diff --git a/radio/src/gui/212x64/model_setup.cpp b/radio/src/gui/212x64/model_setup.cpp index 28592b520..7ea13ad9a 100644 --- a/radio/src/gui/212x64/model_setup.cpp +++ b/radio/src/gui/212x64/model_setup.cpp @@ -574,7 +574,7 @@ void menuModelSetup(event_t event) #endif lcdDrawTextAlignedLeft(y, STR_POTWARNING); - lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0); + lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, "\004""OFF\0""Man\0""Auto", g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0); if (attr && (menuHorizontalPosition == 0)) { CHECK_INCDEC_MODELVAR(event, g_model.potsWarnMode, POTS_WARN_OFF, POTS_WARN_AUTO); storageDirty(EE_MODEL); diff --git a/radio/src/gui/212x64/model_telemetry.cpp b/radio/src/gui/212x64/model_telemetry.cpp index a15d5c03c..13c2f1c21 100644 --- a/radio/src/gui/212x64/model_telemetry.cpp +++ b/radio/src/gui/212x64/model_telemetry.cpp @@ -519,10 +519,10 @@ void menuModelTelemetryFrsky(event_t event) if (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_XJT && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_MULTIMODULE && g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A) - lcdDrawTextAlignedLeft(y, PSTR("RSNR")); + lcdDrawTextAlignedLeft(y, "RSNR"); else #endif - lcdDrawTextAlignedLeft(y, PSTR("RSSI")); + lcdDrawTextAlignedLeft(y, "RSSI"); break; case ITEM_TELEMETRY_RSSI_ALARM1: diff --git a/radio/src/gui/212x64/popups.cpp b/radio/src/gui/212x64/popups.cpp index 40d73451c..dee7c4e72 100644 --- a/radio/src/gui/212x64/popups.cpp +++ b/radio/src/gui/212x64/popups.cpp @@ -44,7 +44,7 @@ void showMessageBox(const char * title) lcdRefresh(); } -const pm_uchar ASTERISK_BITMAP[] PROGMEM = { +const unsigned char ASTERISK_BITMAP[] = { #include "asterisk.lbm" }; diff --git a/radio/src/gui/212x64/radio_calibration.cpp b/radio/src/gui/212x64/radio_calibration.cpp index cc5162782..339db6a02 100644 --- a/radio/src/gui/212x64/radio_calibration.cpp +++ b/radio/src/gui/212x64/radio_calibration.cpp @@ -126,7 +126,6 @@ void menuCommonCalib(event_t event) case CALIB_MOVE_STICKS: // MOVE STICKS/POTS - STICK_SCROLL_DISABLE(); lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS); lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE); for (uint8_t i=0; i0) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0); break; @@ -395,7 +395,7 @@ void menuRadioSetup(event_t event) break; #endif -#if defined(SPLASH) && !defined(FSPLASH) +#if defined(SPLASH) case ITEM_SETUP_DISABLE_SPLASH: { lcdDrawTextAlignedLeft(y, STR_SPLASHSCREEN); @@ -411,7 +411,7 @@ void menuRadioSetup(event_t event) } #endif -#if defined(TELEMETRY_FRSKY) && defined(FRSKY_HUB) && defined(GPS) +#if defined(TELEMETRY_FRSKY) && defined(GPS) case ITEM_SETUP_LABEL_GPS: lcdDrawTextAlignedLeft(y, STR_GPS); break; @@ -455,12 +455,12 @@ void menuRadioSetup(event_t event) #if defined(FAI_CHOICE) case ITEM_SETUP_FAI: - editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, PSTR("FAI Mode"), attr, event); + editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, "FAI Mode"), attr, event; if (attr && checkIncDec_Ret) { if (g_eeGeneral.fai) - POPUP_WARNING(PSTR("FAI\001mode blocked!")); + POPUP_WARNING("FAI\001mode blocked!"); else - POPUP_CONFIRMATION(PSTR("FAI mode?")); + POPUP_CONFIRMATION("FAI mode?"); } break; #endif @@ -495,7 +495,7 @@ void menuRadioSetup(event_t event) case ITEM_SETUP_STICK_MODE: lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr); for (uint8_t i=0; i<4; i++) { - putsStickName((6+4*i)*FW, y, pgm_read_byte(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0); + putsStickName((6+4*i)*FW, y, *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0); } if (attr && s_editMode>0) { CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3); diff --git a/radio/src/gui/212x64/splash.cpp b/radio/src/gui/212x64/splash.cpp index 94f81b530..354501248 100644 --- a/radio/src/gui/212x64/splash.cpp +++ b/radio/src/gui/212x64/splash.cpp @@ -21,11 +21,11 @@ #include "opentx.h" #if defined(SPLASH) -const pm_uchar splashdata[] PROGMEM = { +const unsigned char splashdata[] = { 'S','P','S',0, #include "bitmaps/212x64/splash.lbm" 'S','P','E',0 }; -const pm_uchar * const splash_lbm = splashdata+4; +const unsigned char * const splash_lbm = splashdata+4; void drawSplash() { @@ -44,11 +44,11 @@ void drawSplash() #endif #if defined(SPLASH_FRSKY) -const pm_uchar splashdata2[] PROGMEM = { +const unsigned char splashdata2[] = { 'S','F','S',0, #include "bitmaps/212x64/splash_frsky.lbm" 'S','F','E',0 }; -const pm_uchar * const splash2_lbm = splashdata2+4; +const unsigned char * const splash2_lbm = splashdata2+4; void drawSecondSplash() { diff --git a/radio/src/gui/212x64/view_about.cpp b/radio/src/gui/212x64/view_about.cpp index 26cc7c445..b75ff1095 100644 --- a/radio/src/gui/212x64/view_about.cpp +++ b/radio/src/gui/212x64/view_about.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -const pm_uchar about_bmp[] PROGMEM = { +const unsigned char about_bmp[] = { #include "about.lbm" }; diff --git a/radio/src/gui/212x64/view_main.cpp b/radio/src/gui/212x64/view_main.cpp index c99561bcd..f3b129085 100644 --- a/radio/src/gui/212x64/view_main.cpp +++ b/radio/src/gui/212x64/view_main.cpp @@ -49,11 +49,11 @@ #define TRIM_LEN 27 #define MARKER_WIDTH 5 -const pm_uchar logo_taranis[] PROGMEM = { +const unsigned char logo_taranis[] = { #include "logo.lbm" }; -const pm_uchar icons[] PROGMEM = { +const unsigned char icons[] = { #include "icons.lbm" }; @@ -439,8 +439,6 @@ void menuMainView(event_t event) { static bool secondPage = false; - STICK_SCROLL_DISABLE(); - switch(event) { case EVT_ENTRY: @@ -594,9 +592,9 @@ void menuMainView(event_t event) lcdDrawRect(BITMAP_X, BITMAP_Y, 64, 32); drawStringWithIndex(BITMAP_X+FW, BITMAP_Y+FH-1, STR_GV, gvarLastChanged+1); lcdDrawSizedText(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR); - lcdDrawText(BITMAP_X+FW, BITMAP_Y+2*FH+3, PSTR("["), BOLD); + lcdDrawText(BITMAP_X+FW, BITMAP_Y+2*FH+3, "[", BOLD); drawGVarValue(BITMAP_X+2*FW, BITMAP_Y+2*FH+3, gvarLastChanged, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)), LEFT|BOLD); - lcdDrawText(lcdLastRightPos, BITMAP_Y+2*FH+3, PSTR("]"), BOLD); + lcdDrawText(lcdLastRightPos, BITMAP_Y+2*FH+3, "]", BOLD); } #endif } diff --git a/radio/src/gui/212x64/widgets.cpp b/radio/src/gui/212x64/widgets.cpp index 27eaacac8..8eb631d09 100644 --- a/radio/src/gui/212x64/widgets.cpp +++ b/radio/src/gui/212x64/widgets.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -const pm_uchar SLEEP_BITMAP[] PROGMEM = { +const unsigned char SLEEP_BITMAP[] = { #include "../../bitmaps/212x64/sleep.lbm" }; @@ -34,7 +34,7 @@ void drawSleepBitmap() } #if defined(PWR_BUTTON_PRESS) -const pm_uchar SHUTDOWN_BITMAP[] PROGMEM = { +const unsigned char SHUTDOWN_BITMAP[] = { #include "../../bitmaps/212x64/shutdown.lbm" }; @@ -125,12 +125,12 @@ void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t } } -void title(const pm_char * s) +void title(const char * s) { lcdDrawText(0, 0, s, INVERS); } -choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event) +choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event) { drawFieldLabel(x, y, label); if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr); @@ -138,7 +138,7 @@ choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char * return value; } -uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, event_t event ) +uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event ) { drawCheckBox(x, y, value, attr); return editChoice(x, y, label, NULL, value, 0, 1, attr, event); diff --git a/radio/src/gui/480x272/bitmapbuffer.cpp b/radio/src/gui/480x272/bitmapbuffer.cpp index 8f0134e8a..67fb457e4 100644 --- a/radio/src/gui/480x272/bitmapbuffer.cpp +++ b/radio/src/gui/480x272/bitmapbuffer.cpp @@ -318,7 +318,7 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l int width = getTextWidth(s, len, flags); int height = getFontHeight(flags); uint32_t fontindex = FONTINDEX(flags); - const pm_uchar * font = fontsTable[fontindex]; + const unsigned char * font = fontsTable[fontindex]; const uint16_t * fontspecs = fontspecsTable[fontindex]; BitmapBuffer * fontcache = NULL; @@ -541,23 +541,23 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) FRESULT result = f_open(&imgFile, filename, FA_OPEN_EXISTING | FA_READ); if (result != FR_OK) { - return NULL; + return nullptr; } if (f_size(&imgFile) < 14) { f_close(&imgFile); - return NULL; + return nullptr; } result = f_read(&imgFile, buf, 14, &read); if (result != FR_OK || read != 14) { f_close(&imgFile); - return NULL; + return nullptr; } if (buf[0] != 'B' || buf[1] != 'M') { f_close(&imgFile); - return NULL; + return nullptr; } uint32_t fsize = *((uint32_t *)&buf[2]); @@ -567,7 +567,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) result = f_read(&imgFile, buf, len, &read); if (result != FR_OK || read != len) { f_close(&imgFile); - return NULL; + return nullptr; } uint32_t ihsize = *((uint32_t *)&buf[0]); /* more header size */ @@ -575,7 +575,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) /* invalid header size */ if (ihsize + 14 > hsize) { f_close(&imgFile); - return NULL; + return nullptr; } /* sometimes file size is set to some headers size, set a real size in that case */ @@ -585,7 +585,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) /* declared file size less than header size */ if (fsize <= hsize) { f_close(&imgFile); - return NULL; + return nullptr; } uint32_t w, h; @@ -607,12 +607,12 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) break; default: f_close(&imgFile); - return NULL; + return nullptr; } if (*((uint16_t *)&buf[0]) != 1) { /* planes */ f_close(&imgFile); - return NULL; + return nullptr; } uint16_t depth = *((uint16_t *)&buf[2]); @@ -622,7 +622,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) if (depth == 4) { if (f_lseek(&imgFile, hsize-64) != FR_OK || f_read(&imgFile, buf, 64, &read) != FR_OK || read != 64) { f_close(&imgFile); - return NULL; + return nullptr; } for (uint8_t i=0; i<16; i++) { palette[i] = buf[4*i]; @@ -631,14 +631,14 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) else { if (f_lseek(&imgFile, hsize) != FR_OK) { f_close(&imgFile); - return NULL; + return nullptr; } } BitmapBuffer * bmp = new BitmapBuffer(BMP_RGB565, w, h); - if (bmp == NULL || bmp->getData() == NULL) { + if (bmp == nullptr || bmp->getData() == nullptr) { f_close(&imgFile); - return NULL; + return nullptr; } uint32_t rowSize; @@ -654,7 +654,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) if (result != FR_OK || read != 4) { f_close(&imgFile); delete bmp; - return NULL; + return nullptr; } if (hasAlpha) { *dst = ARGB(pixel & 0xff, (pixel >> 24) & 0xff, (pixel >> 16) & 0xff, (pixel >> 8) & 0xff); @@ -688,7 +688,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) if (result != FR_OK || read != rowSize) { f_close(&imgFile); delete bmp; - return NULL; + return nullptr; } display_t * dst = bmp->getPixelPtr(0, i); for (uint32_t j=0; jdrawText(x, y, s, attr); } -inline void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags attr=0) +inline void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags attr=0) { lcd->drawSizedText(x, y, s, len, attr); } diff --git a/radio/src/gui/480x272/menus.h b/radio/src/gui/480x272/menus.h index aaa2146fe..6aafa5036 100644 --- a/radio/src/gui/480x272/menus.h +++ b/radio/src/gui/480x272/menus.h @@ -218,7 +218,7 @@ bool menuStatsDebug(event_t event); bool menuStatsAnalogs(event_t event); bool menuStatsTraces(event_t event); -static const MenuHandlerFunc menuTabStats[] PROGMEM = { +static const MenuHandlerFunc menuTabStats[] = { menuStatsGraph, menuStatsDebug, menuStatsAnalogs, @@ -243,7 +243,7 @@ extern uint8_t lastMonitorPage; extern void drawSingleMixerBar(coord_t, coord_t, coord_t, coord_t, uint8_t); extern void drawSingleOutputBar(coord_t, coord_t, coord_t, coord_t, uint8_t); -extern const MenuHandlerFunc menuTabScreensSetup[1+MAX_CUSTOM_SCREENS] PROGMEM; +extern const MenuHandlerFunc menuTabScreensSetup[1+MAX_CUSTOM_SCREENS] ; bool menuFirstCalib(event_t event); bool menuMainView(event_t event); @@ -428,8 +428,8 @@ extern uint8_t s_curveChan; #define WARNING_TYPE_INPUT 3 #define WARNING_TYPE_INFO 4 -extern const pm_char * warningText; -extern const pm_char * warningInfoText; +extern const char * warningText; +extern const char * warningInfoText; extern uint8_t warningInfoLength; extern uint8_t warningResult; extern uint8_t warningType; diff --git a/radio/src/gui/480x272/model_gvars.cpp b/radio/src/gui/480x272/model_gvars.cpp index b2bf74752..27e005fc1 100644 --- a/radio/src/gui/480x272/model_gvars.cpp +++ b/radio/src/gui/480x272/model_gvars.cpp @@ -101,7 +101,7 @@ bool menuModelGVarOne(event_t event) break; default: - drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_FP, k-GVAR_FIELD_FM0); + drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_FM, k-GVAR_FIELD_FM0); editGVarValue(MIXES_2ND_COLUMN, y, event, s_currIdx, k-GVAR_FIELD_FM0, LEFT|attr); break; } diff --git a/radio/src/gui/480x272/model_inputs.cpp b/radio/src/gui/480x272/model_inputs.cpp index 0fac6fc0d..111d42d6b 100644 --- a/radio/src/gui/480x272/model_inputs.cpp +++ b/radio/src/gui/480x272/model_inputs.cpp @@ -303,7 +303,7 @@ bool menuModelExpoOne(event_t event) return true; } -#define _STR_MAX(x) PSTR("/" #x) +#define _STR_MAX(x) "/" #x #define STR_MAX(x) _STR_MAX(x) #define EXPO_LINE_WEIGHT_POS 125 diff --git a/radio/src/gui/480x272/model_mixes.cpp b/radio/src/gui/480x272/model_mixes.cpp index f37c276da..1672308bd 100644 --- a/radio/src/gui/480x272/model_mixes.cpp +++ b/radio/src/gui/480x272/model_mixes.cpp @@ -280,7 +280,7 @@ bool menuModelMixOne(event_t event) return true; } -#define _STR_MAX(x) PSTR("/" #x) +#define _STR_MAX(x) "/" #x #define STR_MAX(x) _STR_MAX(x) #define MIX_LINE_WEIGHT_POS 105 diff --git a/radio/src/gui/480x272/model_outputs.cpp b/radio/src/gui/480x272/model_outputs.cpp index df1cdcc33..af5128fd7 100644 --- a/radio/src/gui/480x272/model_outputs.cpp +++ b/radio/src/gui/480x272/model_outputs.cpp @@ -139,7 +139,6 @@ bool menuModelLimits(event_t event) for (uint8_t j=0; j0) ? BLINK|INVERS : INVERS) : 0); uint8_t active = (attr && s_editMode>0) ; - if (active) STICK_SCROLL_DISABLE(); switch(j) { case ITEM_LIMITS_CH_NAME: diff --git a/radio/src/gui/480x272/model_setup.cpp b/radio/src/gui/480x272/model_setup.cpp index 679b9eeae..ef2f254ca 100644 --- a/radio/src/gui/480x272/model_setup.cpp +++ b/radio/src/gui/480x272/model_setup.cpp @@ -530,7 +530,7 @@ bool menuModelSetup(event_t event) case ITEM_MODEL_SLIDPOT_WARNING_STATE: lcdDrawText(MENUS_MARGIN_LEFT, y,STR_POTWARNINGSTATE); - lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, attr); + lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, "\004""OFF\0""Man\0""Auto", g_model.potsWarnMode, attr); if (attr) { CHECK_INCDEC_MODELVAR(event, g_model.potsWarnMode, POTS_WARN_OFF, POTS_WARN_AUTO); storageDirty(EE_MODEL); diff --git a/radio/src/gui/480x272/model_telemetry.cpp b/radio/src/gui/480x272/model_telemetry.cpp index 027aba2c9..5b5b10cbf 100644 --- a/radio/src/gui/480x272/model_telemetry.cpp +++ b/radio/src/gui/480x272/model_telemetry.cpp @@ -526,10 +526,10 @@ bool menuModelTelemetryFrsky(event_t event) if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_MULTIMODULE && g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A) - lcdDrawText(MENUS_MARGIN_LEFT, y, PSTR("RSNR")); + lcdDrawText(MENUS_MARGIN_LEFT, y, "RSNR"); else #endif - lcdDrawText(MENUS_MARGIN_LEFT, y, PSTR("RSSI")); + lcdDrawText(MENUS_MARGIN_LEFT, y, "RSSI"); break; case ITEM_TELEMETRY_RSSI_ALARM1: diff --git a/radio/src/gui/480x272/radio_hardware.cpp b/radio/src/gui/480x272/radio_hardware.cpp index e6c204939..c7425d563 100644 --- a/radio/src/gui/480x272/radio_hardware.cpp +++ b/radio/src/gui/480x272/radio_hardware.cpp @@ -179,7 +179,7 @@ bool menuRadioHardware(event_t event) pauseMixerCalculations(); pausePulses(); EXTERNAL_MODULE_OFF(); - CoTickDelay(10); // 20ms so that the pulses interrupt will reinit the frame rate + RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate telemetryProtocol = 255; // force telemetry port + module reinitialization EXTERNAL_MODULE_ON(); resumePulses(); diff --git a/radio/src/gui/480x272/radio_sdmanager.cpp b/radio/src/gui/480x272/radio_sdmanager.cpp index a652cb206..7206687b2 100644 --- a/radio/src/gui/480x272/radio_sdmanager.cpp +++ b/radio/src/gui/480x272/radio_sdmanager.cpp @@ -67,7 +67,7 @@ inline bool isFilenameLower(bool isfile, const char * fn, const char * line) void getSelectionFullPath(char * lfn) { f_getcwd(lfn, _MAX_LFN); - strcat(lfn, PSTR("/")); + strcat(lfn, "/"); strcat(lfn, reusableBuffer.sdmanager.lines[menuVerticalPosition - menuVerticalOffset]); } @@ -95,7 +95,7 @@ void onSdManagerMenu(const char * result) f_getcwd(lfn, _MAX_LFN); // if destination is dir, copy into that dir if (IS_DIRECTORY(line)) { - strcat(lfn, PSTR("/")); + strcat(lfn, "/"); strcat(lfn, line); } if (strcmp(clipboard.data.sd.directory, lfn)) { // prevent copying to the same directory diff --git a/radio/src/gui/480x272/radio_setup.cpp b/radio/src/gui/480x272/radio_setup.cpp index b42f100a2..a4e86b44e 100644 --- a/radio/src/gui/480x272/radio_setup.cpp +++ b/radio/src/gui/480x272/radio_setup.cpp @@ -154,8 +154,8 @@ bool menuRadioSetup(event_t event) { int16_t year = TM_YEAR_BASE + t.tm_year; int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0); - static const pm_uint8_t dmon[] PROGMEM = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - dlim += pgm_read_byte(&dmon[t.tm_mon]); + static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + dlim += dmon[t.tm_mon]; lcdDrawNumber(lcdNextPos+3, y, t.tm_mday, flags|rowattr|LEADING0, 2); if (rowattr && s_editMode>0) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0); break; @@ -427,15 +427,15 @@ bool menuRadioSetup(event_t event) #if defined(FAI_CHOICE) case ITEM_SETUP_FAI: - lcdDrawText(MENUS_MARGIN_LEFT, y, PSTR("FAI Mode")); + lcdDrawText(MENUS_MARGIN_LEFT, y, "FAI Mode"); if (g_eeGeneral.fai) { - lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, PSTR("Locked in FAI Mode")); + lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, "Locked in FAI Mode"); } else { g_eeGeneral.fai = editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, attr, event); if (attr && checkIncDec_Ret) { g_eeGeneral.fai = false; - POPUP_CONFIRMATION(PSTR("FAI mode?")); + POPUP_CONFIRMATION("FAI mode?"); } } break; @@ -473,7 +473,7 @@ bool menuRadioSetup(event_t event) s[0] = '1'+reusableBuffer.generalSettings.stickMode; lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, s, attr); for (uint8_t i=0; i<4; i++) { - drawSource(RADIO_SETUP_2ND_COLUMN + 40 + 50*i, y, MIXSRC_Rud + pgm_read_byte(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i)); + drawSource(RADIO_SETUP_2ND_COLUMN + 40 + 50*i, y, MIXSRC_Rud + *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i)); } if (attr && s_editMode>0) { CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3); diff --git a/radio/src/gui/480x272/splash.cpp b/radio/src/gui/480x272/splash.cpp index 64c45efb1..54170957a 100644 --- a/radio/src/gui/480x272/splash.cpp +++ b/radio/src/gui/480x272/splash.cpp @@ -22,45 +22,39 @@ #if defined(SPLASH) -const uint8_t __bmp_splash[] { +const uint8_t __bmp_splash[] __ALIGNED(4) { #include "bmp_splash.lbm" }; -Bitmap BMP_SPLASH(BMP_RGB565, (const uint16_t*)__bmp_splash); +Bitmap BMP_SPLASH(BMP_RGB565, (const uint16_t *)__bmp_splash); void drawSplash() { - static bool loadImgFromSD = true; - static BitmapBuffer* splashImg = NULL; + static bool loadImgFromSD = true; + static BitmapBuffer * splashImg = nullptr; - if (loadImgFromSD && splashImg == NULL) { - bool sd_mounted = sdMounted(); - if (!sd_mounted) sdInit(); - splashImg = BitmapBuffer::load(BITMAPS_PATH "/" SPLASH_FILE); - loadImgFromSD = false; - if (!sd_mounted) sdDone(); - } - - lcd->clear(); - - if (splashImg) { - lcd->drawBitmap((LCD_W - splashImg->getWidth())/2, - (LCD_H - splashImg->getHeight())/2, - splashImg); - } - else { - // TODO: verify / load / decompress bitmap - lcd->drawBitmap((LCD_W - BMP_SPLASH.getWidth())/2, - (LCD_H - BMP_SPLASH.getHeight())/2, - &BMP_SPLASH); - } - -#if MENUS_LOCK == 1 - if (readonly == false) { - lcdDrawSolidFilledRect((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 - 9, 50, (sizeof(TR_UNLOCKED)-1)*FW+16, 11, SOLID|ROUND); - lcdDrawText((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 , 53, STR_UNLOCKED); + if (loadImgFromSD && splashImg == nullptr) { + bool sd_mounted = sdMounted(); + if (!sd_mounted) + sdInit(); + splashImg = BitmapBuffer::load(BITMAPS_PATH "/" SPLASH_FILE); + loadImgFromSD = false; + if (!sd_mounted) + sdDone(); } -#endif + lcd->clear(); + + if (splashImg) { + lcd->drawBitmap((LCD_W - splashImg->getWidth())/2, + (LCD_H - splashImg->getHeight())/2, + splashImg); + } + else { + lcd->drawBitmap((LCD_W - BMP_SPLASH.getWidth())/2, + (LCD_H - BMP_SPLASH.getHeight())/2, + &BMP_SPLASH); + } + lcdRefresh(); } #endif diff --git a/radio/src/gui/480x272/view_channels.cpp b/radio/src/gui/480x272/view_channels.cpp index c4601bb0a..8e164b254 100644 --- a/radio/src/gui/480x272/view_channels.cpp +++ b/radio/src/gui/480x272/view_channels.cpp @@ -43,7 +43,7 @@ bool menuChannelsMonitor(event_t event) return menuChannelsMonitor(event, index); } -const MenuHandlerFunc menuTabMonitors[] PROGMEM = { +const MenuHandlerFunc menuTabMonitors[] = { menuChannelsMonitor<0>, menuChannelsMonitor<1>, menuChannelsMonitor<2>, @@ -162,7 +162,7 @@ void drawComboOutputBar(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t chan lcdDrawNumber(x + limPos, y + h, chanVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%"); } -coord_t drawChannelsMonitorLegend(coord_t x, const pm_char * s, int color) +coord_t drawChannelsMonitorLegend(coord_t x, const char * s, int color) { lcdDrawSolidFilledRect(x, MENU_FOOTER_TOP + 2, LEG_COLORBOX + 2, LEG_COLORBOX + 2, BARGRAPH_BGCOLOR); lcdDrawSolidFilledRect(x + 1, MENU_FOOTER_TOP + 3, LEG_COLORBOX, LEG_COLORBOX, color); diff --git a/radio/src/gui/common/stdlcd/model_inputs.cpp b/radio/src/gui/common/stdlcd/model_inputs.cpp index 675ec6eac..17455b14a 100644 --- a/radio/src/gui/common/stdlcd/model_inputs.cpp +++ b/radio/src/gui/common/stdlcd/model_inputs.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -#define _STR_MAX(x) PSTR("/" #x) +#define _STR_MAX(x) "/" #x #define STR_MAX(x) _STR_MAX(x) uint8_t getExposCount() diff --git a/radio/src/gui/common/stdlcd/model_mixes.cpp b/radio/src/gui/common/stdlcd/model_mixes.cpp index 37e884e40..ec70e8f33 100644 --- a/radio/src/gui/common/stdlcd/model_mixes.cpp +++ b/radio/src/gui/common/stdlcd/model_mixes.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -#define _STR_MAX(x) PSTR("/" #x) +#define _STR_MAX(x) "/" #x #define STR_MAX(x) _STR_MAX(x) uint8_t getMixesCount() diff --git a/radio/src/gui/common/stdlcd/radio_sdmanager.cpp b/radio/src/gui/common/stdlcd/radio_sdmanager.cpp index 6e263ec32..b89cd74f4 100644 --- a/radio/src/gui/common/stdlcd/radio_sdmanager.cpp +++ b/radio/src/gui/common/stdlcd/radio_sdmanager.cpp @@ -64,7 +64,7 @@ inline bool isFilenameLower(bool isfile, const char * fn, const char * line) void getSelectionFullPath(char * lfn) { f_getcwd(lfn, _MAX_LFN); - strcat(lfn, PSTR("/")); + strcat(lfn, "/"); strcat(lfn, reusableBuffer.sdmanager.lines[menuVerticalPosition - HEADER_LINE - menuVerticalOffset]); } @@ -92,7 +92,7 @@ void onSdManagerMenu(const char * result) f_getcwd(lfn, _MAX_LFN); // if destination is dir, copy into that dir if (IS_DIRECTORY(line)) { - strcat(lfn, PSTR("/")); + strcat(lfn, "/"); strcat(lfn, line); } if (strcmp(clipboard.data.sd.directory, lfn)) { // prevent copying to the same directory @@ -114,7 +114,7 @@ void onSdManagerMenu(const char * result) getSelectionFullPath(lfn); f_unlink(lfn); strncpy(statusLineMsg, line, 13); - strcpy_P(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED); + strcpy(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED); showStatusLine(); REFRESH_FILES(); } diff --git a/radio/src/gui/common/stdlcd/widgets.cpp b/radio/src/gui/common/stdlcd/widgets.cpp index a3bc1fd58..c1b60ec32 100644 --- a/radio/src/gui/common/stdlcd/widgets.cpp +++ b/radio/src/gui/common/stdlcd/widgets.cpp @@ -20,7 +20,7 @@ #include "opentx.h" -void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx, LcdFlags flags) +void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags flags) { if (flags & RIGHT) { lcdDrawNumber(x, y, idx, flags); diff --git a/radio/src/gui/common/widgets.cpp b/radio/src/gui/common/widgets.cpp index 02bdbbb44..f913840e5 100644 --- a/radio/src/gui/common/widgets.cpp +++ b/radio/src/gui/common/widgets.cpp @@ -43,6 +43,6 @@ void drawFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att) return; } #endif - drawStringWithIndex(x, y, STR_FP, idx-1, att); + drawStringWithIndex(x, y, STR_FM, idx-1, att); } #endif diff --git a/radio/src/gui/gui_common.h b/radio/src/gui/gui_common.h index f95943b28..bec8e1d6b 100644 --- a/radio/src/gui/gui_common.h +++ b/radio/src/gui/gui_common.h @@ -132,7 +132,7 @@ struct mm_protocol_definition { uint8_t protocol; uint8_t maxSubtype; bool failsafe; - const pm_char *subTypeString; + const char *subTypeString; const char *optionsstr; }; diff --git a/radio/src/gui/gui_common_arm.cpp b/radio/src/gui/gui_common_arm.cpp index 0d2c594ed..db231bef5 100644 --- a/radio/src/gui/gui_common_arm.cpp +++ b/radio/src/gui/gui_common_arm.cpp @@ -647,53 +647,53 @@ int getFirstAvailable(int min, int max, IsValueAvailable isValueAvailable) // we don't need the special eeprom/flash string handling, just define them as // local strings -const pm_char STR_SUBTYPE_FLYSKY[] PROGMEM = "\004""Std\0""V9x9""V6x6""V912""CX20"; +const char STR_SUBTYPE_FLYSKY[] = "\004""Std\0""V9x9""V6x6""V912""CX20"; -const pm_char STR_SUBTYPE_AFHDS2A[] PROGMEM = "\010""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS"; +const char STR_SUBTYPE_AFHDS2A[] = "\010""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS"; -const pm_char STR_SUBTYPE_FRSKY[] PROGMEM = "\007""D16\0 ""D8\0 ""D16 8ch""V8\0 ""LBT(EU)""LBT 8ch"; +const char STR_SUBTYPE_FRSKY[] = "\007""D16\0 ""D8\0 ""D16 8ch""V8\0 ""LBT(EU)""LBT 8ch"; -const pm_char STR_SUBTYPE_HISKY[] PROGMEM = "\005""HiSky""HK310"; +const char STR_SUBTYPE_HISKY[] = "\005""HiSky""HK310"; -const pm_char STR_SUBTYPE_DSM[] PROGMEM = "\006""2 22ms""2 11ms""X 22ms""X 11ms"; +const char STR_SUBTYPE_DSM[] = "\006""2 22ms""2 11ms""X 22ms""X 11ms"; -const pm_char STR_SUBTYPE_YD717[] PROGMEM = "\007""YD717\0 ""SKYWLKR""Syma X2""XINXUN\0""NIHUI\0 "; +const char STR_SUBTYPE_YD717[] = "\007""YD717\0 ""SKYWLKR""Syma X2""XINXUN\0""NIHUI\0 "; -const pm_char STR_SUBTYPE_SYMAX[] PROGMEM = "\003""Std""5c\0"; +const char STR_SUBTYPE_SYMAX[] = "\003""Std""5c\0"; -const pm_char STR_SUBTYPE_SLT[] PROGMEM = "\005""SLT\0 ""Vista"; +const char STR_SUBTYPE_SLT[] = "\005""SLT\0 ""Vista"; -const pm_char STR_SUBTYPE_CX10[] PROGMEM = "\007""Green\0 ""Blue\0 ""DM007\0 ""-\0 ""JC3015a""JC3015b""MK33041""Q242\0 "; +const char STR_SUBTYPE_CX10[] = "\007""Green\0 ""Blue\0 ""DM007\0 ""-\0 ""JC3015a""JC3015b""MK33041""Q242\0 "; -const pm_char STR_SUBTYPE_CG023[] PROGMEM = "\005""CG023""YD829"; +const char STR_SUBTYPE_CG023[] = "\005""CG023""YD829"; -const pm_char STR_SUBTYPE_KN[] PROGMEM = "\006""WLtoys""FeiLun"; +const char STR_SUBTYPE_KN[] = "\006""WLtoys""FeiLun"; -const pm_char STR_SUBTYPE_MT99[] PROGMEM = "\005""MT99\0""H7\0 ""YZ\0 ""LS\0 ""FY805"; +const char STR_SUBTYPE_MT99[] = "\005""MT99\0""H7\0 ""YZ\0 ""LS\0 ""FY805"; -const pm_char STR_SUBTYPE_MJXQ[] PROGMEM = "\005""WLH08""X600\0""X800\0""H26D\0""E010\0""H26WH"; +const char STR_SUBTYPE_MJXQ[] = "\005""WLH08""X600\0""X800\0""H26D\0""E010\0""H26WH"; -const pm_char STR_SUBTYPE_HONTAI[] PROGMEM = "\007""Std\0 ""JJRC X1""X5C1cln"; +const char STR_SUBTYPE_HONTAI[] = "\007""Std\0 ""JJRC X1""X5C1cln"; -const pm_char STR_SUBTYPE_Q2X2[] PROGMEM = "\004""Q222""Q242""Q282"; +const char STR_SUBTYPE_Q2X2[] = "\004""Q222""Q242""Q282"; -const pm_char STR_SUBTYPE_Q303[] PROGMEM = "\006""Q303\0 ""CX35\0 ""CX10D\0""CX10WD"; +const char STR_SUBTYPE_Q303[] = "\006""Q303\0 ""CX35\0 ""CX10D\0""CX10WD"; -const pm_char STR_SUBTYPE_WK2x01[] PROGMEM = "\006""WK2801""WK2401""W6_5_1""W6_6_1""W6_Hel""W6_HeI"; +const char STR_SUBTYPE_WK2x01[] = "\006""WK2801""WK2401""W6_5_1""W6_6_1""W6_Hel""W6_HeI"; -const pm_char STR_SUBTYPE_V2X2[] PROGMEM = "\006""V2x2\0 ""JXD506"; +const char STR_SUBTYPE_V2X2[] = "\006""V2x2\0 ""JXD506"; -const pm_char STR_SUBTYPE_BAYANG[] PROGMEM = "\007""Bayang\0""H8S3D\0 ""X16 AH\0 ""irdrone"; +const char STR_SUBTYPE_BAYANG[] = "\007""Bayang\0""H8S3D\0 ""X16 AH\0 ""irdrone"; -const pm_char STR_SUBTYPE_FY326[] PROGMEM = "\005""FY326""FY319"; +const char STR_SUBTYPE_FY326[] = "\005""FY326""FY319"; -const pm_char STR_SUBTYPE_CABELL[] PROGMEM = "\006""CAB_V3""C_TELM""-\0 ""-\0 ""-\0 ""-\0 ""F_SAFE""UNBIND"; +const char STR_SUBTYPE_CABELL[] = "\006""CAB_V3""C_TELM""-\0 ""-\0 ""-\0 ""-\0 ""F_SAFE""UNBIND"; -const pm_char STR_SUBTYPE_H83D[] PROGMEM = "\006""H8_3D\0""H20H\0 ""H20Mini""H30Mini"; +const char STR_SUBTYPE_H83D[] = "\006""H8_3D\0""H20H\0 ""H20Mini""H30Mini"; -const pm_char STR_SUBTYPE_CORONA[] PROGMEM = "\005""V1\0 ""V2\0 ""FD V3"; +const char STR_SUBTYPE_CORONA[] = "\005""V1\0 ""V2\0 ""FD V3"; -const pm_char STR_SUBTYPE_HITEC[] PROGMEM = "\006""Optima\0""Minima"; +const char STR_SUBTYPE_HITEC[] = "\006""Optima\0""Minima"; const mm_protocol_definition multi_protocols[] = { diff --git a/radio/src/gui/navigation/navigation_9x.cpp b/radio/src/gui/navigation/navigation_9x.cpp index dea81579e..63569e4b9 100644 --- a/radio/src/gui/navigation/navigation_9x.cpp +++ b/radio/src/gui/navigation/navigation_9x.cpp @@ -182,10 +182,10 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla tmr10ms_t menuEntryTime; -#define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) +#define MAXCOL(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) #define POS_HORZ_INIT(posVert) 0 -void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow) +void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow) { vertpos_t l_posVert = menuVerticalPosition; horzpos_t l_posHorz = menuHorizontalPosition; @@ -275,7 +275,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t } if (cc != curr) { - chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc])); + chainMenu(menuTab[cc]); } #if defined(ROTARY_ENCODER_NAVIGATION) diff --git a/radio/src/gui/navigation/navigation_horus.cpp b/radio/src/gui/navigation/navigation_horus.cpp index 24f57f56a..cf8bcd483 100644 --- a/radio/src/gui/navigation/navigation_horus.cpp +++ b/radio/src/gui/navigation/navigation_horus.cpp @@ -339,7 +339,7 @@ int8_t navigate(event_t event, int count, int rows, int columns, bool loop) return (prevPosHorz != menuHorizontalPosition || prevPosVert != menuVerticalPosition) ? result : 0; } -bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t * horTab, uint8_t horTabMax, int rowcount, uint8_t flags) +bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, int rowcount, uint8_t flags) { uint8_t maxcol = MAXCOL(menuVerticalPosition); @@ -372,7 +372,7 @@ bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t } if (cc != curr) { - chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc])); + chainMenu(menuTab[cc]); return false; } diff --git a/radio/src/gui/navigation/navigation_x7.cpp b/radio/src/gui/navigation/navigation_x7.cpp index 29838f63b..4ffbf596e 100644 --- a/radio/src/gui/navigation/navigation_x7.cpp +++ b/radio/src/gui/navigation/navigation_x7.cpp @@ -240,13 +240,13 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla tmr10ms_t menuEntryTime; -#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) +#define MAXCOL_RAW(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) #define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE))) #define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE)) #define MENU_FIRST_LINE_EDIT (menuTab ? (MAXCOL((uint16_t)0) >= HIDDEN_ROW ? (MAXCOL((uint16_t)1) >= HIDDEN_ROW ? 2 : 1) : 0) : 0) #define POS_HORZ_INIT(posVert) ((COLATTR(posVert) & NAVIGATION_LINE_BY_LINE) ? -1 : 0) -void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t * horTab, uint8_t horTabMax, vertpos_t rowcount) +void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, vertpos_t rowcount) { vertpos_t l_posVert = menuVerticalPosition; horzpos_t l_posHorz = menuHorizontalPosition; @@ -273,7 +273,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t } if (!menuCalibrationState && cc != curr) { - chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc])); + chainMenu(menuTab[cc]); } drawScreenIndex(curr, menuTabSize, 0); diff --git a/radio/src/gui/navigation/navigation_x9d.cpp b/radio/src/gui/navigation/navigation_x9d.cpp index 0e79afea0..dcd7b8967 100644 --- a/radio/src/gui/navigation/navigation_x9d.cpp +++ b/radio/src/gui/navigation/navigation_x9d.cpp @@ -316,7 +316,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla } #define CURSOR_NOT_ALLOWED_IN_ROW(row) ((int8_t)MAXCOL(row) < 0) -#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) +#define MAXCOL_RAW(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) #define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE))) #define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE)) #define INC(val, min, max) if (valmin) {val=min;} @@ -336,7 +336,7 @@ void onLongMenuPress(const char * result) tmr10ms_t menuEntryTime; -void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags) +void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags) { vertpos_t l_posVert = menuVerticalPosition; horzpos_t l_posHorz = menuHorizontalPosition; @@ -377,7 +377,7 @@ void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc } if (!menuCalibrationState && cc != curr) { - chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc])); + chainMenu(menuTab[cc]); } if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) { diff --git a/radio/src/gui/navigation/navigation_xlite.cpp b/radio/src/gui/navigation/navigation_xlite.cpp index 8759f38c6..c0210caef 100644 --- a/radio/src/gui/navigation/navigation_xlite.cpp +++ b/radio/src/gui/navigation/navigation_xlite.cpp @@ -302,11 +302,11 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla tmr10ms_t menuEntryTime; -#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) +#define MAXCOL_RAW(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) #define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE))) #define POS_HORZ_INIT(posVert) 0 -void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow) +void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow) { vertpos_t l_posVert = menuVerticalPosition; horzpos_t l_posHorz = menuHorizontalPosition; @@ -362,7 +362,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t } if (cc != curr) { - chainMenu((MenuHandlerFunc)pgm_read_adr(&menuTab[cc])); + chainMenu(menuTab[cc]); } #if defined(ROTARY_ENCODER_NAVIGATION) diff --git a/radio/src/gui/screenshot.cpp b/radio/src/gui/screenshot.cpp index ae4dfe3c1..36cad1364 100644 --- a/radio/src/gui/screenshot.cpp +++ b/radio/src/gui/screenshot.cpp @@ -38,7 +38,7 @@ const char * writeScreenshot() char filename[42]; // /SCREENSHOTS/screen-2013-01-01-123540.bmp // check and create folder here - strcpy_P(filename, SCREENSHOTS_PATH); + strcpy(filename, SCREENSHOTS_PATH); const char * error = sdCheckAndCreateDirectory(filename); if (error) { return error; diff --git a/radio/src/io/frsky_sport.cpp b/radio/src/io/frsky_sport.cpp index 8a73d749e..c7adfd162 100644 --- a/radio/src/io/frsky_sport.cpp +++ b/radio/src/io/frsky_sport.cpp @@ -138,7 +138,7 @@ bool sportWaitState(SportUpdateState state, int timeout) else if (sportUpdateState == SPORT_FAIL) { return false; } - CoTickDelay(1); + RTOS_WAIT_TICKS(1); } return false; #endif @@ -313,7 +313,7 @@ void sportFlashDevice(ModuleIndex module, const char * filename) /* wait 2s off */ watchdogSuspend(2000); - CoTickDelay(1000); + RTOS_WAIT_MS(2000); #endif const char * result = sportUpdatePowerOn(module); diff --git a/radio/src/keys.cpp b/radio/src/keys.cpp index eb731d57d..eb2d5a4de 100644 --- a/radio/src/keys.cpp +++ b/radio/src/keys.cpp @@ -179,7 +179,7 @@ void killEvents(event_t event) bool clearKeyEvents() { #if defined(PCBSKY9X) - CoTickDelay(100); // 200ms + RTOS_WAIT_MS(200); // 200ms #endif // loop until all keys are up diff --git a/radio/src/logs.cpp b/radio/src/logs.cpp index 6e6a5f350..f5fcda516 100644 --- a/radio/src/logs.cpp +++ b/radio/src/logs.cpp @@ -22,7 +22,7 @@ #include "ff.h" FIL g_oLogFile __DMA; -const pm_char * g_logError = NULL; +const char * g_logError = NULL; uint8_t logDelay; void writeHeader(); @@ -41,7 +41,7 @@ void logsInit() memset(&g_oLogFile, 0, sizeof(g_oLogFile)); } -const pm_char * logsOpen() +const char * logsOpen() { // Determine and set log file filename FRESULT result; @@ -54,7 +54,7 @@ const pm_char * logsOpen() return STR_SDCARD_FULL; // check and create folder here - strcpy_P(filename, STR_LOGS_PATH); + strcpy(filename, STR_LOGS_PATH); const char * error = sdCheckAndCreateDirectory(filename); if (error) { return error; @@ -85,7 +85,7 @@ const pm_char * logsOpen() // TODO uint8_t num = 1; #endif - strcpy_P(&filename[sizeof(LOGS_PATH)], STR_MODEL); + strcpy(&filename[sizeof(LOGS_PATH)], STR_MODEL); filename[sizeof(LOGS_PATH) + PSIZE(TR_MODEL)] = (char)((num / 10) + '0'); filename[sizeof(LOGS_PATH) + PSIZE(TR_MODEL) + 1] = (char)((num % 10) + '0'); len = sizeof(LOGS_PATH) + PSIZE(TR_MODEL) + 2; @@ -97,7 +97,7 @@ const pm_char * logsOpen() tmp = strAppendDate(&filename[len]); #endif - strcpy_P(tmp, STR_LOGS_EXT); + strcpy(tmp, STR_LOGS_EXT); result = f_open(&g_oLogFile, filename, FA_OPEN_ALWAYS | FA_WRITE | FA_OPEN_APPEND); if (result != FR_OK) { @@ -192,7 +192,7 @@ uint32_t getLogicalSwitchesStates(uint8_t first) void logsWrite() { - static const pm_char * error_displayed = NULL; + static const char * error_displayed = NULL; if (isFunctionActive(FUNCTION_LOGS) && logDelay > 0) { tmr10ms_t tmr10ms = get_tmr10ms(); @@ -200,7 +200,7 @@ void logsWrite() lastLogTime = tmr10ms; if (!g_oLogFile.obj.fs) { - const pm_char * result = logsOpen(); + const char * result = logsOpen(); if (result != NULL) { if (result != error_displayed) { error_displayed = result; diff --git a/radio/src/main_arm.cpp b/radio/src/main_arm.cpp index a0e4a97df..5b601ff5a 100644 --- a/radio/src/main_arm.cpp +++ b/radio/src/main_arm.cpp @@ -423,13 +423,6 @@ void perMain() event_t evt = getEvent(false); -#if defined(NAVIGATION_STICKS) - uint8_t sticks_evt = getSticksNavigationEvent(); - if (sticks_evt) { - evt = sticks_evt; - } -#endif - #if defined(RAMBACKUP) if (unexpectedShutdown) { drawFatalErrorScreen(STR_EMERGENCY_MODE); diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index ee922733c..b94181454 100644 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -143,7 +143,7 @@ int expo(int x, int k) return neg ? -y : y; } -void applyExpos(int16_t * anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) +void applyExpos(int16_t * anas, uint8_t mode, uint8_t ovwrIdx, int16_t ovwrValue) { int8_t cur_chn = -1; @@ -969,9 +969,7 @@ void evalMixes(uint8_t tick10ms) // must be done after mixing because some functions use the inputs/channels values // must be done before limits because of the applyLimit function: it checks for safety switches which would be not initialized otherwise if (tick10ms) { -#if defined(MASTER_VOLUME) requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF; -#endif if (!g_model.noGlobalFunctions) { evalFunctions(g_eeGeneral.customFn, globalFunctionsContext); @@ -992,9 +990,7 @@ void evalMixes(uint8_t tick10ms) int16_t value = applyLimits(i, q); // applyLimits will remove the 256 100% basis - cli(); channelOutputs[i] = value; // copy consistent word to int-level - sei(); } if (tick10ms && flightModesFade) { diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 1bca8a922..e46ad96fe 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -48,7 +48,7 @@ union ReusableBuffer reusableBuffer __DMA; uint8_t* MSC_BOT_Data = reusableBuffer.MSC_BOT_Data; #endif -const pm_uint8_t bchout_ar[] PROGMEM = { +const uint8_t bchout_ar[] = { 0x1B, 0x1E, 0x27, 0x2D, 0x36, 0x39, 0x4B, 0x4E, 0x63, 0x6C, 0x72, 0x78, 0x87, 0x8D, 0x93, 0x9C, 0xB1, 0xB4, @@ -56,7 +56,7 @@ const pm_uint8_t bchout_ar[] PROGMEM = { uint8_t channel_order(uint8_t x) { - return ( ((pgm_read_byte(bchout_ar + g_eeGeneral.templateSetup) >> (6-(x-1) * 2)) & 3 ) + 1 ); + return ( ((*(bchout_ar + g_eeGeneral.templateSetup) >> (6-(x-1) * 2)) & 3 ) + 1 ); } /* @@ -65,7 +65,7 @@ mode2 rud thr ele ail mode3 ail ele thr rud mode4 ail thr ele rud */ -const pm_uint8_t modn12x3[] PROGMEM = { +const uint8_t modn12x3[] = { 0, 1, 2, 3, 0, 2, 1, 3, 3, 1, 2, 0, @@ -667,11 +667,6 @@ getvalue_t convert16bitsTelemValue(source_t channel, ls_telemetry_value_t value) return value; } -getvalue_t convert8bitsTelemValue(source_t channel, ls_telemetry_value_t value) -{ - return value; -} - #if defined(TELEMETRY_FRSKY) ls_telemetry_value_t minTelemValue(source_t channel) { @@ -684,13 +679,6 @@ ls_telemetry_value_t maxTelemValue(source_t channel) } #endif -ls_telemetry_value_t max8bitsTelemValue(source_t channel) -{ - return 30000; -} - - - #define INAC_STICKS_SHIFT 6 #define INAC_SWITCHES_SHIFT 8 bool inputsMoved() @@ -770,8 +758,7 @@ void doSplash() backlightOn(); drawSplash(); - -#if defined(PCBSKY9X) +#if defined(PCBSKY9X) tmr10ms_t curTime = get_tmr10ms() + 10; uint8_t contrast = 10; lcdSetRefVolt(contrast); @@ -784,25 +771,12 @@ void doSplash() tmr10ms_t tgtime = get_tmr10ms() + SPLASH_TIMEOUT; while (tgtime > get_tmr10ms()) { -#if defined(SIMU) - SIMU_SLEEP(1); -#else - CoTickDelay(1); -#endif + RTOS_WAIT_TICKS(1); getADC(); -#if defined(FSPLASH) - // Splash is forced, we can't skip it - if (!(g_eeGeneral.splashMode & 0x04)) { -#endif - if (keyDown() || inputsMoved()) return; -#if defined(FSPLASH) - } -#endif - #if defined(PWR_BUTTON_PRESS) uint32_t pwr_check = pwrCheck(); if (pwr_check == e_power_off) { @@ -924,11 +898,7 @@ void checkAll() showMessageBox(STR_KEYSTUCK); tmr10ms_t tgtime = get_tmr10ms() + 500; while (tgtime != get_tmr10ms()) { -#if defined(SIMU) - SIMU_SLEEP(1); -#else - CoTickDelay(1); -#endif + RTOS_WAIT_MS(1); wdt_reset(); } } @@ -1017,9 +987,7 @@ void checkTHR() wdt_reset(); - SIMU_SLEEP(1); - CoTickDelay(10); - + RTOS_WAIT_MS(10); } LED_ERROR_END(); @@ -1036,7 +1004,7 @@ void checkAlarm() // added by Gohst } } -void alert(const pm_char * title, const pm_char * msg , uint8_t sound) +void alert(const char * title, const char * msg , uint8_t sound) { LED_ERROR_BEGIN(); @@ -1049,8 +1017,7 @@ void alert(const pm_char * title, const pm_char * msg , uint8_t sound) #endif while (1) { - SIMU_SLEEP(1); - CoTickDelay(10); + RTOS_WAIT_MS(10); if (keyDown()) break; // wait for key release @@ -1200,10 +1167,6 @@ void checkTrims() uint16_t s_anaFilt[NUM_ANALOGS]; #endif -#if defined(SIMU) -uint16_t BandGap = 225; -#endif - #if defined(JITTER_MEASURE) JitterMeter rawJitter[NUM_ANALOGS]; JitterMeter avgJitter[NUM_ANALOGS]; @@ -1424,17 +1387,8 @@ void doMixerCalculations() evalMixes(tick10ms); DEBUG_TIMER_STOP(debugTimerEvalMixes); - DEBUG_TIMER_START(debugTimerMixes10ms); if (tick10ms) { - -#if !defined(CPUM64) && !defined(ACCURAT_THROTTLE_TIMER) - // code cost is about 16 bytes for higher throttle accuracy for timer - // would not be noticable anyway, because all version up to this change had only 16 steps; - // now it has already 32 steps; this define would increase to 128 steps - #define ACCURAT_THROTTLE_TIMER -#endif - /* Throttle trace */ int16_t val; @@ -1442,7 +1396,7 @@ void doMixerCalculations() uint8_t ch = g_model.thrTraceSrc-NUM_POTS-NUM_SLIDERS-1; val = channelOutputs[ch]; - LimitData *lim = limitAddress(ch); + LimitData * lim = limitAddress(ch); int16_t gModelMax = LIMIT_MAX_RESX(lim); int16_t gModelMin = LIMIT_MIN_RESX(lim); @@ -1460,29 +1414,17 @@ void doMixerCalculations() gModelMax -= gModelMin; // we compare difference between Max and Mix for recaling needed; Max and Min are shifted to 0 by default // usually max is 1024 min is -1024 --> max-min = 2048 full range -#ifdef ACCURAT_THROTTLE_TIMER - if (gModelMax!=0 && gModelMax!=2048) val = (int32_t) (val << 11) / (gModelMax); // rescaling only needed if Min, Max differs -#else - // @@@ open.20.fsguruh optimized calculation; now *8 /8 instead of 10 base; (*16/16 already cause a overrun; unsigned calculation also not possible, because v may be negative) - gModelMax+=255; // force rounding up --> gModelMax is bigger --> val is smaller - gModelMax >>= (10-2); + if (gModelMax != 0 && gModelMax != 2048) + val = (int32_t) (val << 11) / (gModelMax); // rescaling only needed if Min, Max differs - if (gModelMax!=0 && gModelMax!=8) { - val = (val << 3) / gModelMax; // rescaling only needed if Min, Max differs - } -#endif - - if (val<0) val=0; // prevent val be negative, which would corrupt throttle trace and timers; could occur if safetyswitch is smaller than limits + if (val < 0) + val=0; // prevent val be negative, which would corrupt throttle trace and timers; could occur if safetyswitch is smaller than limits } else { val = RESX + calibratedAnalogs[g_model.thrTraceSrc == 0 ? THR_STICK : g_model.thrTraceSrc+NUM_STICKS-1]; } -#if defined(ACCURAT_THROTTLE_TIMER) val >>= (RESX_SHIFT-6); // calibrate it (resolution increased by factor 4) -#else - val >>= (RESX_SHIFT-4); // calibrate it -#endif evalTimers(val, tick10ms); @@ -1504,11 +1446,8 @@ void doMixerCalculations() if (s_cnt_1s >= 10) { // 1sec s_cnt_1s -= 10; sessionTimer += 1; - - struct t_inactivity *ptrInactivity = &inactivity; - FORCE_INDIRECT(ptrInactivity) ; - ptrInactivity->counter++; - if ((((uint8_t)ptrInactivity->counter)&0x07)==0x01 && g_eeGeneral.inactivityTimer && g_vbat100mV>50 && ptrInactivity->counter > ((uint16_t)g_eeGeneral.inactivityTimer*60)) + inactivity.counter++; + if ((((uint8_t)inactivity.counter)&0x07)==0x01 && g_eeGeneral.inactivityTimer && g_vbat100mV>50 && inactivity.counter > ((uint16_t)g_eeGeneral.inactivityTimer*60)) AUDIO_INACTIVITY(); #if defined(AUDIO) @@ -1517,16 +1456,10 @@ void doMixerCalculations() if (mixWarning & 4) if ((sessionTimer&0x03)==2) AUDIO_MIX_WARNING(3); #endif -#if defined(ACCURAT_THROTTLE_TIMER) val = s_sum_samples_thr_1s / s_cnt_samples_thr_1s; s_timeCum16ThrP += (val>>3); // s_timeCum16ThrP would overrun if we would store throttle value with higher accuracy; therefore stay with 16 steps if (val) s_timeCumThr += 1; s_sum_samples_thr_1s>>=2; // correct better accuracy now, because trace graph can show this information; in case thrtrace is not active, the compile should remove this -#else - val = s_sum_samples_thr_1s / s_cnt_samples_thr_1s; - s_timeCum16ThrP += (val>>1); - if (val) s_timeCumThr += 1; -#endif #if defined(THRTRACE) // throttle trace is done every 10 seconds; Tracebuffer is adjusted to screen size. @@ -1573,36 +1506,7 @@ void doMixerCalculations() s_mixer_first_run_done = true; } -#if defined(NAVIGATION_STICKS) -uint8_t StickScrollAllowed; -uint8_t StickScrollTimer; -static const pm_uint8_t rate[] PROGMEM = { 0, 0, 100, 40, 16, 7, 3, 1 } ; - -uint8_t calcStickScroll( uint8_t index ) -{ - uint8_t direction; - int8_t value; - - if ( ( g_eeGeneral.stickMode & 1 ) == 0 ) - index ^= 3; - - value = calibratedAnalogs[index] / 128; - direction = value > 0 ? 0x80 : 0; - if (value < 0) - value = -value; // (abs) - if (value > 7) - value = 7; - value = pgm_read_byte(rate+(uint8_t)value); - if (value) - StickScrollTimer = STICK_SCROLL_TIMEOUT; // Seconds - return value | direction; -} -#endif - - #define OPENTX_START_ARGS uint8_t splash=true - #define OPENTX_START_SPLASH_NEEDED() (splash) - -void opentxStart(OPENTX_START_ARGS) +void opentxStart(uint8_t splash=true) { TRACE("opentxStart"); @@ -1615,7 +1519,7 @@ void opentxStart(OPENTX_START_ARGS) uint8_t calibration_needed = (g_eeGeneral.chkSum != evalChkSum()); #if defined(GUI) - if (!calibration_needed && OPENTX_START_SPLASH_NEEDED()) { + if (!calibration_needed && splash) { doSplash(); } #endif @@ -1626,7 +1530,7 @@ void opentxStart(OPENTX_START_ARGS) #if defined(PCBSKY9X) && defined(SDCARD) && !defined(SIMU) for (int i=0; i<500 && !Card_initialized; i++) { - CoTickDelay(1); // 2ms + RTOS_WAIT_MS(2); // 2ms } #endif @@ -1693,9 +1597,10 @@ void opentxClose(uint8_t shutdown) storageCheck(true); while (IS_PLAYING(ID_PLAY_PROMPT_BASE + AU_BYE)) { - CoTickDelay(10); + RTOS_WAIT_MS(10); } - CoTickDelay(50); + + RTOS_WAIT_MS(100); #if defined(SDCARD) sdDone(); @@ -1727,81 +1632,7 @@ void opentxResume() } #endif -#if defined(NAVIGATION_STICKS) -uint8_t getSticksNavigationEvent() -{ - uint8_t evt = 0; - if (StickScrollAllowed) { - if ( StickScrollTimer ) { - static uint8_t repeater; - uint8_t direction; - uint8_t value; - - if ( repeater < 128 ) - { - repeater += 1; - } - value = calcStickScroll( 2 ); - direction = value & 0x80; - value &= 0x7F; - if ( value ) - { - if ( repeater > value ) - { - repeater = 0; - if ( evt == 0 ) - { - if ( direction ) - { - evt = EVT_KEY_FIRST(KEY_UP); - } - else - { - evt = EVT_KEY_FIRST(KEY_DOWN); - } - } - } - } - else - { - value = calcStickScroll( 3 ); - direction = value & 0x80; - value &= 0x7F; - if ( value ) - { - if ( repeater > value ) - { - repeater = 0; - if ( evt == 0 ) - { - if ( direction ) - { - evt = EVT_KEY_FIRST(KEY_RIGHT); - } - else - { - evt = EVT_KEY_FIRST(KEY_LEFT); - } - } - } - } - } - } - } - else { - StickScrollTimer = 0; // Seconds - } - StickScrollAllowed = 1 ; - return evt; -} -#endif - - - - - - - #define INSTANT_TRIM_MARGIN 10 /* around 1% */ +#define INSTANT_TRIM_MARGIN 10 /* around 1% */ void instantTrim() { @@ -2118,17 +1949,10 @@ int main() drawSplash(); #endif - sei(); // interrupts needed now - - #if defined(DSM2_SERIAL) && !defined(TELEMETRY_FRSKY) DSM2_Init(); #endif - - - - #if defined(MENU_ROTARY_SW) init_rotary_sw(); #endif @@ -2265,7 +2089,7 @@ uint32_t pwrCheck() RAISE_ALERT(STR_MODEL, STR_MODEL_STILL_POWERED, STR_PRESS_ENTER_TO_CONFIRM, AU_MODEL_STILL_POWERED); while (TELEMETRY_STREAMING()) { resetForcePowerOffRequest(); - CoTickDelay(10); + RTOS_WAIT_MS(20); if (pwrPressed()) { return e_power_on; } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 5e4ccc8b6..daf616120 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -87,7 +87,7 @@ #define CASE_PWM_BACKLIGHT(x) #endif -#if defined(TELEMETRY_FRSKY) && defined(FRSKY_HUB) && defined(GPS) +#if defined(TELEMETRY_FRSKY) && defined(GPS) #define CASE_GPS(x) x, #else #define CASE_GPS(x) @@ -187,7 +187,7 @@ #define IF_FAI_CHOICE(x) #endif - #define IS_FAI_FORBIDDEN(idx) (IS_FAI_ENABLED() && isFaiForbidden(idx)) +#define IS_FAI_FORBIDDEN(idx) (IS_FAI_ENABLED() && isFaiForbidden(idx)) #if defined(BLUETOOTH) #if defined(X9E) && !defined(USEHORUSBT) @@ -202,17 +202,6 @@ #define IS_SLAVE_TRAINER() (g_model.trainerMode == TRAINER_MODE_SLAVE) #endif - #define MASTER_VOLUME - -#if !defined(CPUM64) && !defined(ACCURAT_THROTTLE_TIMER) - // code cost is about 16 bytes for higher throttle accuracy for timer - // would not be noticable anyway, because all version up to this change had only 16 steps; - // now it has already 32 steps; this define would increase to 128 steps - #if !defined(ACCURAT_THROTTLE_TIMER) - #define ACCURAT_THROTTLE_TIMER - #endif -#endif - // RESX range is used for internal calculation; The menu says -100.0 to 100.0; internally it is -1024 to 1024 to allow some optimizations #define RESX_SHIFT 10 #define RESX 1024 @@ -228,19 +217,6 @@ #if defined(SIMU) #include "targets/simu/simpgmspace.h" -#else - typedef const unsigned char pm_uchar; - typedef const char pm_char; - typedef const uint16_t pm_uint16_t; - typedef const uint8_t pm_uint8_t; - typedef const int16_t pm_int16_t; - typedef const int8_t pm_int8_t; - #define pgm_read_byte(address_short) (*(uint8_t*)(address_short)) - #define PSTR(adr) adr - #define PROGMEM - #define pgm_read_adr(x) *(x) - #define cli() - #define sei() #endif #include "debug.h" @@ -260,7 +236,7 @@ #include "myeeprom.h" - #define memclear(p, s) memset(p, 0, s) +#define memclear(p, s) memset(p, 0, s) void memswap(void * a, void * b, uint8_t size); @@ -311,20 +287,14 @@ void memswap(void * a, void * b, uint8_t size); #define PPM_CH_CENTER(ch) (PPM_CENTER) #endif - #include "fifo.h" - #include "io/io_arm.h" - // This doesn't need protection on this processor - extern volatile tmr10ms_t g_tmr10ms; - #define get_tmr10ms() g_tmr10ms +#include "fifo.h" +#include "io/io_arm.h" -#if defined(NAVIGATION_STICKS) - extern uint8_t StickScrollAllowed; - extern uint8_t StickScrollTimer; - #define STICK_SCROLL_TIMEOUT 9 - #define STICK_SCROLL_DISABLE() StickScrollAllowed = 0 -#else - #define STICK_SCROLL_DISABLE() -#endif +extern volatile tmr10ms_t g_tmr10ms; +static inline tmr10ms_t get_tmr10ms() +{ + return g_tmr10ms; +} #if defined(CLI) #include "cli.h" @@ -333,12 +303,10 @@ void memswap(void * a, void * b, uint8_t size); #include "timers.h" #include "storage/storage.h" #include "pulses/pulses.h" - #include "pulses/modules.h" - - #define MASK_CFN_TYPE uint64_t // current max = 64 function switches - #define MASK_FUNC_TYPE uint32_t // current max = 32 functions +#define MASK_CFN_TYPE uint64_t // current max = 64 function switches +#define MASK_FUNC_TYPE uint32_t // current max = 32 functions typedef struct { MASK_FUNC_TYPE activeFunctions; @@ -359,7 +327,6 @@ typedef struct { #include "strhelpers.h" #include "gui.h" - #if !defined(SIMU) #define assert(x) #if !defined(DEBUG) @@ -367,8 +334,8 @@ typedef struct { #endif #endif -extern const pm_uint8_t bchout_ar[]; -extern const pm_uint8_t modn12x3[]; +extern const uint8_t bchout_ar[]; +extern const uint8_t modn12x3[]; //convert from mode 1 to mode stickMode //NOTICE! => 0..3 -> 0..3 @@ -376,7 +343,7 @@ extern const pm_uint8_t modn12x3[]; #define ELE_STICK 1 #define THR_STICK 2 #define AIL_STICK 3 -#define CONVERT_MODE(x) (((x)<=AIL_STICK) ? pgm_read_byte(modn12x3 + 4*g_eeGeneral.stickMode + (x)) : (x) ) +#define CONVERT_MODE(x) (((x)<=AIL_STICK) ? *(modn12x3 + 4*g_eeGeneral.stickMode + (x)) : (x) ) #if defined(PCBXLITE) #define CONVERT_MODE_TRIMS(x) (((x) == RUD_STICK) ? AIL_STICK : ((x) == AIL_STICK) ? RUD_STICK : (x)) @@ -398,8 +365,6 @@ extern uint8_t channel_order(uint8_t x); #if defined(PCBHORUS) #define SPLASH_TIMEOUT 0 /* we use the splash duration to load stuff from the SD */ -#elif defined(FSPLASH) - #define SPLASH_TIMEOUT (g_eeGeneral.splashMode == 0 ? 60000/*infinite=10mn*/ : ((4*100) * (g_eeGeneral.splashMode & 0x03))) #elif defined(PCBTARANIS) #define SPLASH_TIMEOUT (g_eeGeneral.splashMode==-4 ? 1500 : (g_eeGeneral.splashMode<=0 ? (400-g_eeGeneral.splashMode*200) : (400-g_eeGeneral.splashMode*100))) #else @@ -490,7 +455,7 @@ uint16_t evalChkSum(); #define ALERT(title, msg, sound) alert(title, msg, sound) #endif -void alert(const pm_char * t, const pm_char * s , uint8_t sound); +void alert(const char * t, const char * s , uint8_t sound); enum PerOutMode { e_perout_mode_normal = 0, @@ -501,25 +466,15 @@ enum PerOutMode { e_perout_mode_noinput = e_perout_mode_notrainer+e_perout_mode_notrims+e_perout_mode_nosticks }; - - - -// Fiddle to force compiler to use a pointer - #define FORCE_INDIRECT(ptr) - extern uint8_t mixerCurrentFlightMode; extern uint8_t lastFlightMode; extern uint8_t flightModeTransitionLast; - #define bitfield_channels_t uint32_t - #if defined(SIMU) inline int availableMemory() { return 1000; } #elif !defined(SIMU) extern unsigned char *heap; extern int _end; - extern int _estack; - extern int _main_stack_start; extern int _heap_end; #define availableMemory() ((unsigned int)((unsigned char *)&_heap_end - heap)) #endif @@ -529,9 +484,9 @@ void evalMixes(uint8_t tick10ms); void doMixerCalculations(); void scheduleNextMixerCalculation(uint8_t module, uint16_t period_ms); - void checkTrims(); +void checkTrims(); void perMain(); -NOINLINE void per10ms(); +void per10ms(); getvalue_t getValue(mixsrc_t i); @@ -541,9 +496,9 @@ bool getSwitch(swsrc_t swtch, uint8_t flags=0); void logicalSwitchesTimerTick(); void logicalSwitchesReset(); - void evalLogicalSwitches(bool isCurrentPhase=true); - void logicalSwitchesCopyState(uint8_t src, uint8_t dst); - #define LS_RECURSIVE_EVALUATION_RESET() +void evalLogicalSwitches(bool isCurrentFlightmode=true); +void logicalSwitchesCopyState(uint8_t src, uint8_t dst); +#define LS_RECURSIVE_EVALUATION_RESET() #if defined(PCBTARANIS) || defined(PCBHORUS) void getSwitchesPosition(bool startup); @@ -554,9 +509,9 @@ void logicalSwitchesReset(); extern swarnstate_t switches_states; swsrc_t getMovedSwitch(); - #define GET_MOVED_SOURCE_PARAMS uint8_t min - int8_t getMovedSource(GET_MOVED_SOURCE_PARAMS); - #define GET_MOVED_SOURCE(min, max) getMovedSource(min) +#define GET_MOVED_SOURCE_PARAMS uint8_t min +int8_t getMovedSource(GET_MOVED_SOURCE_PARAMS); +#define GET_MOVED_SOURCE(min, max) getMovedSource(min) #if defined(FLIGHT_MODES) extern uint8_t getFlightMode(); @@ -564,7 +519,7 @@ swsrc_t getMovedSwitch(); #define getFlightMode() 0 #endif - #define getTrimFlightMode(phase, idx) (phase) +#define getTrimFlightMode(phase, idx) (phase) #if defined(GVARS) extern int8_t trimGvar[NUM_TRIMS]; @@ -576,7 +531,7 @@ swsrc_t getMovedSwitch(); trim_t getRawTrimValue(uint8_t phase, uint8_t idx); int getTrimValue(uint8_t phase, uint8_t idx); - bool setTrimValue(uint8_t phase, uint8_t idx, int trim); +bool setTrimValue(uint8_t phase, uint8_t idx, int trim); #if defined(ROTARY_ENCODERS) int16_t getRotaryEncoder(uint8_t idx); @@ -598,12 +553,11 @@ extern uint16_t s_timeCumThr; extern uint16_t s_timeCum16ThrP; #if defined(OVERRIDE_CHANNEL_FUNCTION) - #define OVERRIDE_CHANNEL_UNDEFINED -4096 +#define OVERRIDE_CHANNEL_UNDEFINED -4096 extern safetych_t safetyCh[MAX_OUTPUT_CHANNELS]; #endif extern uint8_t trimsCheckTimer; - extern uint8_t trimsDisplayTimer; extern uint8_t trimsDisplayMask; @@ -613,8 +567,7 @@ extern uint8_t unexpectedShutdown; extern uint16_t maxMixerDuration; - - #define DURATION_MS_PREC2(x) ((x)/20) +#define DURATION_MS_PREC2(x) ((x)/20) #if defined(THRTRACE) #if defined(COLORLCD) @@ -664,10 +617,16 @@ void checkSwitches(); void checkAlarm(); void checkAll(); -#if !defined(SIMU) void getADC(); - #define GET_ADC_IF_MIXER_NOT_RUNNING() do { if (s_pulses_paused) getADC(); } while(0) -#endif +static inline void GET_ADC_IF_MIXER_NOT_RUNNING() +{ + do { + if (s_pulses_paused) { + getADC(); + } + } + while(0); +} #include "sbus.h" @@ -677,36 +636,32 @@ void doLoopCommonActions(); #define BITMASK(bit) (1<<(bit)) -#if !defined(UNUSED) -#define UNUSED(x) ((void)(x)) /* to avoid warnings */ -#endif - /// returns the number of elements of an array #define DIM(arr) (sizeof((arr))/sizeof((arr)[0])) -template FORCEINLINE t min(t a, t b) { return a FORCEINLINE t max(t a, t b) { return a>b?a:b; } -template FORCEINLINE t sgn(t a) { return a>0 ? 1 : (a < 0 ? -1 : 0); } -template FORCEINLINE t limit(t mi, t x, t ma) { return min(max(mi,x),ma); } -template void SWAP(t & a, t & b) { t tmp = b; b = a; a = tmp; } +template inline t min(t a, t b) { return a inline t max(t a, t b) { return a>b?a:b; } +template inline t sgn(t a) { return a>0 ? 1 : (a < 0 ? -1 : 0); } +template inline t limit(t mi, t x, t ma) { return min(max(mi,x),ma); } +template inline void SWAP(t & a, t & b) { t tmp = b; b = a; a = tmp; } uint16_t isqrt32(uint32_t n); -#if !defined(BOOT) +#if defined(BOOT) +#define pauseMixerCalculations() +#define resumeMixerCalculations() +#else #include "tasks_arm.h" -extern OS_MutexID mixerMutex; +extern RTOS_MUTEX_HANDLE mixerMutex; inline void pauseMixerCalculations() { - CoEnterMutexSection(mixerMutex); + RTOS_LOCK_MUTEX(mixerMutex); } inline void resumeMixerCalculations() { - CoLeaveMutexSection(mixerMutex); + RTOS_UNLOCK_MUTEX(mixerMutex); } -#else -#define pauseMixerCalculations() -#define resumeMixerCalculations() #endif void generalDefault(); @@ -763,6 +718,7 @@ extern const char eeprom_stamp[]; #else extern const char vers_stamp[]; #endif + /** * Tries to find opentx version in the first 1024 byte of either firmware/bootloader (the one not running) or the buffer * @param buffer If non-null find the firmware version in the buffer instead @@ -781,16 +737,14 @@ extern uint8_t g_vbat100mV; #define g_blinkTmr10ms (*(uint8_t*)&g_tmr10ms) extern uint8_t g_beepCnt; -extern uint8_t g_beepVal[5]; #include "trainer_input.h" extern int32_t chans[MAX_OUTPUT_CHANNELS]; extern int16_t ex_chans[MAX_OUTPUT_CHANNELS]; // Outputs (before LIMITS) of the last perMain extern int16_t channelOutputs[MAX_OUTPUT_CHANNELS]; -extern uint16_t BandGap; - #define NUM_INPUTS (MAX_INPUTS) +#define NUM_INPUTS (MAX_INPUTS) int expo(int x, int k); @@ -873,13 +827,10 @@ int8_t getCurveX(int noPoints, int point); void resetCustomCurveX(int8_t * points, int noPoints); bool moveCurve(uint8_t index, int8_t shift); // TODO bool? - #define APPLY_EXPOS_EXTRA_PARAMS_INC , uint8_t ovwrIdx=0, int16_t ovwrValue=0 - #define APPLY_EXPOS_EXTRA_PARAMS , uint8_t ovwrIdx, int16_t ovwrValue - void clearInputs(); void defaultInputs(); -void applyExpos(int16_t * anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS_INC); +void applyExpos(int16_t * anas, uint8_t mode, uint8_t ovwrIdx=0, int16_t ovwrValue=0); int16_t applyLimits(uint8_t channel, int32_t value); void evalInputs(uint8_t mode); @@ -902,7 +853,7 @@ LogicalSwitchData * lswAddress(uint8_t idx); // static variables used in evalFlightModeMixes - moved here so they don't interfere with the stack // It's also easier to initialize them here. - extern int8_t virtualInputsTrims[NUM_INPUTS]; +extern int8_t virtualInputsTrims[NUM_INPUTS]; extern int16_t anas [NUM_INPUTS]; extern int16_t trims[NUM_TRIMS]; @@ -912,17 +863,16 @@ extern uint8_t s_mixer_first_run_done; void applyDefaultTemplate(); -void incSubtrim(uint8_t idx, int16_t inc); void instantTrim(); void evalTrims(); void copyTrimsToOffset(uint8_t ch); void copySticksToOffset(uint8_t ch); void moveTrimsToOffsets(); -#define ACTIVE_PHASES_TYPE uint16_t +typedef uint16_t ACTIVE_PHASES_TYPE; #define DELAY_POS_SHIFT 0 #define DELAY_POS_MARGIN 3 -#define delayval_t int16_t +typedef int16_t delayval_t; PACK(typedef struct { uint16_t delay; int16_t now; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw @@ -1001,7 +951,6 @@ uint16_t crc16(const uint8_t * ptr, uint32_t len); #define PLAY_REPEAT(x) (x) /* Range 0 to 15 */ #define PLAY_NOW 0x10 #define PLAY_BACKGROUND 0x20 -#define PLAY_INCREMENT(x) ((uint8_t)(((uint8_t)x) << 6)) /* -1, 0, 1, 2 */ enum AUDIO_SOUNDS { AUDIO_HELLO, @@ -1163,7 +1112,6 @@ union ReusableBuffer uint8_t r9mPower; } modelsetup; - // 103 bytes struct { @@ -1206,13 +1154,11 @@ union ReusableBuffer extern union ReusableBuffer reusableBuffer; -void checkFlashOnBeep(); - uint8_t zlen(const char *str, uint8_t size); bool zexist(const char *str, uint8_t size); unsigned int effectiveLen(const char * str, unsigned int size); char * strcat_zchar(char *dest, const char *name, uint8_t size, const char *defaultName=NULL, uint8_t defaultNameSize=0, uint8_t defaultIdx=0); -#define strcat_phasename(dest, idx) strcat_zchar(dest, g_model.flightModeData[idx].name, LEN_FLIGHT_MODE_NAME, STR_FP, PSIZE(TR_FP), idx+1) +#define strcatFlightmodeName(dest, idx) strcat_zchar(dest, g_model.flightModeData[idx].name, LEN_FLIGHT_MODE_NAME, STR_FM, PSIZE(TR_FM), idx+1) #if defined(EEPROM) #define strcat_modelname(dest, idx) strcat_zchar(dest, modelHeaders[idx].name, LEN_MODEL_NAME, STR_MODEL, PSIZE(TR_MODEL), idx+1) #define strcat_currentmodelname(dest) strcat_modelname(dest, g_eeGeneral.currModel) @@ -1223,36 +1169,7 @@ char * strcat_zchar(char *dest, const char *name, uint8_t size, const char *defa #define ZEXIST(s) zexist(s, sizeof(s)) // Stick tolerance varies between transmitters, Higher is better -#if defined (PCB9XR) || defined (PCB9XR128) - #define STICK_TOLERANCE 16 -#else - #define STICK_TOLERANCE 64 -#endif - -#if defined(FRSKY_HUB) && defined(GAUGES) -enum BarThresholdIdx { - THLD_ALT, - THLD_RPM, - THLD_FUEL, - THLD_T1, - THLD_T2, - THLD_SPEED, - THLD_DIST, - THLD_GPSALT, - THLD_CELL, - THLD_CELLS_SUM, - THLD_VFAS, - THLD_CURRENT, - THLD_CONSUMPTION, - THLD_MAX, -}; - - #define FILL_THRESHOLD(idx, val) barsThresholds[idx] = (val) - -extern bar_threshold_t barsThresholds[THLD_MAX]; -#else -#define FILL_THRESHOLD(idx, val) -#endif +#define STICK_TOLERANCE 64 #if defined(TELEMETRY_FRSKY) ls_telemetry_value_t minTelemValue(source_t channel); @@ -1263,17 +1180,9 @@ extern bar_threshold_t barsThresholds[THLD_MAX]; #endif getvalue_t convert16bitsTelemValue(source_t channel, ls_telemetry_value_t value); -ls_telemetry_value_t max8bitsTelemValue(source_t channel); - -getvalue_t convert8bitsTelemValue(source_t channel, ls_telemetry_value_t value); getvalue_t convertLswTelemValue(LogicalSwitchData * cs); - #define convertTelemValue(channel, value) convert16bitsTelemValue(channel, value) - #define convertBarTelemValue(channel, value) convert8bitsTelemValue(channel, value) - #define maxBarTelemValue(channel) max8bitsTelemValue(channel) - -lcdint_t applyChannelRatio(source_t channel, lcdint_t val); -#define ANA_CHANNEL_UNIT(channel) g_model.frsky.channels[channel].type +#define convertTelemValue(channel, value) convert16bitsTelemValue(channel, value) inline int div_and_round(int num, int den) { @@ -1290,11 +1199,6 @@ inline int div_and_round(int num, int den) } #if defined(TELEMETRY_FRSKY) - -extern const pm_uint8_t bchunit_ar[]; - - #define FRSKY_MULTIPLIER_MAX 5 - enum TelemetryViews { TELEMETRY_CUSTOM_SCREEN_1, TELEMETRY_CUSTOM_SCREEN_2, @@ -1304,7 +1208,6 @@ enum TelemetryViews { }; extern uint8_t s_frsky_view; - #endif #define EARTH_RADIUSKM ((uint32_t)6371) @@ -1320,18 +1223,10 @@ void varioWakeup(); #define IS_SOUND_OFF() (g_eeGeneral.beepMode == e_mode_quiet) #endif - #define IS_IMPERIAL_ENABLE() (g_eeGeneral.imperial) - - - -#if defined(TELEMETRY_FRSKY) && defined(FRSKY_HUB) && defined(GPS) - #define IS_GPS_AVAILABLE() IS_USR_PROTO_FRSKY_HUB() -#else - #define IS_GPS_AVAILABLE() (0) -#endif +#define IS_IMPERIAL_ENABLE() (g_eeGeneral.imperial) #if defined(PCBTARANIS) - extern const pm_uchar logo_taranis[]; + extern const unsigned char logo_taranis[]; #endif #if defined(STM32) @@ -1392,7 +1287,7 @@ extern JitterMeter avgJitter[NUM_ANALOGS]; #endif #if defined(BLUETOOTH) -#include "bluetooth.h" + #include "bluetooth.h" #endif #endif // _OPENTX_H_ diff --git a/radio/src/opentx_types.h b/radio/src/opentx_types.h index 42b8333cd..a1fe876d3 100644 --- a/radio/src/opentx_types.h +++ b/radio/src/opentx_types.h @@ -21,12 +21,14 @@ #ifndef _OTXTYPES_H_ #define _OTXTYPES_H_ - typedef uint32_t tmr10ms_t; - typedef int32_t rotenc_t; - typedef int32_t getvalue_t; - typedef uint32_t mixsrc_t; - typedef int32_t swsrc_t; - typedef int16_t safetych_t; - typedef uint16_t bar_threshold_t; +#include + +typedef uint32_t tmr10ms_t; +typedef int32_t rotenc_t; +typedef int32_t getvalue_t; +typedef uint32_t mixsrc_t; +typedef int32_t swsrc_t; +typedef int16_t safetych_t; +typedef uint32_t bitfield_channels_t; #endif // _OTXTYPES_H_ diff --git a/radio/src/pulses/pulses_arm.h b/radio/src/pulses/pulses_arm.h index ab5cfa2ef..060700448 100644 --- a/radio/src/pulses/pulses_arm.h +++ b/radio/src/pulses/pulses_arm.h @@ -148,7 +148,7 @@ union ModulePulsesData { PpmPulsesData ppm; CrossfirePulsesData crossfire; -} __ALIGNED; +} __ALIGNED(4); /* The __ALIGNED keyword is required to align the struct inside the modulePulsesData below, * which is also defined to be __DMA (which includes __ALIGNED) aligned. diff --git a/radio/src/rtos.h b/radio/src/rtos.h new file mode 100644 index 000000000..94521edbc --- /dev/null +++ b/radio/src/rtos.h @@ -0,0 +1,281 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _RTOS_H_ +#define _RTOS_H_ + +#include "definitions.h" + +#ifdef __cplusplus +extern "C++" { +#endif + +#define doNothing() do { } while(0) + +#if defined(SIMU) + #include + #include + #if __GNUC__ + #include + static inline void msleep(unsigned x) + { + usleep(1000 * x); + } + #else + #include + inline void msleep(unsigned x) + { + Sleep(x); + } + #endif + + static inline void RTOS_INIT() + { + } + + static inline void RTOS_START() + { + } + + static inline void RTOS_WAIT_MS(unsigned x) + { + msleep(x); + } + + static inline void RTOS_WAIT_TICKS(unsigned x) + { + msleep(x * 2); + } + + typedef pthread_t RTOS_TASK_HANDLE; + typedef pthread_mutex_t RTOS_MUTEX_HANDLE; + typedef uint32_t RTOS_FLAG_HANDLE; + typedef sem_t * RTOS_EVENT_HANDLE; + +#ifdef __cplusplus + static inline void RTOS_CREATE_MUTEX(pthread_mutex_t &mutex) + { + mutex = PTHREAD_MUTEX_INITIALIZER; + } + + static inline void RTOS_LOCK_MUTEX(pthread_mutex_t &mutex) + { + pthread_mutex_lock(&mutex); + } + + static inline void RTOS_UNLOCK_MUTEX(pthread_mutex_t &mutex) + { + pthread_mutex_unlock(&mutex); + } + + static inline void RTOS_CREATE_FLAG(uint32_t &flag) + { + flag = 0; // TODO: real flags (use semaphores?) + } + + static inline void RTOS_SET_FLAG(uint32_t &flag) + { + flag = 1; + } + + template + class FakeTaskStack + { + public: + FakeTaskStack() + { + } + + void paint() + { + } + + uint16_t size() + { + return SIZE; + } + + uint16_t available() + { + return SIZE / 2; + } + }; + #define RTOS_DEFINE_STACK(name, size) FakeTaskStack name + + #define TASK_FUNCTION(task) void * task(void * pdata) + + template + inline void RTOS_CREATE_TASK(pthread_t &taskId, void * task(void *), const char * name, FakeTaskStack &stack, unsigned stackSize, unsigned priority) + { + pthread_create(&taskId, nullptr, task, nullptr); + } + + #define TASK_RETURN() return nullptr + + constexpr uint16_t stackAvailable() + { + return 500; + } +#endif + + // return 2ms resolution to match CoOS settings + static inline uint32_t RTOS_GET_TIME(void) + { + extern uint64_t simuTimerMicros(void); + return simuTimerMicros() / 2000; + } +#elif defined(RTOS_COOS) +#ifdef __cplusplus + extern "C" { +#endif + #include +#ifdef __cplusplus + } +#endif + + typedef OS_TID RTOS_TASK_HANDLE; + typedef OS_MutexID RTOS_MUTEX_HANDLE; + typedef OS_FlagID RTOS_FLAG_HANDLE; + typedef OS_EventID RTOS_EVENT_HANDLE; + + static inline void RTOS_INIT() + { + CoInitOS(); + } + + static inline void RTOS_START() + { + CoStartOS(); + } + + static inline void RTOS_WAIT_MS(unsigned x) + { + CoTickDelay(x / 2); + } + + static inline void RTOS_WAIT_TICKS(unsigned x) + { + CoTickDelay(x); + } + + #define RTOS_CREATE_TASK(taskId, task, name, stackStruct, stackSize, priority) \ + taskId = CoCreateTask(task, NULL, priority, &stackStruct.stack[stackSize-1], stackSize) + +#ifdef __cplusplus + static inline void RTOS_CREATE_MUTEX(OS_MutexID &mutex) + { + mutex = CoCreateMutex(); + } + + static inline void RTOS_LOCK_MUTEX(OS_MutexID &mutex) + { + CoEnterMutexSection(mutex); + } + + static inline void RTOS_UNLOCK_MUTEX(OS_MutexID &mutex) + { + CoLeaveMutexSection(mutex); + } +#endif + + static inline uint16_t getStackAvailable(void * address, uint16_t size) + { + uint32_t * array = (uint32_t *)address; + uint16_t i = 0; + while (i < size && array[i] == 0x55555555) { + i++; + } + return i*4; + } + + extern int _estack; + extern int _main_stack_start; + static inline uint16_t stackSize() + { + return ((unsigned char *)&_estack - (unsigned char *)&_main_stack_start) / 4; + } + + static inline uint16_t stackAvailable() + { + return getStackAvailable(&_main_stack_start, stackSize()); + } + + #define RTOS_CREATE_FLAG(flag) flag = CoCreateFlag(false, false) + #define RTOS_SET_FLAG(flag) (void)CoSetFlag(flag) + +#ifdef __cplusplus + template + class TaskStack + { + public: + TaskStack() + { + } + + void paint() + { + for (uint32_t i=0; i __ALIGNED(8) name // stack must be aligned to 8 bytes otherwise printf for %f does not work! + + #define TASK_FUNCTION(task) void task(void * pdata) + #define TASK_RETURN() return + +#else // no RTOS + static inline void RTOS_START() + { + } + + static inline void RTOS_WAIT_MS(unsigned x) + { + } + + static inline void RTOS_WAIT_TICKS(unsigned x) + { + } +#endif + +#ifdef __cplusplus +} +#endif + +#endif // _RTOS_H_ diff --git a/radio/src/sdcard.h b/radio/src/sdcard.h index 3f273e724..4211e395f 100644 --- a/radio/src/sdcard.h +++ b/radio/src/sdcard.h @@ -107,7 +107,7 @@ uint32_t sdGetFreeSectors(); const char * sdCheckAndCreateDirectory(const char * path); #if !defined(BOOT) -inline const pm_char * SDCARD_ERROR(FRESULT result) +inline const char * SDCARD_ERROR(FRESULT result) { if (result == FR_NOT_READY) return STR_NO_SDCARD; diff --git a/radio/src/stamp.cpp b/radio/src/stamp.cpp index af74c9cb0..e3fe4148f 100644 --- a/radio/src/stamp.cpp +++ b/radio/src/stamp.cpp @@ -31,14 +31,14 @@ #endif #if defined(COLORLCD) - const pm_char vers_stamp[] PROGMEM = "VERS" TAB ": " "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")"; - const pm_char date_stamp[] PROGMEM = "DATE" TAB ": " DATE; - const pm_char time_stamp[] PROGMEM = "TIME" TAB ": " TIME; - const pm_char eeprom_stamp[] PROGMEM = "EEPR" TAB ": " EEPROM_STR; + const char vers_stamp[] = "VERS" TAB ": " "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")"; + const char date_stamp[] = "DATE" TAB ": " DATE; + const char time_stamp[] = "TIME" TAB ": " TIME; + const char eeprom_stamp[] = "EEPR" TAB ": " EEPROM_STR; #elif defined(PCBTARANIS) - const pm_char vers_stamp[] PROGMEM = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION " (" GIT_STR ")" "\036DATE\037\033: " DATE " " TIME "\036EEPR\037\033: " EEPROM_STR; + const char vers_stamp[] = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION " (" GIT_STR ")" "\036DATE\037\033: " DATE " " TIME "\036EEPR\037\033: " EEPROM_STR; #else - const pm_char vers_stamp[] PROGMEM = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE "\036TIME\037\033: " TIME "\036EEPR\037\033: " EEPROM_STR; + const char vers_stamp[] = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE "\036TIME\037\033: " TIME "\036EEPR\037\033: " EEPROM_STR; #endif /** diff --git a/radio/src/storage/eeprom_conversions.cpp b/radio/src/storage/eeprom_conversions.cpp index fc93afe5e..0046fb2d1 100644 --- a/radio/src/storage/eeprom_conversions.cpp +++ b/radio/src/storage/eeprom_conversions.cpp @@ -1250,10 +1250,10 @@ bool eeConvert() const char *msg = NULL; if (g_eeGeneral.version == 216) { - msg = PSTR("EEprom Data v216"); + msg = "EEprom Data v216"; } else if (g_eeGeneral.version == 217) { - msg = PSTR("EEprom Data v217"); + msg = "EEprom Data v217"; } else { return false; diff --git a/radio/src/storage/eeprom_raw.cpp b/radio/src/storage/eeprom_raw.cpp index edda1f87d..ef3fe4c37 100644 --- a/radio/src/storage/eeprom_raw.cpp +++ b/radio/src/storage/eeprom_raw.cpp @@ -305,7 +305,7 @@ void eepromWriteWait(EepromWriteState state/* = EEPROM_IDLE*/) while (eepromWriteState != state) { #if defined(STM32) // Waits a little bit for CS transitions - CoTickDelay(1/*2ms*/); + RTOS_WAIT_MS(2); #endif eepromWriteProcess(); #ifdef SIMU @@ -440,7 +440,7 @@ uint16_t eeModelSize(uint8_t index) } #if defined(SDCARD) -const pm_char * eeBackupModel(uint8_t i_fileSrc) +const char * eeBackupModel(uint8_t i_fileSrc) { char * buf = reusableBuffer.modelsel.mainname; FIL archiveFile; @@ -468,7 +468,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc) } #if defined(PCBSKY9X) - strcpy(statusLineMsg, PSTR("File ")); + strcpy(statusLineMsg, "File "); strcpy(statusLineMsg+5, &buf[sizeof(MODELS_PATH)]); #endif @@ -507,7 +507,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc) return NULL; } -const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name) +const char * eeRestoreModel(uint8_t i_fileDst, char *model_name) { char * buf = reusableBuffer.modelsel.mainname; FIL restoreFile; diff --git a/radio/src/storage/eeprom_raw.h b/radio/src/storage/eeprom_raw.h index 542b9e4fb..64ac9f182 100644 --- a/radio/src/storage/eeprom_raw.h +++ b/radio/src/storage/eeprom_raw.h @@ -32,8 +32,8 @@ void eeSwapModels(uint8_t id1, uint8_t id2); #define DISPLAY_PROGRESS_BAR(x) #if defined(SDCARD) -const pm_char * eeBackupModel(uint8_t i_fileSrc); -const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name); +const char * eeBackupModel(uint8_t i_fileSrc); +const char * eeRestoreModel(uint8_t i_fileDst, char *model_name); #endif enum EepromWriteState { diff --git a/radio/src/storage/eeprom_rlc.cpp b/radio/src/storage/eeprom_rlc.cpp index e31dcc2d1..8ee311473 100644 --- a/radio/src/storage/eeprom_rlc.cpp +++ b/radio/src/storage/eeprom_rlc.cpp @@ -441,7 +441,7 @@ bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc) } #if defined(SDCARD) -const pm_char * eeBackupModel(uint8_t i_fileSrc) +const char * eeBackupModel(uint8_t i_fileSrc) { char * buf = reusableBuffer.modelsel.mainname; UINT written; @@ -450,7 +450,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc) logsClose(); // check and create folder here - strcpy_P(buf, STR_MODELS_PATH); + strcpy(buf, STR_MODELS_PATH); const char * error = sdCheckAndCreateDirectory(buf); if (error) { return error; @@ -476,7 +476,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc) if (len == 0) { uint8_t num = i_fileSrc + 1; - strcpy_P(&buf[sizeof(MODELS_PATH)], STR_MODEL); + strcpy(&buf[sizeof(MODELS_PATH)], STR_MODEL); buf[sizeof(MODELS_PATH) + PSIZE(TR_MODEL)] = (char)((num / 10) + '0'); buf[sizeof(MODELS_PATH) + PSIZE(TR_MODEL) + 1] = (char)((num % 10) + '0'); len = sizeof(MODELS_PATH) + PSIZE(TR_MODEL) + 2; @@ -487,7 +487,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc) len = tmp - buf; #endif - strcpy_P(&buf[len], STR_MODELS_EXT); + strcpy(&buf[len], STR_MODELS_EXT); #ifdef SIMU TRACE("SD-card backup filename=%s", buf); @@ -524,7 +524,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc) return NULL; } -const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name) +const char * eeRestoreModel(uint8_t i_fileDst, char *model_name) { char * buf = reusableBuffer.modelsel.mainname; UINT read; @@ -532,10 +532,10 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name) // we must close the logs as we reuse the same FIL structure logsClose(); - strcpy_P(buf, STR_MODELS_PATH); + strcpy(buf, STR_MODELS_PATH); buf[sizeof(MODELS_PATH)-1] = '/'; strcpy(&buf[sizeof(MODELS_PATH)], model_name); - strcpy_P(&buf[strlen(buf)], STR_MODELS_EXT); + strcpy(&buf[strlen(buf)], STR_MODELS_EXT); FRESULT result = f_open(&g_oLogFile, buf, FA_OPEN_EXISTING | FA_READ); if (result != FR_OK) { diff --git a/radio/src/storage/eeprom_rlc.h b/radio/src/storage/eeprom_rlc.h index 8fb78c27d..8b44d4f38 100644 --- a/radio/src/storage/eeprom_rlc.h +++ b/radio/src/storage/eeprom_rlc.h @@ -183,8 +183,8 @@ void eeSwapModels(uint8_t id1, uint8_t id2); void eeDeleteModel(uint8_t idx); #if defined(SDCARD) -const pm_char * eeBackupModel(uint8_t i_fileSrc); -const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name); +const char * eeBackupModel(uint8_t i_fileSrc); +const char * eeRestoreModel(uint8_t i_fileDst, char *model_name); #endif // For conversions diff --git a/radio/src/strhelpers.cpp b/radio/src/strhelpers.cpp index b33026659..c3cd63c3b 100644 --- a/radio/src/strhelpers.cpp +++ b/radio/src/strhelpers.cpp @@ -21,7 +21,7 @@ #include "opentx.h" #if !defined(BOOT) -const pm_char s_charTab[] PROGMEM = "_-.,"; +const char s_charTab[] = "_-.,"; char hex2zchar(uint8_t hex) { @@ -37,7 +37,7 @@ char idx2char(int8_t idx) } if (idx < 27) return 'A' + idx - 1; if (idx < 37) return '0' + idx - 27; - if (idx <= 40) return pgm_read_byte(s_charTab+idx-37); + if (idx <= 40) return *(s_charTab+idx-37); #if LEN_SPECIAL_CHARS > 0 if (idx <= (LEN_STD_CHARS + LEN_SPECIAL_CHARS)) return 'z' + 5 + idx - 40; #endif @@ -302,7 +302,7 @@ char * getSwitchString(char * dest, swsrc_t idx) getStringAtIndex(s, STR_VSWITCHES, IDX_ON_IN_STR_VSWITCHES + idx - SWSRC_ON); } else if (idx <= SWSRC_LAST_FLIGHT_MODE) { - strAppendStringWithIndex(s, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE); + strAppendStringWithIndex(s, STR_FM, idx-SWSRC_FIRST_FLIGHT_MODE); } else if (idx == SWSRC_TELEMETRY_STREAMING) { strcpy(s, "Tele"); diff --git a/radio/src/switches.cpp b/radio/src/switches.cpp index ca3215af2..7eb1f12af 100644 --- a/radio/src/switches.cpp +++ b/radio/src/switches.cpp @@ -478,12 +478,12 @@ bool getSwitch(swsrc_t swtch, uint8_t flags) /** @brief Calculates new state of logical switches for mixerCurrentFlightMode */ -void evalLogicalSwitches(bool isCurrentPhase) +void evalLogicalSwitches(bool isCurrentFlightmode) { for (unsigned int idx=0; idx(now.time_since_epoch()).count(); + return (uint64_t) std::chrono::duration_cast(now.time_since_epoch()).count(); #endif } @@ -121,7 +121,7 @@ uint16_t getTmr2MHz() } // return 2ms resolution to match CoOS settings -U64 CoGetOSTime(void) +uint64_t CoGetOSTime(void) { return simuTimerMicros() / 2000; } @@ -384,7 +384,6 @@ void audioConsumeCurrentBuffer() { } -#if defined(MASTER_VOLUME) void setScaledVolume(uint8_t volume) { simuAudio.currentVolume = 127 * volume * simuAudio.volumeGain / VOLUME_LEVEL_MAX / 10; @@ -399,7 +398,6 @@ int32_t getVolume() { return 0; } -#endif #if defined(SIMU_AUDIO) void copyBuffer(uint8_t * dest, const uint16_t * buff, unsigned int samples) @@ -524,11 +522,6 @@ void StopAudioThread() } #endif // #if defined(SIMU_AUDIO) -uint16_t stackAvailable() -{ - return 500; -} - bool simuLcdRefresh = true; display_t simuLcdBuf[DISPLAY_BUFFER_SIZE]; @@ -666,18 +659,3 @@ void LCD_ControlLight(uint16_t dutyCycle) { } void serialPrintf(const char * format, ...) { } void serialCrlf() { } void serialPutc(char c) { } -uint16_t stackSize() { return 0; } - -void * start_routine(void * attr) -{ - FUNCPtr task = (FUNCPtr)attr; - task(NULL); - return NULL; -} - -OS_TID CoCreateTask(FUNCPtr task, void *argv, uint32_t parameter, void * stk, uint32_t stksize) -{ - pthread_t tid; - pthread_create(&tid, NULL, start_routine, (void *)task); - return tid; -} diff --git a/radio/src/targets/simu/simpgmspace.h b/radio/src/targets/simu/simpgmspace.h index 0ceaa74f4..56b244467 100644 --- a/radio/src/targets/simu/simpgmspace.h +++ b/radio/src/targets/simu/simpgmspace.h @@ -77,22 +77,14 @@ void sig(int sgn) #undef min #undef max -#define APM #define __REV -typedef const unsigned char pm_uchar; -typedef const char pm_char; -typedef const uint16_t pm_uint16_t; -typedef const uint8_t pm_uint8_t; -typedef const int16_t pm_int16_t; -typedef const int8_t pm_int8_t; - #if defined(STM32) extern GPIO_TypeDef gpioa, gpiob, gpioc, gpiod, gpioe, gpiof, gpiog, gpioh, gpioi, gpioj; extern TIM_TypeDef tim1, tim2, tim3, tim4, tim5, tim6, tim7, tim8, tim9, tim10; extern USART_TypeDef Usart0, Usart1, Usart2, Usart3, Usart4; extern RCC_TypeDef rcc; -extern DMA_Stream_TypeDef dma1_stream2, dma1_stream5, dma1_stream7, dma2_stream1, dma2_stream2, dma2_stream5, dma2_stream6, dma2_stream7; +extern DMA_Stream_TypeDef dma1_stream0, dma1_stream1, dma1_stream2, dma1_stream3, dma1_stream4, dma1_stream5, dma1_stream6, dma1_stream7, dma2_stream1, dma2_stream2, dma2_stream5, dma2_stream6, dma2_stream7; extern DMA_TypeDef dma2; extern SysTick_Type systick; #undef SysTick @@ -147,7 +139,11 @@ extern SysTick_Type systick; #define USART3 (&Usart3) #undef RCC #define RCC (&rcc) +#undef DMA1_Stream0 +#undef DMA1_Stream1 #undef DMA1_Stream2 +#undef DMA1_Stream3 +#undef DMA1_Stream4 #undef DMA1_Stream5 #undef DMA1_Stream7 #undef DMA2_Stream1 @@ -155,7 +151,11 @@ extern SysTick_Type systick; #undef DMA2_Stream5 #undef DMA2_Stream6 #undef DMA2_Stream7 +#define DMA1_Stream0 (&dma1_stream0) +#define DMA1_Stream1 (&dma1_stream1) #define DMA1_Stream2 (&dma1_stream2) +#define DMA1_Stream3 (&dma1_stream3) +#define DMA1_Stream4 (&dma1_stream4) #define DMA1_Stream5 (&dma1_stream5) #define DMA1_Stream7 (&dma1_stream7) #define DMA2_Stream1 (&dma2_stream1) @@ -213,117 +213,6 @@ extern uint32_t txPdcUsart( uint8_t *buffer, uint32_t size ); extern uint32_t txPdcPending(); extern void rxPdcUsart( void (*pChProcess)(uint8_t x) ); -#define loop_until_bit_is_set( port, bitnum) \ - while ( 0/*! ( (port) & (1 << (bitnum)) )*/ ) ; - -#define PROGMEM -#define pgm_read_byte(address_short) (*(uint8_t*)(address_short)) -#define pgm_read_word(address_short) (*(uint16_t*)(address_short)) -#define pgm_read_adr(address_short) *address_short -#define pgm_read_stringP(adr) ((adr)) -#define PSTR(adr) adr -#define _delay_us(a) -#define _delay_ms(a) -#define cli() -#define sei() -#define strcpy_P strcpy -#define strcat_P strcat -#define memcpy_P memcpy - -#define PORTA dummyport -#define PORTB portb -#define PORTC portc -#define PORTD dummyport -#define PORTE dummyport -#define PORTF dummyport -#define PORTG dummyport -#define PORTH porth -#define PORTL dummyport -#define DDRA dummyport -#define DDRB dummyport -#define DDRC dummyport -#define DDRD dummyport -#define DDRE dummyport -#define DDRF dummyport -#define DDRG dummyport -#define EEMEM - -#define UCSR0B dummyport -#define UDRIE0 dummyport -#define TXB80 dummyport -#define TXCIE0 dummyport -#define TXEN0 dummyport -#define RXEN0 dummyport -#define DDE0 dummyport -#define PORTE0 dummyport -#define RXCIE0 dummyport -#define OCR0A dummyport -#define OCR1A dummyport16 -#define OCR1B dummyport16 -#define OCR1C dummyport16 -#define OCR2 dummyport -#define OCR3A dummyport16 -#define OCR3B dummyport16 -#define OCR4A dummyport -#define OCR5A dummyport -#define TCCR0A dummyport -#define TCCR1A dummyport -#define TCCR1B dummyport -#define TCCR1C dummyport -#define COM1B0 dummyport -#define COM0A0 dummyport -#define TCNT1 dummyport16 -#define TCNT1L dummyport -#define TCNT5 dummyport16 -#define ICR1 dummyport16 -#define TIFR dummyport -#define TIFR1 dummyport -#define ETIFR dummyport - -#define SPDR dummyport -#define SPSR dummyport -#define SPIF dummyport -#define SPCR dummyport - -#define TIMSK dummyport -#define TIMSK1 dummyport -#define TIMSK3 dummyport -#define TIMSK4 dummyport -#define TIMSK5 dummyport -#define ETIMSK dummyport -#define ETIMSK1 dummyport - -#define UCSZ02 dummyport -#define UCSR0C dummyport -#define UCSZ01 dummyport -#define UCSZ00 dummyport -#define UCSR0A dummyport -#define RXC0 dummyport - -#define UDR0 dummyport -#define OCIE1A dummyport -#define OCIE1B dummyport -#define OCIE1C dummyport -#define OCIE4A dummyport -#define OCIE5A dummyport - -#define OUT_B_LIGHT 7 -#define INP_E_ElevDR 2 -#define INP_E_Trainer 5 -#define INP_E_Gear 4 -#define INP_C_ThrCt 6 -#define INP_C_AileDR 7 -#define INP_E_ID2 6 - -#define WGM10 0 -#define WGM12 0 -#define COM1B1 0 -#define FOC1B 0 -#define CS10 0 -#define DOR0 0 -#define UPE0 0 -#define FE0 0 - #define ISR(x, ...) void x() #if !defined(_MSC_VER) && defined(__GNUC__) @@ -338,14 +227,12 @@ extern uint32_t Master_frequency; #define __disable_irq() #define __enable_irq() -extern uint8_t portb, portc, porth, dummyport; -extern uint16_t dummyport16; extern uint8_t main_thread_running; extern char * main_thread_error; -#define getADC() -#define GET_ADC_IF_MIXER_NOT_RUNNING() -#define getADC_bandgap() +static inline void getADC() +{ +} #define SIMU_SLEEP(x) do { if (!main_thread_running) return; sleep(x/*ms*/); } while (0) #define SIMU_SLEEP_NORET(x) do { sleep(x/*ms*/); } while (0) @@ -370,49 +257,12 @@ void StopEepromThread(); #define StopAudioThread() #endif - -#define OS_MutexID pthread_mutex_t -extern OS_MutexID audioMutex; - -#define OS_FlagID uint32_t -#define OS_TID pthread_t -#define OS_TCID uint32_t -#define OS_STK uint32_t - -#define E_OK 0 -#define WDRF 0 - void * simuMain(void * args = NULL); -extern uint8_t MCUCSR, MCUSR, MCUCR; - -typedef unsigned int U32; -typedef unsigned long long U64; -typedef void (*FUNCPtr)(void*); - -#define CoInitOS(...) -#define CoStartOS(...) - -OS_TID CoCreateTask(FUNCPtr task, void *argv, uint32_t parameter, void * stk, uint32_t stksize); -#define CoCreateTaskEx(...) 0 - -#define CoCreateMutex(...) PTHREAD_MUTEX_INITIALIZER -#define CoEnterMutexSection(m) pthread_mutex_lock(&(m)) -#define CoLeaveMutexSection(m) pthread_mutex_unlock(&(m)) - -#define CoSetFlag(...) -#define CoClearFlag(...) -#define CoSetTmrCnt(...) -#define CoEnterISR(...) -#define CoExitISR(...) -#define CoStartTmr(...) -#define CoWaitForSingleFlag(...) 0 -#define CoTickDelay(x) sleep(2*(x)) -#define CoCreateFlag(...) 0 -U64 CoGetOSTime(void); #define UART_Stop(...) #define UART3_Stop(...) #define USART_GetITStatus(...) 0 +#define USART_ClearFlag(...) #if defined(STM32) inline void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) { } @@ -437,6 +287,7 @@ inline void DMA_Init(DMA_Stream_TypeDef* DMAy_Streamx, DMA_InitTypeDef* DMA_Init inline void DMA_ITConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT, FunctionalState NewState) { } inline void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct) { } inline void DMA_Cmd(DMA_Stream_TypeDef* DMAy_Streamx, FunctionalState NewState) { } +void DMACopy(void * src, void * dest, unsigned size); inline FlagStatus DMA_GetFlagStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_FLAG) { return RESET; } inline ITStatus DMA_GetITStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT) { return RESET; } inline void DMA_ClearITPendingBit(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT) { } diff --git a/radio/src/targets/simu/simudisk.cpp b/radio/src/targets/simu/simudisk.cpp index ab3ee4c62..5e8dfcd82 100644 --- a/radio/src/targets/simu/simudisk.cpp +++ b/radio/src/targets/simu/simudisk.cpp @@ -29,7 +29,7 @@ FILE * diskImage = 0; FATFS g_FATFS_Obj = {0}; -OS_MutexID ioMutex; +RTOS_MUTEX_HANDLE ioMutex; int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj) /* Create a sync object */ { diff --git a/radio/src/targets/sky9x/bluetooth.cpp b/radio/src/targets/sky9x/bluetooth.cpp index 4e3add0fb..c058f2c22 100644 --- a/radio/src/targets/sky9x/bluetooth.cpp +++ b/radio/src/targets/sky9x/bluetooth.cpp @@ -86,7 +86,7 @@ void btSendBuffer() btTx.buffer = btTxBuffer; txPdcBt(&btTx); while (btTx.ready == 1) { - CoTickDelay(1); // 2ms for now + RTOS_WAIT_TICKS(1); } btTx.size = 0; } @@ -131,7 +131,7 @@ uint32_t btChangeBaudrate( uint32_t baudIndex ) } } else { - CoTickDelay(1) ; // 2mS + RTOS_WAIT_TICKS(1); } } @@ -167,7 +167,7 @@ uint32_t btPollDevice() } } else { - CoTickDelay(1) ; // 2mS + RTOS_WAIT_TICKS(1) ; // 2mS } } @@ -229,7 +229,7 @@ void bluetoothTask(void * pdata) x = 0 ; } btSetBaudrate(x) ; - CoTickDelay(1) ; // 2mS + RTOS_WAIT_TICKS(1) ; // 2mS btStatus = btPollDevice() ; // Do we get a response? } } @@ -248,7 +248,7 @@ void bluetoothTask(void * pdata) btInit(); } - CoTickDelay(1) ; + RTOS_WAIT_TICKS(1) ; btPollDevice(); // Do we get a response? diff --git a/radio/src/targets/sky9x/board.h b/radio/src/targets/sky9x/board.h index c526ddddf..c49fd1119 100644 --- a/radio/src/targets/sky9x/board.h +++ b/radio/src/targets/sky9x/board.h @@ -223,9 +223,6 @@ extern uint8_t temperature ; // Raw temp reading extern uint8_t maxTemperature ; // Raw temp reading uint8_t getTemperature(); -#define strcpy_P strcpy -#define strcat_P strcat - #if !defined(REVA) extern uint16_t Current_analogue; extern uint16_t Current_max; diff --git a/radio/src/targets/sky9x/diskio.cpp b/radio/src/targets/sky9x/diskio.cpp index 161d90adc..394629d70 100644 --- a/radio/src/targets/sky9x/diskio.cpp +++ b/radio/src/targets/sky9x/diskio.cpp @@ -79,7 +79,7 @@ uint32_t transSpeed; /*-----------------------------------------------------------------------*/ #if !defined(BOOT) -static OS_MutexID ioMutex; +static RTOS_MUTEX_HANDLE ioMutex; volatile int mutexCheck = 0; int ff_cre_syncobj (BYTE vol, _SYNC_t *mutex) { @@ -89,7 +89,7 @@ int ff_cre_syncobj (BYTE vol, _SYNC_t *mutex) int ff_req_grant (_SYNC_t mutex) { - CoEnterMutexSection(mutex); + RTOS_LOCK_MUTEX(mutex); return 1; } @@ -676,7 +676,7 @@ const char * sdIdentify() * The host that does not support CMD8 shall supply high voltage range... */ result = sdCmd8(1); if (result == 0) f8 = 1; - else if (result == SD_NORESPONSE) CoTickDelay(1); /* 2ms delay after "no response" */ + else if (result == SD_NORESPONSE) RTOS_WAIT_MS(2); /* 2ms delay after "no response" */ else return "Identify.8 error"; #if 0 @@ -956,7 +956,7 @@ void sdInit() } sdCmd0(); - CoTickDelay(5); // 10ms + RTOS_WAIT_MS(10); // 10ms sdCmd8(1); #if 0 @@ -971,7 +971,7 @@ void sdInit() uint8_t retry; for (retry=0; retry<10; retry++) { if (!sdCmd2()) break; - CoTickDelay(1); // 2ms + RTOS_WAIT_MS(2); // 2ms } if (retry == 10) { @@ -982,7 +982,7 @@ void sdInit() for (retry=0; retry<10; retry++) { if (!sdCmd3()) break; - CoTickDelay(1); // 2ms + RTOS_WAIT_MS(2); // 2ms } if (retry == 10) { diff --git a/radio/src/targets/taranis/board.cpp b/radio/src/targets/taranis/board.cpp index 9997cf7ea..5c092ee03 100644 --- a/radio/src/targets/taranis/board.cpp +++ b/radio/src/targets/taranis/board.cpp @@ -107,10 +107,10 @@ extern "C" void INTERRUPT_xMS_IRQHandler() #endif #if (defined(PCBX9E) && !defined(SIMU)) -const pm_uchar bmp_startup[] PROGMEM = { +const unsigned char bmp_startup[] = { #include "startup.lbm" }; -const pm_uchar bmp_lock[] PROGMEM = { +const unsigned char bmp_lock[] = { #include "lock.lbm" }; #endif diff --git a/radio/src/targets/taranis/board.h b/radio/src/targets/taranis/board.h index cf056ba0f..87fabf59b 100644 --- a/radio/src/targets/taranis/board.h +++ b/radio/src/targets/taranis/board.h @@ -106,9 +106,6 @@ extern "C" { #define TIMER_MULT_APB1 2 #define TIMER_MULT_APB2 2 -#define strcpy_P strcpy -#define strcat_P strcat - extern uint16_t sessionTimer; // Board driver diff --git a/radio/src/targets/taranis/diskio.cpp b/radio/src/targets/taranis/diskio.cpp index df27815cc..482e62367 100644 --- a/radio/src/targets/taranis/diskio.cpp +++ b/radio/src/targets/taranis/diskio.cpp @@ -60,7 +60,7 @@ /* Lock / unlock functions */ /*-----------------------------------------------------------------------*/ #if !defined(BOOT) -static OS_MutexID ioMutex; +static RTOS_MUTEX_HANDLE ioMutex; int ff_cre_syncobj (BYTE vol, _SYNC_t *mutex) { @@ -70,12 +70,13 @@ int ff_cre_syncobj (BYTE vol, _SYNC_t *mutex) int ff_req_grant (_SYNC_t mutex) { - return CoEnterMutexSection(mutex) == E_OK; + RTOS_LOCK_MUTEX(mutex); + return 1; } void ff_rel_grant (_SYNC_t mutex) { - CoLeaveMutexSection(mutex); + RTOS_UNLOCK_MUTEX(mutex); } int ff_del_syncobj (_SYNC_t mutex) diff --git a/radio/src/tasks_arm.cpp b/radio/src/tasks_arm.cpp index aa41af586..27190c576 100644 --- a/radio/src/tasks_arm.cpp +++ b/radio/src/tasks_arm.cpp @@ -20,18 +20,17 @@ #include "opentx.h" -OS_TID menusTaskId; -// menus stack must be aligned to 8 bytes otherwise printf for %f does not work! -TaskStack _ALIGNED(8) menusStack; +RTOS_TASK_HANDLE menusTaskId; +RTOS_DEFINE_STACK(menusStack, MENUS_STACK_SIZE); -OS_TID mixerTaskId; -TaskStack mixerStack; +RTOS_TASK_HANDLE mixerTaskId; +RTOS_DEFINE_STACK(mixerStack, MIXER_STACK_SIZE); -OS_TID audioTaskId; -TaskStack audioStack; +RTOS_TASK_HANDLE audioTaskId; +RTOS_DEFINE_STACK(audioStack, AUDIO_STACK_SIZE); -OS_MutexID audioMutex; -OS_MutexID mixerMutex; +RTOS_MUTEX_HANDLE audioMutex; +RTOS_MUTEX_HANDLE mixerMutex; enum TaskIndex { MENU_TASK_INDEX, @@ -43,27 +42,6 @@ enum TaskIndex { MAIN_TASK_INDEX = 255 }; -template -void TaskStack::paint() -{ - for (uint32_t i=0; i= (usbStarted() ? 5 : 10)) { // run at least every 20ms (every 10ms if USB is active) @@ -158,11 +124,11 @@ void mixerTask(void * pdata) uint16_t t0 = getTmr2MHz(); DEBUG_TIMER_START(debugTimerMixer); - CoEnterMutexSection(mixerMutex); + RTOS_LOCK_MUTEX(mixerMutex); doMixerCalculations(); DEBUG_TIMER_START(debugTimerMixerCalcToUsage); DEBUG_TIMER_SAMPLE(debugTimerMixerIterval); - CoLeaveMutexSection(mixerMutex); + RTOS_UNLOCK_MUTEX(mixerMutex); DEBUG_TIMER_STOP(debugTimerMixer); #if defined(STM32) && !defined(SIMU) @@ -196,7 +162,7 @@ void scheduleNextMixerCalculation(uint8_t module, uint16_t period_ms) { // Schedule next mixer calculation time, // for now assume mixer calculation takes 2 ms. - nextMixerTime[module] = (uint32_t)CoGetOSTime() + period_ms / 2 - 1/*2ms*/; + nextMixerTime[module] = (uint32_t)RTOS_GET_TIME() + period_ms / 2 - 1/*2ms*/; DEBUG_TIMER_STOP(debugTimerMixerCalcToUsage); } @@ -206,7 +172,7 @@ void scheduleNextMixerCalculation(uint8_t module, uint16_t period_ms) bool perMainEnabled = true; #endif -void menusTask(void * pdata) +TASK_FUNCTION(menusTask) { opentxInit(); @@ -217,13 +183,13 @@ void menusTask(void * pdata) break; } else if (pwr_check == e_power_press) { - CoTickDelay(MENU_TASK_PERIOD_TICKS); + RTOS_WAIT_TICKS(MENU_TASK_PERIOD_TICKS); continue; } #else while (pwrCheck() != e_power_off) { #endif - uint32_t start = (uint32_t)CoGetOSTime(); + uint32_t start = (uint32_t)RTOS_GET_TIME(); DEBUG_TIMER_START(debugTimerPerMain); #if defined(COLORLCD) && defined(CLI) if (perMainEnabled) { @@ -234,11 +200,11 @@ void menusTask(void * pdata) #endif DEBUG_TIMER_STOP(debugTimerPerMain); // TODO remove completely massstorage from sky9x firmware - uint32_t runtime = ((uint32_t)CoGetOSTime() - start); + uint32_t runtime = ((uint32_t)RTOS_GET_TIME() - start); // deduct the thread run-time from the wait, if run-time was more than // desired period, then skip the wait all together if (runtime < MENU_TASK_PERIOD_TICKS) { - CoTickDelay(MENU_TASK_PERIOD_TICKS - runtime); + RTOS_WAIT_TICKS(MENU_TASK_PERIOD_TICKS - runtime); } resetForcePowerOffRequest(); @@ -260,26 +226,27 @@ void menusTask(void * pdata) drawSleepBitmap(); opentxClose(); boardOff(); // Only turn power off if necessary + + TASK_RETURN(); } void tasksStart() { - CoInitOS(); + RTOS_INIT(); #if defined(CLI) cliStart(); #endif - mixerTaskId = CoCreateTask(mixerTask, NULL, 5, &mixerStack.stack[MIXER_STACK_SIZE-1], MIXER_STACK_SIZE); - menusTaskId = CoCreateTask(menusTask, NULL, 10, &menusStack.stack[MENUS_STACK_SIZE-1], MENUS_STACK_SIZE); + RTOS_CREATE_TASK(mixerTaskId, mixerTask, "Mixer", mixerStack, MIXER_STACK_SIZE, MIXER_TASK_PRIO); + RTOS_CREATE_TASK(menusTaskId, menusTask, "Menus", menusStack, MENUS_STACK_SIZE, MENUS_TASK_PRIO); #if !defined(SIMU) - // TODO move the SIMU audio in this task - audioTaskId = CoCreateTask(audioTask, NULL, 7, &audioStack.stack[AUDIO_STACK_SIZE-1], AUDIO_STACK_SIZE); + RTOS_CREATE_TASK(audioTaskId, audioTask, "Audio", audioStack, AUDIO_STACK_SIZE, AUDIO_TASK_PRIO); #endif - audioMutex = CoCreateMutex(); - mixerMutex = CoCreateMutex(); + RTOS_CREATE_MUTEX(audioMutex); + RTOS_CREATE_MUTEX(mixerMutex); - CoStartOS(); + RTOS_START(); } diff --git a/radio/src/tasks_arm.h b/radio/src/tasks_arm.h index abd0e66d7..2096606ca 100644 --- a/radio/src/tasks_arm.h +++ b/radio/src/tasks_arm.h @@ -2,7 +2,7 @@ * Copyright (C) OpenTX * * Based on code named - * th9x - http://code.google.com/p/th9x + * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * @@ -21,59 +21,37 @@ #ifndef _TASKS_ARM_H_ #define _TASKS_ARM_H_ -#if !defined(SIMU) -extern "C" { -#include -} -#endif +#include "rtos.h" +// stack sizes should be in multiples of 8 for better alignment #define MENUS_STACK_SIZE 2000 -#define MIXER_STACK_SIZE 500 -#define AUDIO_STACK_SIZE 500 -#define BLUETOOTH_STACK_SIZE 500 +#define MIXER_STACK_SIZE 512 +#define AUDIO_STACK_SIZE 512 -#if defined(_MSC_VER) -#define _ALIGNED(x) __declspec(align(x)) -#elif defined(__GNUC__) -#define _ALIGNED(x) __attribute__ ((aligned(x))) -#endif +#define MIXER_TASK_PRIO 5 +#define AUDIO_TASK_PRIO 7 +#define MENUS_TASK_PRIO 10 +#define CLI_TASK_PRIO 10 -uint16_t getStackAvailable(void * address, uint16_t size); +extern RTOS_TASK_HANDLE menusTaskId; +extern RTOS_DEFINE_STACK(menusStack, MENUS_STACK_SIZE); -template -class TaskStack -{ - public: - TaskStack() { } - void paint(); - uint16_t size() - { - return SIZE * 4; - } - uint16_t available() - { - return getStackAvailable(stack, SIZE); - } - OS_STK stack[SIZE]; -}; +extern RTOS_TASK_HANDLE mixerTaskId; +extern RTOS_DEFINE_STACK(mixerStack, MIXER_STACK_SIZE); + +extern RTOS_TASK_HANDLE audioTaskId; +extern RTOS_DEFINE_STACK(audioStack, AUDIO_STACK_SIZE); + +extern RTOS_MUTEX_HANDLE mixerMutex; +extern RTOS_FLAG_HANDLE openTxInitCompleteFlag; void stackPaint(); -uint16_t stackSize(); -uint16_t stackAvailable(); - -extern OS_TID menusTaskId; -// menus stack must be aligned to 8 bytes otherwise printf for %f does not work! -extern TaskStack _ALIGNED(8) menusStack; - -extern OS_TID mixerTaskId; -extern TaskStack mixerStack; - -extern OS_TID audioTaskId; -extern TaskStack audioStack; - void tasksStart(); extern volatile uint16_t timeForcePowerOffPressed; -inline void resetForcePowerOffRequest() {timeForcePowerOffPressed = 0; } +inline void resetForcePowerOffRequest() +{ + timeForcePowerOffPressed = 0; +} #endif // _TASKS_ARM_H_ diff --git a/radio/src/telemetry/frsky.cpp b/radio/src/telemetry/frsky.cpp index 93d421aa5..02622bfeb 100644 --- a/radio/src/telemetry/frsky.cpp +++ b/radio/src/telemetry/frsky.cpp @@ -20,10 +20,7 @@ #include "opentx.h" - - - -NOINLINE void processFrskyTelemetryData(uint8_t data) +void processFrskyTelemetryData(uint8_t data) { static uint8_t dataState = STATE_DATA_IDLE; diff --git a/radio/src/telemetry/frsky.h b/radio/src/telemetry/frsky.h index 5394b5f5e..653de2944 100644 --- a/radio/src/telemetry/frsky.h +++ b/radio/src/telemetry/frsky.h @@ -259,9 +259,8 @@ enum AlarmLevel { #define BYTESTUFF 0x7d #define STUFF_MASK 0x20 - #define frskySendAlarms() +#define frskySendAlarms() -#if defined(FRSKY_HUB) typedef enum { TS_IDLE = 0, // waiting for 0x5e frame marker TS_DATA_ID, // waiting for dataID @@ -269,7 +268,6 @@ typedef enum { TS_DATA_HIGH, // waiting for data high byte TS_XOR = 0x80 // decode stuffed byte } TS_STATE; -#endif // FrSky D Telemetry Protocol void processHubPacket(uint8_t id, int16_t value); diff --git a/radio/src/telemetry/frsky_d_arm.cpp b/radio/src/telemetry/frsky_d_arm.cpp index f6e4454cf..6264ff1ba 100644 --- a/radio/src/telemetry/frsky_d_arm.cpp +++ b/radio/src/telemetry/frsky_d_arm.cpp @@ -20,7 +20,6 @@ #include "opentx.h" -#if defined(FRSKY_HUB) void parseTelemHubByte(uint8_t byte) { static int8_t structPos; @@ -61,7 +60,6 @@ void parseTelemHubByte(uint8_t byte) state = TS_IDLE; processHubPacket(structPos, (byte << 8) + lowByte); } -#endif // #if defined(FRSKY_HUB) void frskyDProcessPacket(const uint8_t *packet) { diff --git a/radio/src/tests/timers.cpp b/radio/src/tests/timers.cpp index 9af5265ac..7e04e82cc 100644 --- a/radio/src/tests/timers.cpp +++ b/radio/src/tests/timers.cpp @@ -20,17 +20,9 @@ #include "gtests.h" - -#if defined(ACCURAT_THROTTLE_TIMER) - #define THR_100 128 // approximately 10% full throttle - #define THR_50 64 // approximately 10% full throttle - #define THR_10 13 // approximately 10% full throttle -#else - #define THR_100 32 // approximately 10% full throttle - #define THR_50 16 // approximately 10% full throttle - #define THR_10 3 // approximately 10% full throttle -#endif - +#define THR_100 128 // approximately 10% full throttle +#define THR_50 64 // approximately 10% full throttle +#define THR_10 13 // approximately 10% full throttle #define TEST_AB_EQUAL(a, b) if (a != b) { return ::testing::AssertionFailure() << \ #a "= " << (uint32_t)a << ", " << #b "= " << (uint32_t)b; }; @@ -165,13 +157,8 @@ TEST(Timers, timerThrottleRelative) EXPECT_TRUE(evalTimersForNSecondsAndTest(1, 0, 0, TMR_RUNNING, 0)); EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_100, 0, TMR_RUNNING, 100)); EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_50, 0, TMR_RUNNING, 150)); // 50% throttle == 50s -#if defined(ACCURAT_THROTTLE_TIMER) EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_10, 0, TMR_RUNNING, 160)); // 10% throttle == 10s EXPECT_TRUE(evalTimersForNSecondsAndTest(100, 0, 0, TMR_RUNNING, 160)); -#else - EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_10, 0, TMR_RUNNING, 159)); // 10% throttle == 10s - EXPECT_TRUE(evalTimersForNSecondsAndTest(100, 0, 0, TMR_RUNNING, 159)); -#endif // test down-running initModelTimer(0, TMRMODE_THR_REL, 200); @@ -180,13 +167,8 @@ TEST(Timers, timerThrottleRelative) EXPECT_TRUE(evalTimersForNSecondsAndTest(1, 0, 0, TMR_RUNNING, 199)); EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_100, 0, TMR_RUNNING, 99)); EXPECT_TRUE(evalTimersForNSecondsAndTest(200, THR_50, 0, TMR_NEGATIVE, -1)); // 50% throttle == 100s -#if defined(ACCURAT_THROTTLE_TIMER) EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_10, 0, TMR_NEGATIVE,-11)); // 10% throttle == 10s EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_100, 0, TMR_STOPPED,-111)); -#else - EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_10, 0, TMR_NEGATIVE,-10)); // 10% throttle == 10s - EXPECT_TRUE(evalTimersForNSecondsAndTest(100, THR_100, 0, TMR_STOPPED,-110)); -#endif } TEST(Timers, timerThrottleTriggered) diff --git a/radio/src/thirdparty/FatFs/ff.h b/radio/src/thirdparty/FatFs/ff.h index 84ab016ed..a22016247 100644 --- a/radio/src/thirdparty/FatFs/ff.h +++ b/radio/src/thirdparty/FatFs/ff.h @@ -21,6 +21,8 @@ #ifndef _FATFS #define _FATFS 68020 /* Revision ID */ +#include "rtos.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/radio/src/thirdparty/FatFs/ffconf.h b/radio/src/thirdparty/FatFs/ffconf.h index 03a895fba..533364752 100644 --- a/radio/src/thirdparty/FatFs/ffconf.h +++ b/radio/src/thirdparty/FatFs/ffconf.h @@ -2,6 +2,8 @@ / FatFs - FAT file system module configuration file /---------------------------------------------------------------------------*/ +#include "rtos.h" + #define _FFCONF 68020 /* Revision ID */ #if !defined(SIMU) @@ -263,7 +265,7 @@ extern "C" { #if !defined(BOOT) #define _FS_REENTRANT 1 /* 0:Disable or 1:Enable */ - #define _SYNC_t unsigned char /*OS_MutexID*/ /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */ + #define _SYNC_t RTOS_MUTEX_HANDLE /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */ #else #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */ #endif diff --git a/radio/src/timers.cpp b/radio/src/timers.cpp index 1ebb36674..33337a2a4 100644 --- a/radio/src/timers.cpp +++ b/radio/src/timers.cpp @@ -65,11 +65,7 @@ void saveTimers() } } -#if defined(ACCURAT_THROTTLE_TIMER) - #define THR_TRG_TRESHOLD 13 // approximately 10% full throttle -#else - #define THR_TRG_TRESHOLD 3 // approximately 10% full throttle -#endif +#define THR_TRG_TRESHOLD 13 // approximately 10% full throttle void evalTimers(int16_t throttle, uint8_t tick10ms) { @@ -105,19 +101,10 @@ void evalTimers(int16_t throttle, uint8_t tick10ms) if (throttle) newTimerVal++; } else if (timerMode == TMRMODE_THR_REL) { - // @@@ open.20.fsguruh: why so complicated? we have already a s_sum field; use it for the half seconds (not showable) as well - // check for s_cnt[i]==0 is not needed because we are shure it is at least 1 - #if defined(ACCURAT_THROTTLE_TIMER) if ((timerState->sum/timerState->cnt) >= 128) { // throttle was normalized to 0 to 128 value (throttle/64*2 (because - range is added as well) newTimerVal++; // add second used of throttle timerState->sum -= 128*timerState->cnt; } - #else - if ((timerState->sum/timerState->cnt) >= 32) { // throttle was normalized to 0 to 32 value (throttle/16*2 (because - range is added as well) - newTimerVal++; // add second used of throttle - timerState->sum -= 32*timerState->cnt; - } - #endif timerState->cnt = 0; } else if (timerMode == TMRMODE_THR_TRG) { diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 6a4303329..784b47c05 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -23,7 +23,7 @@ #define ISTR(x) LEN_##x TR_##x // The non-0-terminated-strings -const pm_char STR_OPEN9X[] PROGMEM = +const char STR_OPEN9X[] = ISTR(OFFON) ISTR(MMMINV) ISTR(NCHANNELS) @@ -113,458 +113,456 @@ const pm_char STR_OPEN9X[] PROGMEM = ; // The 0-terminated-strings -const pm_char STR_POPUPS[] PROGMEM = TR_POPUPS; +const char STR_POPUPS[] = TR_POPUPS; #if !defined(OFS_EXIT) - const pm_char STR_EXIT[] PROGMEM = TR_EXIT; + const char STR_EXIT[] = TR_EXIT; #endif #if !defined(PCBHORUS) - const pm_char STR_MENUWHENDONE[] PROGMEM = TR_MENUWHENDONE; + const char STR_MENUWHENDONE[] = TR_MENUWHENDONE; #endif -const pm_char STR_FREE[] PROGMEM = TR_FREE; -const pm_char STR_DELETEMODEL[] PROGMEM = TR_DELETEMODEL; -const pm_char STR_COPYINGMODEL[] PROGMEM = TR_COPYINGMODEL; -const pm_char STR_MOVINGMODEL[] PROGMEM = TR_MOVINGMODEL; -const pm_char STR_LOADINGMODEL[] PROGMEM = TR_LOADINGMODEL; -const pm_char STR_NAME[] PROGMEM = TR_NAME; -const pm_char STR_BITMAP[] PROGMEM = TR_BITMAP; -const pm_char STR_TIMER[] PROGMEM = TR_TIMER; -const pm_char STR_ELIMITS[] PROGMEM = TR_ELIMITS; -const pm_char STR_ETRIMS[] PROGMEM = TR_ETRIMS; -const pm_char STR_TRIMINC[] PROGMEM = TR_TRIMINC; -const pm_char STR_DISPLAY_TRIMS[] PROGMEM = TR_DISPLAY_TRIMS; -const pm_char STR_TTRACE[] PROGMEM = TR_TTRACE; -const pm_char STR_TTRIM[] PROGMEM = TR_TTRIM; -const pm_char STR_BEEPCTR[] PROGMEM = TR_BEEPCTR; -const pm_char STR_USE_GLOBAL_FUNCS[] PROGMEM = TR_USE_GLOBAL_FUNCS; +const char STR_FREE[] = TR_FREE; +const char STR_DELETEMODEL[] = TR_DELETEMODEL; +const char STR_COPYINGMODEL[] = TR_COPYINGMODEL; +const char STR_MOVINGMODEL[] = TR_MOVINGMODEL; +const char STR_LOADINGMODEL[] = TR_LOADINGMODEL; +const char STR_NAME[] = TR_NAME; +const char STR_BITMAP[] = TR_BITMAP; +const char STR_TIMER[] = TR_TIMER; +const char STR_ELIMITS[] = TR_ELIMITS; +const char STR_ETRIMS[] = TR_ETRIMS; +const char STR_TRIMINC[] = TR_TRIMINC; +const char STR_DISPLAY_TRIMS[] = TR_DISPLAY_TRIMS; +const char STR_TTRACE[] = TR_TTRACE; +const char STR_TTRIM[] = TR_TTRIM; +const char STR_BEEPCTR[] = TR_BEEPCTR; +const char STR_USE_GLOBAL_FUNCS[] = TR_USE_GLOBAL_FUNCS; #if defined(PCBSKY9X) && defined(REVX) - const pm_char STR_OUTPUT_TYPE[] PROGMEM = TR_OUTPUT_TYPE; + const char STR_OUTPUT_TYPE[] = TR_OUTPUT_TYPE; #endif -const pm_char STR_PROTO[] PROGMEM = TR_PROTO; -const pm_char STR_PPMFRAME[] PROGMEM = TR_PPMFRAME; -const pm_char STR_REFRESHRATE[] PROGMEM = TR_REFRESHRATE; -const pm_char SSTR_WARN_BATTVOLTAGE[] PROGMEM = STR_WARN_BATTVOLTAGE; -const pm_char STR_MS[] PROGMEM = TR_MS; -const pm_char STR_SWITCH[] PROGMEM = TR_SWITCH; -const pm_char STR_TRIMS[] PROGMEM = TR_TRIMS; -const pm_char STR_FADEIN[] PROGMEM = TR_FADEIN; -const pm_char STR_FADEOUT[] PROGMEM = TR_FADEOUT; -const pm_char STR_DEFAULT[] PROGMEM = TR_DEFAULT; -const pm_char STR_CHECKTRIMS[] PROGMEM = TR_CHECKTRIMS; +const char STR_PROTO[] = TR_PROTO; +const char STR_PPMFRAME[] = TR_PPMFRAME; +const char STR_REFRESHRATE[] = TR_REFRESHRATE; +const char SSTR_WARN_BATTVOLTAGE[] = STR_WARN_BATTVOLTAGE; +const char STR_MS[] = TR_MS; +const char STR_SWITCH[] = TR_SWITCH; +const char STR_TRIMS[] = TR_TRIMS; +const char STR_FADEIN[] = TR_FADEIN; +const char STR_FADEOUT[] = TR_FADEOUT; +const char STR_DEFAULT[] = TR_DEFAULT; +const char STR_CHECKTRIMS[] = TR_CHECKTRIMS; #ifdef HELI -const pm_char STR_SWASHTYPE[] PROGMEM = TR_SWASHTYPE; -const pm_char STR_COLLECTIVE[] PROGMEM = TR_COLLECTIVE; -const pm_char STR_AILERON[] PROGMEM = TR_AILERON; -const pm_char STR_ELEVATOR[] PROGMEM = TR_ELEVATOR; -const pm_char STR_SWASHRING[] PROGMEM = TR_SWASHRING; -const pm_char STR_ELEDIRECTION[] PROGMEM = TR_ELEDIRECTION; -const pm_char STR_AILDIRECTION[] PROGMEM = TR_AILDIRECTION; -const pm_char STR_COLDIRECTION[] PROGMEM = TR_COLDIRECTION; +const char STR_SWASHTYPE[] = TR_SWASHTYPE; +const char STR_COLLECTIVE[] = TR_COLLECTIVE; +const char STR_AILERON[] = TR_AILERON; +const char STR_ELEVATOR[] = TR_ELEVATOR; +const char STR_SWASHRING[] = TR_SWASHRING; +const char STR_ELEDIRECTION[] = TR_ELEDIRECTION; +const char STR_AILDIRECTION[] = TR_AILDIRECTION; +const char STR_COLDIRECTION[] = TR_COLDIRECTION; #endif -const pm_char STR_MODE[] PROGMEM = TR_MODE; +const char STR_MODE[] = TR_MODE; #if defined(AUDIO) && defined(BUZZER) -const pm_char STR_SPEAKER[] PROGMEM = TR_SPEAKER; -const pm_char STR_BUZZER[] PROGMEM = TR_BUZZER; +const char STR_SPEAKER[] = TR_SPEAKER; +const char STR_BUZZER[] = TR_BUZZER; #endif -const pm_char STR_NOFREEEXPO[] PROGMEM = TR_NOFREEEXPO; -const pm_char STR_NOFREEMIXER[] PROGMEM = TR_NOFREEMIXER; -const pm_char STR_SOURCE[] PROGMEM = TR_SOURCE; -const pm_char STR_WEIGHT[] PROGMEM = TR_WEIGHT; -const pm_char STR_EXPO[] PROGMEM = TR_EXPO; -const pm_char STR_SIDE[] PROGMEM = TR_SIDE; -const pm_char STR_DIFFERENTIAL[] PROGMEM = TR_DIFFERENTIAL; -const pm_char STR_OFFSET[] PROGMEM = TR_OFFSET; -const pm_char STR_TRIM[] PROGMEM = TR_TRIM; -const pm_char STR_DREX[] PROGMEM = TR_DREX; -const pm_char STR_CURVE[] PROGMEM = TR_CURVE; -const pm_char STR_FLMODE[] PROGMEM = TR_FLMODE; -const pm_char STR_MIXWARNING[] PROGMEM = TR_MIXWARNING; -const pm_char STR_OFF[] PROGMEM = TR_OFF; -const pm_char STR_MULTPX[] PROGMEM = TR_MULTPX; -const pm_char STR_DELAYDOWN[] PROGMEM = TR_DELAYDOWN; -const pm_char STR_DELAYUP[] PROGMEM = TR_DELAYUP; -const pm_char STR_SLOWDOWN[] PROGMEM = TR_SLOWDOWN; -const pm_char STR_SLOWUP[] PROGMEM = TR_SLOWUP; -const pm_char STR_MIXER[] PROGMEM = TR_MIXER; -const pm_char STR_CV[] PROGMEM = TR_CV; -const pm_char STR_GV[] PROGMEM = TR_GV; -const pm_char STR_ACHANNEL[] PROGMEM = TR_ACHANNEL; -const pm_char STR_RANGE[] PROGMEM = TR_RANGE; -const pm_char STR_CENTER[] PROGMEM = TR_CENTER; -const pm_char STR_BAR[] PROGMEM = TR_BAR; -const pm_char STR_ALARM[] PROGMEM = TR_ALARM; -const pm_char STR_USRDATA[] PROGMEM = TR_USRDATA; -const pm_char STR_BLADES[] PROGMEM = TR_BLADES; -const pm_char STR_SCREEN[] PROGMEM = TR_SCREEN; -const pm_char STR_SOUND_LABEL[] PROGMEM = TR_SOUND_LABEL; -const pm_char STR_LENGTH[] PROGMEM = TR_LENGTH; -const pm_char STR_BEEP_LENGTH[] PROGMEM = TR_BEEP_LENGTH; +const char STR_NOFREEEXPO[] = TR_NOFREEEXPO; +const char STR_NOFREEMIXER[] = TR_NOFREEMIXER; +const char STR_SOURCE[] = TR_SOURCE; +const char STR_WEIGHT[] = TR_WEIGHT; +const char STR_EXPO[] = TR_EXPO; +const char STR_SIDE[] = TR_SIDE; +const char STR_DIFFERENTIAL[] = TR_DIFFERENTIAL; +const char STR_OFFSET[] = TR_OFFSET; +const char STR_TRIM[] = TR_TRIM; +const char STR_DREX[] = TR_DREX; +const char STR_CURVE[] = TR_CURVE; +const char STR_FLMODE[] = TR_FLMODE; +const char STR_MIXWARNING[] = TR_MIXWARNING; +const char STR_OFF[] = TR_OFF; +const char STR_MULTPX[] = TR_MULTPX; +const char STR_DELAYDOWN[] = TR_DELAYDOWN; +const char STR_DELAYUP[] = TR_DELAYUP; +const char STR_SLOWDOWN[] = TR_SLOWDOWN; +const char STR_SLOWUP[] = TR_SLOWUP; +const char STR_MIXER[] = TR_MIXER; +const char STR_CV[] = TR_CV; +const char STR_GV[] = TR_GV; +const char STR_ACHANNEL[] = TR_ACHANNEL; +const char STR_RANGE[] = TR_RANGE; +const char STR_CENTER[] = TR_CENTER; +const char STR_BAR[] = TR_BAR; +const char STR_ALARM[] = TR_ALARM; +const char STR_USRDATA[] = TR_USRDATA; +const char STR_BLADES[] = TR_BLADES; +const char STR_SCREEN[] = TR_SCREEN; +const char STR_SOUND_LABEL[] = TR_SOUND_LABEL; +const char STR_LENGTH[] = TR_LENGTH; +const char STR_BEEP_LENGTH[] = TR_BEEP_LENGTH; #if defined(AUDIO) -const pm_char STR_SPKRPITCH[] PROGMEM = TR_SPKRPITCH; +const char STR_SPKRPITCH[] = TR_SPKRPITCH; #endif #if defined(HAPTIC) -const pm_char STR_HAPTIC_LABEL[] PROGMEM = TR_HAPTIC_LABEL; -const pm_char STR_HAPTICSTRENGTH[] PROGMEM = TR_HAPTICSTRENGTH; +const char STR_HAPTIC_LABEL[] = TR_HAPTIC_LABEL; +const char STR_HAPTICSTRENGTH[] = TR_HAPTICSTRENGTH; #endif -const pm_char STR_CONTRAST[] PROGMEM = TR_CONTRAST; -const pm_char STR_ALARMS_LABEL[] PROGMEM = TR_ALARMS_LABEL; -const pm_char STR_BATTERY_RANGE[] PROGMEM = TR_BATTERY_RANGE; -const pm_char STR_BATTERYWARNING[] PROGMEM = TR_BATTERYWARNING; -const pm_char STR_INACTIVITYALARM[] PROGMEM = TR_INACTIVITYALARM; -const pm_char STR_MEMORYWARNING[] PROGMEM = TR_MEMORYWARNING; -const pm_char STR_ALARMWARNING[] PROGMEM = TR_ALARMWARNING; -const pm_char STR_RSSISHUTDOWNALARM[] PROGMEM = TR_RSSISHUTDOWNALARM; -const pm_char STR_MODEL_STILL_POWERED[] PROGMEM = TR_MODEL_STILL_POWERED; -const pm_char STR_MODEL_SHUTDOWN[] PROGMEM = TR_MODEL_SHUTDOWN; -const pm_char STR_PRESS_ENTER_TO_CONFIRM[] PROGMEM = TR_PRESS_ENTER_TO_CONFIRM; +const char STR_CONTRAST[] = TR_CONTRAST; +const char STR_ALARMS_LABEL[] = TR_ALARMS_LABEL; +const char STR_BATTERY_RANGE[] = TR_BATTERY_RANGE; +const char STR_BATTERYWARNING[] = TR_BATTERYWARNING; +const char STR_INACTIVITYALARM[] = TR_INACTIVITYALARM; +const char STR_MEMORYWARNING[] = TR_MEMORYWARNING; +const char STR_ALARMWARNING[] = TR_ALARMWARNING; +const char STR_RSSISHUTDOWNALARM[] = TR_RSSISHUTDOWNALARM; +const char STR_MODEL_STILL_POWERED[] = TR_MODEL_STILL_POWERED; +const char STR_MODEL_SHUTDOWN[] = TR_MODEL_SHUTDOWN; +const char STR_PRESS_ENTER_TO_CONFIRM[] = TR_PRESS_ENTER_TO_CONFIRM; #if defined(ROTARY_ENCODERS) -const pm_char STR_RENAVIG[] PROGMEM = TR_RENAVIG; +const char STR_RENAVIG[] = TR_RENAVIG; #endif -const pm_char STR_THROTTLEREVERSE[] PROGMEM = TR_THROTTLEREVERSE; -const pm_char STR_TIMER_NAME[] PROGMEM = TR_TIMER_NAME; -const pm_char STR_MINUTEBEEP[] PROGMEM = TR_MINUTEBEEP; -const pm_char STR_BEEPCOUNTDOWN[] PROGMEM = TR_BEEPCOUNTDOWN; -const pm_char STR_PERSISTENT[] PROGMEM = TR_PERSISTENT; -const pm_char STR_BACKLIGHT_LABEL[] PROGMEM = TR_BACKLIGHT_LABEL; -const pm_char STR_BLDELAY[] PROGMEM = TR_BLDELAY; +const char STR_THROTTLEREVERSE[] = TR_THROTTLEREVERSE; +const char STR_TIMER_NAME[] = TR_TIMER_NAME; +const char STR_MINUTEBEEP[] = TR_MINUTEBEEP; +const char STR_BEEPCOUNTDOWN[] = TR_BEEPCOUNTDOWN; +const char STR_PERSISTENT[] = TR_PERSISTENT; +const char STR_BACKLIGHT_LABEL[] = TR_BACKLIGHT_LABEL; +const char STR_BLDELAY[] = TR_BLDELAY; #if defined(PWM_BACKLIGHT) || defined(PCBHORUS) -const pm_char STR_BLONBRIGHTNESS[] PROGMEM = TR_BLONBRIGHTNESS; -const pm_char STR_BLOFFBRIGHTNESS[] PROGMEM = TR_BLOFFBRIGHTNESS; +const char STR_BLONBRIGHTNESS[] = TR_BLONBRIGHTNESS; +const char STR_BLOFFBRIGHTNESS[] = TR_BLOFFBRIGHTNESS; #endif -const pm_char STR_SPLASHSCREEN[] PROGMEM = TR_SPLASHSCREEN; -const pm_char STR_THROTTLEWARNING[] PROGMEM = TR_THROTTLEWARNING; -const pm_char STR_SWITCHWARNING[] PROGMEM = TR_SWITCHWARNING; -const pm_char STR_POTWARNINGSTATE[] PROGMEM = TR_POTWARNINGSTATE; -const pm_char STR_POTWARNING[] PROGMEM = TR_POTWARNING; -const pm_char STR_SLIDERWARNING[] PROGMEM = TR_SLIDERWARNING; +const char STR_SPLASHSCREEN[] = TR_SPLASHSCREEN; +const char STR_THROTTLEWARNING[] = TR_THROTTLEWARNING; +const char STR_SWITCHWARNING[] = TR_SWITCHWARNING; +const char STR_POTWARNINGSTATE[] = TR_POTWARNINGSTATE; +const char STR_POTWARNING[] = TR_POTWARNING; +const char STR_SLIDERWARNING[] = TR_SLIDERWARNING; #ifdef TELEMETRY_FRSKY -const pm_char STR_TIMEZONE[] PROGMEM = TR_TIMEZONE; -const pm_char STR_ADJUST_RTC[] PROGMEM = TR_ADJUST_RTC; -const pm_char STR_GPS[] PROGMEM = TR_GPS; -const pm_char STR_GPSCOORD[] PROGMEM = TR_GPSCOORD; -const pm_char STR_VARIO[] PROGMEM = TR_VARIO; -const pm_char STR_PITCH_AT_ZERO[] PROGMEM = TR_PITCH_AT_ZERO; -const pm_char STR_PITCH_AT_MAX[] PROGMEM = TR_PITCH_AT_MAX; -const pm_char STR_REPEAT_AT_ZERO[] PROGMEM = TR_REPEAT_AT_ZERO; +const char STR_TIMEZONE[] = TR_TIMEZONE; +const char STR_ADJUST_RTC[] = TR_ADJUST_RTC; +const char STR_GPS[] = TR_GPS; +const char STR_GPSCOORD[] = TR_GPSCOORD; +const char STR_VARIO[] = TR_VARIO; +const char STR_PITCH_AT_ZERO[] = TR_PITCH_AT_ZERO; +const char STR_PITCH_AT_MAX[] = TR_PITCH_AT_MAX; +const char STR_REPEAT_AT_ZERO[] = TR_REPEAT_AT_ZERO; #endif -const pm_char STR_RXCHANNELORD[] PROGMEM = TR_RXCHANNELORD; -const pm_char STR_STICKS[] PROGMEM = TR_STICKS; -const pm_char STR_POTS[] PROGMEM = TR_POTS; -const pm_char STR_SWITCHES[] PROGMEM = TR_SWITCHES; -const pm_char STR_SWITCHES_DELAY[] PROGMEM = TR_SWITCHES_DELAY; -const pm_char STR_SLAVE[] PROGMEM = TR_SLAVE; -const pm_char STR_MODESRC[] PROGMEM = TR_MODESRC; -const pm_char STR_MULTIPLIER[] PROGMEM = TR_MULTIPLIER; -const pm_char STR_CAL[] PROGMEM = TR_CAL; -const pm_char STR_VTRIM[] PROGMEM = TR_VTRIM; -const pm_char STR_BG[] PROGMEM = TR_BG; -const pm_char STR_MENUTOSTART[] PROGMEM = TR_MENUTOSTART; -const pm_char STR_SETMIDPOINT[] PROGMEM = TR_SETMIDPOINT; -const pm_char STR_MOVESTICKSPOTS[] PROGMEM = TR_MOVESTICKSPOTS; -const pm_char STR_RXBATT[] PROGMEM = TR_RXBATT; -const pm_char STR_TX[] PROGMEM = TR_TXnRX; -const pm_char STR_ACCEL[] PROGMEM = TR_ACCEL; -const pm_char STR_NODATA[] PROGMEM = TR_NODATA; -const pm_char STR_TOTTM1TM2THRTHP[] PROGMEM = TR_TOTTM1TM2THRTHP; -const pm_char STR_TMR1LATMAXUS[] PROGMEM = TR_TMR1LATMAXUS; -const pm_char STR_TMR1LATMINUS[] PROGMEM = TR_TMR1LATMINUS; -const pm_char STR_TMR1JITTERUS[] PROGMEM = TR_TMR1JITTERUS; -const pm_char STR_TMIXMAXMS[] PROGMEM = TR_TMIXMAXMS; -const pm_char STR_FREESTACKMINB[] PROGMEM = TR_FREESTACKMINB; -const pm_char STR_MENUTORESET[] PROGMEM = TR_MENUTORESET; -const pm_char STR_PPM_TRAINER[] PROGMEM = TR_PPM_TRAINER; -const pm_char STR_CH[] PROGMEM = TR_CH; -const pm_char STR_MODEL[] PROGMEM = TR_MODEL; -const pm_char STR_FP[] PROGMEM = TR_FP; -const pm_char STR_MIX[] PROGMEM = TR_MIX; -const pm_char STR_ALERT[] PROGMEM = TR_ALERT; -const pm_char STR_PRESSANYKEYTOSKIP[] PROGMEM = TR_PRESSANYKEYTOSKIP; -const pm_char STR_THROTTLENOTIDLE[] PROGMEM = TR_THROTTLENOTIDLE; -const pm_char STR_ALARMSDISABLED[] PROGMEM = TR_ALARMSDISABLED; -const pm_char STR_PRESSANYKEY[] PROGMEM = TR_PRESSANYKEY; -const pm_char STR_TRIMS2OFFSETS[] PROGMEM = TR_TRIMS2OFFSETS; -const pm_char STR_OUTPUTS2FAILSAFE[] PROGMEM = TR_OUTPUTS2FAILSAFE; -const pm_char STR_MENURADIOSETUP[] PROGMEM = TR_MENURADIOSETUP; +const char STR_RXCHANNELORD[] = TR_RXCHANNELORD; +const char STR_STICKS[] = TR_STICKS; +const char STR_POTS[] = TR_POTS; +const char STR_SWITCHES[] = TR_SWITCHES; +const char STR_SWITCHES_DELAY[] = TR_SWITCHES_DELAY; +const char STR_SLAVE[] = TR_SLAVE; +const char STR_MODESRC[] = TR_MODESRC; +const char STR_MULTIPLIER[] = TR_MULTIPLIER; +const char STR_CAL[] = TR_CAL; +const char STR_VTRIM[] = TR_VTRIM; +const char STR_BG[] = TR_BG; +const char STR_MENUTOSTART[] = TR_MENUTOSTART; +const char STR_SETMIDPOINT[] = TR_SETMIDPOINT; +const char STR_MOVESTICKSPOTS[] = TR_MOVESTICKSPOTS; +const char STR_RXBATT[] = TR_RXBATT; +const char STR_TX[] = TR_TXnRX; +const char STR_ACCEL[] = TR_ACCEL; +const char STR_NODATA[] = TR_NODATA; +const char STR_TOTTM1TM2THRTHP[] = TR_TOTTM1TM2THRTHP; +const char STR_TMR1LATMAXUS[] = TR_TMR1LATMAXUS; +const char STR_TMR1LATMINUS[] = TR_TMR1LATMINUS; +const char STR_TMR1JITTERUS[] = TR_TMR1JITTERUS; +const char STR_TMIXMAXMS[] = TR_TMIXMAXMS; +const char STR_FREESTACKMINB[] = TR_FREESTACKMINB; +const char STR_MENUTORESET[] = TR_MENUTORESET; +const char STR_PPM_TRAINER[] = TR_PPM_TRAINER; +const char STR_CH[] = TR_CH; +const char STR_MODEL[] = TR_MODEL; +const char STR_FM[] = TR_FM; +const char STR_MIX[] = TR_MIX; +const char STR_ALERT[] = TR_ALERT; +const char STR_PRESSANYKEYTOSKIP[] = TR_PRESSANYKEYTOSKIP; +const char STR_THROTTLENOTIDLE[] = TR_THROTTLENOTIDLE; +const char STR_ALARMSDISABLED[] = TR_ALARMSDISABLED; +const char STR_PRESSANYKEY[] = TR_PRESSANYKEY; +const char STR_TRIMS2OFFSETS[] = TR_TRIMS2OFFSETS; +const char STR_OUTPUTS2FAILSAFE[] = TR_OUTPUTS2FAILSAFE; +const char STR_MENURADIOSETUP[] = TR_MENURADIOSETUP; #if defined(EEPROM) -const pm_char STR_BAD_RADIO_DATA[] PROGMEM = TR_BADEEPROMDATA; -const pm_char STR_STORAGE_FORMAT[] PROGMEM = TR_EEPROMFORMATTING; -const pm_char STR_STORAGE_WARNING[] PROGMEM = TR_EEPROMWARN; -const pm_char STR_EEPROM_CONVERTING[] PROGMEM = TR_EEPROM_CONVERTING; -const pm_char STR_EEPROMLOWMEM[] PROGMEM = TR_EEPROMLOWMEM; -const pm_char STR_EEPROMOVERFLOW[] PROGMEM = TR_EEPROMOVERFLOW; +const char STR_BAD_RADIO_DATA[] = TR_BADEEPROMDATA; +const char STR_STORAGE_FORMAT[] = TR_EEPROMFORMATTING; +const char STR_STORAGE_WARNING[] = TR_EEPROMWARN; +const char STR_EEPROM_CONVERTING[] = TR_EEPROM_CONVERTING; +const char STR_EEPROMLOWMEM[] = TR_EEPROMLOWMEM; +const char STR_EEPROMOVERFLOW[] = TR_EEPROMOVERFLOW; #else -const pm_char STR_BAD_RADIO_DATA[] PROGMEM = TR_BAD_RADIO_DATA; -const pm_char STR_STORAGE_WARNING[] PROGMEM = TR_STORAGE_WARNING; -const pm_char STR_STORAGE_FORMAT[] PROGMEM = TR_STORAGE_FORMAT; +const char STR_BAD_RADIO_DATA[] = TR_BAD_RADIO_DATA; +const char STR_STORAGE_WARNING[] = TR_STORAGE_WARNING; +const char STR_STORAGE_FORMAT[] = TR_STORAGE_FORMAT; #endif -const pm_char STR_FAS_OFFSET[] PROGMEM = TR_FAS_OFFSET; +const char STR_FAS_OFFSET[] = TR_FAS_OFFSET; -const pm_char STR_MENUDATEANDTIME[] PROGMEM = TR_MENUDATEANDTIME; +const char STR_MENUDATEANDTIME[] = TR_MENUDATEANDTIME; -const pm_char STR_MENUTRAINER[] PROGMEM = TR_MENUTRAINER; -const pm_char STR_MENUSPECIALFUNCS[] PROGMEM = TR_MENUSPECIALFUNCS; -const pm_char STR_MENUVERSION[] PROGMEM = TR_MENUVERSION; -const pm_char STR_MENU_RADIO_SWITCHES[] PROGMEM = TR_MENU_RADIO_SWITCHES; -const pm_char STR_MENU_RADIO_ANALOGS[] PROGMEM = TR_MENU_RADIO_ANALOGS; -const pm_char STR_MENUCALIBRATION[] PROGMEM = TR_MENUCALIBRATION; +const char STR_MENUTRAINER[] = TR_MENUTRAINER; +const char STR_MENUSPECIALFUNCS[] = TR_MENUSPECIALFUNCS; +const char STR_MENUVERSION[] = TR_MENUVERSION; +const char STR_MENU_RADIO_SWITCHES[] = TR_MENU_RADIO_SWITCHES; +const char STR_MENU_RADIO_ANALOGS[] = TR_MENU_RADIO_ANALOGS; +const char STR_MENUCALIBRATION[] = TR_MENUCALIBRATION; -const pm_char STR_MENUMODELSEL[] PROGMEM = TR_MENUMODELSEL; -const pm_char STR_MENUSETUP[] PROGMEM = TR_MENUSETUP; -const pm_char STR_MENUFLIGHTMODE[] PROGMEM = TR_MENUFLIGHTMODE; -const pm_char STR_MENUFLIGHTMODES[] PROGMEM = TR_MENUFLIGHTMODES; +const char STR_MENUMODELSEL[] = TR_MENUMODELSEL; +const char STR_MENUSETUP[] = TR_MENUSETUP; +const char STR_MENUFLIGHTMODE[] = TR_MENUFLIGHTMODE; +const char STR_MENUFLIGHTMODES[] = TR_MENUFLIGHTMODES; #ifdef HELI -const pm_char STR_MENUHELISETUP[] PROGMEM = TR_MENUHELISETUP; +const char STR_MENUHELISETUP[] = TR_MENUHELISETUP; #endif -const pm_char STR_MENUINPUTS[] PROGMEM = TR_MENUINPUTS; -const pm_char STR_MENULIMITS[] PROGMEM = TR_MENULIMITS; -const pm_char STR_MENUCURVES[] PROGMEM = TR_MENUCURVES; -const pm_char STR_MENUCURVE[] PROGMEM = TR_MENUCURVE; -const pm_char STR_MENULOGICALSWITCH[] PROGMEM = TR_MENULOGICALSWITCH; -const pm_char STR_MENULOGICALSWITCHES[] PROGMEM = TR_MENULOGICALSWITCHES; -const pm_char STR_MENUCUSTOMFUNC[] PROGMEM = TR_MENUCUSTOMFUNC; +const char STR_MENUINPUTS[] = TR_MENUINPUTS; +const char STR_MENULIMITS[] = TR_MENULIMITS; +const char STR_MENUCURVES[] = TR_MENUCURVES; +const char STR_MENUCURVE[] = TR_MENUCURVE; +const char STR_MENULOGICALSWITCH[] = TR_MENULOGICALSWITCH; +const char STR_MENULOGICALSWITCHES[] = TR_MENULOGICALSWITCHES; +const char STR_MENUCUSTOMFUNC[] = TR_MENUCUSTOMFUNC; #if defined(LUA) -const pm_char STR_MENUCUSTOMSCRIPTS[] PROGMEM = TR_MENUCUSTOMSCRIPTS; +const char STR_MENUCUSTOMSCRIPTS[] = TR_MENUCUSTOMSCRIPTS; #endif #if defined(TELEMETRY_FRSKY) -const pm_char STR_MENUTELEMETRY[] PROGMEM = TR_MENUTELEMETRY; -const pm_char STR_LIMIT[] PROGMEM = TR_LIMIT; +const char STR_MENUTELEMETRY[] = TR_MENUTELEMETRY; +const char STR_LIMIT[] = TR_LIMIT; #endif -const pm_char STR_MENUSTAT[] PROGMEM = TR_MENUSTAT; -const pm_char STR_MENUDEBUG[] PROGMEM = TR_MENUDEBUG; +const char STR_MENUSTAT[] = TR_MENUSTAT; +const char STR_MENUDEBUG[] = TR_MENUDEBUG; const char * const STR_MONITOR_CHANNELS[] = { TR_MONITOR_CHANNELS1, TR_MONITOR_CHANNELS2, TR_MONITOR_CHANNELS3, TR_MONITOR_CHANNELS4 }; -const pm_char STR_MONITOR_SWITCHES[] PROGMEM = TR_MONITOR_SWITCHES; -const pm_char STR_MONITOR_OUTPUT_DESC[] PROGMEM = TR_MONITOR_OUTPUT_DESC; -const pm_char STR_MONITOR_MIXER_DESC[] PROGMEM = TR_MONITOR_MIXER_DESC; -const pm_char STR_MENUGLOBALVARS[] PROGMEM = TR_MENUGLOBALVARS; +const char STR_MONITOR_SWITCHES[] = TR_MONITOR_SWITCHES; +const char STR_MONITOR_OUTPUT_DESC[] = TR_MONITOR_OUTPUT_DESC; +const char STR_MONITOR_MIXER_DESC[] = TR_MONITOR_MIXER_DESC; +const char STR_MENUGLOBALVARS[] = TR_MENUGLOBALVARS; #if defined(DSM2) || defined(PXX) -const pm_char STR_RECEIVER_NUM[] PROGMEM = TR_RECEIVER_NUM; -const pm_char STR_RECEIVER[] PROGMEM = TR_RECEIVER; -const pm_char STR_REBIND[] PROGMEM = TR_REBIND; +const char STR_RECEIVER_NUM[] = TR_RECEIVER_NUM; +const char STR_RECEIVER[] = TR_RECEIVER; +const char STR_REBIND[] = TR_REBIND; #endif -const pm_char STR_SYNCMENU[] PROGMEM = TR_SYNCMENU; -const pm_char STR_INTERNALRF[] PROGMEM = TR_INTERNALRF; -const pm_char STR_EXTERNALRF[] PROGMEM = TR_EXTERNALRF; -const pm_char STR_MODULE_TELEMETRY[] PROGMEM = TR_MODULE_TELEMETRY; -const pm_char STR_MODULE_TELEM_ON[] PROGMEM = TR_MODULE_TELEM_ON; -const pm_char STR_COUNTRYCODE[] PROGMEM = TR_COUNTRYCODE; -const pm_char STR_USBMODE[] PROGMEM = TR_USBMODE; -const pm_char STR_FAILSAFE[] PROGMEM = TR_FAILSAFE; -const pm_char STR_FAILSAFESET[] PROGMEM = TR_FAILSAFESET; -const pm_char STR_HOLD[] PROGMEM = TR_HOLD; -const pm_char STR_NONE[] PROGMEM = TR_NONE; -const pm_char STR_MENUSENSOR[] PROGMEM = TR_MENUSENSOR; -const pm_char STR_SENSOR[] PROGMEM = TR_SENSOR; -const pm_char STR_DISABLE_INTERNAL[] PROGMEM = TR_DISABLE_INTERNAL; +const char STR_SYNCMENU[] = TR_SYNCMENU; +const char STR_INTERNALRF[] = TR_INTERNALRF; +const char STR_EXTERNALRF[] = TR_EXTERNALRF; +const char STR_MODULE_TELEMETRY[] = TR_MODULE_TELEMETRY; +const char STR_MODULE_TELEM_ON[] = TR_MODULE_TELEM_ON; +const char STR_COUNTRYCODE[] = TR_COUNTRYCODE; +const char STR_USBMODE[] = TR_USBMODE; +const char STR_FAILSAFE[] = TR_FAILSAFE; +const char STR_FAILSAFESET[] = TR_FAILSAFESET; +const char STR_HOLD[] = TR_HOLD; +const char STR_NONE[] = TR_NONE; +const char STR_MENUSENSOR[] = TR_MENUSENSOR; +const char STR_SENSOR[] = TR_SENSOR; +const char STR_DISABLE_INTERNAL[] = TR_DISABLE_INTERNAL; -const pm_char STR_INVERT_THR[] PROGMEM = TR_INVERT_THR; -const pm_char STR_AND_SWITCH[] PROGMEM = TR_AND_SWITCH; -const pm_char STR_SF[] PROGMEM = TR_SF; -const pm_char STR_GF[] PROGMEM = TR_GF; +const char STR_INVERT_THR[] = TR_INVERT_THR; +const char STR_AND_SWITCH[] = TR_AND_SWITCH; +const char STR_SF[] = TR_SF; +const char STR_GF[] = TR_GF; -#if defined(FRSKY_HUB) -const pm_char STR_MINRSSI[] PROGMEM = TR_MINRSSI; -const pm_char STR_LATITUDE[] PROGMEM = TR_LATITUDE; -const pm_char STR_LONGITUDE[] PROGMEM = TR_LONGITUDE; -#endif +const char STR_MINRSSI[] = TR_MINRSSI; +const char STR_LATITUDE[] = TR_LATITUDE; +const char STR_LONGITUDE[] = TR_LONGITUDE; -const pm_char STR_SHUTDOWN[] PROGMEM = TR_SHUTDOWN; -const pm_char STR_SAVEMODEL[] PROGMEM = TR_SAVEMODEL; +const char STR_SHUTDOWN[] = TR_SHUTDOWN; +const char STR_SAVEMODEL[] = TR_SAVEMODEL; #if defined(PCBX9E) -const pm_char STR_POWEROFF[] PROGMEM = TR_POWEROFF; +const char STR_POWEROFF[] = TR_POWEROFF; #endif -const pm_char STR_BATT_CALIB[] PROGMEM = TR_BATT_CALIB; +const char STR_BATT_CALIB[] = TR_BATT_CALIB; -const pm_char STR_VOLTAGE[] PROGMEM = TR_VOLTAGE; -const pm_char STR_CURRENT[] PROGMEM = TR_CURRENT; +const char STR_VOLTAGE[] = TR_VOLTAGE; +const char STR_CURRENT[] = TR_CURRENT; -const pm_char STR_CURRENT_CALIB[] PROGMEM = TR_CURRENT_CALIB; -const pm_char STR_UNITSSYSTEM[] PROGMEM = TR_UNITSSYSTEM; -const pm_char STR_VOICELANG[] PROGMEM = TR_VOICELANG; -const pm_char STR_MODELIDUSED[] PROGMEM = TR_MODELIDUSED; -const pm_char STR_BEEP_VOLUME[] PROGMEM = INDENT TR_BEEP_VOLUME; -const pm_char STR_WAV_VOLUME[] PROGMEM = INDENT TR_WAV_VOLUME; -const pm_char STR_BG_VOLUME[] PROGMEM = INDENT TR_BG_VOLUME; -const pm_char STR_PERSISTENT_MAH[] PROGMEM = TR_PERSISTENT_MAH; +const char STR_CURRENT_CALIB[] = TR_CURRENT_CALIB; +const char STR_UNITSSYSTEM[] = TR_UNITSSYSTEM; +const char STR_VOICELANG[] = TR_VOICELANG; +const char STR_MODELIDUSED[] = TR_MODELIDUSED; +const char STR_BEEP_VOLUME[] = INDENT TR_BEEP_VOLUME; +const char STR_WAV_VOLUME[] = INDENT TR_WAV_VOLUME; +const char STR_BG_VOLUME[] = INDENT TR_BG_VOLUME; +const char STR_PERSISTENT_MAH[] = TR_PERSISTENT_MAH; #if defined(NAVIGATION_MENUS) -const pm_char STR_SELECT_MODEL[] PROGMEM = TR_SELECT_MODEL; -const pm_char STR_CREATE_CATEGORY[] PROGMEM = TR_CREATE_CATEGORY; -const pm_char STR_RENAME_CATEGORY[] PROGMEM = TR_RENAME_CATEGORY; -const pm_char STR_DELETE_CATEGORY[] PROGMEM = TR_DELETE_CATEGORY; -const pm_char STR_CREATE_MODEL[] PROGMEM = TR_CREATE_MODEL; -const pm_char STR_DUPLICATE_MODEL[] PROGMEM = TR_DUPLICATE_MODEL; -const pm_char STR_COPY_MODEL[] PROGMEM = TR_COPY_MODEL; -const pm_char STR_MOVE_MODEL[] PROGMEM = TR_MOVE_MODEL; -const pm_char STR_DELETE_MODEL[] PROGMEM = TR_DELETE_MODEL; -const pm_char STR_EDIT[] PROGMEM = TR_EDIT; -const pm_char STR_INSERT_BEFORE[] PROGMEM = TR_INSERT_BEFORE; -const pm_char STR_INSERT_AFTER[] PROGMEM = TR_INSERT_AFTER; -const pm_char STR_COPY[] PROGMEM = TR_COPY; -const pm_char STR_MOVE[] PROGMEM = TR_MOVE; -const pm_char STR_PASTE[] PROGMEM = TR_PASTE; -const pm_char STR_INSERT[] PROGMEM = TR_INSERT; -const pm_char STR_DELETE[] PROGMEM = TR_DELETE; -const pm_char STR_RESET_FLIGHT[] PROGMEM = TR_RESET_FLIGHT; -const pm_char STR_RESET_TIMER1[] PROGMEM = TR_RESET_TIMER1; -const pm_char STR_RESET_TIMER2[] PROGMEM = TR_RESET_TIMER2; -const pm_char STR_RESET_TIMER3[] PROGMEM = TR_RESET_TIMER3; -const pm_char STR_RESET_TELEMETRY[] PROGMEM = TR_RESET_TELEMETRY; -const pm_char STR_STATISTICS[] PROGMEM = TR_STATISTICS; -const pm_char STR_ABOUT_US[] PROGMEM = TR_ABOUT_US; -const pm_char STR_USB_JOYSTICK[] PROGMEM = TR_USB_JOYSTICK; -const pm_char STR_USB_MASS_STORAGE[] PROGMEM = TR_USB_MASS_STORAGE; -const pm_char STR_USB_SERIAL[] PROGMEM = TR_USB_SERIAL; -const pm_char STR_SETUP_SCREENS[] PROGMEM = TR_SETUP_SCREENS; -const pm_char STR_MONITOR_SCREENS[] PROGMEM = TR_MONITOR_SCREENS; +const char STR_SELECT_MODEL[] = TR_SELECT_MODEL; +const char STR_CREATE_CATEGORY[] = TR_CREATE_CATEGORY; +const char STR_RENAME_CATEGORY[] = TR_RENAME_CATEGORY; +const char STR_DELETE_CATEGORY[] = TR_DELETE_CATEGORY; +const char STR_CREATE_MODEL[] = TR_CREATE_MODEL; +const char STR_DUPLICATE_MODEL[] = TR_DUPLICATE_MODEL; +const char STR_COPY_MODEL[] = TR_COPY_MODEL; +const char STR_MOVE_MODEL[] = TR_MOVE_MODEL; +const char STR_DELETE_MODEL[] = TR_DELETE_MODEL; +const char STR_EDIT[] = TR_EDIT; +const char STR_INSERT_BEFORE[] = TR_INSERT_BEFORE; +const char STR_INSERT_AFTER[] = TR_INSERT_AFTER; +const char STR_COPY[] = TR_COPY; +const char STR_MOVE[] = TR_MOVE; +const char STR_PASTE[] = TR_PASTE; +const char STR_INSERT[] = TR_INSERT; +const char STR_DELETE[] = TR_DELETE; +const char STR_RESET_FLIGHT[] = TR_RESET_FLIGHT; +const char STR_RESET_TIMER1[] = TR_RESET_TIMER1; +const char STR_RESET_TIMER2[] = TR_RESET_TIMER2; +const char STR_RESET_TIMER3[] = TR_RESET_TIMER3; +const char STR_RESET_TELEMETRY[] = TR_RESET_TELEMETRY; +const char STR_STATISTICS[] = TR_STATISTICS; +const char STR_ABOUT_US[] = TR_ABOUT_US; +const char STR_USB_JOYSTICK[] = TR_USB_JOYSTICK; +const char STR_USB_MASS_STORAGE[] = TR_USB_MASS_STORAGE; +const char STR_USB_SERIAL[] = TR_USB_SERIAL; +const char STR_SETUP_SCREENS[] = TR_SETUP_SCREENS; +const char STR_MONITOR_SCREENS[] = TR_MONITOR_SCREENS; #endif #if defined(MULTIMODULE) -const pm_char STR_MULTI_CUSTOM[] PROGMEM = TR_MULTI_CUSTOM; -const pm_char STR_MULTI_RFTUNE[] PROGMEM = TR_MULTI_RFTUNE; -const pm_char STR_MULTI_TELEMETRY[] PROGMEM = TR_MULTI_TELEMETRY; -const pm_char STR_MULTI_VIDFREQ[] PROGMEM = TR_MULTI_VIDFREQ; -const pm_char STR_MULTI_OPTION[] PROGMEM = TR_MULTI_OPTION; -const pm_char STR_MULTI_AUTOBIND[] PROGMEM = TR_MULTI_AUTOBIND; -const pm_char STR_MULTI_DSM_AUTODTECT[] PROGMEM = TR_MULTI_DSM_AUTODTECT; -const pm_char STR_MULTI_LOWPOWER[] PROGMEM = TR_MULTI_LOWPOWER; -const pm_char STR_MODULE_NO_SERIAL_MODE[] PROGMEM = TR_MODULE_NO_SERIAL_MODE; -const pm_char STR_MODULE_NO_INPUT[] PROGMEM = TR_MODULE_NO_INPUT; -const pm_char STR_MODULE_WAITFORBIND[] PROGMEM = TR_MODULE_WAITFORBIND; -const pm_char STR_MODULE_NO_TELEMETRY[] PROGMEM = TR_MODULE_NO_TELEMETRY; -const pm_char STR_MODULE_BINDING[] PROGMEM = TR_MODULE_BINDING; -const pm_char STR_PROTOCOL_INVALID[] PROGMEM = TR_PROTOCOL_INVALID; -const pm_char STR_MODULE_STATUS[] PROGMEM = TR_MODULE_STATUS; -const pm_char STR_MODULE_SYNC[] PROGMEM = TR_MODULE_SYNC; -const pm_char STR_MULTI_SERVOFREQ[] PROGMEM = TR_MULTI_SERVOFREQ; +const char STR_MULTI_CUSTOM[] = TR_MULTI_CUSTOM; +const char STR_MULTI_RFTUNE[] = TR_MULTI_RFTUNE; +const char STR_MULTI_TELEMETRY[] = TR_MULTI_TELEMETRY; +const char STR_MULTI_VIDFREQ[] = TR_MULTI_VIDFREQ; +const char STR_MULTI_OPTION[] = TR_MULTI_OPTION; +const char STR_MULTI_AUTOBIND[] = TR_MULTI_AUTOBIND; +const char STR_MULTI_DSM_AUTODTECT[] = TR_MULTI_DSM_AUTODTECT; +const char STR_MULTI_LOWPOWER[] = TR_MULTI_LOWPOWER; +const char STR_MODULE_NO_SERIAL_MODE[] = TR_MODULE_NO_SERIAL_MODE; +const char STR_MODULE_NO_INPUT[] = TR_MODULE_NO_INPUT; +const char STR_MODULE_WAITFORBIND[] = TR_MODULE_WAITFORBIND; +const char STR_MODULE_NO_TELEMETRY[] = TR_MODULE_NO_TELEMETRY; +const char STR_MODULE_BINDING[] = TR_MODULE_BINDING; +const char STR_PROTOCOL_INVALID[] = TR_PROTOCOL_INVALID; +const char STR_MODULE_STATUS[] = TR_MODULE_STATUS; +const char STR_MODULE_SYNC[] = TR_MODULE_SYNC; +const char STR_MULTI_SERVOFREQ[] = TR_MULTI_SERVOFREQ; #if LCD_W < 212 -const pm_char STR_SUBTYPE[] PROGMEM = TR_SUBTYPE; +const char STR_SUBTYPE[] = TR_SUBTYPE; #endif #endif -const pm_char STR_RESET_BTN[] PROGMEM = TR_RESET_BTN; +const char STR_RESET_BTN[] = TR_RESET_BTN; #if defined(SDCARD) -const pm_char STR_BACKUP_MODEL[] PROGMEM = TR_BACKUP_MODEL; -const pm_char STR_RESTORE_MODEL[] PROGMEM = TR_RESTORE_MODEL; -const pm_char STR_DELETE_ERROR[] PROGMEM = TR_DELETE_ERROR; -const pm_char STR_SDCARD_ERROR[] PROGMEM = TR_SDCARD_ERROR; -const pm_char STR_NO_SDCARD[] PROGMEM = TR_NO_SDCARD; -const pm_char STR_SDCARD_FULL[] PROGMEM = TR_SDCARD_FULL; -const pm_char STR_INCOMPATIBLE[] PROGMEM = TR_INCOMPATIBLE; -const pm_char STR_LOGS_PATH[] PROGMEM = LOGS_PATH; -const pm_char STR_LOGS_EXT[] PROGMEM = LOGS_EXT; -const pm_char STR_MODELS_PATH[] PROGMEM = MODELS_PATH; -const pm_char STR_MODELS_EXT[] PROGMEM = MODELS_EXT; +const char STR_BACKUP_MODEL[] = TR_BACKUP_MODEL; +const char STR_RESTORE_MODEL[] = TR_RESTORE_MODEL; +const char STR_DELETE_ERROR[] = TR_DELETE_ERROR; +const char STR_SDCARD_ERROR[] = TR_SDCARD_ERROR; +const char STR_NO_SDCARD[] = TR_NO_SDCARD; +const char STR_SDCARD_FULL[] = TR_SDCARD_FULL; +const char STR_INCOMPATIBLE[] = TR_INCOMPATIBLE; +const char STR_LOGS_PATH[] = LOGS_PATH; +const char STR_LOGS_EXT[] = LOGS_EXT; +const char STR_MODELS_PATH[] = MODELS_PATH; +const char STR_MODELS_EXT[] = MODELS_EXT; #endif -const pm_char STR_CAT_NOT_EMPTY[] PROGMEM = TR_CAT_NOT_EMPTY; -const pm_char STR_WARNING[] PROGMEM = TR_WARNING; -const pm_char STR_THROTTLEWARN[] PROGMEM = TR_THROTTLEWARN; -const pm_char STR_ALARMSWARN[] PROGMEM = TR_ALARMSWARN; -const pm_char STR_SWITCHWARN[] PROGMEM = TR_SWITCHWARN; -const pm_char STR_FAILSAFEWARN[] PROGMEM = TR_FAILSAFEWARN; +const char STR_CAT_NOT_EMPTY[] = TR_CAT_NOT_EMPTY; +const char STR_WARNING[] = TR_WARNING; +const char STR_THROTTLEWARN[] = TR_THROTTLEWARN; +const char STR_ALARMSWARN[] = TR_ALARMSWARN; +const char STR_SWITCHWARN[] = TR_SWITCHWARN; +const char STR_FAILSAFEWARN[] = TR_FAILSAFEWARN; #if defined(NIGHTLY_BUILD_WARNING) -const pm_char STR_NIGHTLY_WARNING[] PROGMEM = TR_NIGHTLY_WARNING; -const pm_char STR_NIGHTLY_NOTSAFE[] PROGMEM = TR_NIGHTLY_NOTSAFE; +const char STR_NIGHTLY_WARNING[] = TR_NIGHTLY_WARNING; +const char STR_NIGHTLY_NOTSAFE[] = TR_NIGHTLY_NOTSAFE; #endif -const pm_char STR_WRONG_SDCARDVERSION[] PROGMEM = TR_WRONG_SDCARDVERSION; -const pm_char STR_WRONG_PCBREV[] PROGMEM = TR_WRONG_PCBREV; -const pm_char STR_EMERGENCY_MODE[] PROGMEM = TR_EMERGENCY_MODE; -const pm_char STR_PCBREV_ERROR[] PROGMEM = TR_PCBREV_ERROR; -const pm_char STR_NO_FAILSAFE[] PROGMEM = TR_NO_FAILSAFE; -const pm_char STR_KEYSTUCK[] PROGMEM = TR_KEYSTUCK; +const char STR_WRONG_SDCARDVERSION[] = TR_WRONG_SDCARDVERSION; +const char STR_WRONG_PCBREV[] = TR_WRONG_PCBREV; +const char STR_EMERGENCY_MODE[] = TR_EMERGENCY_MODE; +const char STR_PCBREV_ERROR[] = TR_PCBREV_ERROR; +const char STR_NO_FAILSAFE[] = TR_NO_FAILSAFE; +const char STR_KEYSTUCK[] = TR_KEYSTUCK; -const pm_char STR_SPEAKER_VOLUME[] PROGMEM = TR_SPEAKER_VOLUME; -const pm_char STR_LCD[] PROGMEM = TR_LCD; -const pm_char STR_BRIGHTNESS[] PROGMEM = TR_BRIGHTNESS; -const pm_char STR_CPU_TEMP[] PROGMEM = TR_CPU_TEMP; -const pm_char STR_CPU_CURRENT[] PROGMEM = TR_CPU_CURRENT; -const pm_char STR_CPU_MAH[] PROGMEM = TR_CPU_MAH; -const pm_char STR_COPROC[] PROGMEM = TR_COPROC; -const pm_char STR_COPROC_TEMP[] PROGMEM = TR_COPROC_TEMP; -const pm_char STR_TEMPWARNING[] PROGMEM = TR_TEMPWARNING; -const pm_char STR_CAPAWARNING[] PROGMEM = TR_CAPAWARNING; -const pm_char STR_FUNC[] PROGMEM = TR_FUNC; -const pm_char STR_V1[] PROGMEM = TR_V1; -const pm_char STR_V2[] PROGMEM = TR_V2; -const pm_char STR_DURATION[] PROGMEM = TR_DURATION; -const pm_char STR_DELAY[] PROGMEM = TR_DELAY; -const pm_char STR_SD_CARD[] PROGMEM = TR_SD_CARD; -const pm_char STR_SDHC_CARD[] PROGMEM = TR_SDHC_CARD; -const pm_char STR_NO_SOUNDS_ON_SD[] PROGMEM = TR_NO_SOUNDS_ON_SD; -const pm_char STR_NO_MODELS_ON_SD[] PROGMEM = TR_NO_MODELS_ON_SD; -const pm_char STR_NO_BITMAPS_ON_SD[] PROGMEM = TR_NO_BITMAPS_ON_SD; -const pm_char STR_NO_SCRIPTS_ON_SD[] PROGMEM = TR_NO_SCRIPTS_ON_SD; -const pm_char STR_SCRIPT_SYNTAX_ERROR[] PROGMEM = TR_SCRIPT_SYNTAX_ERROR; -const pm_char STR_SCRIPT_PANIC[] PROGMEM = TR_SCRIPT_PANIC; -const pm_char STR_SCRIPT_KILLED[] PROGMEM = TR_SCRIPT_KILLED; -const pm_char STR_SCRIPT_ERROR[] PROGMEM = TR_SCRIPT_ERROR; -const pm_char STR_PLAY_FILE[] PROGMEM = TR_PLAY_FILE; -const pm_char STR_ASSIGN_BITMAP[] PROGMEM = TR_ASSIGN_BITMAP; +const char STR_SPEAKER_VOLUME[] = TR_SPEAKER_VOLUME; +const char STR_LCD[] = TR_LCD; +const char STR_BRIGHTNESS[] = TR_BRIGHTNESS; +const char STR_CPU_TEMP[] = TR_CPU_TEMP; +const char STR_CPU_CURRENT[] = TR_CPU_CURRENT; +const char STR_CPU_MAH[] = TR_CPU_MAH; +const char STR_COPROC[] = TR_COPROC; +const char STR_COPROC_TEMP[] = TR_COPROC_TEMP; +const char STR_TEMPWARNING[] = TR_TEMPWARNING; +const char STR_CAPAWARNING[] = TR_CAPAWARNING; +const char STR_FUNC[] = TR_FUNC; +const char STR_V1[] = TR_V1; +const char STR_V2[] = TR_V2; +const char STR_DURATION[] = TR_DURATION; +const char STR_DELAY[] = TR_DELAY; +const char STR_SD_CARD[] = TR_SD_CARD; +const char STR_SDHC_CARD[] = TR_SDHC_CARD; +const char STR_NO_SOUNDS_ON_SD[] = TR_NO_SOUNDS_ON_SD; +const char STR_NO_MODELS_ON_SD[] = TR_NO_MODELS_ON_SD; +const char STR_NO_BITMAPS_ON_SD[] = TR_NO_BITMAPS_ON_SD; +const char STR_NO_SCRIPTS_ON_SD[] = TR_NO_SCRIPTS_ON_SD; +const char STR_SCRIPT_SYNTAX_ERROR[] = TR_SCRIPT_SYNTAX_ERROR; +const char STR_SCRIPT_PANIC[] = TR_SCRIPT_PANIC; +const char STR_SCRIPT_KILLED[] = TR_SCRIPT_KILLED; +const char STR_SCRIPT_ERROR[] = TR_SCRIPT_ERROR; +const char STR_PLAY_FILE[] = TR_PLAY_FILE; +const char STR_ASSIGN_BITMAP[] = TR_ASSIGN_BITMAP; #if defined(PCBHORUS) -const pm_char STR_ASSIGN_SPLASH[] PROGMEM = TR_ASSIGN_SPLASH; +const char STR_ASSIGN_SPLASH[] = TR_ASSIGN_SPLASH; #endif -const pm_char STR_EXECUTE_FILE[] PROGMEM = TR_EXECUTE_FILE; -const pm_char STR_DELETE_FILE[] PROGMEM = TR_DELETE_FILE; -const pm_char STR_COPY_FILE[] PROGMEM = TR_COPY_FILE; -const pm_char STR_RENAME_FILE[] PROGMEM = TR_RENAME_FILE; -const pm_char STR_SD_INFO[] PROGMEM = TR_SD_INFO; -const pm_char STR_SD_FORMAT[] PROGMEM = TR_SD_FORMAT; -const pm_char STR_REMOVED[] PROGMEM = TR_REMOVED; -const pm_char STR_NA[] PROGMEM = TR_NA; -const pm_char STR_HARDWARE[] PROGMEM = TR_HARDWARE; -const pm_char STR_FORMATTING[] PROGMEM = TR_FORMATTING; -const pm_char STR_TEMP_CALIB[] PROGMEM = TR_TEMP_CALIB; -const pm_char STR_TIME[] PROGMEM = TR_TIME; -const pm_char STR_MAXBAUDRATE[] PROGMEM = TR_MAXBAUDRATE; -const pm_char STR_BAUDRATE[] PROGMEM = TR_BAUDRATE; -const pm_char STR_SD_INFO_TITLE[] PROGMEM = TR_SD_INFO_TITLE; -const pm_char STR_SD_TYPE[] PROGMEM = TR_SD_TYPE; -const pm_char STR_SD_SPEED[] PROGMEM = TR_SD_SPEED; -const pm_char STR_SD_SECTORS[] PROGMEM = TR_SD_SECTORS; -const pm_char STR_SD_SIZE[] PROGMEM = TR_SD_SIZE; -const pm_char STR_TYPE[] PROGMEM = TR_TYPE; -const pm_char STR_GLOBAL_VARS[] PROGMEM = TR_GLOBAL_VARS; -const pm_char STR_GVARS[] PROGMEM = TR_GVARS; -const pm_char STR_GLOBAL_VAR[] PROGMEM = TR_GLOBAL_VAR; -const pm_char STR_OWN[] PROGMEM = TR_OWN; -const pm_char STR_ROTARY_ENCODER[] PROGMEM = TR_ROTARY_ENCODER; -const pm_char STR_DATE[] PROGMEM = TR_DATE; -const pm_char STR_CHANNELS_MONITOR[] PROGMEM = TR_CHANNELS_MONITOR; -const pm_char STR_MIXERS_MONITOR[] PROGMEM = TR_MIXERS_MONITOR; -const pm_char STR_PATH_TOO_LONG[] PROGMEM = TR_PATH_TOO_LONG; -const pm_char STR_VIEW_TEXT[] PROGMEM = TR_VIEW_TEXT; -const pm_char STR_FLASH_BOOTLOADER[] PROGMEM = TR_FLASH_BOOTLOADER; -const pm_char STR_FLASH_INTERNAL_MODULE[] PROGMEM = TR_FLASH_INTERNAL_MODULE; -const pm_char STR_FLASH_EXTERNAL_MODULE[] PROGMEM = TR_FLASH_EXTERNAL_MODULE; -const pm_char STR_FIRMWARE_UPDATE_ERROR[] PROGMEM = TR_FIRMWARE_UPDATE_ERROR; -const pm_char STR_FLASH_EXTERNAL_DEVICE[] PROGMEM = TR_FLASH_EXTERNAL_DEVICE; -const pm_char STR_WRITING[] PROGMEM = TR_WRITING; -const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT; -const pm_char STR_EEBACKUP[] PROGMEM = TR_EEBACKUP; -const pm_char STR_FACTORYRESET[] PROGMEM = TR_FACTORYRESET; -const pm_char STR_CONFIRMRESET[] PROGMEM = TR_CONFIRMRESET; -const pm_char STR_TOO_MANY_LUA_SCRIPTS[] PROGMEM = TR_TO_MANY_LUA_SCRIPTS; -const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR; +const char STR_EXECUTE_FILE[] = TR_EXECUTE_FILE; +const char STR_DELETE_FILE[] = TR_DELETE_FILE; +const char STR_COPY_FILE[] = TR_COPY_FILE; +const char STR_RENAME_FILE[] = TR_RENAME_FILE; +const char STR_SD_INFO[] = TR_SD_INFO; +const char STR_SD_FORMAT[] = TR_SD_FORMAT; +const char STR_REMOVED[] = TR_REMOVED; +const char STR_NA[] = TR_NA; +const char STR_HARDWARE[] = TR_HARDWARE; +const char STR_FORMATTING[] = TR_FORMATTING; +const char STR_TEMP_CALIB[] = TR_TEMP_CALIB; +const char STR_TIME[] = TR_TIME; +const char STR_MAXBAUDRATE[] = TR_MAXBAUDRATE; +const char STR_BAUDRATE[] = TR_BAUDRATE; +const char STR_SD_INFO_TITLE[] = TR_SD_INFO_TITLE; +const char STR_SD_TYPE[] = TR_SD_TYPE; +const char STR_SD_SPEED[] = TR_SD_SPEED; +const char STR_SD_SECTORS[] = TR_SD_SECTORS; +const char STR_SD_SIZE[] = TR_SD_SIZE; +const char STR_TYPE[] = TR_TYPE; +const char STR_GLOBAL_VARS[] = TR_GLOBAL_VARS; +const char STR_GVARS[] = TR_GVARS; +const char STR_GLOBAL_VAR[] = TR_GLOBAL_VAR; +const char STR_OWN[] = TR_OWN; +const char STR_ROTARY_ENCODER[] = TR_ROTARY_ENCODER; +const char STR_DATE[] = TR_DATE; +const char STR_CHANNELS_MONITOR[] = TR_CHANNELS_MONITOR; +const char STR_MIXERS_MONITOR[] = TR_MIXERS_MONITOR; +const char STR_PATH_TOO_LONG[] = TR_PATH_TOO_LONG; +const char STR_VIEW_TEXT[] = TR_VIEW_TEXT; +const char STR_FLASH_BOOTLOADER[] = TR_FLASH_BOOTLOADER; +const char STR_FLASH_INTERNAL_MODULE[] = TR_FLASH_INTERNAL_MODULE; +const char STR_FLASH_EXTERNAL_MODULE[] = TR_FLASH_EXTERNAL_MODULE; +const char STR_FIRMWARE_UPDATE_ERROR[] = TR_FIRMWARE_UPDATE_ERROR; +const char STR_FLASH_EXTERNAL_DEVICE[] = TR_FLASH_EXTERNAL_DEVICE; +const char STR_WRITING[] = TR_WRITING; +const char STR_CONFIRM_FORMAT[] = TR_CONFIRM_FORMAT; +const char STR_EEBACKUP[] = TR_EEBACKUP; +const char STR_FACTORYRESET[] = TR_FACTORYRESET; +const char STR_CONFIRMRESET[] = TR_CONFIRMRESET; +const char STR_TOO_MANY_LUA_SCRIPTS[] = TR_TO_MANY_LUA_SCRIPTS; +const char STR_BLCOLOR[] = TR_BLCOLOR; - const pm_char STR_MODELNAME[] PROGMEM = TR_MODELNAME; - const pm_char STR_PHASENAME[] PROGMEM = TR_PHASENAME; - const pm_char STR_MIXNAME[] PROGMEM = TR_MIXNAME; - const pm_char STR_INPUTNAME[] PROGMEM = TR_INPUTNAME; - const pm_char STR_EXPONAME[] PROGMEM = TR_EXPONAME; + const char STR_MODELNAME[] = TR_MODELNAME; + const char STR_PHASENAME[] = TR_PHASENAME; + const char STR_MIXNAME[] = TR_MIXNAME; + const char STR_INPUTNAME[] = TR_INPUTNAME; + const char STR_EXPONAME[] = TR_EXPONAME; #if LCD_W >= 212 const char * const STR_PHASES_HEADERS[] = TR_PHASES_HEADERS; @@ -574,181 +572,181 @@ const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR; const char * const STR_GVAR_HEADERS[] = TR_GVAR_HEADERS; #endif - const pm_char STR_TRAINER[] PROGMEM = TR_TRAINER; - const pm_char STR_MODULE_BIND[] PROGMEM = TR_MODULE_BIND; - const pm_char STR_BINDING_1_8_TELEM_ON[] PROGMEM = TR_BINDING_CH1_8_TELEM_ON; - const pm_char STR_BINDING_1_8_TELEM_OFF[] PROGMEM = TR_BINDING_CH1_8_TELEM_OFF; - const pm_char STR_BINDING_9_16_TELEM_ON[] PROGMEM = TR_BINDING_CH9_16_TELEM_ON; - const pm_char STR_BINDING_9_16_TELEM_OFF[] PROGMEM = TR_BINDING_CH9_16_TELEM_OFF; - const pm_char STR_CHANNELRANGE[] PROGMEM = TR_CHANNELRANGE; - const pm_char STR_ANTENNASELECTION[] PROGMEM = TR_ANTENNASELECTION; - const pm_char STR_ANTENNACONFIRM1[] PROGMEM = TR_ANTENNACONFIRM1; - const pm_char STR_ANTENNACONFIRM2[] PROGMEM = TR_ANTENNACONFIRM2; - const pm_char STR_SET[] PROGMEM = TR_SET; - const pm_char STR_PREFLIGHT[] PROGMEM = TR_PREFLIGHT; - const pm_char STR_CHECKLIST[] PROGMEM = TR_CHECKLIST; - const pm_char STR_VIEW_NOTES[] PROGMEM = TR_VIEW_NOTES; - const pm_char STR_MODEL_SELECT[] PROGMEM = TR_MODEL_SELECT; - const pm_char STR_RESET_SUBMENU[] PROGMEM = TR_RESET_SUBMENU; - const pm_char STR_LOWALARM[] PROGMEM = TR_LOWALARM; - const pm_char STR_CRITICALALARM[] PROGMEM = TR_CRITICALALARM; - const pm_char STR_RSSIALARM_WARN[] PROGMEM = TR_RSSIALARM_WARN; - const pm_char STR_NO_RSSIALARM[] PROGMEM = TR_NO_RSSIALARM; - const pm_char STR_DISABLE_ALARM[] PROGMEM = TR_DISABLE_ALARM; - const pm_char STR_TELEMETRY_TYPE[] PROGMEM = TR_TELEMETRY_TYPE; - const pm_char STR_TELEMETRY_SENSORS[] PROGMEM = TR_TELEMETRY_SENSORS; - const pm_char STR_VALUE[] PROGMEM = TR_VALUE; - const pm_char STR_TOPLCDTIMER[] PROGMEM = TR_TOPLCDTIMER; - const pm_char STR_UNIT[] PROGMEM = TR_UNIT; - const pm_char STR_TELEMETRY_NEWSENSOR[] PROGMEM = TR_TELEMETRY_NEWSENSOR; - const pm_char STR_ID[] PROGMEM = TR_ID; - const pm_char STR_PRECISION[] PROGMEM = TR_PRECISION; - const pm_char STR_RATIO[] PROGMEM = TR_RATIO; - const pm_char STR_FORMULA[] PROGMEM = TR_FORMULA; - const pm_char STR_CELLINDEX[] PROGMEM = TR_CELLINDEX; - const pm_char STR_LOGS[] PROGMEM = TR_LOGS; - const pm_char STR_OPTIONS[] PROGMEM = TR_OPTIONS; - const pm_char STR_ALTSENSOR[] PROGMEM = TR_ALTSENSOR; - const pm_char STR_CELLSENSOR[] PROGMEM = TR_CELLSENSOR; - const pm_char STR_GPSSENSOR[] PROGMEM = TR_GPSSENSOR; - const pm_char STR_CURRENTSENSOR[] PROGMEM = TR_CURRENTSENSOR; - const pm_char STR_AUTOOFFSET[] PROGMEM = TR_AUTOOFFSET; - const pm_char STR_ONLYPOSITIVE[] PROGMEM = TR_ONLYPOSITIVE; - const pm_char STR_FILTER[] PROGMEM = TR_FILTER; - const pm_char STR_TELEMETRYFULL[] PROGMEM = TR_TELEMETRYFULL; - const pm_char STR_SERVOS_OK[] PROGMEM = TR_SERVOS_OK; - const pm_char STR_SERVOS_KO[] PROGMEM = TR_SERVOS_KO; - const pm_char STR_INVERTED_SERIAL[] PROGMEM = TR_INVERTED_SERIAL; - const pm_char STR_IGNORE_INSTANCE[] PROGMEM = TR_IGNORE_INSTANCE; - const pm_char STR_DISCOVER_SENSORS[] PROGMEM = TR_DISCOVER_SENSORS; - const pm_char STR_STOP_DISCOVER_SENSORS[] PROGMEM = TR_STOP_DISCOVER_SENSORS; - const pm_char STR_DELETE_ALL_SENSORS[] PROGMEM = TR_DELETE_ALL_SENSORS; - const pm_char STR_CONFIRMDELETE[] PROGMEM = TR_CONFIRMDELETE; - const pm_char STR_SELECT_WIDGET[] PROGMEM = TR_SELECT_WIDGET; - const pm_char STR_REMOVE_WIDGET[] PROGMEM = TR_REMOVE_WIDGET; - const pm_char STR_WIDGET_SETTINGS[] PROGMEM = TR_WIDGET_SETTINGS; - const pm_char STR_REMOVE_SCREEN[] PROGMEM = TR_REMOVE_SCREEN; - const pm_char STR_SETUP_WIDGETS[] PROGMEM = TR_SETUP_WIDGETS; - const pm_char STR_USER_INTERFACE[] PROGMEM = TR_USER_INTERFACE; - const pm_char STR_THEME[] PROGMEM = TR_THEME; - const pm_char STR_SETUP[] PROGMEM = TR_SETUP; - const pm_char STR_MAINVIEWX[] PROGMEM = TR_MAINVIEWX; - const pm_char STR_LAYOUT[] PROGMEM = TR_LAYOUT; - const pm_char STR_ADDMAINVIEW[] PROGMEM = TR_ADDMAINVIEW; - const pm_char STR_BACKGROUND_COLOR[] PROGMEM = TR_BACKGROUND_COLOR; - const pm_char STR_MAIN_COLOR[] PROGMEM = TR_MAIN_COLOR; - const pm_char STR_TEXT_VIEWER[] PROGMEM = TR_TEXT_VIEWER; - const pm_char STR_MULTI_RFPOWER[] PROGMEM = TR_MULTI_RFPOWER; + const char STR_TRAINER[] = TR_TRAINER; + const char STR_MODULE_BIND[] = TR_MODULE_BIND; + const char STR_BINDING_1_8_TELEM_ON[] = TR_BINDING_CH1_8_TELEM_ON; + const char STR_BINDING_1_8_TELEM_OFF[] = TR_BINDING_CH1_8_TELEM_OFF; + const char STR_BINDING_9_16_TELEM_ON[] = TR_BINDING_CH9_16_TELEM_ON; + const char STR_BINDING_9_16_TELEM_OFF[] = TR_BINDING_CH9_16_TELEM_OFF; + const char STR_CHANNELRANGE[] = TR_CHANNELRANGE; + const char STR_ANTENNASELECTION[] = TR_ANTENNASELECTION; + const char STR_ANTENNACONFIRM1[] = TR_ANTENNACONFIRM1; + const char STR_ANTENNACONFIRM2[] = TR_ANTENNACONFIRM2; + const char STR_SET[] = TR_SET; + const char STR_PREFLIGHT[] = TR_PREFLIGHT; + const char STR_CHECKLIST[] = TR_CHECKLIST; + const char STR_VIEW_NOTES[] = TR_VIEW_NOTES; + const char STR_MODEL_SELECT[] = TR_MODEL_SELECT; + const char STR_RESET_SUBMENU[] = TR_RESET_SUBMENU; + const char STR_LOWALARM[] = TR_LOWALARM; + const char STR_CRITICALALARM[] = TR_CRITICALALARM; + const char STR_RSSIALARM_WARN[] = TR_RSSIALARM_WARN; + const char STR_NO_RSSIALARM[] = TR_NO_RSSIALARM; + const char STR_DISABLE_ALARM[] = TR_DISABLE_ALARM; + const char STR_TELEMETRY_TYPE[] = TR_TELEMETRY_TYPE; + const char STR_TELEMETRY_SENSORS[] = TR_TELEMETRY_SENSORS; + const char STR_VALUE[] = TR_VALUE; + const char STR_TOPLCDTIMER[] = TR_TOPLCDTIMER; + const char STR_UNIT[] = TR_UNIT; + const char STR_TELEMETRY_NEWSENSOR[] = TR_TELEMETRY_NEWSENSOR; + const char STR_ID[] = TR_ID; + const char STR_PRECISION[] = TR_PRECISION; + const char STR_RATIO[] = TR_RATIO; + const char STR_FORMULA[] = TR_FORMULA; + const char STR_CELLINDEX[] = TR_CELLINDEX; + const char STR_LOGS[] = TR_LOGS; + const char STR_OPTIONS[] = TR_OPTIONS; + const char STR_ALTSENSOR[] = TR_ALTSENSOR; + const char STR_CELLSENSOR[] = TR_CELLSENSOR; + const char STR_GPSSENSOR[] = TR_GPSSENSOR; + const char STR_CURRENTSENSOR[] = TR_CURRENTSENSOR; + const char STR_AUTOOFFSET[] = TR_AUTOOFFSET; + const char STR_ONLYPOSITIVE[] = TR_ONLYPOSITIVE; + const char STR_FILTER[] = TR_FILTER; + const char STR_TELEMETRYFULL[] = TR_TELEMETRYFULL; + const char STR_SERVOS_OK[] = TR_SERVOS_OK; + const char STR_SERVOS_KO[] = TR_SERVOS_KO; + const char STR_INVERTED_SERIAL[] = TR_INVERTED_SERIAL; + const char STR_IGNORE_INSTANCE[] = TR_IGNORE_INSTANCE; + const char STR_DISCOVER_SENSORS[] = TR_DISCOVER_SENSORS; + const char STR_STOP_DISCOVER_SENSORS[] = TR_STOP_DISCOVER_SENSORS; + const char STR_DELETE_ALL_SENSORS[] = TR_DELETE_ALL_SENSORS; + const char STR_CONFIRMDELETE[] = TR_CONFIRMDELETE; + const char STR_SELECT_WIDGET[] = TR_SELECT_WIDGET; + const char STR_REMOVE_WIDGET[] = TR_REMOVE_WIDGET; + const char STR_WIDGET_SETTINGS[] = TR_WIDGET_SETTINGS; + const char STR_REMOVE_SCREEN[] = TR_REMOVE_SCREEN; + const char STR_SETUP_WIDGETS[] = TR_SETUP_WIDGETS; + const char STR_USER_INTERFACE[] = TR_USER_INTERFACE; + const char STR_THEME[] = TR_THEME; + const char STR_SETUP[] = TR_SETUP; + const char STR_MAINVIEWX[] = TR_MAINVIEWX; + const char STR_LAYOUT[] = TR_LAYOUT; + const char STR_ADDMAINVIEW[] = TR_ADDMAINVIEW; + const char STR_BACKGROUND_COLOR[] = TR_BACKGROUND_COLOR; + const char STR_MAIN_COLOR[] = TR_MAIN_COLOR; + const char STR_TEXT_VIEWER[] = TR_TEXT_VIEWER; + const char STR_MULTI_RFPOWER[] = TR_MULTI_RFPOWER; - const pm_char STR_BYTES[] PROGMEM = TR_BYTES; - const pm_char STR_ANTENNAPROBLEM[] PROGMEM = TR_ANTENNAPROBLEM; - const pm_char STR_MODULE[] PROGMEM = TR_MODULE; - const pm_char STR_ENABLE_POPUP[] PROGMEM = TR_ENABLE_POPUP; - const pm_char STR_DISABLE_POPUP[] PROGMEM = TR_DISABLE_POPUP; - const pm_char STR_POPUP[] PROGMEM = TR_POPUP; - const pm_char STR_MIN[] PROGMEM = TR_MIN; - const pm_char STR_MAX[] PROGMEM = TR_MAX; - const pm_char STR_CURVE_PRESET[] PROGMEM = TR_CURVE_PRESET; - const pm_char STR_PRESET[] PROGMEM = TR_PRESET; - const pm_char STR_MIRROR[] PROGMEM = TR_MIRROR; - const pm_char STR_CLEAR[] PROGMEM = TR_CLEAR; - const pm_char STR_RESET[] PROGMEM = TR_RESET; - const pm_char STR_COUNT[] PROGMEM = TR_COUNT; - const pm_char STR_PT[] PROGMEM = TR_PT; - const pm_char STR_PTS[] PROGMEM = TR_PTS; - const pm_char STR_SMOOTH[] PROGMEM = TR_SMOOTH; - const pm_char STR_COPY_STICKS_TO_OFS[] PROGMEM = TR_COPY_STICKS_TO_OFS; - const pm_char STR_COPY_TRIMS_TO_OFS[] PROGMEM = TR_COPY_TRIMS_TO_OFS; - const pm_char STR_INCDEC[] PROGMEM = TR_INCDEC; - const pm_char STR_GLOBALVAR[] PROGMEM = TR_GLOBALVAR; - const pm_char STR_MIXSOURCE[] PROGMEM = TR_MIXSOURCE; - const pm_char STR_CONSTANT[] PROGMEM = TR_CONSTANT; - const pm_char STR_TOP_BAR[] PROGMEM = TR_TOP_BAR; - const pm_char STR_ALTITUDE[] PROGMEM = TR_ALTITUDE; - const pm_char STR_SCALE[] PROGMEM = TR_SCALE; - const pm_char STR_VIEW_CHANNELS[] PROGMEM = TR_VIEW_CHANNELS; - const pm_char STR_UART3MODE[] PROGMEM = TR_UART3MODE; - const pm_char STR_THROTTLE_LABEL[] PROGMEM = TR_THROTTLE_LABEL; - const pm_char STR_SCRIPT[] PROGMEM = TR_SCRIPT; - const pm_char STR_INPUTS[] PROGMEM = TR_INPUTS; - const pm_char STR_OUTPUTS[] PROGMEM = TR_OUTPUTS; - const pm_char STR_MENU_INPUTS[] PROGMEM = TR_MENU_INPUTS; - const pm_char STR_MENU_LUA[] PROGMEM = TR_MENU_LUA; - const pm_char STR_MENU_STICKS[] PROGMEM = TR_MENU_STICKS; - const pm_char STR_MENU_POTS[] PROGMEM = TR_MENU_POTS; - const pm_char STR_MENU_MAX[] PROGMEM = TR_MENU_MAX; - const pm_char STR_MENU_HELI[] PROGMEM = TR_MENU_HELI; - const pm_char STR_MENU_TRIMS[] PROGMEM = TR_MENU_TRIMS; - const pm_char STR_MENU_SWITCHES[] PROGMEM = TR_MENU_SWITCHES; - const pm_char STR_MENU_LOGICAL_SWITCHES[] PROGMEM = TR_MENU_LOGICAL_SWITCHES; - const pm_char STR_MENU_TRAINER[] PROGMEM = TR_MENU_TRAINER; - const pm_char STR_MENU_CHANNELS[] PROGMEM = TR_MENU_CHANNELS; - const pm_char STR_MENU_GVARS[] PROGMEM = TR_MENU_GVARS; - const pm_char STR_MENU_TELEMETRY[] PROGMEM = TR_MENU_TELEMETRY; - const pm_char STR_MENU_DISPLAY[] PROGMEM = TR_MENU_DISPLAY; - const pm_char STR_MENU_OTHER[] PROGMEM = TR_MENU_OTHER; - const pm_char STR_MENU_INVERT[] PROGMEM = TR_MENU_INVERT; - const pm_char STR_JITTER_FILTER[] PROGMEM = TR_JITTER_FILTER; + const char STR_BYTES[] = TR_BYTES; + const char STR_ANTENNAPROBLEM[] = TR_ANTENNAPROBLEM; + const char STR_MODULE[] = TR_MODULE; + const char STR_ENABLE_POPUP[] = TR_ENABLE_POPUP; + const char STR_DISABLE_POPUP[] = TR_DISABLE_POPUP; + const char STR_POPUP[] = TR_POPUP; + const char STR_MIN[] = TR_MIN; + const char STR_MAX[] = TR_MAX; + const char STR_CURVE_PRESET[] = TR_CURVE_PRESET; + const char STR_PRESET[] = TR_PRESET; + const char STR_MIRROR[] = TR_MIRROR; + const char STR_CLEAR[] = TR_CLEAR; + const char STR_RESET[] = TR_RESET; + const char STR_COUNT[] = TR_COUNT; + const char STR_PT[] = TR_PT; + const char STR_PTS[] = TR_PTS; + const char STR_SMOOTH[] = TR_SMOOTH; + const char STR_COPY_STICKS_TO_OFS[] = TR_COPY_STICKS_TO_OFS; + const char STR_COPY_TRIMS_TO_OFS[] = TR_COPY_TRIMS_TO_OFS; + const char STR_INCDEC[] = TR_INCDEC; + const char STR_GLOBALVAR[] = TR_GLOBALVAR; + const char STR_MIXSOURCE[] = TR_MIXSOURCE; + const char STR_CONSTANT[] = TR_CONSTANT; + const char STR_TOP_BAR[] = TR_TOP_BAR; + const char STR_ALTITUDE[] = TR_ALTITUDE; + const char STR_SCALE[] = TR_SCALE; + const char STR_VIEW_CHANNELS[] = TR_VIEW_CHANNELS; + const char STR_UART3MODE[] = TR_UART3MODE; + const char STR_THROTTLE_LABEL[] = TR_THROTTLE_LABEL; + const char STR_SCRIPT[] = TR_SCRIPT; + const char STR_INPUTS[] = TR_INPUTS; + const char STR_OUTPUTS[] = TR_OUTPUTS; + const char STR_MENU_INPUTS[] = TR_MENU_INPUTS; + const char STR_MENU_LUA[] = TR_MENU_LUA; + const char STR_MENU_STICKS[] = TR_MENU_STICKS; + const char STR_MENU_POTS[] = TR_MENU_POTS; + const char STR_MENU_MAX[] = TR_MENU_MAX; + const char STR_MENU_HELI[] = TR_MENU_HELI; + const char STR_MENU_TRIMS[] = TR_MENU_TRIMS; + const char STR_MENU_SWITCHES[] = TR_MENU_SWITCHES; + const char STR_MENU_LOGICAL_SWITCHES[] = TR_MENU_LOGICAL_SWITCHES; + const char STR_MENU_TRAINER[] = TR_MENU_TRAINER; + const char STR_MENU_CHANNELS[] = TR_MENU_CHANNELS; + const char STR_MENU_GVARS[] = TR_MENU_GVARS; + const char STR_MENU_TELEMETRY[] = TR_MENU_TELEMETRY; + const char STR_MENU_DISPLAY[] = TR_MENU_DISPLAY; + const char STR_MENU_OTHER[] = TR_MENU_OTHER; + const char STR_MENU_INVERT[] = TR_MENU_INVERT; + const char STR_JITTER_FILTER[] = TR_JITTER_FILTER; #if MENUS_LOCK == 1 - const pm_char STR_UNLOCKED[] PROGMEM = TR_UNLOCKED; - const pm_char STR_MODS_FORBIDDEN[] PROGMEM = TR_MODS_FORBIDDEN; + const char STR_UNLOCKED[] = TR_UNLOCKED; + const char STR_MODS_FORBIDDEN[] = TR_MODS_FORBIDDEN; #endif #if defined(PCBTARANIS) || defined(DSM2) - const pm_char STR_MODULE_RANGE[] PROGMEM = TR_MODULE_RANGE; + const char STR_MODULE_RANGE[] = TR_MODULE_RANGE; #endif #if defined(BLUETOOTH) - const pm_char STR_BLUETOOTH[] PROGMEM = TR_BLUETOOTH; - const pm_char STR_BLUETOOTH_DISC[] PROGMEM = TR_BLUETOOTH_DISC; - const pm_char STR_BLUETOOTH_INIT[] PROGMEM = TR_BLUETOOTH_INIT; - const pm_char STR_BLUETOOTH_DIST_ADDR[] PROGMEM = TR_BLUETOOTH_DIST_ADDR; - const pm_char STR_BLUETOOTH_LOCAL_ADDR[] PROGMEM = TR_BLUETOOTH_LOCAL_ADDR; - const pm_char STR_BLUETOOTH_PIN_CODE[] PROGMEM = TR_BLUETOOTH_PIN_CODE; + const char STR_BLUETOOTH[] = TR_BLUETOOTH; + const char STR_BLUETOOTH_DISC[] = TR_BLUETOOTH_DISC; + const char STR_BLUETOOTH_INIT[] = TR_BLUETOOTH_INIT; + const char STR_BLUETOOTH_DIST_ADDR[] = TR_BLUETOOTH_DIST_ADDR; + const char STR_BLUETOOTH_LOCAL_ADDR[] = TR_BLUETOOTH_LOCAL_ADDR; + const char STR_BLUETOOTH_PIN_CODE[] = TR_BLUETOOTH_PIN_CODE; #endif - const pm_char STR_ABOUTUS[] PROGMEM = TR_ABOUTUS; - const pm_char STR_ABOUT_OPENTX_1[] PROGMEM = TR_ABOUT_OPENTX_1; - const pm_char STR_ABOUT_OPENTX_2[] PROGMEM = TR_ABOUT_OPENTX_2; - const pm_char STR_ABOUT_OPENTX_3[] PROGMEM = TR_ABOUT_OPENTX_3; - const pm_char STR_ABOUT_OPENTX_4[] PROGMEM = TR_ABOUT_OPENTX_4; - const pm_char STR_ABOUT_OPENTX_5[] PROGMEM = TR_ABOUT_OPENTX_5; + const char STR_ABOUTUS[] = TR_ABOUTUS; + const char STR_ABOUT_OPENTX_1[] = TR_ABOUT_OPENTX_1; + const char STR_ABOUT_OPENTX_2[] = TR_ABOUT_OPENTX_2; + const char STR_ABOUT_OPENTX_3[] = TR_ABOUT_OPENTX_3; + const char STR_ABOUT_OPENTX_4[] = TR_ABOUT_OPENTX_4; + const char STR_ABOUT_OPENTX_5[] = TR_ABOUT_OPENTX_5; - const pm_char STR_ABOUT_BERTRAND_1[] PROGMEM = TR_ABOUT_BERTRAND_1; - const pm_char STR_ABOUT_BERTRAND_2[] PROGMEM = TR_ABOUT_BERTRAND_2; - const pm_char STR_ABOUT_BERTRAND_3[] PROGMEM = TR_ABOUT_BERTRAND_3; + const char STR_ABOUT_BERTRAND_1[] = TR_ABOUT_BERTRAND_1; + const char STR_ABOUT_BERTRAND_2[] = TR_ABOUT_BERTRAND_2; + const char STR_ABOUT_BERTRAND_3[] = TR_ABOUT_BERTRAND_3; - const pm_char STR_ABOUT_MIKE_1[] PROGMEM = TR_ABOUT_MIKE_1; - const pm_char STR_ABOUT_MIKE_2[] PROGMEM = TR_ABOUT_MIKE_2; - const pm_char STR_ABOUT_MIKE_3[] PROGMEM = TR_ABOUT_MIKE_3; - const pm_char STR_ABOUT_MIKE_4[] PROGMEM = TR_ABOUT_MIKE_4; + const char STR_ABOUT_MIKE_1[] = TR_ABOUT_MIKE_1; + const char STR_ABOUT_MIKE_2[] = TR_ABOUT_MIKE_2; + const char STR_ABOUT_MIKE_3[] = TR_ABOUT_MIKE_3; + const char STR_ABOUT_MIKE_4[] = TR_ABOUT_MIKE_4; - const pm_char STR_ABOUT_ROMOLO_1[] PROGMEM = TR_ABOUT_ROMOLO_1; - const pm_char STR_ABOUT_ROMOLO_2[] PROGMEM = TR_ABOUT_ROMOLO_2; - const pm_char STR_ABOUT_ROMOLO_3[] PROGMEM = TR_ABOUT_ROMOLO_3; + const char STR_ABOUT_ROMOLO_1[] = TR_ABOUT_ROMOLO_1; + const char STR_ABOUT_ROMOLO_2[] = TR_ABOUT_ROMOLO_2; + const char STR_ABOUT_ROMOLO_3[] = TR_ABOUT_ROMOLO_3; - const pm_char STR_ABOUT_ANDRE_1[] PROGMEM = TR_ABOUT_ANDRE_1; - const pm_char STR_ABOUT_ANDRE_2[] PROGMEM = TR_ABOUT_ANDRE_2; - const pm_char STR_ABOUT_ANDRE_3[] PROGMEM = TR_ABOUT_ANDRE_3; + const char STR_ABOUT_ANDRE_1[] = TR_ABOUT_ANDRE_1; + const char STR_ABOUT_ANDRE_2[] = TR_ABOUT_ANDRE_2; + const char STR_ABOUT_ANDRE_3[] = TR_ABOUT_ANDRE_3; - const pm_char STR_ABOUT_ROB_1[] PROGMEM = TR_ABOUT_ROB_1; - const pm_char STR_ABOUT_ROB_2[] PROGMEM = TR_ABOUT_ROB_2; + const char STR_ABOUT_ROB_1[] = TR_ABOUT_ROB_1; + const char STR_ABOUT_ROB_2[] = TR_ABOUT_ROB_2; - const pm_char STR_ABOUT_MARTIN_1[] PROGMEM = TR_ABOUT_MARTIN_1; - const pm_char STR_ABOUT_MARTIN_2[] PROGMEM = TR_ABOUT_MARTIN_2; + const char STR_ABOUT_MARTIN_1[] = TR_ABOUT_MARTIN_1; + const char STR_ABOUT_MARTIN_2[] = TR_ABOUT_MARTIN_2; - const pm_char STR_ABOUT_KJELL_1[] PROGMEM = TR_ABOUT_KJELL_1; - const pm_char STR_ABOUT_KJELL_2[] PROGMEM = TR_ABOUT_KJELL_2; - const pm_char STR_ABOUT_KJELL_3[] PROGMEM = TR_ABOUT_KJELL_3; - const pm_char STR_ABOUT_KJELL_4[] PROGMEM = TR_ABOUT_KJELL_4; + const char STR_ABOUT_KJELL_1[] = TR_ABOUT_KJELL_1; + const char STR_ABOUT_KJELL_2[] = TR_ABOUT_KJELL_2; + const char STR_ABOUT_KJELL_3[] = TR_ABOUT_KJELL_3; + const char STR_ABOUT_KJELL_4[] = TR_ABOUT_KJELL_4; - const pm_char STR_ABOUT_HARDWARE_1[] PROGMEM = TR_ABOUT_HARDWARE_1; - const pm_char STR_ABOUT_HARDWARE_2[] PROGMEM = TR_ABOUT_HARDWARE_2; - const pm_char STR_ABOUT_HARDWARE_3[] PROGMEM = TR_ABOUT_HARDWARE_3; + const char STR_ABOUT_HARDWARE_1[] = TR_ABOUT_HARDWARE_1; + const char STR_ABOUT_HARDWARE_2[] = TR_ABOUT_HARDWARE_2; + const char STR_ABOUT_HARDWARE_3[] = TR_ABOUT_HARDWARE_3; - const pm_char STR_ABOUT_PARENTS_1[] PROGMEM = TR_ABOUT_PARENTS_1; - const pm_char STR_ABOUT_PARENTS_2[] PROGMEM = TR_ABOUT_PARENTS_2; - const pm_char STR_ABOUT_PARENTS_3[] PROGMEM = TR_ABOUT_PARENTS_3; - const pm_char STR_ABOUT_PARENTS_4[] PROGMEM = TR_ABOUT_PARENTS_4; + const char STR_ABOUT_PARENTS_1[] = TR_ABOUT_PARENTS_1; + const char STR_ABOUT_PARENTS_2[] = TR_ABOUT_PARENTS_2; + const char STR_ABOUT_PARENTS_3[] = TR_ABOUT_PARENTS_3; + const char STR_ABOUT_PARENTS_4[] = TR_ABOUT_PARENTS_4; diff --git a/radio/src/translations.h b/radio/src/translations.h index ca629f870..b2fa391ec 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -104,7 +104,7 @@ // The non-0-terminated-strings -extern const pm_char STR_OPEN9X[]; +extern const char STR_OPEN9X[]; #define OFS_OFFON 0 #define OFS_MMMINV (OFS_OFFON + sizeof(TR_OFFON)) @@ -311,12 +311,12 @@ extern const pm_char STR_OPEN9X[]; #define STR_VANTENNATYPES (STR_OPEN9X + OFS_VANTENNATYPES) #if defined(BLUETOOTH) - extern const pm_char STR_BLUETOOTH[]; -extern const pm_char STR_BLUETOOTH_DISC[]; -extern const pm_char STR_BLUETOOTH_INIT[]; -extern const pm_char STR_BLUETOOTH_DIST_ADDR[]; -extern const pm_char STR_BLUETOOTH_LOCAL_ADDR[]; - extern const pm_char STR_BLUETOOTH_PIN_CODE[]; + extern const char STR_BLUETOOTH[]; +extern const char STR_BLUETOOTH_DISC[]; +extern const char STR_BLUETOOTH_INIT[]; +extern const char STR_BLUETOOTH_DIST_ADDR[]; +extern const char STR_BLUETOOTH_LOCAL_ADDR[]; + extern const char STR_BLUETOOTH_PIN_CODE[]; #define STR_BLUETOOTH_MODES (STR_OPEN9X + OFS_BLUETOOTH_MODES) #endif @@ -324,293 +324,291 @@ extern const pm_char STR_BLUETOOTH_LOCAL_ADDR[]; // The 0-terminated-strings #define NO_INDENT(x) (x)+LEN_INDENT -extern const pm_char STR_POPUPS[]; +extern const char STR_POPUPS[]; #if defined(OFS_EXIT) #define STR_EXIT (STR_POPUPS + OFS_EXIT) #else - extern const pm_char STR_EXIT[]; + extern const char STR_EXIT[]; #endif #if !defined(PCBHORUS) - extern const pm_char STR_MENUWHENDONE[]; + extern const char STR_MENUWHENDONE[]; #endif -extern const pm_char STR_FREE[]; +extern const char STR_FREE[]; #define LEN_FREE PSIZE(TR_FREE) -extern const pm_char STR_DELETEMODEL[]; -extern const pm_char STR_COPYINGMODEL[]; -extern const pm_char STR_MOVINGMODEL[]; -extern const pm_char STR_LOADINGMODEL[]; -extern const pm_char STR_NAME[]; -extern const pm_char STR_BITMAP[]; -extern const pm_char STR_TIMER[]; -extern const pm_char STR_ELIMITS[]; -extern const pm_char STR_ETRIMS[]; -extern const pm_char STR_TRIMINC[]; -extern const pm_char STR_DISPLAY_TRIMS[]; -extern const pm_char STR_TTRACE[]; -extern const pm_char STR_TTRIM[]; -extern const pm_char STR_BEEPCTR[]; -extern const pm_char STR_USE_GLOBAL_FUNCS[]; +extern const char STR_DELETEMODEL[]; +extern const char STR_COPYINGMODEL[]; +extern const char STR_MOVINGMODEL[]; +extern const char STR_LOADINGMODEL[]; +extern const char STR_NAME[]; +extern const char STR_BITMAP[]; +extern const char STR_TIMER[]; +extern const char STR_ELIMITS[]; +extern const char STR_ETRIMS[]; +extern const char STR_TRIMINC[]; +extern const char STR_DISPLAY_TRIMS[]; +extern const char STR_TTRACE[]; +extern const char STR_TTRIM[]; +extern const char STR_BEEPCTR[]; +extern const char STR_USE_GLOBAL_FUNCS[]; #if defined(PCBSKY9X) && defined(REVX) - extern const pm_char STR_OUTPUT_TYPE[]; + extern const char STR_OUTPUT_TYPE[]; #endif -extern const pm_char STR_PROTO[]; -extern const pm_char STR_PPMFRAME[]; -extern const pm_char STR_REFRESHRATE[]; -extern const pm_char SSTR_WARN_BATTVOLTAGE[]; -extern const pm_char STR_MS[]; -extern const pm_char STR_SWITCH[]; -extern const pm_char STR_TRIMS[]; -extern const pm_char STR_FADEIN[]; -extern const pm_char STR_FADEOUT[]; -extern const pm_char STR_DEFAULT[]; -extern const pm_char STR_CHECKTRIMS[]; -extern const pm_char STR_SWASHTYPE[]; -extern const pm_char STR_COLLECTIVE[]; -extern const pm_char STR_AILERON[]; -extern const pm_char STR_ELEVATOR[]; -extern const pm_char STR_SWASHRING[]; -extern const pm_char STR_ELEDIRECTION[]; -extern const pm_char STR_AILDIRECTION[]; -extern const pm_char STR_COLDIRECTION[]; -extern const pm_char STR_MODE[]; +extern const char STR_PROTO[]; +extern const char STR_PPMFRAME[]; +extern const char STR_REFRESHRATE[]; +extern const char SSTR_WARN_BATTVOLTAGE[]; +extern const char STR_MS[]; +extern const char STR_SWITCH[]; +extern const char STR_TRIMS[]; +extern const char STR_FADEIN[]; +extern const char STR_FADEOUT[]; +extern const char STR_DEFAULT[]; +extern const char STR_CHECKTRIMS[]; +extern const char STR_SWASHTYPE[]; +extern const char STR_COLLECTIVE[]; +extern const char STR_AILERON[]; +extern const char STR_ELEVATOR[]; +extern const char STR_SWASHRING[]; +extern const char STR_ELEDIRECTION[]; +extern const char STR_AILDIRECTION[]; +extern const char STR_COLDIRECTION[]; +extern const char STR_MODE[]; #if defined(AUDIO) && defined(BUZZER) -extern const pm_char STR_SPEAKER[]; -extern const pm_char STR_BUZZER[]; +extern const char STR_SPEAKER[]; +extern const char STR_BUZZER[]; #else #define STR_SPEAKER STR_MODE #define STR_BUZZER STR_MODE #endif -extern const pm_char STR_NOFREEEXPO[]; -extern const pm_char STR_NOFREEMIXER[]; -extern const pm_char STR_SOURCE[]; -extern const pm_char STR_WEIGHT[]; -extern const pm_char STR_EXPO[]; -extern const pm_char STR_SIDE[]; -extern const pm_char STR_DIFFERENTIAL[]; -extern const pm_char STR_OFFSET[]; -extern const pm_char STR_TRIM[]; -extern const pm_char STR_DREX[]; -extern const pm_char STR_CURVE[]; -extern const pm_char STR_FLMODE[]; -extern const pm_char STR_MIXWARNING[]; -extern const pm_char STR_OFF[]; -extern const pm_char STR_MULTPX[]; -extern const pm_char STR_DELAYDOWN[]; -extern const pm_char STR_DELAYUP[]; -extern const pm_char STR_SLOWDOWN[]; -extern const pm_char STR_SLOWUP[]; -extern const pm_char STR_MIXER[]; -extern const pm_char STR_CV[]; -extern const pm_char STR_GV[]; -extern const pm_char STR_ACHANNEL[]; -extern const pm_char STR_RANGE[]; -extern const pm_char STR_CENTER[]; -extern const pm_char STR_BAR[]; -extern const pm_char STR_ALARM[]; -extern const pm_char STR_USRDATA[]; -extern const pm_char STR_BLADES[]; -extern const pm_char STR_SCREEN[]; -extern const pm_char STR_SOUND_LABEL[]; -extern const pm_char STR_LENGTH[]; -extern const pm_char STR_BEEP_LENGTH[]; -extern const pm_char STR_BEEP_LENGTH[]; -extern const pm_char STR_SPKRPITCH[]; -extern const pm_char STR_HAPTIC_LABEL[]; -extern const pm_char STR_HAPTICSTRENGTH[]; -extern const pm_char STR_CONTRAST[]; -extern const pm_char STR_ALARMS_LABEL[]; -extern const pm_char STR_BATTERY_RANGE[]; -extern const pm_char STR_BATTERYWARNING[]; -extern const pm_char STR_INACTIVITYALARM[]; -extern const pm_char STR_MEMORYWARNING[]; -extern const pm_char STR_ALARMWARNING[]; -extern const pm_char STR_RSSISHUTDOWNALARM[]; -extern const pm_char STR_MODEL_STILL_POWERED[]; -extern const pm_char STR_MODEL_SHUTDOWN[]; -extern const pm_char STR_PRESS_ENTER_TO_CONFIRM[]; -extern const pm_char STR_RENAVIG[]; -extern const pm_char STR_THROTTLEREVERSE[]; -extern const pm_char STR_TIMER_NAME[]; -extern const pm_char STR_MINUTEBEEP[]; -extern const pm_char STR_BEEPCOUNTDOWN[]; -extern const pm_char STR_PERSISTENT[]; -extern const pm_char STR_BACKLIGHT_LABEL[]; -extern const pm_char STR_BLDELAY[]; +extern const char STR_NOFREEEXPO[]; +extern const char STR_NOFREEMIXER[]; +extern const char STR_SOURCE[]; +extern const char STR_WEIGHT[]; +extern const char STR_EXPO[]; +extern const char STR_SIDE[]; +extern const char STR_DIFFERENTIAL[]; +extern const char STR_OFFSET[]; +extern const char STR_TRIM[]; +extern const char STR_DREX[]; +extern const char STR_CURVE[]; +extern const char STR_FLMODE[]; +extern const char STR_MIXWARNING[]; +extern const char STR_OFF[]; +extern const char STR_MULTPX[]; +extern const char STR_DELAYDOWN[]; +extern const char STR_DELAYUP[]; +extern const char STR_SLOWDOWN[]; +extern const char STR_SLOWUP[]; +extern const char STR_MIXER[]; +extern const char STR_CV[]; +extern const char STR_GV[]; +extern const char STR_ACHANNEL[]; +extern const char STR_RANGE[]; +extern const char STR_CENTER[]; +extern const char STR_BAR[]; +extern const char STR_ALARM[]; +extern const char STR_USRDATA[]; +extern const char STR_BLADES[]; +extern const char STR_SCREEN[]; +extern const char STR_SOUND_LABEL[]; +extern const char STR_LENGTH[]; +extern const char STR_BEEP_LENGTH[]; +extern const char STR_BEEP_LENGTH[]; +extern const char STR_SPKRPITCH[]; +extern const char STR_HAPTIC_LABEL[]; +extern const char STR_HAPTICSTRENGTH[]; +extern const char STR_CONTRAST[]; +extern const char STR_ALARMS_LABEL[]; +extern const char STR_BATTERY_RANGE[]; +extern const char STR_BATTERYWARNING[]; +extern const char STR_INACTIVITYALARM[]; +extern const char STR_MEMORYWARNING[]; +extern const char STR_ALARMWARNING[]; +extern const char STR_RSSISHUTDOWNALARM[]; +extern const char STR_MODEL_STILL_POWERED[]; +extern const char STR_MODEL_SHUTDOWN[]; +extern const char STR_PRESS_ENTER_TO_CONFIRM[]; +extern const char STR_RENAVIG[]; +extern const char STR_THROTTLEREVERSE[]; +extern const char STR_TIMER_NAME[]; +extern const char STR_MINUTEBEEP[]; +extern const char STR_BEEPCOUNTDOWN[]; +extern const char STR_PERSISTENT[]; +extern const char STR_BACKLIGHT_LABEL[]; +extern const char STR_BLDELAY[]; #if defined(PWM_BACKLIGHT) || defined(PCBHORUS) -extern const pm_char STR_BLONBRIGHTNESS[]; -extern const pm_char STR_BLOFFBRIGHTNESS[]; +extern const char STR_BLONBRIGHTNESS[]; +extern const char STR_BLOFFBRIGHTNESS[]; #endif -extern const pm_char STR_SPLASHSCREEN[]; -extern const pm_char STR_THROTTLEWARNING[]; -extern const pm_char STR_SWITCHWARNING[]; -extern const pm_char STR_POTWARNINGSTATE[]; -extern const pm_char STR_POTWARNING[]; -extern const pm_char STR_SLIDERWARNING[]; -extern const pm_char STR_TIMEZONE[]; -extern const pm_char STR_ADJUST_RTC[]; -extern const pm_char STR_GPS[]; -extern const pm_char STR_GPSCOORD[]; -extern const pm_char STR_VARIO[]; -extern const pm_char STR_PITCH_AT_ZERO[]; -extern const pm_char STR_PITCH_AT_MAX[]; -extern const pm_char STR_REPEAT_AT_ZERO[]; -extern const pm_char STR_RXCHANNELORD[]; -extern const pm_char STR_STICKS[]; -extern const pm_char STR_POTS[]; -extern const pm_char STR_SWITCHES[]; -extern const pm_char STR_SWITCHES_DELAY[]; -extern const pm_char STR_SLAVE[]; -extern const pm_char STR_MODESRC[]; -extern const pm_char STR_MULTIPLIER[]; +extern const char STR_SPLASHSCREEN[]; +extern const char STR_THROTTLEWARNING[]; +extern const char STR_SWITCHWARNING[]; +extern const char STR_POTWARNINGSTATE[]; +extern const char STR_POTWARNING[]; +extern const char STR_SLIDERWARNING[]; +extern const char STR_TIMEZONE[]; +extern const char STR_ADJUST_RTC[]; +extern const char STR_GPS[]; +extern const char STR_GPSCOORD[]; +extern const char STR_VARIO[]; +extern const char STR_PITCH_AT_ZERO[]; +extern const char STR_PITCH_AT_MAX[]; +extern const char STR_REPEAT_AT_ZERO[]; +extern const char STR_RXCHANNELORD[]; +extern const char STR_STICKS[]; +extern const char STR_POTS[]; +extern const char STR_SWITCHES[]; +extern const char STR_SWITCHES_DELAY[]; +extern const char STR_SLAVE[]; +extern const char STR_MODESRC[]; +extern const char STR_MULTIPLIER[]; #define LEN_MULTIPLIER PSIZE(TR_MULTIPLIER) -extern const pm_char STR_CAL[]; -extern const pm_char STR_VTRIM[]; -extern const pm_char STR_BG[]; -extern const pm_char STR_MENUTOSTART[]; -extern const pm_char STR_SETMIDPOINT[]; -extern const pm_char STR_MOVESTICKSPOTS[]; -extern const pm_char STR_RXBATT[]; -extern const pm_char STR_TX[]; +extern const char STR_CAL[]; +extern const char STR_VTRIM[]; +extern const char STR_BG[]; +extern const char STR_MENUTOSTART[]; +extern const char STR_SETMIDPOINT[]; +extern const char STR_MOVESTICKSPOTS[]; +extern const char STR_RXBATT[]; +extern const char STR_TX[]; #define STR_RX (STR_TX+OFS_RX) -extern const pm_char STR_ACCEL[]; -extern const pm_char STR_NODATA[]; -extern const pm_char STR_TOTTM1TM2THRTHP[]; -extern const pm_char STR_TMR1LATMAXUS[]; -extern const pm_char STR_TMR1LATMINUS[]; -extern const pm_char STR_TMR1JITTERUS[]; -extern const pm_char STR_TMIXMAXMS[]; -extern const pm_char STR_FREESTACKMINB[]; -extern const pm_char STR_MENUTORESET[]; -extern const pm_char STR_PPM_TRAINER[]; -extern const pm_char STR_CH[]; -extern const pm_char STR_MODEL[]; -extern const pm_char STR_FP[]; -extern const pm_char STR_MIX[]; -extern const pm_char STR_EEPROMLOWMEM[]; -extern const pm_char STR_ALERT[]; -extern const pm_char STR_PRESSANYKEYTOSKIP[]; -extern const pm_char STR_THROTTLENOTIDLE[]; -extern const pm_char STR_ALARMSDISABLED[]; -extern const pm_char STR_PRESSANYKEY[]; +extern const char STR_ACCEL[]; +extern const char STR_NODATA[]; +extern const char STR_TOTTM1TM2THRTHP[]; +extern const char STR_TMR1LATMAXUS[]; +extern const char STR_TMR1LATMINUS[]; +extern const char STR_TMR1JITTERUS[]; +extern const char STR_TMIXMAXMS[]; +extern const char STR_FREESTACKMINB[]; +extern const char STR_MENUTORESET[]; +extern const char STR_PPM_TRAINER[]; +extern const char STR_CH[]; +extern const char STR_MODEL[]; +extern const char STR_FM[]; +extern const char STR_MIX[]; +extern const char STR_EEPROMLOWMEM[]; +extern const char STR_ALERT[]; +extern const char STR_PRESSANYKEYTOSKIP[]; +extern const char STR_THROTTLENOTIDLE[]; +extern const char STR_ALARMSDISABLED[]; +extern const char STR_PRESSANYKEY[]; #define LEN_PRESSANYKEY PSIZE(TR_PRESSANYKEY) -extern const pm_char STR_BAD_RADIO_DATA[]; -extern const pm_char STR_STORAGE_FORMAT[]; -extern const pm_char STR_EEPROMOVERFLOW[]; -extern const pm_char STR_TRIMS2OFFSETS[]; -extern const pm_char STR_OUTPUTS2FAILSAFE[]; -extern const pm_char STR_MENURADIOSETUP[]; -extern const pm_char STR_MENUDATEANDTIME[]; -extern const pm_char STR_MENUTRAINER[]; -extern const pm_char STR_MENUSPECIALFUNCS[]; -extern const pm_char STR_MENUVERSION[]; -extern const pm_char STR_MENU_RADIO_SWITCHES[]; -extern const pm_char STR_MENU_RADIO_ANALOGS[]; -extern const pm_char STR_MENUCALIBRATION[]; -extern const pm_char STR_MENUMODELSEL[]; -extern const pm_char STR_MENUSETUP[]; -extern const pm_char STR_MENUFLIGHTMODE[]; -extern const pm_char STR_MENUFLIGHTMODES[]; -extern const pm_char STR_MENUHELISETUP[]; -extern const pm_char STR_MENUINPUTS[]; -extern const pm_char STR_MENULIMITS[]; -extern const pm_char STR_MENUCURVES[]; -extern const pm_char STR_MENUCURVE[]; -extern const pm_char STR_MENULOGICALSWITCH[]; -extern const pm_char STR_MENULOGICALSWITCHES[]; -extern const pm_char STR_MENUCUSTOMFUNC[]; -extern const pm_char STR_MENUCUSTOMSCRIPTS[]; -extern const pm_char STR_MENUTELEMETRY[]; -extern const pm_char STR_MENUTEMPLATES[]; -extern const pm_char STR_MENUSTAT[]; -extern const pm_char STR_MENUDEBUG[]; +extern const char STR_BAD_RADIO_DATA[]; +extern const char STR_STORAGE_FORMAT[]; +extern const char STR_EEPROMOVERFLOW[]; +extern const char STR_TRIMS2OFFSETS[]; +extern const char STR_OUTPUTS2FAILSAFE[]; +extern const char STR_MENURADIOSETUP[]; +extern const char STR_MENUDATEANDTIME[]; +extern const char STR_MENUTRAINER[]; +extern const char STR_MENUSPECIALFUNCS[]; +extern const char STR_MENUVERSION[]; +extern const char STR_MENU_RADIO_SWITCHES[]; +extern const char STR_MENU_RADIO_ANALOGS[]; +extern const char STR_MENUCALIBRATION[]; +extern const char STR_MENUMODELSEL[]; +extern const char STR_MENUSETUP[]; +extern const char STR_MENUFLIGHTMODE[]; +extern const char STR_MENUFLIGHTMODES[]; +extern const char STR_MENUHELISETUP[]; +extern const char STR_MENUINPUTS[]; +extern const char STR_MENULIMITS[]; +extern const char STR_MENUCURVES[]; +extern const char STR_MENUCURVE[]; +extern const char STR_MENULOGICALSWITCH[]; +extern const char STR_MENULOGICALSWITCHES[]; +extern const char STR_MENUCUSTOMFUNC[]; +extern const char STR_MENUCUSTOMSCRIPTS[]; +extern const char STR_MENUTELEMETRY[]; +extern const char STR_MENUTEMPLATES[]; +extern const char STR_MENUSTAT[]; +extern const char STR_MENUDEBUG[]; extern const char * const STR_MONITOR_CHANNELS[]; -extern const pm_char STR_MONITOR_SWITCHES[]; -extern const pm_char STR_MONITOR_OUTPUT_DESC[]; -extern const pm_char STR_MONITOR_MIXER_DESC[]; -extern const pm_char STR_MENUGLOBALVARS[]; -extern const pm_char STR_INVERT_THR[]; -extern const pm_char STR_AND_SWITCH[]; -extern const pm_char STR_SF[]; -extern const pm_char STR_GF[]; +extern const char STR_MONITOR_SWITCHES[]; +extern const char STR_MONITOR_OUTPUT_DESC[]; +extern const char STR_MONITOR_MIXER_DESC[]; +extern const char STR_MENUGLOBALVARS[]; +extern const char STR_INVERT_THR[]; +extern const char STR_AND_SWITCH[]; +extern const char STR_SF[]; +extern const char STR_GF[]; -extern const pm_char STR_FAS_OFFSET[]; +extern const char STR_FAS_OFFSET[]; #if defined(MULTIMODULE) -extern const pm_char STR_MULTI_CUSTOM[]; -extern const pm_char STR_MULTI_OPTION[]; -extern const pm_char STR_MULTI_VIDFREQ[]; -extern const pm_char STR_MULTI_RFTUNE[]; -extern const pm_char STR_MULTI_TELEMETRY[]; -extern const pm_char STR_MULTI_AUTOBIND[]; -extern const pm_char STR_MULTI_DSM_AUTODTECT[]; -extern const pm_char STR_MULTI_LOWPOWER[]; -extern const pm_char STR_MODULE_NO_SERIAL_MODE[]; -extern const pm_char STR_MODULE_NO_INPUT[]; -extern const pm_char STR_MODULE_WAITFORBIND[]; -extern const pm_char STR_MODULE_NO_TELEMETRY[]; -extern const pm_char STR_MODULE_BINDING[]; -extern const pm_char STR_PROTOCOL_INVALID[]; -extern const pm_char STR_MODULE_STATUS[]; -extern const pm_char STR_MODULE_SYNC[]; -extern const pm_char STR_MULTI_SERVOFREQ[]; +extern const char STR_MULTI_CUSTOM[]; +extern const char STR_MULTI_OPTION[]; +extern const char STR_MULTI_VIDFREQ[]; +extern const char STR_MULTI_RFTUNE[]; +extern const char STR_MULTI_TELEMETRY[]; +extern const char STR_MULTI_AUTOBIND[]; +extern const char STR_MULTI_DSM_AUTODTECT[]; +extern const char STR_MULTI_LOWPOWER[]; +extern const char STR_MODULE_NO_SERIAL_MODE[]; +extern const char STR_MODULE_NO_INPUT[]; +extern const char STR_MODULE_WAITFORBIND[]; +extern const char STR_MODULE_NO_TELEMETRY[]; +extern const char STR_MODULE_BINDING[]; +extern const char STR_PROTOCOL_INVALID[]; +extern const char STR_MODULE_STATUS[]; +extern const char STR_MODULE_SYNC[]; +extern const char STR_MULTI_SERVOFREQ[]; #if LCD_W < 212 -extern const pm_char STR_SUBTYPE[]; +extern const char STR_SUBTYPE[]; #endif #endif #if defined(DSM2) || defined(PXX) -extern const pm_char STR_RECEIVER_NUM[]; -extern const pm_char STR_RECEIVER[]; -extern const pm_char STR_REBIND[]; +extern const char STR_RECEIVER_NUM[]; +extern const char STR_RECEIVER[]; +extern const char STR_REBIND[]; #endif -extern const pm_char STR_SYNCMENU[]; -extern const pm_char STR_INTERNALRF[]; -extern const pm_char STR_EXTERNALRF[]; -extern const pm_char STR_MODULE_TELEMETRY[]; -extern const pm_char STR_MODULE_TELEM_ON[]; -extern const pm_char STR_FAILSAFE[]; -extern const pm_char STR_FAILSAFESET[]; -extern const pm_char STR_HOLD[]; -extern const pm_char STR_NONE[]; -extern const pm_char STR_MENUSENSOR[]; -extern const pm_char STR_SENSOR[]; -extern const pm_char STR_COUNTRYCODE[]; -extern const pm_char STR_USBMODE[]; -extern const pm_char STR_DISABLE_INTERNAL[]; +extern const char STR_SYNCMENU[]; +extern const char STR_INTERNALRF[]; +extern const char STR_EXTERNALRF[]; +extern const char STR_MODULE_TELEMETRY[]; +extern const char STR_MODULE_TELEM_ON[]; +extern const char STR_FAILSAFE[]; +extern const char STR_FAILSAFESET[]; +extern const char STR_HOLD[]; +extern const char STR_NONE[]; +extern const char STR_MENUSENSOR[]; +extern const char STR_SENSOR[]; +extern const char STR_COUNTRYCODE[]; +extern const char STR_USBMODE[]; +extern const char STR_DISABLE_INTERNAL[]; #if defined(TELEMETRY_FRSKY) -extern const pm_char STR_LIMIT[]; +extern const char STR_LIMIT[]; #endif -#ifdef FRSKY_HUB -extern const pm_char STR_MINRSSI[]; -extern const pm_char STR_LATITUDE[]; -extern const pm_char STR_LONGITUDE[]; -#endif +extern const char STR_MINRSSI[]; +extern const char STR_LATITUDE[]; +extern const char STR_LONGITUDE[]; -extern const pm_char STR_SHUTDOWN[]; -extern const pm_char STR_SAVEMODEL[]; +extern const char STR_SHUTDOWN[]; +extern const char STR_SAVEMODEL[]; #if defined(PCBX9E) -extern const pm_char STR_POWEROFF[]; +extern const char STR_POWEROFF[]; #endif -extern const pm_char STR_BATT_CALIB[]; +extern const char STR_BATT_CALIB[]; -extern const pm_char STR_VOLTAGE[]; -extern const pm_char STR_CURRENT[]; +extern const char STR_VOLTAGE[]; +extern const char STR_CURRENT[]; -extern const pm_char STR_CURRENT_CALIB[]; -extern const pm_char STR_UNITSSYSTEM[]; -extern const pm_char STR_VOICELANG[]; -extern const pm_char STR_MODELIDUSED[]; -extern const pm_char STR_BEEP_VOLUME[]; -extern const pm_char STR_WAV_VOLUME[]; -extern const pm_char STR_BG_VOLUME[]; -extern const pm_char STR_PERSISTENT_MAH[]; +extern const char STR_CURRENT_CALIB[]; +extern const char STR_UNITSSYSTEM[]; +extern const char STR_VOICELANG[]; +extern const char STR_MODELIDUSED[]; +extern const char STR_BEEP_VOLUME[]; +extern const char STR_WAV_VOLUME[]; +extern const char STR_BG_VOLUME[]; +extern const char STR_PERSISTENT_MAH[]; #if defined(PCBSKY9X) #define LEN_CALIB_FIELDS (PSIZE(TR_BATT_CALIB) > PSIZE(TR_CURRENT_CALIB) ? PSIZE(TR_BATT_CALIB) : PSIZE(TR_CURRENT_CALIB)) @@ -619,143 +617,143 @@ extern const pm_char STR_PERSISTENT_MAH[]; #endif #if defined(NAVIGATION_MENUS) - extern const pm_char STR_SELECT_MODEL[]; - extern const pm_char STR_CREATE_CATEGORY[]; - extern const pm_char STR_RENAME_CATEGORY[]; - extern const pm_char STR_DELETE_CATEGORY[]; - extern const pm_char STR_CREATE_MODEL[]; - extern const pm_char STR_DUPLICATE_MODEL[]; - extern const pm_char STR_COPY_MODEL[]; - extern const pm_char STR_MOVE_MODEL[]; - extern const pm_char STR_DELETE_MODEL[]; - extern const pm_char STR_EDIT[]; - extern const pm_char STR_INSERT_BEFORE[]; - extern const pm_char STR_INSERT_AFTER[]; - extern const pm_char STR_COPY[]; - extern const pm_char STR_MOVE[]; - extern const pm_char STR_PASTE[]; - extern const pm_char STR_INSERT[]; - extern const pm_char STR_DELETE[]; - extern const pm_char STR_RESET_FLIGHT[]; - extern const pm_char STR_RESET_TIMER1[]; - extern const pm_char STR_RESET_TIMER2[]; - extern const pm_char STR_RESET_TIMER3[]; - extern const pm_char STR_RESET_TELEMETRY[]; - extern const pm_char STR_STATISTICS[]; - extern const pm_char STR_ABOUT_US[]; - extern const pm_char STR_USB_JOYSTICK[]; - extern const pm_char STR_USB_MASS_STORAGE[]; - extern const pm_char STR_USB_SERIAL[]; - extern const pm_char STR_SETUP_SCREENS[]; - extern const pm_char STR_MONITOR_SCREENS[]; + extern const char STR_SELECT_MODEL[]; + extern const char STR_CREATE_CATEGORY[]; + extern const char STR_RENAME_CATEGORY[]; + extern const char STR_DELETE_CATEGORY[]; + extern const char STR_CREATE_MODEL[]; + extern const char STR_DUPLICATE_MODEL[]; + extern const char STR_COPY_MODEL[]; + extern const char STR_MOVE_MODEL[]; + extern const char STR_DELETE_MODEL[]; + extern const char STR_EDIT[]; + extern const char STR_INSERT_BEFORE[]; + extern const char STR_INSERT_AFTER[]; + extern const char STR_COPY[]; + extern const char STR_MOVE[]; + extern const char STR_PASTE[]; + extern const char STR_INSERT[]; + extern const char STR_DELETE[]; + extern const char STR_RESET_FLIGHT[]; + extern const char STR_RESET_TIMER1[]; + extern const char STR_RESET_TIMER2[]; + extern const char STR_RESET_TIMER3[]; + extern const char STR_RESET_TELEMETRY[]; + extern const char STR_STATISTICS[]; + extern const char STR_ABOUT_US[]; + extern const char STR_USB_JOYSTICK[]; + extern const char STR_USB_MASS_STORAGE[]; + extern const char STR_USB_SERIAL[]; + extern const char STR_SETUP_SCREENS[]; + extern const char STR_MONITOR_SCREENS[]; #endif -extern const pm_char STR_RESET_BTN[]; +extern const char STR_RESET_BTN[]; #if defined(SDCARD) - extern const pm_char STR_BACKUP_MODEL[]; - extern const pm_char STR_RESTORE_MODEL[]; - extern const pm_char STR_DELETE_ERROR[]; - extern const pm_char STR_SDCARD_ERROR[]; - extern const pm_char STR_NO_SDCARD[]; - extern const pm_char STR_SDCARD_FULL[]; - extern const pm_char STR_INCOMPATIBLE[]; - extern const pm_char STR_LOGS_PATH[]; - extern const pm_char STR_LOGS_EXT[]; - extern const pm_char STR_MODELS_PATH[]; - extern const pm_char STR_MODELS_EXT[]; + extern const char STR_BACKUP_MODEL[]; + extern const char STR_RESTORE_MODEL[]; + extern const char STR_DELETE_ERROR[]; + extern const char STR_SDCARD_ERROR[]; + extern const char STR_NO_SDCARD[]; + extern const char STR_SDCARD_FULL[]; + extern const char STR_INCOMPATIBLE[]; + extern const char STR_LOGS_PATH[]; + extern const char STR_LOGS_EXT[]; + extern const char STR_MODELS_PATH[]; + extern const char STR_MODELS_EXT[]; #define STR_UPDATE_LIST STR_DELAYDOWN #endif -extern const pm_char STR_CAT_NOT_EMPTY[]; -extern const pm_char STR_WARNING[]; -extern const pm_char STR_STORAGE_WARNING[]; -extern const pm_char STR_EEPROM_CONVERTING[]; -extern const pm_char STR_THROTTLEWARN[]; -extern const pm_char STR_ALARMSWARN[]; -extern const pm_char STR_SWITCHWARN[]; -extern const pm_char STR_FAILSAFEWARN[]; -extern const pm_char STR_NIGHTLY_WARNING[]; -extern const pm_char STR_NIGHTLY_NOTSAFE[]; -extern const pm_char STR_WRONG_SDCARDVERSION[]; -extern const pm_char STR_WRONG_PCBREV[]; -extern const pm_char STR_EMERGENCY_MODE[]; -extern const pm_char STR_PCBREV_ERROR[]; -extern const pm_char STR_NO_FAILSAFE[]; -extern const pm_char STR_KEYSTUCK[]; +extern const char STR_CAT_NOT_EMPTY[]; +extern const char STR_WARNING[]; +extern const char STR_STORAGE_WARNING[]; +extern const char STR_EEPROM_CONVERTING[]; +extern const char STR_THROTTLEWARN[]; +extern const char STR_ALARMSWARN[]; +extern const char STR_SWITCHWARN[]; +extern const char STR_FAILSAFEWARN[]; +extern const char STR_NIGHTLY_WARNING[]; +extern const char STR_NIGHTLY_NOTSAFE[]; +extern const char STR_WRONG_SDCARDVERSION[]; +extern const char STR_WRONG_PCBREV[]; +extern const char STR_EMERGENCY_MODE[]; +extern const char STR_PCBREV_ERROR[]; +extern const char STR_NO_FAILSAFE[]; +extern const char STR_KEYSTUCK[]; -extern const pm_char STR_SPEAKER_VOLUME[]; -extern const pm_char STR_LCD[]; -extern const pm_char STR_BRIGHTNESS[]; -extern const pm_char STR_CPU_TEMP[]; -extern const pm_char STR_CPU_CURRENT[]; -extern const pm_char STR_CPU_MAH[]; -extern const pm_char STR_COPROC[]; -extern const pm_char STR_COPROC_TEMP[]; -extern const pm_char STR_CAPAWARNING[]; -extern const pm_char STR_TEMPWARNING[]; -extern const pm_char STR_FUNC[]; -extern const pm_char STR_V1[]; -extern const pm_char STR_V2[]; -extern const pm_char STR_DURATION[]; -extern const pm_char STR_DELAY[]; -extern const pm_char STR_SD_CARD[]; -extern const pm_char STR_SDHC_CARD[]; -extern const pm_char STR_NO_SOUNDS_ON_SD[]; -extern const pm_char STR_NO_MODELS_ON_SD[]; -extern const pm_char STR_NO_BITMAPS_ON_SD[]; -extern const pm_char STR_NO_SCRIPTS_ON_SD[]; -extern const pm_char STR_SCRIPT_SYNTAX_ERROR[]; -extern const pm_char STR_SCRIPT_PANIC[]; -extern const pm_char STR_SCRIPT_KILLED[]; -extern const pm_char STR_SCRIPT_ERROR[]; -extern const pm_char STR_PLAY_FILE[]; -extern const pm_char STR_ASSIGN_BITMAP[]; +extern const char STR_SPEAKER_VOLUME[]; +extern const char STR_LCD[]; +extern const char STR_BRIGHTNESS[]; +extern const char STR_CPU_TEMP[]; +extern const char STR_CPU_CURRENT[]; +extern const char STR_CPU_MAH[]; +extern const char STR_COPROC[]; +extern const char STR_COPROC_TEMP[]; +extern const char STR_CAPAWARNING[]; +extern const char STR_TEMPWARNING[]; +extern const char STR_FUNC[]; +extern const char STR_V1[]; +extern const char STR_V2[]; +extern const char STR_DURATION[]; +extern const char STR_DELAY[]; +extern const char STR_SD_CARD[]; +extern const char STR_SDHC_CARD[]; +extern const char STR_NO_SOUNDS_ON_SD[]; +extern const char STR_NO_MODELS_ON_SD[]; +extern const char STR_NO_BITMAPS_ON_SD[]; +extern const char STR_NO_SCRIPTS_ON_SD[]; +extern const char STR_SCRIPT_SYNTAX_ERROR[]; +extern const char STR_SCRIPT_PANIC[]; +extern const char STR_SCRIPT_KILLED[]; +extern const char STR_SCRIPT_ERROR[]; +extern const char STR_PLAY_FILE[]; +extern const char STR_ASSIGN_BITMAP[]; #if defined(PCBHORUS) -extern const pm_char STR_ASSIGN_SPLASH[]; +extern const char STR_ASSIGN_SPLASH[]; #endif -extern const pm_char STR_EXECUTE_FILE[]; -extern const pm_char STR_DELETE_FILE[]; -extern const pm_char STR_COPY_FILE[]; -extern const pm_char STR_RENAME_FILE[]; -extern const pm_char STR_REMOVED[]; -extern const pm_char STR_SD_INFO[]; -extern const pm_char STR_SD_FORMAT[]; -extern const pm_char STR_NA[]; -extern const pm_char STR_HARDWARE[]; -extern const pm_char STR_FORMATTING[]; -extern const pm_char STR_TEMP_CALIB[]; -extern const pm_char STR_TIME[]; -extern const pm_char STR_MAXBAUDRATE[]; -extern const pm_char STR_BAUDRATE[]; -extern const pm_char STR_SD_INFO_TITLE[]; -extern const pm_char STR_SD_TYPE[]; -extern const pm_char STR_SD_SPEED[]; -extern const pm_char STR_SD_SECTORS[]; -extern const pm_char STR_SD_SIZE[]; -extern const pm_char STR_TYPE[]; -extern const pm_char STR_GLOBAL_VARS[]; -extern const pm_char STR_GVARS[]; -extern const pm_char STR_GLOBAL_VAR[]; -extern const pm_char STR_OWN[]; -extern const pm_char STR_ROTARY_ENCODER[]; -extern const pm_char STR_DATE[]; -extern const pm_char STR_CHANNELS_MONITOR[]; -extern const pm_char STR_MIXERS_MONITOR[]; -extern const pm_char STR_PATH_TOO_LONG[]; -extern const pm_char STR_VIEW_TEXT[]; -extern const pm_char STR_FLASH_BOOTLOADER[]; -extern const pm_char STR_FLASH_EXTERNAL_DEVICE[]; -extern const pm_char STR_FLASH_INTERNAL_MODULE[]; -extern const pm_char STR_FLASH_EXTERNAL_MODULE[]; -extern const pm_char STR_FIRMWARE_UPDATE_ERROR[]; -extern const pm_char STR_WRITING[]; -extern const pm_char STR_CONFIRM_FORMAT[]; -extern const pm_char STR_EEBACKUP[]; -extern const pm_char STR_FACTORYRESET[]; -extern const pm_char STR_CONFIRMRESET[]; -extern const pm_char STR_TOO_MANY_LUA_SCRIPTS[]; -extern const pm_char STR_BLCOLOR[]; +extern const char STR_EXECUTE_FILE[]; +extern const char STR_DELETE_FILE[]; +extern const char STR_COPY_FILE[]; +extern const char STR_RENAME_FILE[]; +extern const char STR_REMOVED[]; +extern const char STR_SD_INFO[]; +extern const char STR_SD_FORMAT[]; +extern const char STR_NA[]; +extern const char STR_HARDWARE[]; +extern const char STR_FORMATTING[]; +extern const char STR_TEMP_CALIB[]; +extern const char STR_TIME[]; +extern const char STR_MAXBAUDRATE[]; +extern const char STR_BAUDRATE[]; +extern const char STR_SD_INFO_TITLE[]; +extern const char STR_SD_TYPE[]; +extern const char STR_SD_SPEED[]; +extern const char STR_SD_SECTORS[]; +extern const char STR_SD_SIZE[]; +extern const char STR_TYPE[]; +extern const char STR_GLOBAL_VARS[]; +extern const char STR_GVARS[]; +extern const char STR_GLOBAL_VAR[]; +extern const char STR_OWN[]; +extern const char STR_ROTARY_ENCODER[]; +extern const char STR_DATE[]; +extern const char STR_CHANNELS_MONITOR[]; +extern const char STR_MIXERS_MONITOR[]; +extern const char STR_PATH_TOO_LONG[]; +extern const char STR_VIEW_TEXT[]; +extern const char STR_FLASH_BOOTLOADER[]; +extern const char STR_FLASH_EXTERNAL_DEVICE[]; +extern const char STR_FLASH_INTERNAL_MODULE[]; +extern const char STR_FLASH_EXTERNAL_MODULE[]; +extern const char STR_FIRMWARE_UPDATE_ERROR[]; +extern const char STR_WRITING[]; +extern const char STR_CONFIRM_FORMAT[]; +extern const char STR_EEBACKUP[]; +extern const char STR_FACTORYRESET[]; +extern const char STR_CONFIRMRESET[]; +extern const char STR_TOO_MANY_LUA_SCRIPTS[]; +extern const char STR_BLCOLOR[]; struct LanguagePack { const char * id; @@ -807,11 +805,11 @@ extern const pm_char STR_BLCOLOR[]; inline PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t flags) { currentLanguagePack->playNumber(number, unit, flags, id); } inline PLAY_FUNCTION(playDuration, int seconds, uint8_t flags) { currentLanguagePack->playDuration(seconds, flags, id); } - extern const pm_char STR_MODELNAME[]; - extern const pm_char STR_PHASENAME[]; - extern const pm_char STR_MIXNAME[]; - extern const pm_char STR_INPUTNAME[]; - extern const pm_char STR_EXPONAME[]; + extern const char STR_MODELNAME[]; + extern const char STR_PHASENAME[]; + extern const char STR_MIXNAME[]; + extern const char STR_INPUTNAME[]; + extern const char STR_EXPONAME[]; #if defined(COLORLCD) #define TR_PHASES_HEADERS { TR_PHASES_HEADERS_NAME, TR_PHASES_HEADERS_SW, TR_PHASES_HEADERS_RUD_TRIM, TR_PHASES_HEADERS_ELE_TRIM, TR_PHASES_HEADERS_THT_TRIM, TR_PHASES_HEADERS_AIL_TRIM, TR_PHASES_HEADERS_CH5_TRIM, TR_PHASES_HEADERS_CH6_TRIM, TR_PHASES_HEADERS_FAD_IN, TR_PHASES_HEADERS_FAD_OUT } @@ -831,176 +829,176 @@ extern const pm_char STR_BLCOLOR[]; extern const char * const STR_GVAR_HEADERS[]; #endif - extern const pm_char STR_TRAINER[]; - extern const pm_char STR_MODULE_BIND[]; - extern const pm_char STR_BINDING_1_8_TELEM_ON[]; - extern const pm_char STR_BINDING_1_8_TELEM_OFF[]; - extern const pm_char STR_BINDING_9_16_TELEM_ON[]; - extern const pm_char STR_BINDING_9_16_TELEM_OFF[]; - extern const pm_char STR_CHANNELRANGE[]; - extern const pm_char STR_ANTENNASELECTION[]; - extern const pm_char STR_ANTENNACONFIRM1[]; - extern const pm_char STR_ANTENNACONFIRM2[]; - extern const pm_char STR_SET[]; - extern const pm_char STR_PREFLIGHT[]; - extern const pm_char STR_CHECKLIST[]; - extern const pm_char STR_VIEW_NOTES[]; - extern const pm_char STR_MODEL_SELECT[]; - extern const pm_char STR_RESET_SUBMENU[]; - extern const pm_char STR_LOWALARM[]; - extern const pm_char STR_CRITICALALARM[]; - extern const pm_char STR_RSSIALARM_WARN[]; - extern const pm_char STR_NO_RSSIALARM[]; - extern const pm_char STR_DISABLE_ALARM[]; - extern const pm_char STR_TELEMETRY_TYPE[]; - extern const pm_char STR_TELEMETRY_SENSORS[]; - extern const pm_char STR_VALUE[]; - extern const pm_char STR_TOPLCDTIMER[]; - extern const pm_char STR_UNIT[] PROGMEM; - extern const pm_char STR_TELEMETRY_NEWSENSOR[]; - extern const pm_char STR_ID[]; - extern const pm_char STR_PRECISION[]; - extern const pm_char STR_RATIO[]; - extern const pm_char STR_FORMULA[]; - extern const pm_char STR_CELLINDEX[]; - extern const pm_char STR_LOGS[]; - extern const pm_char STR_OPTIONS[]; - extern const pm_char STR_ALTSENSOR[]; - extern const pm_char STR_CELLSENSOR[]; - extern const pm_char STR_GPSSENSOR[]; - extern const pm_char STR_CURRENTSENSOR[]; - extern const pm_char STR_AUTOOFFSET[]; - extern const pm_char STR_ONLYPOSITIVE[]; - extern const pm_char STR_FILTER[]; - extern const pm_char STR_TELEMETRYFULL[]; - extern const pm_char STR_SERVOS_OK[]; - extern const pm_char STR_SERVOS_KO[]; - extern const pm_char STR_INVERTED_SERIAL[]; - extern const pm_char STR_IGNORE_INSTANCE[]; - extern const pm_char STR_DISCOVER_SENSORS[]; - extern const pm_char STR_STOP_DISCOVER_SENSORS[]; - extern const pm_char STR_DELETE_ALL_SENSORS[]; - extern const pm_char STR_CONFIRMDELETE[]; - extern const pm_char STR_SELECT_WIDGET[]; - extern const pm_char STR_REMOVE_WIDGET[]; - extern const pm_char STR_WIDGET_SETTINGS[]; - extern const pm_char STR_REMOVE_SCREEN[]; - extern const pm_char STR_SETUP_WIDGETS[]; - extern const pm_char STR_USER_INTERFACE[]; - extern const pm_char STR_THEME[]; - extern const pm_char STR_SETUP[]; - extern const pm_char STR_MAINVIEWX[]; - extern const pm_char STR_LAYOUT[]; - extern const pm_char STR_ADDMAINVIEW[]; - extern const pm_char STR_BACKGROUND_COLOR[]; - extern const pm_char STR_MAIN_COLOR[]; - extern const pm_char STR_TEXT_VIEWER[]; - extern const pm_char STR_MULTI_RFPOWER[]; + extern const char STR_TRAINER[]; + extern const char STR_MODULE_BIND[]; + extern const char STR_BINDING_1_8_TELEM_ON[]; + extern const char STR_BINDING_1_8_TELEM_OFF[]; + extern const char STR_BINDING_9_16_TELEM_ON[]; + extern const char STR_BINDING_9_16_TELEM_OFF[]; + extern const char STR_CHANNELRANGE[]; + extern const char STR_ANTENNASELECTION[]; + extern const char STR_ANTENNACONFIRM1[]; + extern const char STR_ANTENNACONFIRM2[]; + extern const char STR_SET[]; + extern const char STR_PREFLIGHT[]; + extern const char STR_CHECKLIST[]; + extern const char STR_VIEW_NOTES[]; + extern const char STR_MODEL_SELECT[]; + extern const char STR_RESET_SUBMENU[]; + extern const char STR_LOWALARM[]; + extern const char STR_CRITICALALARM[]; + extern const char STR_RSSIALARM_WARN[]; + extern const char STR_NO_RSSIALARM[]; + extern const char STR_DISABLE_ALARM[]; + extern const char STR_TELEMETRY_TYPE[]; + extern const char STR_TELEMETRY_SENSORS[]; + extern const char STR_VALUE[]; + extern const char STR_TOPLCDTIMER[]; + extern const char STR_UNIT[] ; + extern const char STR_TELEMETRY_NEWSENSOR[]; + extern const char STR_ID[]; + extern const char STR_PRECISION[]; + extern const char STR_RATIO[]; + extern const char STR_FORMULA[]; + extern const char STR_CELLINDEX[]; + extern const char STR_LOGS[]; + extern const char STR_OPTIONS[]; + extern const char STR_ALTSENSOR[]; + extern const char STR_CELLSENSOR[]; + extern const char STR_GPSSENSOR[]; + extern const char STR_CURRENTSENSOR[]; + extern const char STR_AUTOOFFSET[]; + extern const char STR_ONLYPOSITIVE[]; + extern const char STR_FILTER[]; + extern const char STR_TELEMETRYFULL[]; + extern const char STR_SERVOS_OK[]; + extern const char STR_SERVOS_KO[]; + extern const char STR_INVERTED_SERIAL[]; + extern const char STR_IGNORE_INSTANCE[]; + extern const char STR_DISCOVER_SENSORS[]; + extern const char STR_STOP_DISCOVER_SENSORS[]; + extern const char STR_DELETE_ALL_SENSORS[]; + extern const char STR_CONFIRMDELETE[]; + extern const char STR_SELECT_WIDGET[]; + extern const char STR_REMOVE_WIDGET[]; + extern const char STR_WIDGET_SETTINGS[]; + extern const char STR_REMOVE_SCREEN[]; + extern const char STR_SETUP_WIDGETS[]; + extern const char STR_USER_INTERFACE[]; + extern const char STR_THEME[]; + extern const char STR_SETUP[]; + extern const char STR_MAINVIEWX[]; + extern const char STR_LAYOUT[]; + extern const char STR_ADDMAINVIEW[]; + extern const char STR_BACKGROUND_COLOR[]; + extern const char STR_MAIN_COLOR[]; + extern const char STR_TEXT_VIEWER[]; + extern const char STR_MULTI_RFPOWER[]; - extern const pm_char STR_BYTES[]; - extern const pm_char STR_ANTENNAPROBLEM[]; - extern const pm_char STR_MODULE[]; - extern const pm_char STR_ENABLE_POPUP[]; - extern const pm_char STR_DISABLE_POPUP[]; - extern const pm_char STR_POPUP[]; - extern const pm_char STR_MIN[]; - extern const pm_char STR_MAX[]; - extern const pm_char STR_CURVE_PRESET[]; - extern const pm_char STR_PRESET[]; - extern const pm_char STR_MIRROR[]; - extern const pm_char STR_CLEAR[]; - extern const pm_char STR_RESET[]; - extern const pm_char STR_COUNT[]; - extern const pm_char STR_PT[]; - extern const pm_char STR_PTS[]; - extern const pm_char STR_SMOOTH[]; - extern const pm_char STR_COPY_STICKS_TO_OFS[]; - extern const pm_char STR_COPY_TRIMS_TO_OFS[]; - extern const pm_char STR_INCDEC[]; - extern const pm_char STR_GLOBALVAR[]; - extern const pm_char STR_MIXSOURCE[]; - extern const pm_char STR_CONSTANT[]; - extern const pm_char STR_TOP_BAR[]; - extern const pm_char STR_ALTITUDE[]; - extern const pm_char STR_SCALE[]; - extern const pm_char STR_VIEW_CHANNELS[]; - extern const pm_char STR_POTWARNING[]; - extern const pm_char STR_UART3MODE[]; - extern const pm_char STR_THROTTLE_LABEL[]; - extern const pm_char STR_SCRIPT[]; - extern const pm_char STR_INPUTS[]; - extern const pm_char STR_OUTPUTS[]; - extern const pm_char STR_MENU_INPUTS[]; - extern const pm_char STR_MENU_LUA[]; - extern const pm_char STR_MENU_STICKS[]; - extern const pm_char STR_MENU_POTS[]; - extern const pm_char STR_MENU_MAX[]; - extern const pm_char STR_MENU_HELI[]; - extern const pm_char STR_MENU_TRIMS[]; - extern const pm_char STR_MENU_SWITCHES[]; - extern const pm_char STR_MENU_LOGICAL_SWITCHES[]; - extern const pm_char STR_MENU_TRAINER[]; - extern const pm_char STR_MENU_CHANNELS[]; - extern const pm_char STR_MENU_GVARS[]; - extern const pm_char STR_MENU_TELEMETRY[]; - extern const pm_char STR_MENU_DISPLAY[]; - extern const pm_char STR_MENU_OTHER[]; - extern const pm_char STR_MENU_INVERT[]; - extern const pm_char STR_JITTER_FILTER[]; + extern const char STR_BYTES[]; + extern const char STR_ANTENNAPROBLEM[]; + extern const char STR_MODULE[]; + extern const char STR_ENABLE_POPUP[]; + extern const char STR_DISABLE_POPUP[]; + extern const char STR_POPUP[]; + extern const char STR_MIN[]; + extern const char STR_MAX[]; + extern const char STR_CURVE_PRESET[]; + extern const char STR_PRESET[]; + extern const char STR_MIRROR[]; + extern const char STR_CLEAR[]; + extern const char STR_RESET[]; + extern const char STR_COUNT[]; + extern const char STR_PT[]; + extern const char STR_PTS[]; + extern const char STR_SMOOTH[]; + extern const char STR_COPY_STICKS_TO_OFS[]; + extern const char STR_COPY_TRIMS_TO_OFS[]; + extern const char STR_INCDEC[]; + extern const char STR_GLOBALVAR[]; + extern const char STR_MIXSOURCE[]; + extern const char STR_CONSTANT[]; + extern const char STR_TOP_BAR[]; + extern const char STR_ALTITUDE[]; + extern const char STR_SCALE[]; + extern const char STR_VIEW_CHANNELS[]; + extern const char STR_POTWARNING[]; + extern const char STR_UART3MODE[]; + extern const char STR_THROTTLE_LABEL[]; + extern const char STR_SCRIPT[]; + extern const char STR_INPUTS[]; + extern const char STR_OUTPUTS[]; + extern const char STR_MENU_INPUTS[]; + extern const char STR_MENU_LUA[]; + extern const char STR_MENU_STICKS[]; + extern const char STR_MENU_POTS[]; + extern const char STR_MENU_MAX[]; + extern const char STR_MENU_HELI[]; + extern const char STR_MENU_TRIMS[]; + extern const char STR_MENU_SWITCHES[]; + extern const char STR_MENU_LOGICAL_SWITCHES[]; + extern const char STR_MENU_TRAINER[]; + extern const char STR_MENU_CHANNELS[]; + extern const char STR_MENU_GVARS[]; + extern const char STR_MENU_TELEMETRY[]; + extern const char STR_MENU_DISPLAY[]; + extern const char STR_MENU_OTHER[]; + extern const char STR_MENU_INVERT[]; + extern const char STR_JITTER_FILTER[]; #if MENUS_LOCK == 1 - extern const pm_char STR_UNLOCKED[]; - extern const pm_char STR_MODS_FORBIDDEN[]; + extern const char STR_UNLOCKED[]; + extern const char STR_MODS_FORBIDDEN[]; #endif #if defined(PCBTARANIS) || defined(DSM2) - extern const pm_char STR_MODULE_RANGE[]; + extern const char STR_MODULE_RANGE[]; #endif - extern const pm_char STR_ABOUTUS[]; - extern const pm_char STR_ABOUT_OPENTX_1[]; - extern const pm_char STR_ABOUT_OPENTX_2[]; - extern const pm_char STR_ABOUT_OPENTX_3[]; - extern const pm_char STR_ABOUT_OPENTX_4[]; - extern const pm_char STR_ABOUT_OPENTX_5[]; + extern const char STR_ABOUTUS[]; + extern const char STR_ABOUT_OPENTX_1[]; + extern const char STR_ABOUT_OPENTX_2[]; + extern const char STR_ABOUT_OPENTX_3[]; + extern const char STR_ABOUT_OPENTX_4[]; + extern const char STR_ABOUT_OPENTX_5[]; - extern const pm_char STR_ABOUT_BERTRAND_1[]; - extern const pm_char STR_ABOUT_BERTRAND_2[]; - extern const pm_char STR_ABOUT_BERTRAND_3[]; + extern const char STR_ABOUT_BERTRAND_1[]; + extern const char STR_ABOUT_BERTRAND_2[]; + extern const char STR_ABOUT_BERTRAND_3[]; - extern const pm_char STR_ABOUT_MIKE_1[]; - extern const pm_char STR_ABOUT_MIKE_2[]; - extern const pm_char STR_ABOUT_MIKE_3[]; - extern const pm_char STR_ABOUT_MIKE_4[]; + extern const char STR_ABOUT_MIKE_1[]; + extern const char STR_ABOUT_MIKE_2[]; + extern const char STR_ABOUT_MIKE_3[]; + extern const char STR_ABOUT_MIKE_4[]; - extern const pm_char STR_ABOUT_ROMOLO_1[]; - extern const pm_char STR_ABOUT_ROMOLO_2[]; - extern const pm_char STR_ABOUT_ROMOLO_3[]; + extern const char STR_ABOUT_ROMOLO_1[]; + extern const char STR_ABOUT_ROMOLO_2[]; + extern const char STR_ABOUT_ROMOLO_3[]; - extern const pm_char STR_ABOUT_ANDRE_1[]; - extern const pm_char STR_ABOUT_ANDRE_2[]; - extern const pm_char STR_ABOUT_ANDRE_3[]; + extern const char STR_ABOUT_ANDRE_1[]; + extern const char STR_ABOUT_ANDRE_2[]; + extern const char STR_ABOUT_ANDRE_3[]; - extern const pm_char STR_ABOUT_ROB_1[]; - extern const pm_char STR_ABOUT_ROB_2[]; + extern const char STR_ABOUT_ROB_1[]; + extern const char STR_ABOUT_ROB_2[]; - extern const pm_char STR_ABOUT_MARTIN_1[]; - extern const pm_char STR_ABOUT_MARTIN_2[]; + extern const char STR_ABOUT_MARTIN_1[]; + extern const char STR_ABOUT_MARTIN_2[]; - extern const pm_char STR_ABOUT_KJELL_1[]; - extern const pm_char STR_ABOUT_KJELL_2[]; - extern const pm_char STR_ABOUT_KJELL_3[]; - extern const pm_char STR_ABOUT_KJELL_4[]; + extern const char STR_ABOUT_KJELL_1[]; + extern const char STR_ABOUT_KJELL_2[]; + extern const char STR_ABOUT_KJELL_3[]; + extern const char STR_ABOUT_KJELL_4[]; - extern const pm_char STR_ABOUT_HARDWARE_1[]; - extern const pm_char STR_ABOUT_HARDWARE_2[]; - extern const pm_char STR_ABOUT_HARDWARE_3[]; + extern const char STR_ABOUT_HARDWARE_1[]; + extern const char STR_ABOUT_HARDWARE_2[]; + extern const char STR_ABOUT_HARDWARE_3[]; - extern const pm_char STR_ABOUT_PARENTS_1[]; - extern const pm_char STR_ABOUT_PARENTS_2[]; - extern const pm_char STR_ABOUT_PARENTS_3[]; - extern const pm_char STR_ABOUT_PARENTS_4[]; + extern const char STR_ABOUT_PARENTS_1[]; + extern const char STR_ABOUT_PARENTS_2[]; + extern const char STR_ABOUT_PARENTS_3[]; + extern const char STR_ABOUT_PARENTS_4[]; #define CHR_SHORT TR_CHR_SHORT #define CHR_LONG TR_CHR_LONG diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 264407bed..3e96174e1 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -701,7 +701,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODEL" -#define TR_FP "LR" +#define TR_FM "LR" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "Dochází EEPROM" #define TR_ALERT "\006 POZOR" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index f5f82bc8a..b9597aa7f 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -708,7 +708,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODELL" -#define TR_FP "FP" +#define TR_FM "FP" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM voll" #define TR_ALERT "WARNUNG" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 1efe31a16..9bb5ecd6e 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -707,7 +707,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODEL" -#define TR_FP "FM" +#define TR_FM "FM" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM low mem" #define TR_ALERT "\016ALERT" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index d00d56c16..c12dce7b5 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -705,7 +705,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODELO" -#define TR_FP "FM" +#define TR_FM "FM" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM mem.baja" #define TR_ALERT "\016ALERTA" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index ff69d9ae1..659ffc79d 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -697,7 +697,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODEL" -#define TR_FP "FM" +#define TR_FM "FM" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "FINSKA low mem" #define TR_ALERT "\016ALERT" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 540f0191a..c23d05e2b 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -718,7 +718,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODELE" -#define TR_FP "PV" +#define TR_FM "PV" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM pleine!" #define TR_ALERT "\014ALERTE" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 490d7bc82..f503d13c7 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -707,7 +707,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODELLO" -#define TR_FP "FV" +#define TR_FM "FV" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM quasi piena!" #define TR_ALERT "\016ALERT" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index 1c126d8cd..524c45176 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -705,7 +705,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODEL" -#define TR_FP "FM" +#define TR_FM "FM" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM weinig geheugen" #define TR_ALERT "ALARM" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 7c2029a9b..accf211cc 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -708,7 +708,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "KN" #define TR_MODEL "MODEL" -#define TR_FP "FL" +#define TR_FM "FL" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "Niska pamięć EEPROM" #define TR_ALERT "\006UWAGA" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 4e2446310..e8288bb94 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -704,7 +704,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "CH" #define TR_MODEL "MODEL" -#define TR_FP "FP" +#define TR_FM "FP" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "EEPROM BX Memoria" #define TR_ALERT "\016ALERT" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 12af4ddfa..1d5b0386e 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -718,7 +718,7 @@ #define TR_PPM_TRAINER "TR" #define TR_CH "KN" #define TR_MODEL "Modell" -#define TR_FP "FL" +#define TR_FM "FL" #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "Minnesbrist" #define TR_ALERT "\016OBS" diff --git a/radio/util/addtr.py b/radio/util/addtr.py index 77b220c40..adcc2b0b1 100755 --- a/radio/util/addtr.py +++ b/radio/util/addtr.py @@ -25,13 +25,13 @@ def modifyTranslations(constant, translation, after): def modifyDeclaration(constant, after): - newline = "extern const pm_char S" + constant + "[];" + newline = "extern const char S" + constant + "[];" filename = "translations.h" addLine(filename, newline, after + "[];") def modifyDefinition(constant, after): - newline = "const pm_char S" + constant + "[] PROGMEM = " + constant + ";" + newline = "const char S" + constant + "[] = " + constant + ";" filename = "translations.cpp" addLine(filename, newline, after + "[] ") diff --git a/radio/util/img2lbm.py b/radio/util/img2lbm.py index 40d2dc69c..0837738c7 100755 --- a/radio/util/img2lbm.py +++ b/radio/util/img2lbm.py @@ -164,7 +164,6 @@ with open(output_filename, "w") as f: elif what == "4/4/4/4": constant = sys.argv[2].upper()[:-4] values = [] - #f.write("const uint8_t __%s[] __ALIGNED = {\n" % constant) writeSize(f, width, height) for y in range(height): for x in range(width): @@ -179,7 +178,6 @@ with open(output_filename, "w") as f: elif what == "5/6/5": constant = sys.argv[2].upper()[:-4] values = [] - #f.write("const uint8_t __%s[] __ALIGNED = {\n" % constant) writeSize(f, width, height) for y in range(height): for x in range(width): diff --git a/radio/util/parse.py b/radio/util/parse.py index d4ea45f69..b267fe3de 100755 --- a/radio/util/parse.py +++ b/radio/util/parse.py @@ -15,7 +15,7 @@ cw = open(filename + ".stringsc", "w") replacements = {} for line in fr.readlines(): - pos_pstr = line.find("PSTR(\"") + pos_pstr = line.find("\"" MENU = False if pos_pstr < 0: pos_pstr = line.find("MENU(\"") @@ -53,10 +53,10 @@ for line in fr.readlines(): replacements[str_rep] = pstr print(glob_str, "=>", pstr, str_rep) ew.write("#define " + str_rep[1:] + " " * (17 - len(str_rep)) + '"%s"\n' % pstr) - hw.write("extern const PROGMEM char %s[];\n" % str_rep) + hw.write("extern const char %s[];\n" % str_rep) cw.write("const prog_char APM %s[] = %s;\n" % (str_rep, str_rep[1:])) - pos_pstr = line.find("PSTR(\"") + pos_pstr = line.find("\"" fw.write(line) diff --git a/tools/build-companion-nightly.sh b/tools/build-companion-nightly.sh index 9ff167e73..d9c3c3ac0 100755 --- a/tools/build-companion-nightly.sh +++ b/tools/build-companion-nightly.sh @@ -25,7 +25,7 @@ done SRCDIR=$1 OUTDIR=$2 -COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DNIGHTLY_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DGAUGES=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES" +COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DNIGHTLY_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES" if [ "$(uname)" = "Darwin" ]; then COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_PREFIX_PATH=~/Qt/5.7/clang_64/ -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'" fi diff --git a/tools/build-companion-release.sh b/tools/build-companion-release.sh index 87640c968..ca13c47d1 100755 --- a/tools/build-companion-release.sh +++ b/tools/build-companion-release.sh @@ -25,7 +25,7 @@ done SRCDIR=$1 OUTDIR=$2 -COMMON_OPTIONS="-DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DGAUGES=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES" +COMMON_OPTIONS="-DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES" if [ "$(uname)" = "Darwin" ]; then COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_PREFIX_PATH=~/Qt/5.7/clang_64/ -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'" fi diff --git a/tools/commit-tests.sh b/tools/commit-tests.sh index 08d3cec59..223468e4b 100755 --- a/tools/commit-tests.sh +++ b/tools/commit-tests.sh @@ -62,7 +62,7 @@ cd build if [[ " SKY9X ARM9X ALL " =~ " ${FLAVOR} " ]] ; then # OpenTX on Sky9x rm -rf * - cmake ${COMMON_OPTIONS} -DPCB=SKY9X -DHELI=YES DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DGAUGES=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES -DGVARS=YES ${SRCDIR} + cmake ${COMMON_OPTIONS} -DPCB=SKY9X -DHELI=YES DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES -DGVARS=YES ${SRCDIR} make -j${CORES} ${FIRMARE_TARGET} make -j${CORES} libsimulator make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}