From 711b54c98e99ea4b185cd7c7af6a265c7b5c7efd Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 4 Jul 2014 12:22:28 +0200 Subject: [PATCH] Fixes #1436 - Be careful, there is a conversion on M128/gruvin9x boards, L13, L14 and L15 are removed --- companion/src/firmwares/opentx/opentxeeprom.cpp | 2 +- companion/src/firmwares/opentx/opentxinterface.cpp | 9 +++++---- radio/src/myeeprom.h | 8 ++++---- radio/src/translations/cz.h.txt | 2 -- radio/src/translations/de.h.txt | 2 -- radio/src/translations/en.h.txt | 2 -- radio/src/translations/es.h.txt | 2 -- radio/src/translations/fi.h.txt | 2 -- radio/src/translations/fr.h.txt | 2 -- radio/src/translations/it.h.txt | 2 -- radio/src/translations/pl.h.txt | 2 -- radio/src/translations/pt.h.txt | 2 -- radio/src/translations/se.h.txt | 2 -- 13 files changed, 10 insertions(+), 29 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index b549e5a6d..71a5000b3 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -19,7 +19,7 @@ #define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32) #define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16) #define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14)) -#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 15 : 12)) +#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12)) #define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16)) #define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES) #define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5) diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index ee6aabcf1..707b1030a 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -369,10 +369,10 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t break; case BOARD_GRUVIN9X: case BOARD_MEGA2560: - version = 216; + version = 217; break; case BOARD_M128: - version = 216; + version = 217; break; case BOARD_STOCK: version = 216; @@ -561,8 +561,6 @@ int OpenTxFirmware::getCapability(const Capability capability) case LogicalSwitches: if (IS_ARM(board)) return 32; - else if (board==BOARD_GRUVIN9X||board==BOARD_M128) - return 15; else return 12; case CustomAndSwitches: @@ -876,6 +874,9 @@ bool OpenTxEepromInterface::checkVersion(unsigned int version) case 216: // A lot of things (first github release) break; + case 217: + // 3 logical switches removed on M128 / gruvin9x boards + break; default: return false; } diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index ac2e4affe..761300ffe 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -58,10 +58,10 @@ #define EEPROM_VER 216 #define FIRST_CONV_EEPROM_VER 215 #elif defined(CPUM2560) || defined(CPUM2561) - #define EEPROM_VER 216 + #define EEPROM_VER 217 #define FIRST_CONV_EEPROM_VER EEPROM_VER #elif defined(CPUM128) - #define EEPROM_VER 216 + #define EEPROM_VER 217 #else #define EEPROM_VER 216 #endif @@ -108,7 +108,7 @@ #define MAX_FLIGHT_MODES 6 #define MAX_MIXERS 32 #define MAX_EXPOS 16 - #define NUM_LOGICAL_SWITCH 15 // number of custom switches + #define NUM_LOGICAL_SWITCH 12 // number of custom switches #define NUM_CFN 24 // number of functions assigned to switches #define NUM_TRAINER 8 #define NUM_POTS 3 @@ -119,7 +119,7 @@ #define MAX_FLIGHT_MODES 5 #define MAX_MIXERS 32 #define MAX_EXPOS 14 - #define NUM_LOGICAL_SWITCH 15 // number of custom switches + #define NUM_LOGICAL_SWITCH 12 // number of custom switches #define NUM_CFN 24 // number of functions assigned to switches #define NUM_TRAINER 8 #define NUM_POTS 3 diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 49268f082..d298fd593 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index a2e1dc94d..d23d20464 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index fdbc73d84..7e0f0e551 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index b5bff9a6e..c34ea26e1 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 6aa072f44..e7b9a36a4 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 1b2334918..8179d24f6 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 7091fe6cb..ee2b56f72 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 99ef2d339..63e666cf6 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 52ea7c9f8..aaacc802b 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 00a12cc77..fd83af563 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -420,8 +420,6 @@ #if defined(CPUARM) #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" -#elif defined(PCBGRUVIN9X) || defined(CPUM2561) || defined(CPUM128) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15" #else #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" #endif