diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index 91d29a620..07ff6abad 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -1386,9 +1386,9 @@ void menuGeneralHardware(uint8_t event) putsMixerSource(sizeof(TR_TYPE)*FW, y, MIXSRC_FIRST_POT+idx); uint8_t potType = (g_eeGeneral.potsType & mask) >> shift; if (potType == POT_TYPE_NONE && i < 2) - potType = POT_TYPE_POT; + potType = POT_TYPE_DETENT; potType = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_TYPE, STR_POTTYPES, potType, 0, POT_TYPE_MAX, attr, event); - if (potType == POT_TYPE_POT && i < 2) + if (potType == POT_TYPE_DETENT && i < 2) potType = POT_TYPE_NONE; g_eeGeneral.potsType &= ~mask; g_eeGeneral.potsType |= (potType << shift); @@ -1490,7 +1490,9 @@ void menuCommonCalib(uint8_t event) reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]); reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]); if (i >= POT1 && i <= POT_LAST) { - reusableBuffer.calib.midVals[i] = (reusableBuffer.calib.hiVals[i] + reusableBuffer.calib.loVals[i]) / 2; + if (IS_POT_WITHOUT_DETENT(i)) { + reusableBuffer.calib.midVals[i] = (reusableBuffer.calib.hiVals[i] + reusableBuffer.calib.loVals[i]) / 2; + } #if defined(PCBTARANIS) uint8_t idx = i - POT1; int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount; diff --git a/radio/src/opentx.h b/radio/src/opentx.h index c3835284f..b6e3fd3e2 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -348,17 +348,20 @@ extern void boardInit(); enum PotType { POT_TYPE_NONE, - POT_TYPE_POT, + POT_TYPE_DETENT, POT_TYPE_MULTIPOS, - POT_TYPE_MAX=POT_TYPE_MULTIPOS + POT_TYPE_NO_DETENT, + POT_TYPE_MAX=POT_TYPE_NO_DETENT }; #if defined(PCBTARANIS) - #define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE) - #define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS) + #define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE) + #define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS) + #define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT) #else - #define IS_POT_AVAILABLE(x) (true) - #define IS_POT_MULTIPOS(x) (false) + #define IS_POT_AVAILABLE(x) (true) + #define IS_POT_MULTIPOS(x) (false) + #define IS_POT_WITHOUT_DETENT(x) (true) #endif #define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4) diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 94803ee61..f1c0bc06d 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "VYP\0 ""S-Port Mirror\0 ""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "Není\0 ""Potenciometr\0 ""Vícepol. přep.\0" +#define TR_POTTYPES "Není\0 ""Pot with detent""Vícepol. přep.\0""Potenciometr\0" #define LEN_DATETIME "\006" #define TR_DATETIME "DATUM:""ČAS: " diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index cfd045c13..075783c33 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "AUS\0 ""S-Port Data Out\0""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "Kein\0 ""Poti\0 ""Stufen-Schalter " +#define TR_POTTYPES "Kein\0 ""Pot with detent""Stufen-Schalter ""Poti\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""ZEIT:" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index c3afb04b5..841842541 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "OFF\0 ""S-Port Mirror\0 ""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "None\0 ""Pot\0 ""Multipos Switch" +#define TR_POTTYPES "None\0 ""Pot with detent""Multipos Switch""Pot\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""TIME:" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 61cfd17a4..a20840ffc 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "OFF\0 ""S-Port Mirror\0 ""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "None\0 ""Pot\0 ""Multipos Switch" +#define TR_POTTYPES "None\0 ""Pot with detent""Multipos Switch""Pot\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""HORA:" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 86735965e..26ae0c0d2 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "POIS\0 ""S-Port Pelik\0 ""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "None\0 ""Potikka\0 ""Monias. Kytkin\0" +#define TR_POTTYPES "None\0 ""Pot with detent""Monias. Kytkin\0""Potikka\0" #define LEN_DATETIME "\005" #define TR_DATETIME "PÄIV:""AIKA:" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 203fc03cc..7f92160aa 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "OFF\0 ""Recopie S-Port\0""Telemetrie\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "Rien\0 ""Potentiomètre\0 ""Inter multi-pos" +#define TR_POTTYPES "Rien\0 ""Pot avec centre""Inter multi-pos""Potentiomètre\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATE:""HEURE" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 15dcd4d7c..ae57762bc 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "OFF\0 ""Replica Porta-S""Telemetria\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "None\0 ""Potenziometro\0 ""Inter. Multipos" +#define TR_POTTYPES "None\0 ""Pot with detent""Inter. Multipos""Potenziometro\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""ORA :" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index acc0c7d7b..5d60e2e81 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "Wyłącz\0 ""S-Port Mirror\0 ""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "Brak\0 ""Potencjometr\0 ""Przeł.Wielopoz." +#define TR_POTTYPES "Brak\0 ""Pot with detent""Przeł.Wielopoz.""Potencjometr\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""CZAS:" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 1a8266c37..7df048c71 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "OFF\0 ""S-Port Mirror\0 ""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\017" -#define TR_POTTYPES "None\0 ""Pot\0 ""Multipos Switch" +#define TR_POTTYPES "None\0 ""Pot with detent""Multipos Switch""Pot\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DATA:""HORA:" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 7a40b85d6..180ae10c7 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -83,7 +83,7 @@ #define TR_UART3MODES "Av\0 ""Spegling av S-Port""Telemetry\0 ""Debug\0 " #define LEN_POTTYPES "\020" -#define TR_POTTYPES "Ingen\0 ""Potentiometer\0 ""Flerlägesväljare" +#define TR_POTTYPES "Ingen\0 ""Pot with detent""Flerlägesväljare""Potentiometer\0" #define LEN_DATETIME "\005" #define TR_DATETIME "DAG: ""TID: "