Issue #588 - S1/S2 Type added in Hardware configuration page

This commit is contained in:
Bertrand Songis
2014-01-31 12:13:46 +01:00
parent 38145a02f4
commit 0446658f4b
10 changed files with 68 additions and 16 deletions
+19 -9
View File
@@ -1168,6 +1168,8 @@ void menuGeneralDiagAna(uint8_t event)
#if defined(PCBTARANIS)
enum menuGeneralHwItems {
ITEM_SETUP_HW_POT1,
ITEM_SETUP_HW_POT2,
ITEM_SETUP_HW_UART3_MODE,
ITEM_SETUP_HW_MAX
};
@@ -1181,9 +1183,22 @@ void menuGeneralHardware(uint8_t event)
uint8_t sub = m_posVert - 1;
for (uint8_t i=0; i<ITEM_SETUP_HW_MAX; i++) {
uint8_t y = 1 + 1*FH + i*FH;
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
uint8_t y = 1 + 1*FH + i*FH;
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
switch(i) {
case ITEM_SETUP_HW_POT1:
case ITEM_SETUP_HW_POT2:
{
int idx = i - ITEM_SETUP_HW_POT1;
uint8_t mask = (1<<idx);
uint8_t potType = selectMenuItem(HW_SETTINGS_COLUMN, y, i==ITEM_SETUP_HW_POT1 ? STR_POT1TYPE : STR_POT2TYPE, STR_POTTYPES, g_eeGeneral.potsType & mask, 0, 1, attr, event);
if (potType)
g_eeGeneral.potsType |= mask;
else
g_eeGeneral.potsType &= ~mask;
break;
}
case ITEM_SETUP_HW_UART3_MODE:
g_eeGeneral.hw_uartMode = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.hw_uartMode, 0, 2, attr, event);
break;
@@ -1278,7 +1293,7 @@ void menuCommonCalib(uint8_t event)
#if defined(PCBTARANIS)
uint8_t idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (count <= POTS_POS_COUNT) {
if (IS_MULTIPOS_POT(i) && count <= POTS_POS_COUNT) {
if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 0 || vt < reusableBuffer.calib.xpotsCalib[idx].lastPosition - XPOT_DELTA || vt > reusableBuffer.calib.xpotsCalib[idx].lastPosition + XPOT_DELTA) {
reusableBuffer.calib.xpotsCalib[idx].lastPosition = vt;
reusableBuffer.calib.xpotsCalib[idx].lastCount = 1;
@@ -1333,10 +1348,6 @@ void menuCommonCalib(uint8_t event)
lcd_putsAtt(0*FW, 2*FH, STR_SETMIDPOINT, s_noScroll ? INVERS : 0);
lcd_putsLeft(3*FH, STR_MENUWHENDONE);
#if defined(PCBTARANIS)
g_eeGeneral.potsType = 0;
#endif
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
reusableBuffer.calib.loVals[i] = 15000;
reusableBuffer.calib.hiVals[i] = -15000;
@@ -1372,7 +1383,7 @@ void menuCommonCalib(uint8_t event)
for (uint8_t i=POT1; i<=POT_LAST; i++) {
int idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (count > 1 && count <= POTS_POS_COUNT) {
if (IS_MULTIPOS_POT(i) && count > 1 && count <= POTS_POS_COUNT) {
for (int j=0; j<count; j++) {
for (int k=j+1; k<count; k++) {
if (reusableBuffer.calib.xpotsCalib[idx].steps[k] < reusableBuffer.calib.xpotsCalib[idx].steps[j]) {
@@ -1380,7 +1391,6 @@ void menuCommonCalib(uint8_t event)
}
}
}
g_eeGeneral.potsType |= (1 << idx);
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[i];
calib->count = count - 1;
for (int j=0; j<calib->count; j++) {
+3
View File
@@ -57,6 +57,7 @@ const pm_char STR_OPEN9X[] PROGMEM =
ISTR(TRNCHN)
#if defined(PCBTARANIS)
ISTR(UART3MODES)
ISTR(POTTYPES)
#endif
ISTR(VTRIMINC)
ISTR(RETA123)
@@ -496,6 +497,8 @@ const pm_char STR_VIEW_TEXT[] PROGMEM = "View text";
const pm_char STR_VIEW_CHANNELS[] PROGMEM = "View Channels";
const pm_char STR_VIEW_NOTES[] PROGMEM = "View Notes";
const pm_char STR_UART3MODE[] PROGMEM = TR_UART3MODE;
const pm_char STR_POT1TYPE[] PROGMEM = TR_POT1TYPE;
const pm_char STR_POT2TYPE[] PROGMEM = TR_POT2TYPE;
#endif
#if MENUS_LOCK == 1
+7 -3
View File
@@ -100,10 +100,11 @@ extern const pm_char STR_OPEN9X[];
#endif
#define OFS_TRNCHN (OFS_TRNMODE + sizeof(TR_TRNMODE))
#if defined(PCBTARANIS)
#define OFS_UART3MODES (OFS_TRNCHN + sizeof(TR_TRNCHN))
#define OFS_VTRIMINC (OFS_UART3MODES + sizeof(TR_UART3MODES))
#define OFS_UART3MODES (OFS_TRNCHN + sizeof(TR_TRNCHN))
#define OFS_POTTYPES (OFS_UART3MODES + sizeof(TR_UART3MODES))
#define OFS_VTRIMINC (OFS_POTTYPES + sizeof(TR_POTTYPES))
#else
#define OFS_VTRIMINC (OFS_TRNCHN + sizeof(TR_TRNCHN))
#define OFS_VTRIMINC (OFS_TRNCHN + sizeof(TR_TRNCHN))
#endif
#define OFS_RETA123 (OFS_VTRIMINC + sizeof(TR_VTRIMINC))
#define OFS_VPROTOS (OFS_RETA123 + sizeof(TR_RETA123))
@@ -196,6 +197,7 @@ extern const pm_char STR_OPEN9X[];
#define STR_TRNMODE (STR_OPEN9X + OFS_TRNMODE)
#define STR_TRNCHN (STR_OPEN9X + OFS_TRNCHN)
#define STR_UART3MODES (STR_OPEN9X + OFS_UART3MODES)
#define STR_POTTYPES (STR_OPEN9X + OFS_POTTYPES)
#define STR_VTRIMINC (STR_OPEN9X + OFS_VTRIMINC)
#define STR_RETA123 (STR_OPEN9X + OFS_RETA123)
#define STR_VPROTOS (STR_OPEN9X + OFS_VPROTOS)
@@ -683,6 +685,8 @@ extern const pm_char STR_VIEW_TEXT[];
extern const pm_char STR_VIEW_CHANNELS[];
extern const pm_char STR_VIEW_NOTES[];
extern const pm_char STR_UART3MODE[];
extern const pm_char STR_POT1TYPE[];
extern const pm_char STR_POT2TYPE[];
#endif
#if MENUS_LOCK == 1
+5
View File
@@ -71,6 +71,9 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DATE:""ZEIT:"
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH INDENT "Store mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
#define TR_UART3MODE "Serial port"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
+5
View File
@@ -71,6 +71,9 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DATE:""TIME:"
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH INDENT "Store mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
#define TR_UART3MODE "Serial port"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
+6 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Authors (alphabetical order)
* - Bertrand Songis <bsongis@gmail.com>
* - Bernet Andre <bernet.andre@gmail.com>
@@ -71,6 +71,9 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DATA:""HORA:"
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH INDENT "Valor mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
#define TR_UART3MODE "Serial port"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
+6 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Authors (alphabetical order)
* - Bertrand Songis <bsongis@gmail.com>
* - Bernet Andre <bernet.andre@gmail.com>
@@ -71,6 +71,9 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DATE:""HEURE"
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH TR(INDENT "Enr. mAh",INDENT "Enregistrer mAh")
#define TR_FAS_OFFSET TR(INDENT "Corr FAS", INDENT "Correction FAS")
#define TR_UART3MODE "Port série"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "RSSI Max"
+7 -2
View File
@@ -71,14 +71,17 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DATA:""ORA :"
#define LEN_VLCD "\006"
#define TR_VLCD "NormalOptrex"
#define LEN_COUNTRYCODES TR("\002", "\007")
#define TR_COUNTRYCODES TR("US""JP""EU", "America""Japan\0 ""Europe\0")
#define LEN_COUNTRYCODES TR("\002", "\007")
#define TR_COUNTRYCODES TR("US""JP""EU", "America""Japan\0 ""Europe\0")
#define LEN_VTRIMINC "\006"
#define TR_VTRIMINC "Exp ""ExFine""Fine ""Medio ""Ampio "
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH INDENT "Store mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
#define TR_UART3MODE "Serial port"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
+5
View File
@@ -71,6 +71,9 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "OFF\0 ""SPORT Mirror\0 ""Virtual SP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DATA:""HORA:"
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH INDENT "Store mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
#define TR_UART3MODE "Serial port"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
+5
View File
@@ -71,6 +71,9 @@
#define LEN_UART3MODES "\017"
#define TR_UART3MODES "Av\0 ""SPORT-spegel\0 ""VirtuellSP2UART"
#define LEN_POTTYPES "\017"
#define TR_POTTYPES "Pot\0 ""Multipos Switch"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DAG: ""TID: "
@@ -680,6 +683,8 @@
#define TR_PERSISTENT_MAH INDENT "Store mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
#define TR_UART3MODE "Serieport"
#define TR_POT1TYPE "S1 Type"
#define TR_POT2TYPE "S2 Type"
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"