Merge branch 'next' of https://github.com/opentx/opentx into kilrah/Switch_and_pot_warnings

Conflicts:
	companion/src/eeprominterface.h
	companion/src/firmwares/opentx/opentxeeprom.cpp
	radio/src/opentx.cpp
	radio/src/translations/es.h.txt
	radio/src/translations/fr.h.txt
This commit is contained in:
Andre Bernet
2014-02-10 14:47:32 +01:00
238 changed files with 18614 additions and 8730 deletions
+6 -8
View File
@@ -1037,19 +1037,17 @@ void menuGeneralVersion(uint8_t event)
{
SIMPLE_MENU(STR_MENUVERSION, menuTabDiag, e_Vers, 1);
lcd_putsLeft(2*FH, stamp1);
lcd_putsLeft(3*FH, stamp2);
lcd_putsLeft(4*FH, stamp3);
lcd_putsLeft(2*FH, vers_stamp);
#if defined(PCBSKY9X) && !defined(REVA)
if (Coproc_valid == 1) {
lcd_putsLeft(5*FH, PSTR("CoPr:"));
lcd_outdez8(10*FW, 5*FH, Coproc_read);
lcd_putsLeft(6*FH, PSTR("CoPr:"));
lcd_outdez8(10*FW, 6*FH, Coproc_read);
}
else {
lcd_putsLeft(5*FH, PSTR("CoPr: ---"));
lcd_putsLeft(6*FH, PSTR("CoPr: ---"));
}
#endif
lcd_putsLeft(7*FH, eeprom_stamp);
#endif
}
void displayKeyState(uint8_t x, uint8_t y, EnumKeys key)
File diff suppressed because it is too large Load Diff
+50 -18
View File
@@ -228,18 +228,6 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
#endif
}
}
if (event == EVT_KEY_LONG(KEY_ENTER) && i_max > SWSRC_ON) {
s_editMode = !s_editMode;
if (newval > SWSRC_ON)
newval -= (NUM_SWITCH+1);
else if (newval > 0)
newval += (NUM_SWITCH+1);
else if (newval < SWSRC_OFF)
newval += (NUM_SWITCH+1);
else if (newval < 0)
newval -= (NUM_SWITCH+1);
}
}
#endif
@@ -976,7 +964,7 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
{
lcd_putsColumnLeft(x, y, STR_SWITCH);
putsSwitches(x, y, value, attr);
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, -NUM_SWITCH, NUM_SWITCH);
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST, SWSRC_LAST);
return value;
}
@@ -1046,6 +1034,16 @@ int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t m
}
#endif
void repeatLastCursorMove(uint8_t event)
{
if (CURSOR_MOVED_LEFT(event) || CURSOR_MOVED_RIGHT(event)) {
putEvent(event);
}
else {
m_posHorz = 0;
}
}
#if LCD_W >= 212
#define MENU_X 30
#define MENU_Y 16
@@ -1221,8 +1219,8 @@ bool isSourceAvailable(int16_t source)
}
if (source>=MIXSRC_SW1 && source<=MIXSRC_LAST_CSW) {
CustomSwData * cs = cswAddress(source-MIXSRC_SW1);
return (cs->func != CS_OFF);
LogicalSwitchData * cs = cswAddress(source-MIXSRC_SW1);
return (cs->func != LS_FUNC_NONE);
}
#if !defined(GVARS)
@@ -1250,7 +1248,7 @@ bool isInputSourceAvailable(int16_t source)
return false;
}
bool isSwitchAvailable(int16_t swtch)
bool isSwitchAvailableInLogicalSwitches(int16_t swtch)
{
if (swtch < 0) {
if (swtch <= -SWSRC_ON)
@@ -1276,11 +1274,45 @@ bool isSwitchAvailable(int16_t swtch)
}
#endif
return true;
}
bool isSwitchAvailable(int16_t swtch)
{
if (!isSwitchAvailableInLogicalSwitches(swtch)) {
return false;
}
if (swtch >= SWSRC_FIRST_CSW && swtch <= SWSRC_LAST_CSW) {
CustomSwData * cs = cswAddress(swtch-SWSRC_FIRST_CSW);
return (cs->func != CS_OFF);
LogicalSwitchData * cs = cswAddress(swtch-SWSRC_FIRST_CSW);
return (cs->func != LS_FUNC_NONE);
}
return true;
}
// Not available yet, will be needed if we implement the Range function later...
bool isLogicalSwitchFunctionAvailable(int16_t function)
{
return function != LS_FUNC_RANGE;
}
bool isAssignableFunctionAvailable(int16_t function)
{
switch (function) {
#if !defined(HAPTIC)
case FUNC_HAPTIC:
return false;
#endif
#if !defined(GVARS)
case FUNC_ADJUST_GVAR:
return false;
#endif
default:
return true;
}
}
#endif
+5 -1
View File
@@ -190,7 +190,10 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
var = checkIncDecModelZero(event,var,max)
#if defined(CPUARM)
bool isLogicalSwitchFunctionAvailable(int16_t function);
bool isAssignableFunctionAvailable(int16_t function);
bool isSwitchAvailable(int16_t swtch);
bool isSwitchAvailableInLogicalSwitches(int16_t swtch);
#define AUTOSWITCH_ENTER_LONG() (attr && event==EVT_KEY_LONG(KEY_ENTER))
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH|NO_INCDEC_MARKS, isSwitchAvailable)
@@ -401,7 +404,8 @@ bool modelHasNotes();
#define REPEAT_LAST_CURSOR_MOVE() { if (EVT_KEY_MASK(event) >= 0x0e) putEvent(event); else m_posHorz = 0; }
#define MOVE_CURSOR_FROM_HERE() if (m_posHorz > 0) REPEAT_LAST_CURSOR_MOVE()
#else
#define REPEAT_LAST_CURSOR_MOVE() m_posHorz = 0;
void repeatLastCursorMove(uint8_t event);
#define REPEAT_LAST_CURSOR_MOVE() repeatLastCursorMove(event)
#define MOVE_CURSOR_FROM_HERE() REPEAT_LAST_CURSOR_MOVE()
#endif
+5 -5
View File
@@ -295,7 +295,7 @@ void displayTopBar()
x -= 12;
}
if (isFunctionActive(FUNC_LOGS)) {
if (isFunctionActive(FUNCTION_LOGS)) {
LCD_NOTIF_ICON(x, ICON_LOGS);
x -= 12;
}
@@ -343,7 +343,7 @@ void displayTimers()
if (g_model.timers[0].mode) {
TimerState & timerState = timersStates[0];
putsTime(TIMERS_X, TIMER1_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT);
putsTmrMode(TIMERS_X, TIMER1_Y-6, g_model.timers[0].mode, STRCONDENSED|SMLSIZE);
putsTimerMode(TIMERS_X, TIMER1_Y-6, g_model.timers[0].mode, SMLSIZE);
if (g_model.timers[0].persistent) lcd_putcAtt(TIMERS_R, TIMER1_Y+1, 'P', SMLSIZE);
if (timerState.val < 0) {
if (BLINK_ON_PHASE) {
@@ -356,7 +356,7 @@ void displayTimers()
if (g_model.timers[1].mode) {
TimerState & timerState = timersStates[1];
putsTime(TIMERS_X, TIMER2_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT);
putsTmrMode(TIMERS_X, TIMER2_Y-6, g_model.timers[1].mode, STRCONDENSED|SMLSIZE);
putsTimerMode(TIMERS_X, TIMER2_Y-6, g_model.timers[1].mode, SMLSIZE);
if (g_model.timers[1].persistent) lcd_putcAtt(TIMERS_R, TIMER2_Y+1, 'P', SMLSIZE);
if (timerState.val < 0) {
if (BLINK_ON_PHASE) {
@@ -373,7 +373,7 @@ void displayTimers()
TimerState & timerState = timersStates[0];
uint8_t att = DBLSIZE | (timerState.val<0 ? BLINK|INVERS : 0);
putsTime(12*FW+2+10*FWNUM-4, FH*2, timerState.val, att, att);
putsTmrMode(timerState.val >= 0 ? 9*FW-FW/2+3 : 9*FW-FW/2-4, FH*3, g_model.timers[0].mode, STRCONDENSED);
putsTimerMode(timerState.val >= 0 ? 9*FW-FW/2+3 : 9*FW-FW/2-4, FH*3, g_model.timers[0].mode);
}
}
#endif
@@ -818,7 +818,7 @@ void menuMainView(uint8_t event)
}
else { // timer2
putsTime(33+FW+2+10*FWNUM-4, FH*5, timersStates[1].val, DBLSIZE, DBLSIZE);
putsTmrMode(timersStates[1].val >= 0 ? 20-FW/2+5 : 20-FW/2-2, FH*6, g_model.timers[1].mode, STRCONDENSED);
putsTimerMode(timersStates[1].val >= 0 ? 20-FW/2+5 : 20-FW/2-2, FH*6, g_model.timers[1].mode);
// lcd_outdezNAtt(33+11*FW, FH*6, s_timerVal_10ms[1], LEADING0, 2); // 1/100s
}
#endif // PCBTARANIS
+1 -3
View File
@@ -57,15 +57,13 @@ void menuStatisticsView(uint8_t event)
return;
}
lcd_puts( 1*FW, FH*1, STR_TM1TM2);
lcd_puts( 1*FW, FH*0, STR_TOTTM1TM2THRTHP);
putsTime( 5*FW+5*FWNUM+1, FH*1, timersStates[0].val, 0, 0);
putsTime( 12*FW+5*FWNUM+1, FH*1, timersStates[1].val, 0, 0);
lcd_puts( 1*FW, FH*2, STR_THRTHP);
putsTime( 5*FW+5*FWNUM+1, FH*2, s_timeCumThr, 0, 0);
putsTime( 12*FW+5*FWNUM+1, FH*2, s_timeCum16ThrP/16, 0, 0);
lcd_puts( 17*FW, FH*0, STR_TOT);
putsTime( 12*FW+5*FWNUM+1, FH*0, s_timeCumTot, 0, 0);
#if defined(PCBTARANIS)