#1549 (Firmware part)

This commit is contained in:
bsongis
2014-07-23 17:05:14 +02:00
parent fd84c62ff4
commit 7a85328b86
12 changed files with 24 additions and 19 deletions
+5 -3
View File
@@ -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;
+9 -6
View File
@@ -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)
+1 -1
View File
@@ -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: "
+1 -1
View File
@@ -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:"
+1 -1
View File
@@ -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:"
+1 -1
View File
@@ -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:"
+1 -1
View File
@@ -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:"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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 :"
+1 -1
View File
@@ -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:"
+1 -1
View File
@@ -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:"
+1 -1
View File
@@ -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: "