New telemetry screens (bars)

New telemetry units for A1 / A2
Update to pgmtypes according to Michal patch (suggested by gcc developers!)
EEPROM v204
This commit is contained in:
bsongis
2012-02-08 20:56:36 +00:00
parent 2c64004e7c
commit caa2aec727
22 changed files with 670 additions and 558 deletions
+16 -16
View File
@@ -494,10 +494,10 @@ void menuProcArduPilot1(uint8_t event)
initval (1, PACK_POS, LON); initval (1, PACK_POS, LON);
// title of the screen // title of the screen
title ('1'); title ('1');
lcd_puts_P (5*FW, 1*FH, PSTR(" Latitude")); // line 1 column 5 lcd_puts (5*FW, 1*FH, PSTR(" Latitude")); // line 1 column 5
// first buffer into line 2 column 2 // first buffer into line 2 column 2
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (5*FW, 4*FH, PSTR(" Longitude")); // line 4 column 5 lcd_puts (5*FW, 4*FH, PSTR(" Longitude")); // line 4 column 5
// second buffer into line 5 column 2 // second buffer into line 5 column 2
lcd_putsAtt (1*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (1*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -520,9 +520,9 @@ void menuProcArduPilot2(uint8_t event)
initval (0, PACK_POS, SPD); initval (0, PACK_POS, SPD);
initval (1, PACK_POS, CRT); initval (1, PACK_POS, CRT);
title ('2'); title ('2');
lcd_puts_P (1*FW, 1*FH, PSTR(" Ground speed")); lcd_puts (1*FW, 1*FH, PSTR(" Ground speed"));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" Climb rate") ); lcd_puts (1*FW, 4*FH, PSTR(" Climb rate") );
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -544,9 +544,9 @@ void menuProcArduPilot3(uint8_t event)
initval (0, PACK_POS, ALT); initval (0, PACK_POS, ALT);
initval (1, PACK_POS, ALH); initval (1, PACK_POS, ALH);
title ('3'); title ('3');
lcd_puts_P (1*FW, 1*FH, PSTR(" Altitude")); lcd_puts (1*FW, 1*FH, PSTR(" Altitude"));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" Altitude Hold") ); lcd_puts (1*FW, 4*FH, PSTR(" Altitude Hold") );
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -568,9 +568,9 @@ void menuProcArduPilot4(uint8_t event)
initval (0, PACK_POS, CRS); initval (0, PACK_POS, CRS);
initval (1, PACK_POS, BER); initval (1, PACK_POS, BER);
title ('4'); title ('4');
lcd_puts_P (1*FW, 1*FH, PSTR(" Course")); lcd_puts (1*FW, 1*FH, PSTR(" Course"));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" Bearing")); lcd_puts (1*FW, 4*FH, PSTR(" Bearing"));
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -594,9 +594,9 @@ void menuProcArduPilot5(uint8_t event)
initval (0, PACK_POS, WPN); initval (0, PACK_POS, WPN);
initval (1, PACK_POS, DST); initval (1, PACK_POS, DST);
title ('5'); title ('5');
lcd_puts_P (1*FW, 1*FH, PSTR(" Way Point # ")); lcd_puts (1*FW, 1*FH, PSTR(" Way Point # "));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" Distance ")); lcd_puts (1*FW, 4*FH, PSTR(" Distance "));
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -620,9 +620,9 @@ void menuProcArduPilot6(uint8_t event)
initval (0, PACK_ATT, ASP); initval (0, PACK_ATT, ASP);
initval (1, PACK_ATT, THH); initval (1, PACK_ATT, THH);
title ('6'); title ('6');
lcd_puts_P (1*FW, 1*FH, PSTR(" Air Speed ")); lcd_puts (1*FW, 1*FH, PSTR(" Air Speed "));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" Climb Rate ")); lcd_puts (1*FW, 4*FH, PSTR(" Climb Rate "));
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -646,9 +646,9 @@ void menuProcArduPilot7(uint8_t event)
initval (0, PACK_ATT, RLL); initval (0, PACK_ATT, RLL);
initval (1, PACK_ATT, PCH); initval (1, PACK_ATT, PCH);
title ('7'); title ('7');
lcd_puts_P (1*FW, 1*FH, PSTR(" Roll Angle")); lcd_puts (1*FW, 1*FH, PSTR(" Roll Angle"));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" Pitch Angle")); lcd_puts (1*FW, 4*FH, PSTR(" Pitch Angle"));
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
@@ -672,9 +672,9 @@ void menuProcArduPilot8(uint8_t event)
initval (0, PACK_MOD, MOD); initval (0, PACK_MOD, MOD);
initval (1, PACK_WPC, WPC); initval (1, PACK_WPC, WPC);
title ('8'); title ('8');
lcd_puts_P (1*FW, 1*FH, PSTR(" ArduPilot Mode")); lcd_puts (1*FW, 1*FH, PSTR(" ArduPilot Mode"));
lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE); lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
lcd_puts_P (1*FW, 4*FH, PSTR(" RTL Distance")); lcd_puts (1*FW, 4*FH, PSTR(" RTL Distance"));
lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE); lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
} }
+1 -6
View File
@@ -15,11 +15,6 @@
#include "open9x.h" #include "open9x.h"
audioQueue::audioQueue() audioQueue::audioQueue()
{
aqinit();
}
void audioQueue::aqinit()
{ {
toneTimeLeft = 0; toneTimeLeft = 0;
tonePause = 0; tonePause = 0;
@@ -236,7 +231,7 @@ void audioQueue::event(uint8_t e, uint8_t f)
break; break;
// inactivity timer alert // inactivity timer alert
case AU_INACTIVITY: case AU_INACTIVITY:
playNow(70, 10, 2,2); playNow(70, 10, 2, 2);
break; break;
// low battery in tx // low battery in tx
case AU_TX_BATTERY_LOW: case AU_TX_BATTERY_LOW:
-2
View File
@@ -143,11 +143,9 @@ class audioQueue
} }
protected: protected:
void aqinit(); // To stop constructor being compiled twice
inline uint8_t getToneLength(uint8_t tLen); inline uint8_t getToneLength(uint8_t tLen);
private: private:
uint8_t t_queueRidx; uint8_t t_queueRidx;
uint8_t t_queueWidx; uint8_t t_queueWidx;
+2
View File
@@ -442,6 +442,8 @@ void per10ms()
#if defined (FRSKY) #if defined (FRSKY)
// TODO it would be better in frsky.h / .cpp!
// Attempt to transmit any waiting Fr-Sky alarm set packets every 50ms (subject to packet buffer availability) // Attempt to transmit any waiting Fr-Sky alarm set packets every 50ms (subject to packet buffer availability)
static uint8_t FrskyDelay = 5; static uint8_t FrskyDelay = 5;
if (FrskyAlarmSendState && (--FrskyDelay == 0)) if (FrskyAlarmSendState && (--FrskyDelay == 0))
+3 -3
View File
@@ -580,10 +580,10 @@ void RlcFile::DisplayProgressBar(uint8_t x)
if (s_eeDirtyMsk || isWriting() || eeprom_buffer_size) { if (s_eeDirtyMsk || isWriting() || eeprom_buffer_size) {
#if defined (PROGRESS_BAR) #if defined (PROGRESS_BAR)
uint8_t len = (s_eeDirtyMsk ? 123 : min((uint8_t)123, (uint8_t)((m_rlc_len) / 5 + eeprom_buffer_size))); uint8_t len = (s_eeDirtyMsk ? 123 : min((uint8_t)123, (uint8_t)((m_rlc_len) / 5 + eeprom_buffer_size)));
lcd_filled_rect(2, 1, 125, 5, WHITE); lcd_filled_rect(2, 1, 125, 5, SOLID, WHITE);
lcd_filled_rect(3, 2, 123-len, 3); lcd_filled_rect(3, 2, 123-len, 3);
#elif defined (PROGRESS_CIRCLE) #elif defined (PROGRESS_CIRCLE)
lcd_filled_rect(x-1, 0, 7, 7, WHITE); lcd_filled_rect(x-1, 0, 7, 7, SOLID, WHITE);
uint8_t len = s_eeDirtyMsk ? 1 : limit(1, 12 - (uint8_t)(m_rlc_len/m_ratio), 12); uint8_t len = s_eeDirtyMsk ? 1 : limit(1, 12 - (uint8_t)(m_rlc_len/m_ratio), 12);
lcd_hline(x+1, 1, min((uint8_t)3, len)); lcd_hline(x+1, 1, min((uint8_t)3, len));
if (len >= 3) { if (len >= 3) {
@@ -597,7 +597,7 @@ void RlcFile::DisplayProgressBar(uint8_t x)
} }
#elif defined (PROGRESS_VERTICAL_BAR) #elif defined (PROGRESS_VERTICAL_BAR)
uint8_t len = s_eeDirtyMsk ? 1 : limit((uint8_t)1, (uint8_t)(7 - (m_rlc_len/m_ratio)), (uint8_t)7); uint8_t len = s_eeDirtyMsk ? 1 : limit((uint8_t)1, (uint8_t)(7 - (m_rlc_len/m_ratio)), (uint8_t)7);
lcd_filled_rect(x+1, 0, 5, FH, WHITE); lcd_filled_rect(x+1, 0, 5, FH, SOLID, WHITE);
lcd_filled_rect(x+2, 7-len, 3, len); lcd_filled_rect(x+2, 7-len, 3, len);
#elif defined (PROGRESS_FIXED_CIRCLE) #elif defined (PROGRESS_FIXED_CIRCLE)
lcd_square(x, 1, 5); lcd_square(x, 1, 5);
+38 -17
View File
@@ -43,7 +43,7 @@ uint8_t frskyStreaming = 0;
uint8_t frskyUsrStreaming = 0; uint8_t frskyUsrStreaming = 0;
FrskyData frskyTelemetry[2]; FrskyData frskyTelemetry[2];
FrskyData frskyRSSI[2]; FrskyRSSI frskyRSSI[2];
struct FrskyAlarm { struct FrskyAlarm {
uint8_t level; // The alarm's 'urgency' level. 0=disabled, 1=yellow, 2=orange, 3=red uint8_t level; // The alarm's 'urgency' level. 0=disabled, 1=yellow, 2=orange, 3=red
@@ -54,9 +54,8 @@ struct FrskyAlarm {
struct FrskyAlarm frskyAlarms[4]; struct FrskyAlarm frskyAlarms[4];
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
FrskyHubData frskyHubData; FrskyHubData frskyHubData; // TODO initialization?
int16_t baroAltitudeOffset = 0; uint8_t barsThresholds[BAR_MAX-3];
uint8_t maxGpsSpeed = 0;
#endif #endif
void frskyPushValue(uint8_t *&ptr, uint8_t value) void frskyPushValue(uint8_t *&ptr, uint8_t value)
@@ -99,14 +98,8 @@ int8_t parseTelemHubIndex(uint8_t index)
index = 0; // invalid index index = 0; // invalid index
if (index > 0x39) if (index > 0x39)
index -= 17; index -= 17;
if (index > 0x27)
index -= 1;
if (index > 0x21) if (index > 0x21)
index -= 5; index -= 5;
if (index > 0x0f)
index -= 6;
if (index > 0x08)
index -= 2;
return 2*(index-1); return 2*(index-1);
} }
@@ -151,8 +144,22 @@ void parseTelemHubByte(uint8_t byte)
return; return;
} }
((uint8_t*)&frskyHubData)[structPos+1] = byte; ((uint8_t*)&frskyHubData)[structPos+1] = byte;
if (structPos == offsetof(FrskyHubData, gpsSpeed_ap)/2 && maxGpsSpeed < frskyHubData.gpsSpeed_ap) if ((uint8_t)structPos == offsetof(FrskyHubData, gpsSpeed_ap)) {
maxGpsSpeed = frskyHubData.gpsSpeed_ap; // Speed => Max speed
if (frskyHubData.maxGpsSpeed < frskyHubData.gpsSpeed_ap)
frskyHubData.maxGpsSpeed = frskyHubData.gpsSpeed_ap;
}
if ((uint8_t)structPos == offsetof(FrskyHubData, volts)) {
// Voltage => Cell number + Cell voltage
uint8_t battnumber = (frskyHubData.volts & 0x00F0) >> 4;
if (frskyHubData.cellsCount < battnumber+1) {
frskyHubData.cellsCount = battnumber+1;
}
uint8_t cellVolts = 2*(((frskyHubData.volts & 0xFF00) >> 8) + ((frskyHubData.volts & 0x000F) << 8));
frskyHubData.cellVolts[battnumber] = cellVolts;
if (!frskyHubData.minCellVolts || cellVolts < frskyHubData.minCellVolts)
frskyHubData.minCellVolts = cellVolts;
}
state = TS_IDLE; state = TS_IDLE;
} }
@@ -485,21 +492,35 @@ void frskyAlarmsRefresh()
} }
#endif #endif
void FrskyData::set(uint8_t value) void FrskyRSSI::set(uint8_t value)
{ {
this->value = value; this->value = (((uint16_t)this->value * 7) + value) / 8;
if (!max || max < value)
max = value;
if (!min || min > value) if (!min || min > value)
min = value; min = value;
} }
void FrskyData::set(uint8_t value)
{
if (!max || max < value)
max = value;
FrskyRSSI::set(value);
}
void resetTelemetry() void resetTelemetry()
{ {
memset(frskyTelemetry, 0, sizeof(frskyTelemetry)); memset(frskyTelemetry, 0, sizeof(frskyTelemetry));
memset(frskyRSSI, 0, sizeof(frskyRSSI)); memset(frskyRSSI, 0, sizeof(frskyRSSI));
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
baroAltitudeOffset = -frskyHubData.baroAltitude; frskyHubData.baroAltitudeOffset = -frskyHubData.baroAltitude;
frskyHubData.maxGpsSpeed = 0;
frskyHubData.cellsCount = 0;
frskyHubData.minCellVolts = 0;
#endif
#ifdef SIMU
frskyTelemetry[0].set(120);
frskyRSSI[0].set(75);
frskyHubData.fuelLevel = 75;
#endif #endif
} }
+17 -7
View File
@@ -39,13 +39,21 @@ enum AlarmLevel {
#define ALARM_GREATER(channel, alarm) ((g_model.frsky.channels[channel].alarms_greater >> alarm) & 1) #define ALARM_GREATER(channel, alarm) ((g_model.frsky.channels[channel].alarms_greater >> alarm) & 1)
#define ALARM_LEVEL(channel, alarm) ((g_model.frsky.channels[channel].alarms_level >> (2*alarm)) & 3) #define ALARM_LEVEL(channel, alarm) ((g_model.frsky.channels[channel].alarms_level >> (2*alarm)) & 3)
struct FrskyData { // TODO change names
class FrskyRSSI {
public:
uint8_t value; uint8_t value;
uint8_t min; uint8_t min;
void set(uint8_t value);
};
class FrskyData: public FrskyRSSI {
public:
uint8_t max; uint8_t max;
void set(uint8_t value); void set(uint8_t value);
}; };
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
struct FrskyHubData { struct FrskyHubData {
// 1 spare // 1 spare
@@ -55,9 +63,10 @@ struct FrskyHubData {
uint16_t fuelLevel; // 0, 25, 50, 75, 100 percent uint16_t fuelLevel; // 0, 25, 50, 75, 100 percent
int16_t temperature2; // -20 .. 250 deg. celcius int16_t temperature2; // -20 .. 250 deg. celcius
uint16_t volts; // 1/500V increments (0..4.2V) uint16_t volts; // 1/500V increments (0..4.2V)
// 2 spares int16_t baroAltitudeOffset; // spare reused
uint16_t maxGpsSpeed; // spare reused
int16_t gpsAltitude_ap; // after punct int16_t gpsAltitude_ap; // after punct
// 6 spares uint8_t cellVolts[12]; // 6 spares reused
uint16_t baroAltitude; // 0..9,999 meters uint16_t baroAltitude; // 0..9,999 meters
uint16_t gpsSpeed_bp; // before punct uint16_t gpsSpeed_bp; // before punct
uint16_t gpsLongitude_bp; // before punct uint16_t gpsLongitude_bp; // before punct
@@ -79,7 +88,8 @@ struct FrskyHubData {
int16_t accelX; // 1/256th gram (-8g ~ +8g) int16_t accelX; // 1/256th gram (-8g ~ +8g)
int16_t accelY; // 1/256th gram (-8g ~ +8g) int16_t accelY; // 1/256th gram (-8g ~ +8g)
int16_t accelZ; // 1/256th gram (-8g ~ +8g) int16_t accelZ; // 1/256th gram (-8g ~ +8g)
// 1 spare uint8_t cellsCount; // 1/2 spare reused
uint8_t minCellVolts; // 1/2 spare reused
uint16_t current; uint16_t current;
// 17 spares // 17 spares
uint16_t volts_bp; uint16_t volts_bp;
@@ -90,14 +100,14 @@ struct FrskyHubData {
struct FrskyHubData { struct FrskyHubData {
uint16_t baroAltitude; // 0..9,999 meters uint16_t baroAltitude; // 0..9,999 meters
int16_t baroAltitudeOffset;
}; };
#endif #endif
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
extern FrskyHubData frskyHubData; extern FrskyHubData frskyHubData;
extern int16_t baroAltitudeOffset; extern uint8_t barsThresholds[BAR_MAX-3];
extern uint8_t maxGpsSpeed;
#endif #endif
// Global Fr-Sky telemetry data variables // Global Fr-Sky telemetry data variables
@@ -109,7 +119,7 @@ extern uint8_t frskyUsrStreaming;
extern uint8_t FrskyAlarmSendState; extern uint8_t FrskyAlarmSendState;
extern FrskyData frskyTelemetry[2]; extern FrskyData frskyTelemetry[2];
extern FrskyData frskyRSSI[2]; extern FrskyRSSI frskyRSSI[2];
extern uint8_t frskyTxBuffer[FRSKY_TX_PACKET_SIZE]; extern uint8_t frskyTxBuffer[FRSKY_TX_PACKET_SIZE];
extern uint8_t frskyTxBufferCount; extern uint8_t frskyTxBufferCount;
+36 -39
View File
@@ -90,7 +90,7 @@ void menuProcSetup(uint8_t event)
uint8_t subN = 1; uint8_t subN = 1;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_BEEPER); lcd_putsLeft( y, STR_BEEPER);
lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPER+LEN_VBEEPER*g_eeGeneral.beeperVal, LEN_VBEEPER, (sub==subN ? INVERS:0)); lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPER+LEN_VBEEPER*g_eeGeneral.beeperVal, LEN_VBEEPER, (sub==subN ? INVERS:0));
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.beeperVal, 0, 6); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.beeperVal, 0, 6);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
@@ -98,7 +98,7 @@ void menuProcSetup(uint8_t event)
#ifdef AUDIO #ifdef AUDIO
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_SPKRPITCH); lcd_putsLeft( y, STR_SPKRPITCH);
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.speakerPitch,(sub==subN ? INVERS : 0)|LEFT); lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.speakerPitch,(sub==subN ? INVERS : 0)|LEFT);
if (sub==subN) { if (sub==subN) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 100); CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 100);
@@ -109,7 +109,7 @@ void menuProcSetup(uint8_t event)
#ifdef HAPTIC #ifdef HAPTIC
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_HAPTICSTRENGTH); lcd_putsLeft( y, STR_HAPTICSTRENGTH);
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.hapticStrength, (sub==subN ? INVERS : 0)|LEFT); lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.hapticStrength, (sub==subN ? INVERS : 0)|LEFT);
if (sub==subN) { if (sub==subN) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.hapticStrength, 0, 5); CHECK_INCDEC_GENVAR(event, g_eeGeneral.hapticStrength, 0, 5);
@@ -119,7 +119,7 @@ void menuProcSetup(uint8_t event)
#endif #endif
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_CONTRAST); lcd_putsLeft( y, STR_CONTRAST);
lcd_outdezAtt(PARAM_OFS,y,g_eeGeneral.contrast,(sub==subN ? INVERS : 0)|LEFT); lcd_outdezAtt(PARAM_OFS,y,g_eeGeneral.contrast,(sub==subN ? INVERS : 0)|LEFT);
if(sub==subN) { if(sub==subN) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.contrast, 10, 45); CHECK_INCDEC_GENVAR(event, g_eeGeneral.contrast, 10, 45);
@@ -129,14 +129,14 @@ void menuProcSetup(uint8_t event)
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y,STR_BATTERYWARNING); lcd_putsLeft( y,STR_BATTERYWARNING);
putsVolts(PARAM_OFS, y, g_eeGeneral.vBatWarn, (sub==subN ? INVERS : 0)|LEFT); putsVolts(PARAM_OFS, y, g_eeGeneral.vBatWarn, (sub==subN ? INVERS : 0)|LEFT);
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y,STR_INACTIVITYALARM); lcd_putsLeft( y,STR_INACTIVITYALARM);
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.inactivityTimer, (sub==subN ? INVERS : 0)|LEFT); lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.inactivityTimer, (sub==subN ? INVERS : 0)|LEFT);
lcd_putc(lcd_lastPos, y, 'm'); lcd_putc(lcd_lastPos, y, 'm');
if(sub==subN) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes if(sub==subN) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
@@ -144,49 +144,49 @@ void menuProcSetup(uint8_t event)
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y,STR_FILTERADC); lcd_putsLeft( y,STR_FILTERADC);
lcd_putsnAtt(PARAM_OFS, y, STR_ADCFILTER+LEN_ADCFILTER*g_eeGeneral.filterInput, LEN_ADCFILTER, (sub==subN ? INVERS:0)); lcd_putsnAtt(PARAM_OFS, y, STR_ADCFILTER+LEN_ADCFILTER*g_eeGeneral.filterInput, LEN_ADCFILTER, (sub==subN ? INVERS:0));
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.filterInput, 0, 2); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.filterInput, 0, 2);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y,STR_THROTTLEREVERSE); lcd_putsLeft( y,STR_THROTTLEREVERSE);
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.throttleReversed, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.throttleReversed, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.throttleReversed, 0, 1); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.throttleReversed, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_MINUTEBEEP); lcd_putsLeft( y, STR_MINUTEBEEP);
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.minuteBeep, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.minuteBeep, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.minuteBeep, 0, 1); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.minuteBeep, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_BEEPCOUNTDOWN); lcd_putsLeft( y, STR_BEEPCOUNTDOWN);
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.preBeep, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.preBeep, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.preBeep, 0, 1); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.preBeep, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_FLASHONBEEP); lcd_putsLeft( y, STR_FLASHONBEEP);
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.flashBeep, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.flashBeep, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.flashBeep, 0, 1); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.flashBeep, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_LIGHTSWITCH); lcd_putsLeft( y, STR_LIGHTSWITCH);
putsSwitches(PARAM_OFS,y,g_eeGeneral.lightSw,sub==subN ? INVERS : 0); putsSwitches(PARAM_OFS,y,g_eeGeneral.lightSw,sub==subN ? INVERS : 0);
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightSw, -MAX_SWITCH, MAX_SWITCH); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightSw, -MAX_SWITCH, MAX_SWITCH);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_LIGHTOFFAFTER); lcd_putsLeft( y, STR_LIGHTOFFAFTER);
if(g_eeGeneral.lightAutoOff) { if(g_eeGeneral.lightAutoOff) {
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.lightAutoOff*5,LEFT|(sub==subN ? INVERS : 0)); lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.lightAutoOff*5,LEFT|(sub==subN ? INVERS : 0));
lcd_putc(lcd_lastPos, y, 's'); lcd_putc(lcd_lastPos, y, 's');
@@ -201,7 +201,7 @@ void menuProcSetup(uint8_t event)
#ifdef SPLASH #ifdef SPLASH
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
uint8_t b = 1-g_eeGeneral.disableSplashScreen; uint8_t b = 1-g_eeGeneral.disableSplashScreen;
lcd_puts_P(0, y,STR_SPLASHSCREEN); lcd_putsLeft( y,STR_SPLASHSCREEN);
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
if(sub==subN) if(sub==subN)
{ {
@@ -214,7 +214,7 @@ void menuProcSetup(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
uint8_t b = 1-g_eeGeneral.disableThrottleWarning; uint8_t b = 1-g_eeGeneral.disableThrottleWarning;
lcd_puts_P(0, y,STR_THROTTLEWARNING); lcd_putsLeft( y,STR_THROTTLEWARNING);
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
if(sub==subN) if(sub==subN)
{ {
@@ -225,7 +225,7 @@ void menuProcSetup(uint8_t event)
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_SWITCHWARNING); lcd_putsLeft( y, STR_SWITCHWARNING);
lcd_putsnAtt(PARAM_OFS, y, STR_WARNSW+LEN_WARNSW*(1+g_eeGeneral.switchWarning), LEN_WARNSW, (sub==subN ? INVERS:0)); lcd_putsnAtt(PARAM_OFS, y, STR_WARNSW+LEN_WARNSW*(1+g_eeGeneral.switchWarning), LEN_WARNSW, (sub==subN ? INVERS:0));
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchWarning, -1, 1); if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchWarning, -1, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
@@ -233,7 +233,7 @@ void menuProcSetup(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
uint8_t b = 1-g_eeGeneral.disableMemoryWarning; uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
lcd_puts_P(0, y, STR_MEMORYWARNING); lcd_putsLeft( y, STR_MEMORYWARNING);
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
if(sub==subN) if(sub==subN)
{ {
@@ -245,7 +245,7 @@ void menuProcSetup(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
uint8_t b = 1-g_eeGeneral.disableAlarmWarning; uint8_t b = 1-g_eeGeneral.disableAlarmWarning;
lcd_puts_P(0, y,STR_ALARMWARNING); lcd_putsLeft( y,STR_ALARMWARNING);
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
if(sub==subN) if(sub==subN)
{ {
@@ -257,7 +257,7 @@ void menuProcSetup(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
uint8_t b = g_eeGeneral.enableTelemetryAlarm; uint8_t b = g_eeGeneral.enableTelemetryAlarm;
lcd_puts_P(0, y,STR_NODATAALARM); lcd_putsLeft( y,STR_NODATAALARM);
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
if(sub==subN) if(sub==subN)
{ {
@@ -269,7 +269,7 @@ void menuProcSetup(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
uint8_t attr = sub==subN?INVERS:0; uint8_t attr = sub==subN?INVERS:0;
lcd_puts_P(0, y,STR_RXCHANNELORD);// RAET->AETR lcd_putsLeft( y,STR_RXCHANNELORD);// RAET->AETR
for (uint8_t i=1; i<=4; i++) for (uint8_t i=1; i<=4; i++)
putsChnLetter((16+i)*FW, y, channel_order(i), attr); putsChnLetter((16+i)*FW, y, channel_order(i), attr);
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23); if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
@@ -277,7 +277,7 @@ void menuProcSetup(uint8_t event)
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 1*FW, y, STR_MODE2); // TODO STR_MODE would save flash lcd_puts( 1*FW, y, STR_MODE2); // TODO STR_MODE would save flash
if(y<7*FH) {for(uint8_t i=0; i<4; i++) lcd_img((6+4*i)*FW, y, sticks,i,0); } if(y<7*FH) {for(uint8_t i=0; i<4; i++) lcd_img((6+4*i)*FW, y, sticks,i,0); }
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
@@ -397,11 +397,11 @@ void menuProcTrainer(uint8_t event)
uint8_t blink ; uint8_t blink ;
if (SLAVE_MODE) { // i am the slave if (SLAVE_MODE) { // i am the slave
lcd_puts_P(7*FW, 3*FH, STR_SLAVE); lcd_puts(7*FW, 3*FH, STR_SLAVE);
return; return;
} }
lcd_puts_P(3*FW, 1*FH, STR_MODESRC); lcd_puts(3*FW, 1*FH, STR_MODESRC);
sub--; sub--;
y = 2*FH; y = 2*FH;
@@ -434,7 +434,7 @@ void menuProcTrainer(uint8_t event)
y += FH; y += FH;
} }
lcd_puts_P(0*FW, y, STR_MULTIPLIER); lcd_puts(0*FW, y, STR_MULTIPLIER);
lcd_outdezAtt(13*FW, y, g_eeGeneral.PPM_Multiplier+10, (sub==4 ? INVERS : 0)|PREC1); lcd_outdezAtt(13*FW, y, g_eeGeneral.PPM_Multiplier+10, (sub==4 ? INVERS : 0)|PREC1);
if(sub==4) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40); if(sub==4) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
y += FH; y += FH;
@@ -463,11 +463,11 @@ void menuProcDiagVers(uint8_t event)
{ {
SIMPLE_MENU(STR_MENUVERSION, menuTabDiag, e_Vers, 1); SIMPLE_MENU(STR_MENUVERSION, menuTabDiag, e_Vers, 1);
lcd_puts_P(0, 2*FH,stamp1 ); lcd_putsLeft( 2*FH,stamp1 );
lcd_puts_P(0, 3*FH,stamp2 ); lcd_putsLeft( 3*FH,stamp2 );
lcd_puts_P(0, 4*FH,stamp3 ); lcd_putsLeft( 4*FH,stamp3 );
lcd_puts_P(0, 5*FH,stamp4 ); lcd_putsLeft( 5*FH,stamp4 );
lcd_puts_P(0, 7*FH,STR_EEPROMV); lcd_putsLeft( 7*FH,STR_EEPROMV);
lcd_outdezAtt(8*FW, 7*FH, g_eeGeneral.myVers, LEFT); lcd_outdezAtt(8*FW, 7*FH, g_eeGeneral.myVers, LEFT);
} }
@@ -500,7 +500,7 @@ void menuProcDiagKeys(uint8_t event)
} }
#endif #endif
lcd_puts_P(14*FW, 3*FH, STR_VTRIM); lcd_puts(14*FW, 3*FH, STR_VTRIM);
for(uint8_t i=0; i<4; i++) for(uint8_t i=0; i<4; i++)
{ {
uint8_t y=i*FH+FH*4; uint8_t y=i*FH+FH*4;
@@ -531,7 +531,7 @@ void menuProcDiagAna(uint8_t event)
// lcd_outdezAtt( 21*FW, 3*FH, g_eeGeneral.vBatCalib, 0) ; // lcd_outdezAtt( 21*FW, 3*FH, g_eeGeneral.vBatCalib, 0) ;
// lcd_outdezAtt( 21*FW, 4*FH, abRunningAvg, 0) ; // lcd_outdezAtt( 21*FW, 4*FH, abRunningAvg, 0) ;
// Display raw BandGap result (debug) // Display raw BandGap result (debug)
lcd_puts_P( 19*FW, 5*FH, STR_BG) ; lcd_puts( 19*FW, 5*FH, STR_BG) ;
lcd_outdezAtt(21*FW, 6*FH, BandGap, 0); lcd_outdezAtt(21*FW, 6*FH, BandGap, 0);
lcd_outdezAtt(21*FW, 7*FH, anaIn(7)*35/512, PREC1); lcd_outdezAtt(21*FW, 7*FH, anaIn(7)*35/512, PREC1);
@@ -576,15 +576,13 @@ void menuProcDiagCalib(uint8_t event)
switch (idxState) { switch (idxState) {
case 0: case 0:
// START CALIBRATION // START CALIBRATION
// [MENU] lcd_puts(3*FW, 3*FH, STR_MENUTOSTART);
lcd_puts_P(2*FW, 3*FH, STR_MENUTOSTART);
break; break;
case 1: case 1:
// SET MIDPOINT // SET MIDPOINT
// [MENU] lcd_putsAtt(5*FW, 2*FH, STR_SETMIDPOINT, s_noScroll ? INVERS : 0);
lcd_putsAtt(2*FW, 2*FH, STR_SETMIDPOINT, s_noScroll ? INVERS : 0); lcd_puts(3*FW, 3*FH, STR_MENUWHENDONE);
lcd_puts_P(2*FW, 3*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<7; i++) { for (uint8_t i=0; i<7; i++) {
loVals[i] = 15000; loVals[i] = 15000;
@@ -595,9 +593,8 @@ void menuProcDiagCalib(uint8_t event)
case 2: case 2:
// MOVE STICKS/POTS // MOVE STICKS/POTS
// [MENU] lcd_putsAtt(3*FW, 2*FH, STR_MOVESTICKSPOTS, s_noScroll ? INVERS : 0);
lcd_putsAtt(2*FW, 2*FH, STR_MOVESTICKSPOTS, s_noScroll ? INVERS : 0); lcd_puts(3*FW, 3*FH, STR_MENUWHENDONE);
lcd_puts_P(2*FW, 3*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<7; i++) { for (uint8_t i=0; i<7; i++) {
if (abs(loVals[i]-hiVals[i])>50) { if (abs(loVals[i]-hiVals[i])>50) {
+102 -41
View File
@@ -68,7 +68,7 @@ void lcd_putcAtt(uint8_t x, uint8_t y, const char c, uint8_t mode)
uint8_t *p = &displayBuf[ y / 8 * DISPLAY_W + x ]; uint8_t *p = &displayBuf[ y / 8 * DISPLAY_W + x ];
const pm_uchar *q = &font_5x8_x20_x7f[ + (c-0x20)*5]; const pm_uchar *q = &font_5x8_x20_x7f[ + (c-0x20)*5];
bool inv = (mode & INVERS) ? true : (mode & BLINK ? BLINK_ON_PHASE : false); bool inv = (mode & INVERS) ? true : (mode & BLINK ? BLINK_ON_PHASE : false);
if(mode & DBLSIZE) if(mode & DBLSIZE)
{ {
/* each letter consists of ten top bytes followed by /* each letter consists of ten top bytes followed by
@@ -76,23 +76,20 @@ void lcd_putcAtt(uint8_t x, uint8_t y, const char c, uint8_t mode)
q = &font_10x16_x20_x7f[(c-0x20)*10 + ((c-0x20)/16)*160]; q = &font_10x16_x20_x7f[(c-0x20)*10 + ((c-0x20)/16)*160];
for(char i=5; i>=0; i--) { for(char i=5; i>=0; i--) {
if (mode & CONDENSED && i==0) break; if (mode & CONDENSED && i==0) break;
/*top byte*/ uint8_t b1=0, b2=0, b3=0, b4=0;
uint8_t b1 = i>0 ? pgm_read_byte(q) : 0; if (i>0) {
/*bottom byte*/ b1 = pgm_read_byte(q); /*top byte*/
uint8_t b3 = i>0 ? pgm_read_byte(160+q) : 0; b3 = pgm_read_byte(160+q); /*bottom byte*/
/*top byte*/ b2 = pgm_read_byte(++q); /*top byte*/
uint8_t b2 = i>0 ? pgm_read_byte(++q) : 0; b4 = pgm_read_byte(160+q); /*bottom byte*/
/*bottom byte*/ }
uint8_t b4 = i>0 ? pgm_read_byte(160+q) : 0;
if(inv) { if(inv) {
b1=~b1; b1=~b1;
b2=~b2; b2=~b2;
b3=~b3; b3=~b3;
b4=~b4; b4=~b4;
} }
if(&p[DISPLAY_W+1] < DISPLAY_END) {
if(&p[DISPLAY_W+1] < DISPLAY_END){
p[0]=b1; p[0]=b1;
p[1]=b2; p[1]=b2;
p[DISPLAY_W] = b3; p[DISPLAY_W] = b3;
@@ -110,15 +107,21 @@ void lcd_putcAtt(uint8_t x, uint8_t y, const char c, uint8_t mode)
condense=1; condense=1;
} }
for (char i=5; i!=0; i--) { uint8_t ym8 = (y % 8);
uint8_t b = pgm_read_byte(q++); for (char i=5; i>=0; i--) {
uint8_t b = (i>0 ? pgm_read_byte(q++) : 0);
if (inv) b = ~b;
if (condense && i==4) { if (condense && i==4) {
/*condense the letter by skipping column 4 */ /*condense the letter by skipping column 4 */
continue; continue;
} }
if(p<DISPLAY_END) *p++ = inv ? ~b : b; if (p<DISPLAY_END) {
*p = (*p & (~(0xff << ym8))) + (b << ym8);
if (ym8) { uint8_t *r = p + DISPLAY_W; if (r<DISPLAY_END) *r = (*r & (~(0xff >> (8-ym8)))) + (b >> (8-ym8)); }
p++;
}
} }
if(p<DISPLAY_END) *p++ = inv ? ~0 : 0;
} }
} }
@@ -142,10 +145,15 @@ void lcd_putsnAtt(uint8_t x,uint8_t y,const pm_char * s,uint8_t len,uint8_t mode
c = pgm_read_byte(s); c = pgm_read_byte(s);
break; break;
} }
if (!c) break; if (!c || x>DISPLAY_W-6) break;
lcd_putcAtt(x,y,c,mode); if (c >= 0x20) {
x+=FW; lcd_putcAtt(x,y,c,mode);
if (mode&DBLSIZE) x+=FW-1; x += FW;
if (mode&DBLSIZE) x += FW-1;
}
else {
x += (c*FW);
}
s++; s++;
len--; len--;
} }
@@ -162,11 +170,16 @@ void lcd_putsAtt(uint8_t x,uint8_t y,const pm_char * s,uint8_t mode)
lcd_putsnAtt(x, y, s, 255, mode); lcd_putsnAtt(x, y, s, 255, mode);
} }
void lcd_puts_P(uint8_t x,uint8_t y,const pm_char * s) void lcd_puts(uint8_t x,uint8_t y,const pm_char * s)
{ {
lcd_putsAtt( x, y, s, 0); lcd_putsAtt( x, y, s, 0);
} }
void lcd_putsLeft(uint8_t y, const pm_char * s)
{
lcd_putsAtt(0, y, s, 0);
}
void lcd_outhex4(uint8_t x,uint8_t y,uint16_t val) void lcd_outhex4(uint8_t x,uint8_t y,uint16_t val)
{ {
x+=FWNUM*4; x+=FWNUM*4;
@@ -331,6 +344,9 @@ void lcd_vlineStip(uint8_t x, int8_t y, int8_t h, uint8_t pat)
if (y<0) { h+=y; y=0; } if (y<0) { h+=y; y=0; }
if (y+h > DISPLAY_H) { h = DISPLAY_H - y; } if (y+h > DISPLAY_H) { h = DISPLAY_H - y; }
if (pat==DOTTED && !(y%2))
pat = ~pat;
uint8_t *p = &displayBuf[ y / 8 * DISPLAY_W + x ]; uint8_t *p = &displayBuf[ y / 8 * DISPLAY_W + x ];
y = y % 8; y = y % 8;
if (y) { if (y) {
@@ -362,16 +378,18 @@ void lcd_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t pat, uint8_t a
{ {
if (!((att & BLINK) && BLINK_ON_PHASE)) { if (!((att & BLINK) && BLINK_ON_PHASE)) {
lcd_vlineStip(x, y, h, pat); lcd_vlineStip(x, y, h, pat);
lcd_hlineStip(x, y+h-1, w, pat);
lcd_vlineStip(x+w-1, y, h, pat); lcd_vlineStip(x+w-1, y, h, pat);
if (~att & ROUND) { x+=1; w-=2; }
lcd_hlineStip(x, y+h-1, w, pat);
lcd_hlineStip(x, y, w, pat); lcd_hlineStip(x, y, w, pat);
} }
} }
void lcd_filled_rect(uint8_t x, int8_t y, uint8_t w, uint8_t h, uint8_t att) void lcd_filled_rect(uint8_t x, int8_t y, uint8_t w, uint8_t h, uint8_t pat, uint8_t att)
{ {
for (int8_t i=y; i<y+h; i++) { for (int8_t i=y; i<y+h; i++) {
if (i>=0 && i<64) lcd_hline(x, i, w, att); if (i>=0 && i<64) lcd_hlineStip(x, i, w, pat, att);
if (pat != 0xff) pat = ~pat;
} }
} }
@@ -387,6 +405,7 @@ void putsTime(uint8_t x,uint8_t y,int16_t tme,uint8_t att,uint8_t att2)
lcd_outdezNAtt(lcd_lastPos+FW, y, tme%60, att2|LEADING0|LEFT, 2); lcd_outdezNAtt(lcd_lastPos+FW, y, tme%60, att2|LEADING0|LEFT, 2);
} }
// TODO to be optimized with putsTelemetryValue
void putsVolts(uint8_t x, uint8_t y, uint16_t volts, uint8_t att) void putsVolts(uint8_t x, uint8_t y, uint16_t volts, uint8_t att)
{ {
lcd_outdezAtt(x, y, (int16_t)volts, att | ((att&PREC2)==PREC2 ? 0 : PREC1)); lcd_outdezAtt(x, y, (int16_t)volts, att | ((att&PREC2)==PREC2 ? 0 : PREC1));
@@ -493,29 +512,71 @@ void putsTmrMode(uint8_t x, uint8_t y, int8_t mode, uint8_t att)
#ifdef FRSKY #ifdef FRSKY
// TODO move this into frsky.cpp // TODO move this into frsky.cpp
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, uint8_t val, uint8_t att) void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att)
{ {
// TODO optimize this, avoid int32_t // TODO enum
int16_t converted_value = ((int32_t)val+g_model.frsky.channels[channel].offset) * g_model.frsky.channels[channel].ratio * 2 / 51;
if (g_model.frsky.channels[channel].type == UNIT_VOLTS && converted_value < 1000) { switch (channel) {
att |= PREC2; case 0:
case 1:
// A1 and A2
{
// TODO optimize this, avoid int32_t
int16_t converted_value = ((int32_t)val+g_model.frsky.channels[channel].offset) * g_model.frsky.channels[channel].ratio * 2 / 51;
if (g_model.frsky.channels[channel].type >= UNIT_RAW) {
converted_value /= 10;
}
else {
if (converted_value < 1000) {
att |= PREC2;
}
else {
converted_value /= 10;
att |= PREC1;
}
}
putsTelemetryValue(x, y, converted_value, g_model.frsky.channels[channel].type, att);
}
break;
case 2:
// Altitude
putsTelemetryValue(x, y, val * 4, UNIT_METERS, att);
break;
case 3:
// RPMs
lcd_outdezAtt(x, y, (int16_t)val * 50, att);
break;
case 4:
// FUEL
putsTelemetryValue(x, y, val, UNIT_PERCENT, att);
break;
case 5:
case 6:
// TEMPERATURE
putsTelemetryValue(x, y, val, UNIT_DEGREES, att);
break;
case 7:
// SPEED
putsTelemetryValue(x, y, val*2, UNIT_KMH, att);
break;
case 8:
// CELL
putsVolts(x, y, val*2, att);
break;
} }
else {
converted_value /= 10;
}
putsTelemetryValue(x, y, converted_value, g_model.frsky.channels[channel].type, att);
} }
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att) void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att)
{ {
if (unit == UNIT_VOLTS) { lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att); // TODO we could add this test inside lcd_outdezAtt!
putsVolts(x, y, val, att); if (~att & NO_UNIT && unit != UNIT_RAW)
} lcd_putsnAtt(lcd_lastPos+1, y, STR_VTELEMUNIT+LEN_VTELEMUNIT*unit, LEN_VTELEMUNIT, 0);
else {
lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att); // TODO we could add this test inside lcd_outdezAtt!
if (~att & NO_UNIT && unit != UNIT_RAW)
lcd_putsnAtt(lcd_lastPos+1, y, STR_VTELEMUNIT+LEN_VTELEMUNIT*unit, LEN_VTELEMUNIT, 0);
}
} }
#endif #endif
+10 -5
View File
@@ -59,6 +59,7 @@
/* line, rect, square flags */ /* line, rect, square flags */
#define BLACK 0x02 #define BLACK 0x02
#define WHITE 0x04 #define WHITE 0x04
#define ROUND 0x08
/* other flags */ /* other flags */
#define NO_UNIT UNSIGN #define NO_UNIT UNSIGN
@@ -72,7 +73,8 @@ extern void lcd_putcAtt(unsigned char x,unsigned char y,const char c,uint8_t mod
extern void lcd_putsAtt(unsigned char x,unsigned char y,const pm_char * s,uint8_t mode); extern void lcd_putsAtt(unsigned char x,unsigned char y,const pm_char * s,uint8_t mode);
extern void lcd_putsnAtt(unsigned char x,unsigned char y,const pm_char * s,unsigned char len,uint8_t mode); extern void lcd_putsnAtt(unsigned char x,unsigned char y,const pm_char * s,unsigned char len,uint8_t mode);
extern void lcd_puts_P(unsigned char x,unsigned char y,const pm_char * s); extern void lcd_puts(unsigned char x,unsigned char y,const pm_char * s);
extern void lcd_putsLeft(unsigned char y, const pm_char * s);
extern void lcd_putsn_P(unsigned char x,unsigned char y,const pm_char * s,unsigned char len); extern void lcd_putsn_P(unsigned char x,unsigned char y,const pm_char * s,unsigned char len);
extern void lcd_outhex4(unsigned char x,unsigned char y,uint16_t val); extern void lcd_outhex4(unsigned char x,unsigned char y,uint16_t val);
@@ -99,19 +101,22 @@ extern void putsTime(uint8_t x,uint8_t y, int16_t tme, uint8_t att, uint8_t att2
#ifdef FRSKY #ifdef FRSKY
// TODO move this into frsky.h // TODO move this into frsky.h
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, uint8_t val, uint8_t att); void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att);
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att); void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att);
#endif #endif
#define SOLID 0xff
#define DOTTED 0x55
extern void lcd_plot(unsigned char x, unsigned char y, uint8_t att=0); extern void lcd_plot(unsigned char x, unsigned char y, uint8_t att=0);
extern void lcd_hline(unsigned char x, unsigned char y, uint8_t w, uint8_t att=0); extern void lcd_hline(unsigned char x, unsigned char y, uint8_t w, uint8_t att=0);
extern void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att=0); extern void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att=0);
extern void lcd_vline(uint8_t x, int8_t y, int8_t h); extern void lcd_vline(uint8_t x, int8_t y, int8_t h);
extern void lcd_vlineStip(uint8_t x, int8_t y, int8_t h, uint8_t pat); extern void lcd_vlineStip(uint8_t x, int8_t y, int8_t h, uint8_t pat);
extern void lcd_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t pat=0xff, uint8_t att=0); extern void lcd_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t pat=SOLID, uint8_t att=0);
extern void lcd_filled_rect(uint8_t x, int8_t y, uint8_t w, uint8_t h, uint8_t att=0); extern void lcd_filled_rect(uint8_t x, int8_t y, uint8_t w, uint8_t h, uint8_t pat=SOLID, uint8_t att=0);
inline void lcd_square(uint8_t x, uint8_t y, uint8_t w, uint8_t att=0) { lcd_rect(x, y, w, w, 0xff, att); } inline void lcd_square(uint8_t x, uint8_t y, uint8_t w, uint8_t att=0) { lcd_rect(x, y, w, w, SOLID, att); }
#define DO_CROSS(xx,yy,ww) \ #define DO_CROSS(xx,yy,ww) \
lcd_vline(xx,yy-ww/2,ww); \ lcd_vline(xx,yy-ww/2,ww); \
+138 -138
View File
@@ -40,11 +40,11 @@ uint8_t tabViews[] = {
2, /*e_inputs*/ 2, /*e_inputs*/
1, /*e_timer2*/ 1, /*e_timer2*/
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
4, /*e_telemetry*/ 5, /*e_telemetry*/
#elif defined(WS_HOW_HIGH) #elif defined(WS_HOW_HIGH)
3, /*e_telemetry*/ 4, /*e_telemetry*/
#elif defined(FRSKY) #elif defined(FRSKY)
2, /*e_telemetry*/ 3, /*e_telemetry*/
#endif #endif
}; };
@@ -67,8 +67,8 @@ void doMainScreenGrphics()
DO_CROSS(LBOX_CENTERX,LBOX_CENTERY,3) DO_CROSS(LBOX_CENTERX,LBOX_CENTERY,3)
DO_CROSS(RBOX_CENTERX,RBOX_CENTERY,3) DO_CROSS(RBOX_CENTERX,RBOX_CENTERY,3)
lcd_square(LBOX_CENTERX+(calibratedStick[CONVERT_MODE(0+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, LBOX_CENTERY-(calibratedStick[CONVERT_MODE(1+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH); lcd_square(LBOX_CENTERX+(calibratedStick[CONVERT_MODE(0+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, LBOX_CENTERY-(calibratedStick[CONVERT_MODE(1+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH, ROUND);
lcd_square(RBOX_CENTERX+(calibratedStick[CONVERT_MODE(3+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, RBOX_CENTERY-(calibratedStick[CONVERT_MODE(2+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH); lcd_square(RBOX_CENTERX+(calibratedStick[CONVERT_MODE(3+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, RBOX_CENTERY-(calibratedStick[CONVERT_MODE(2+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH, ROUND);
// Optimization by Mike Blandford // Optimization by Mike Blandford
{ {
@@ -81,11 +81,31 @@ void doMainScreenGrphics()
} }
} }
#if defined(FRSKY)
void displayA1A2(uint8_t x, uint8_t y, uint8_t idx)
{
lcd_puts(x, y, PSTR("A :"));
lcd_putc(x+FW, y, '1'+idx);
}
void displayRssiLine()
{
lcd_hline(0, 54, 128, 0); // separator
lcd_putsLeft(7*FH+1, STR_TX); lcd_outdezNAtt(4*FW, 7*FH+1, frskyRSSI[1].value, LEADING0, 2);
lcd_rect(25, 57, 38, 7);
lcd_filled_rect(26, 58, 9*frskyRSSI[1].value/25, 5);
lcd_puts(105, 7*FH+1, STR_RX); lcd_outdezNAtt(105+4*FW-1, 7*FH+1, frskyRSSI[0].value, LEADING0, 2);
lcd_rect(65, 57, 38, 7);
uint8_t v = 9*frskyRSSI[0].value/25;
lcd_filled_rect(66+36-v, 58, v, 5);
}
#endif
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
void displayAltitudeLine(uint8_t x, uint8_t y, uint8_t flags) void displayAltitudeLine(uint8_t x, uint8_t y, uint8_t flags)
{ {
lcd_puts_P(x, y, STR_ALT); lcd_puts(x, y, STR_ALT);
int16_t value = frskyHubData.baroAltitude + baroAltitudeOffset; int16_t value = frskyHubData.baroAltitude + frskyHubData.baroAltitudeOffset;
putsTelemetryValue(lcd_lastPos, y, value, UNIT_METERS, flags|LEFT); putsTelemetryValue(lcd_lastPos, y, value, UNIT_METERS, flags|LEFT);
} }
#endif #endif
@@ -248,11 +268,11 @@ void menuMainView(uint8_t event)
uint8_t xm, ym; uint8_t xm, ym;
xm = x[CONVERT_MODE(i+1)-1]; xm = x[CONVERT_MODE(i+1)-1];
uint8_t att = 0; uint8_t att = ROUND;
int16_t val = getTrimValue(getTrimFlightPhase(i, phase), i); int16_t val = getTrimValue(getTrimFlightPhase(i, phase), i);
if (val < -125 || val > 125) if (val < -125 || val > 125)
att = BLINK; att = BLINK|ROUND;
if (val < -(TL+1)*4) if (val < -(TL+1)*4)
val = -(TL+1); val = -(TL+1);
@@ -265,7 +285,6 @@ void menuMainView(uint8_t event)
ym = 31; ym = 31;
lcd_vline(xm, ym-TL, TL*2); lcd_vline(xm, ym-TL, TL*2);
if (i!=2 || !g_model.thrTrim) { if (i!=2 || !g_model.thrTrim) {
// TODO square?
lcd_vline(xm-1, ym-1, 3); lcd_vline(xm-1, ym-1, 3);
lcd_vline(xm+1, ym-1, 3); lcd_vline(xm+1, ym-1, 3);
} }
@@ -288,7 +307,7 @@ void menuMainView(uint8_t event)
uint8_t x0,y0; uint8_t x0,y0;
int16_t val = g_chans512[i]; int16_t val = g_chans512[i];
//val += g_model.limitData[i].revert ? g_model.limitData[i].offset : -g_model.limitData[i].offset; //val += g_model.limitData[i].revert ? g_model.limitData[i].offset : -g_model.limitData[i].offset;
switch(view_base) // TODO optim with if (view_base == e_e_outputValues) ... else ... switch(view_base)
{ {
case e_outputValues: case e_outputValues:
x0 = (i%4*9+3)*FW/2; x0 = (i%4*9+3)*FW/2;
@@ -305,19 +324,18 @@ void menuMainView(uint8_t event)
#define WBAR2 (50/2) #define WBAR2 (50/2)
x0 = i<4 ? 128/4+2 : 128*3/4-2; x0 = i<4 ? 128/4+2 : 128*3/4-2;
y0 = 38+(i%4)*5; y0 = 38+(i%4)*5;
int8_t l = (abs(val) * WBAR2 + 512) / 1024;
if(l>WBAR2) l = WBAR2; // prevent bars from going over the end - comment for debugging
lcd_hlineStip(x0-WBAR2,y0,WBAR2*2+1,0x55); int8_t len = (abs(val) * WBAR2 + 512) / 1024;
if(len>WBAR2) len = WBAR2; // prevent bars from going over the end - comment for debugging
lcd_hlineStip(x0-WBAR2, y0, WBAR2*2+1, DOTTED);
lcd_vline(x0,y0-2,5); lcd_vline(x0,y0-2,5);
// TODO optim if (val>0){
if(val>0){
x0+=1; x0+=1;
}else{ }else{
x0-=l; x0-=len;
} }
lcd_hline(x0,y0+1,l); lcd_hline(x0,y0+1,len);
lcd_hline(x0,y0-1,l); lcd_hline(x0,y0-1,len);
break; break;
} }
} }
@@ -340,103 +358,98 @@ void menuMainView(uint8_t event)
V_BAR(SCREEN_WIDTH/2-5*4+2+i*5, SCREEN_HEIGHT-8, len) V_BAR(SCREEN_WIDTH/2-5*4+2+i*5, SCREEN_HEIGHT-8, len)
} }
for (uint8_t i=0; i<12; i++) { for (uint8_t i=0; i<12; i++) {
if ((i%6) < 3) lcd_puts_P(i<6 ? 2*FW-2 : 16*FW-2, (i%3)*FH+4*FH, STR_SW); if ((i%6) < 3) lcd_puts(i<6 ? 2*FW-2 : 16*FW-2, (i%3)*FH+4*FH, STR_SW);
lcd_putcAtt((i<6 ? 2*FW-2 : 16*FW-2) + 2 * FW + ((i%6) < 3 ? 0 : FW), (i%3)*FH+4*FH, i<9 ? '1'+i : 'A'+i-9, getSwitch(10+i, 0) ? INVERS : 0); lcd_putcAtt((i<6 ? 2*FW-2 : 16*FW-2) + 2 * FW + ((i%6) < 3 ? 0 : FW), (i%3)*FH+4*FH, i<9 ? '1'+i : 'A'+i-9, getSwitch(10+i, 0) ? INVERS : 0);
} }
} }
} }
#if defined(FRSKY) #if defined(FRSKY)
else if (view_base == e_telemetry) { else if (view_base == e_telemetry) {
static uint8_t displayCount = 0;
static uint8_t staticTelemetry[2];
static uint8_t staticRSSI[2];
static bool alarmRaised[2];
if (frskyStreaming) { if (frskyStreaming) {
uint8_t y0, x0, blink; uint8_t y0, x0, blink;
if (!displayCount) {
for (int i=0; i<2; i++) {
staticTelemetry[i] = frskyTelemetry[i].value;
staticRSSI[i] = frskyRSSI[i].value;
alarmRaised[i] = FRSKY_alarmRaised(i);
}
}
displayCount = (displayCount+1) % 50;
if (view == e_telemetry+ALTERNATE_VIEW) { if (view == e_telemetry+ALTERNATE_VIEW) {
// The bars
uint8_t bars_height = 5;
for (int8_t i=3; i>=0; i--) {
if (g_model.frsky.bars[i].source && (63-g_model.frsky.bars[i].barMax) > g_model.frsky.bars[i].barMin) {
lcd_putsnAtt(0, bars_height+bars_height+1+i*(bars_height+6), STR_VTELEMBARS+LEN_VTELEMBARS*g_model.frsky.bars[i].source, LEN_VTELEMBARS, 0);
lcd_rect(25, bars_height+6+i*(bars_height+6), 101, bars_height+2);
int16_t value = getValue(CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+g_model.frsky.bars[i].source-1);
uint8_t threshold = 0, thresholdX = 0;
if (g_model.frsky.bars[i].source <= 2)
threshold = g_model.frsky.channels[g_model.frsky.bars[i].source-1].alarms_value[0];
else
threshold = barsThresholds[g_model.frsky.bars[i].source-3];
if (threshold) {
thresholdX = (uint8_t)(int16_t)((int16_t)100 * (threshold - g_model.frsky.bars[i].barMin * 4) / ((63 - g_model.frsky.bars[i].barMax) * 4 - g_model.frsky.bars[i].barMin * 4));
if (thresholdX > 100)
thresholdX = 0;
}
uint8_t width = (uint8_t)limit((int16_t)0, (int16_t)((int16_t)100 * (value - g_model.frsky.bars[i].barMin * 4) / ((63 - g_model.frsky.bars[i].barMax) * 4 - g_model.frsky.bars[i].barMin * 4)), (int16_t)100);
lcd_filled_rect(26, bars_height+6+1+i*(bars_height+6), width, bars_height, (threshold > value) ? DOTTED : SOLID);
for (uint8_t j=50; j<125; j+=25)
if (j>thresholdX) lcd_vline(j, bars_height+6+1+i*(bars_height+6), bars_height);
if (thresholdX) {
lcd_vlineStip(26+thresholdX, bars_height+4+i*(bars_height+6), bars_height+3, DOTTED);
lcd_hline(25+thresholdX, bars_height+4+i*(bars_height+6), 3);
}
}
else {
bars_height += 2;
}
}
displayRssiLine();
}
else if (view == e_telemetry+2*ALTERNATE_VIEW) {
// Big A1 / A2 with min and max
if (g_model.frsky.channels[0].ratio || g_model.frsky.channels[1].ratio) { if (g_model.frsky.channels[0].ratio || g_model.frsky.channels[1].ratio) {
x0 = 0; x0 = 0;
for (int i=0; i<2; i++) { for (uint8_t i=0; i<2; i++) {
if (g_model.frsky.channels[i].ratio) { if (g_model.frsky.channels[i].ratio) {
blink = (alarmRaised[i] ? INVERS : 0); blink = (FRSKY_alarmRaised(i) ? INVERS : 0);
lcd_puts_P(x0, 3*FH, PSTR("A :")); displayA1A2(x0, 2*FH, i);
lcd_putc(x0+FW, 3*FH, '1'+i);
x0 += 3*FW; x0 += 3*FW;
putsTelemetryChannel(x0, 2*FH, i, staticTelemetry[i], blink|DBLSIZE|LEFT); putsTelemetryChannel(x0, 2*FH, i, frskyTelemetry[i].value, blink|DBLSIZE|LEFT);
putsTelemetryChannel(x0+FW, 4*FH, i, frskyTelemetry[i].min, 0); putsTelemetryChannel(x0+FW, 3*FH, i, frskyTelemetry[i].min, 0);
putsTelemetryChannel(x0+3*FW, 4*FH, i, frskyTelemetry[i].max, LEFT); putsTelemetryChannel(x0+3*FW, 3*FH, i, frskyTelemetry[i].max, LEFT);
x0 = 11*FW-2; x0 = 11*FW-2;
} }
} }
} }
#if 0 // Cells voltage
// Display RX Batt Volts only if a valid channel (A1/A2) has been selected lcd_putsLeft( 5*FH-3, PSTR("V1=\004V2=\004V3=")) ;
if (g_eeFrsky.rxVoltsChannel >0) lcd_putsLeft( 6*FH-3, PSTR("V4=\004V5=\004V6="));
{ {
y+=FH; lcd_puts_P(2*FW, y, STR_RXBATT); uint8_t x, y;
// Rx batt voltage bar frame x = 6*FW;
y = 6*FH-3;
// Minimum voltage for (uint8_t k=0; k<frskyHubData.cellsCount && k<6; k++) {
lcd_vline(3, 58, 6); // marker uint8_t attr = (barsThresholds[6/*TODO constant*/] && frskyHubData.cellVolts[k] < barsThresholds[6/*TODO constant*/]) ? BLINK|PREC2 : PREC2;
if (k == 3) {
y = 6*FH; x = 6*FW;
putsVolts(1, y, g_eeFrsky.rxVoltsBarMin, LEFT); y = 7*FH-3;
uint8_t middleVolts = g_eeFrsky.rxVoltsBarMin+(g_eeFrsky.rxVoltsBarMax - g_eeFrsky.rxVoltsBarMin)/2; }
putsVolts(64-FW, y, middleVolts, LEFT); lcd_outdezNAtt(x, y, frskyHubData.cellVolts[k] * 2, attr, 4);
lcd_vline(64, 58, 6); // marker x += 7*FW;
putsVolts(128-FW, y, g_eeFrsky.rxVoltsBarMax, 0);
lcd_vline(125, 58, 6); // marker
// Rx Batt: volts (255 == g_eefrsky.rxVoltsMax)
uint16_t centaVolts = (voltsVal > 0) ? (10 * (uint16_t)g_eeFrsky.rxVoltsMax * (uint32_t)(voltsVal) / 255) + g_eeFrsky.rxVoltsOfs : 0;
lcd_outdezAtt(13*FW, 4*FH, centaVolts, 0|PREC2);
lcd_putc(13*FW, 4*FH, 'v');
// draw the actual voltage bar
uint16_t centaVoltsMin = 10 * g_eeFrsky.rxVoltsBarMin;
if (centaVolts >= centaVoltsMin)
{
uint8_t vbarLen = (centaVolts - (10 * (uint16_t)g_eeFrsky.rxVoltsBarMin)) * 12
/ (g_eeFrsky.rxVoltsBarMax - g_eeFrsky.rxVoltsBarMin);
for (uint8_t i = 59; i < 63; i++) // Bar 4 pixels thick (high)
lcd_hline(4, i, (vbarLen > 120) ? 120 : vbarLen);
} }
} }
#endif
lcd_puts_P(0, 6*FH, STR_RX); displayRssiLine();
lcd_outdezAtt(3 * FW, 5*FH+2, staticRSSI[0], DBLSIZE|LEFT);
lcd_outdezAtt(4 * FW, 7*FH, frskyRSSI[0].min, 0);
lcd_outdezAtt(6 * FW, 7*FH, frskyRSSI[0].max, LEFT);
lcd_puts_P(11 * FW - 2, 6*FH, STR_TX);
lcd_outdezAtt(14 * FW - 2, 5*FH+2, staticRSSI[1], DBLSIZE|LEFT);
lcd_outdezAtt(15 * FW - 2, 7*FH, frskyRSSI[1].min, 0);
lcd_outdezAtt(17 * FW - 2, 7*FH, frskyRSSI[1].max, LEFT);
} }
#ifdef WS_HOW_HIGH #ifdef WS_HOW_HIGH
else if (g_model.frsky.usrProto == PROTO_WS_HOW_HIGH && view == e_telemetry+2*ALTERNATE_VIEW) { else if (g_model.frsky.usrProto == PROTO_WS_HOW_HIGH && view == e_telemetry+3*ALTERNATE_VIEW) {
displayAltitudeLine(0, 4*FH, DBLSIZE); displayAltitudeLine(0, 4*FH, DBLSIZE);
lcd_puts_P(1*FW, 7*FH, STR_RX); displayRssiLine();
lcd_outdezAtt(4*FW, 7*FH, staticRSSI[0], LEFT);
lcd_puts_P(11*FW, 7*FH, STR_TX);
lcd_outdezAtt(14*FW, 7*FH, staticRSSI[1], LEFT);
lcd_filled_rect(0, 7*FH, DISPLAY_W, 8);
} }
#endif #endif
#ifdef FRSKY_HUB #ifdef FRSKY_HUB
else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+3*ALTERNATE_VIEW) { else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+4*ALTERNATE_VIEW) {
#define DATE_LINE (7*FH) #define DATE_LINE (7*FH+1)
//lcd_puts_P(0, DATE_LINE, PSTR("D/T:")); //lcd_putsLeft( DATE_LINE, PSTR("D/T:"));
// Date // Date
lcd_outdezNAtt(3*FW, DATE_LINE, frskyHubData.year+2000, LEFT, 4); lcd_outdezNAtt(3*FW, DATE_LINE, frskyHubData.year+2000, LEFT, 4);
lcd_putc(7*FW-4, DATE_LINE, '-'); lcd_putc(7*FW-4, DATE_LINE, '-');
@@ -450,11 +463,11 @@ void menuMainView(uint8_t event)
lcd_outdezNAtt(15*FW+2, DATE_LINE, frskyHubData.min, LEFT|LEADING0, 2); lcd_outdezNAtt(15*FW+2, DATE_LINE, frskyHubData.min, LEFT|LEADING0, 2);
lcd_putc(17*FW-1, DATE_LINE, ':'); lcd_putc(17*FW-1, DATE_LINE, ':');
lcd_outdezNAtt(18*FW-1, DATE_LINE, frskyHubData.sec, LEFT|LEADING0, 2); lcd_outdezNAtt(18*FW-1, DATE_LINE, frskyHubData.sec, LEFT|LEADING0, 2);
lcd_filled_rect(0, DATE_LINE, DISPLAY_W, 8); lcd_filled_rect(0, DATE_LINE-1, DISPLAY_W, 8);
// Latitude // Latitude
#define LAT_LINE (2*FH) #define LAT_LINE (2*FH-4)
lcd_puts_P(0, LAT_LINE, PSTR("Lat:")); lcd_putsLeft( LAT_LINE, PSTR("Lat:"));
lcd_outdezAtt(lcd_lastPos, LAT_LINE, frskyHubData.gpsLatitude_bp / 100, LEFT); // ddd before '.' lcd_outdezAtt(lcd_lastPos, LAT_LINE, frskyHubData.gpsLatitude_bp / 100, LEFT); // ddd before '.'
lcd_putc(lcd_lastPos, LAT_LINE, '@'); lcd_putc(lcd_lastPos, LAT_LINE, '@');
uint8_t mn = frskyHubData.gpsLatitude_bp % 100; uint8_t mn = frskyHubData.gpsLatitude_bp % 100;
@@ -464,8 +477,8 @@ void menuMainView(uint8_t event)
lcd_putc(lcd_lastPos+1, LAT_LINE, frskyHubData.gpsLatitudeNS ? frskyHubData.gpsLatitudeNS : '-'); lcd_putc(lcd_lastPos+1, LAT_LINE, frskyHubData.gpsLatitudeNS ? frskyHubData.gpsLatitudeNS : '-');
// Longitude // Longitude
#define LONG_LINE (3*FH) #define LONG_LINE (3*FH-3)
lcd_puts_P(0, LONG_LINE, PSTR("Lon:")); lcd_putsLeft(LONG_LINE, PSTR("Lon:"));
lcd_outdezAtt(lcd_lastPos, LONG_LINE, frskyHubData.gpsLongitude_bp / 100, LEFT); // ddd before '.' lcd_outdezAtt(lcd_lastPos, LONG_LINE, frskyHubData.gpsLongitude_bp / 100, LEFT); // ddd before '.'
lcd_putc(lcd_lastPos, LONG_LINE, '@'); lcd_putc(lcd_lastPos, LONG_LINE, '@');
mn = frskyHubData.gpsLongitude_bp % 100; mn = frskyHubData.gpsLongitude_bp % 100;
@@ -476,7 +489,7 @@ void menuMainView(uint8_t event)
#if 0 #if 0
// Course / Heading // Course / Heading
lcd_puts_P(5, 5*FH, STR_HDG); lcd_puts(5, 5*FH, STR_HDG);
lcd_outdezNAtt(lcd_lastPos, 5*FH, frskyHubData.gpsCourse_bp, LEFT|LEADING0, 3); // before '.' lcd_outdezNAtt(lcd_lastPos, 5*FH, frskyHubData.gpsCourse_bp, LEFT|LEADING0, 3); // before '.'
lcd_plot(lcd_lastPos, 6*FH-2, 0); // small decimal point lcd_plot(lcd_lastPos, 6*FH-2, 0); // small decimal point
lcd_outdezAtt(lcd_lastPos+2, 5*FH, frskyHubData.gpsCourse_ap, LEFT); // after '.' lcd_outdezAtt(lcd_lastPos+2, 5*FH, frskyHubData.gpsCourse_ap, LEFT); // after '.'
@@ -485,81 +498,68 @@ void menuMainView(uint8_t event)
// Speed // Speed
#define SPEED_LINE (6*FH) #define SPEED_LINE (6*FH)
lcd_puts_P(0, SPEED_LINE, STR_SPD); lcd_putsLeft( SPEED_LINE, STR_SPDnMAX);
putsTelemetryValue(lcd_lastPos, SPEED_LINE, frskyHubData.gpsSpeed_bp, UNIT_KTS, LEFT|DBLSIZE); // before '.' putsTelemetryValue(4*FW, SPEED_LINE, frskyHubData.gpsSpeed_bp, UNIT_KTS, LEFT|DBLSIZE); // before '.'
// lcd_putcAtt(lcd_lastPos-2, 5*FH, '.', DBLSIZE); // small decimal point // lcd_putcAtt(lcd_lastPos-2, 5*FH, '.', DBLSIZE); // small decimal point
// lcd_outdezAtt(lcd_lastPos+FW, 5*FH, frskyHubData.gpsSpeed_ap, LEFT|UNSIGN|DBLSIZE); // after '.' // lcd_outdezAtt(lcd_lastPos+FW, 5*FH, frskyHubData.gpsSpeed_ap, LEFT|UNSIGN|DBLSIZE); // after '.'
lcd_puts_P(10*FW, SPEED_LINE, PSTR("Max:")); putsTelemetryValue(17*FW, SPEED_LINE, frskyHubData.maxGpsSpeed, UNIT_KTS, LEFT); // before '.'
putsTelemetryValue(lcd_lastPos, SPEED_LINE, maxGpsSpeed, UNIT_KTS, LEFT); // before '.'
// Altitude // Altitude
#define ALTITUDE_LINE (4*FH) #define ALTITUDE_LINE (4*FH-1)
lcd_puts_P(0, ALTITUDE_LINE, STR_ALT); lcd_putsLeft( ALTITUDE_LINE, STR_ALT);
putsTelemetryValue(lcd_lastPos, ALTITUDE_LINE, frskyHubData.gpsAltitude_bp, UNIT_METERS, LEFT); // before '.' putsTelemetryValue(4*FW, ALTITUDE_LINE, frskyHubData.gpsAltitude_bp, UNIT_METERS, LEFT); // before '.'
// lcd_plot(lcd_lastPos, 8*FH-2, 0); // small decimal point // lcd_plot(lcd_lastPos, 8*FH-2, 0); // small decimal point
// lcd_outdezAtt(lcd_lastPos+2, 7*FH, frskyHubData.gpsAltitude_ap, LEFT|UNSIGN); // after '.' // lcd_outdezAtt(lcd_lastPos+2, 7*FH, frskyHubData.gpsAltitude_ap, LEFT|UNSIGN); // after '.'
} }
else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+2*ALTERNATE_VIEW) { else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+3*ALTERNATE_VIEW) {
// Temperature 1 // Temperature 1
lcd_puts_P(0, 4*FH, STR_TEMP1); lcd_putsLeft( 4*FH, STR_TEMP1nTEMP2);
putsTelemetryValue(lcd_lastPos, 4*FH, frskyHubData.temperature1, UNIT_DEGREES, DBLSIZE|LEFT); putsTelemetryValue(4*FW, 4*FH, frskyHubData.temperature1, UNIT_DEGREES, DBLSIZE|LEFT);
// Temperature 2 // Temperature 2
lcd_puts_P(11*FW, 4*FH, STR_TEMP2); putsTelemetryValue(15*FW, 4*FH, frskyHubData.temperature2, UNIT_DEGREES, DBLSIZE|LEFT);
putsTelemetryValue(lcd_lastPos, 4*FH, frskyHubData.temperature2, UNIT_DEGREES, DBLSIZE|LEFT);
// RPM // RPM
lcd_puts_P(0, 2*FH, STR_RPM); lcd_putsLeft(2*FH, STR_RPMnFUEL);
lcd_outdezNAtt(lcd_lastPos, 1*FH, frskyHubData.rpm, DBLSIZE|LEFT); lcd_outdezNAtt(4*FW, 1*FH, frskyHubData.rpm, DBLSIZE|LEFT);
// Fuel // Fuel
lcd_puts_P(10*FW, 2*FH, STR_FUEL); putsTelemetryValue(15*FW, 2*FH, frskyHubData.fuelLevel, UNIT_PERCENT, DBLSIZE|LEFT);
lcd_outdezNAtt(lcd_lastPos, 1*FH, frskyHubData.fuelLevel, DBLSIZE|LEFT); // TODO putsTelemetry + UNIT_PERCENT
lcd_putc(lcd_lastPos, 2*FH, '%');
#if 0
// Volts
lcd_puts_P(10*FW, 7*FH, STR_VOLTS);
lcd_outdezNAtt(lcd_lastPos, 6*FH, frskyHubData.volts, DBLSIZE|LEFT); // TODO putsTelemetry?
lcd_putc(lcd_lastPos, 7*FH, 'V');
#endif
// Altitude (barometric) // Altitude (barometric)
displayAltitudeLine(0, 6*FH, DBLSIZE); displayAltitudeLine(0, 6*FH, DBLSIZE);
// Accelerometer // Accelerometer
lcd_puts_P(0, 7*FH, STR_ACCEL); #define ACC_LINE (7*FH+1)
// lcd_puts_P(4*FW, 7*FH, PSTR("x:")); lcd_putsLeft(ACC_LINE, STR_ACCEL);
lcd_outdezNAtt(4*FW, 7*FH, (int32_t)frskyHubData.accelX * 100 / 256, LEFT|PREC2); // lcd_puts(4*FW, 7*FH, PSTR("x:"));
lcd_outdezNAtt(4*FW, ACC_LINE, (int32_t)frskyHubData.accelX * 100 / 256, LEFT|PREC2);
// lcd_putc(lcd_lastPos, 7*FH, 'g'); // lcd_putc(lcd_lastPos, 7*FH, 'g');
// lcd_puts_P(11*FW, 7*FH, PSTR("y:")); // lcd_puts(11*FW, 7*FH, PSTR("y:"));
lcd_outdezNAtt(10*FW, 7*FH, (int32_t)frskyHubData.accelY * 100 / 256, LEFT|PREC2); lcd_outdezNAtt(10*FW, ACC_LINE, (int32_t)frskyHubData.accelY * 100 / 256, LEFT|PREC2);
// lcd_putc(lcd_lastPos, 7*FH, 'g'); // lcd_putc(lcd_lastPos, 7*FH, 'g');
// lcd_puts_P(18*FW, 7*FH, PSTR("z:")); // lcd_puts(18*FW, 7*FH, PSTR("z:"));
lcd_outdezNAtt(16*FW, 7*FH, (int32_t)frskyHubData.accelZ * 100 / 256, LEFT|PREC2); lcd_outdezNAtt(16*FW, ACC_LINE, (int32_t)frskyHubData.accelZ * 100 / 256, LEFT|PREC2);
// lcd_putc(lcd_lastPos, 7*FH, 'g'); // lcd_putc(lcd_lastPos, 7*FH, 'g');
lcd_filled_rect(0, DATE_LINE, DISPLAY_W, 8); lcd_filled_rect(0, ACC_LINE-1, DISPLAY_W, 8);
} }
#endif #endif
else { else {
y0 = 5*FH; y0 = 5*FH;
//lcd_puts_P(2*FW-3, y0, STR_TELE); x0 = 2*FW-3;
x0 = 4*FW-3;
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
if (g_model.frsky.channels[i].ratio) { if (g_model.frsky.channels[i].ratio) {
blink = (alarmRaised[i] ? INVERS+BLINK : 0)|LEFT; blink = (FRSKY_alarmRaised(i) ? INVERS+BLINK : 0)|LEFT;
lcd_puts_P(x0, y0, PSTR("A :")); displayA1A2(x0, y0, i);
lcd_putc(x0+FW, y0, '1'+i); putsTelemetryChannel(x0+3*FW, y0, i, frskyTelemetry[i].value, blink);
putsTelemetryChannel(x0+3*FW, y0, i, staticTelemetry[i], blink); x0 = 12*FW-3;
x0 = 13*FW-3;
} }
} }
y0+=FH; y0+=FH;
//lcd_puts_P(2*FW-3, y0, STR_RSSI); lcd_puts(2*FW-3, y0, STR_RX);
lcd_puts_P(4*FW-3, y0, STR_RX); lcd_outdezAtt(5*FW-3, y0, frskyRSSI[0].value, LEFT);
lcd_outdezAtt(7*FW-3, y0, staticRSSI[0], LEFT); lcd_puts(12*FW-3, y0, STR_TX);
lcd_puts_P(13*FW-3, y0, STR_TX); lcd_outdezAtt(15*FW-3, y0, frskyRSSI[1].value, LEFT);
lcd_outdezAtt(16*FW-3, y0, staticRSSI[1], LEFT);
} }
} }
else { else {
+114 -106
View File
@@ -96,9 +96,9 @@ uint8_t s_confirmation = 0;
void displayBox() void displayBox()
{ {
lcd_filled_rect(10, 16, 108, 40, WHITE); lcd_filled_rect(10, 16, 108, 40, SOLID, WHITE);
lcd_rect(10, 16, 108, 40); lcd_rect(10, 16, 108, 40);
lcd_puts_P(16, 3*FH, s_warning); lcd_puts(16, 3*FH, s_warning);
// could be a place for a s_warning_info // could be a place for a s_warning_info
} }
@@ -114,7 +114,7 @@ void displayWarning(uint8_t event)
{ {
if (s_warning) { if (s_warning) {
displayBox(); displayBox();
lcd_puts_P(16, 5*FH, STR_POPUPS+10); lcd_puts(16, 5*FH, STR_EXIT);
switch(event) { switch(event) {
case EVT_KEY_FIRST(KEY_EXIT): case EVT_KEY_FIRST(KEY_EXIT):
killEvents(event); killEvents(event);
@@ -130,7 +130,7 @@ void displayConfirmation(uint8_t event)
displayBox(); displayBox();
if (s_warning_info) if (s_warning_info)
lcd_putsnAtt(16, 4*FH, s_warning_info, s_warning_info_len, ZCHAR); lcd_putsnAtt(16, 4*FH, s_warning_info, s_warning_info_len, ZCHAR);
lcd_puts_P(16, 5*FH, STR_POPUPS); lcd_puts(16, 5*FH, STR_POPUPS);
switch(event) { switch(event) {
case EVT_KEY_FIRST(KEY_MENU): case EVT_KEY_FIRST(KEY_MENU):
@@ -176,7 +176,7 @@ void menuProcModelSelect(uint8_t event)
if (!check_submenu_simple(_event_, MAX_MODELS-1)) return; if (!check_submenu_simple(_event_, MAX_MODELS-1)) return;
int8_t sub = m_posVert; int8_t sub = m_posVert;
lcd_puts_P(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE); lcd_puts(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
lcd_outdezAtt( 17*FW, 0, EeFsGetFree(),0); lcd_outdezAtt( 17*FW, 0, EeFsGetFree(),0);
DisplayScreenIndex(e_ModelSelect, DIM(menuTabModel), INVERS); DisplayScreenIndex(e_ModelSelect, DIM(menuTabModel), INVERS);
@@ -327,7 +327,7 @@ void menuProcModelSelect(uint8_t event)
if (s_copyMode && sub==i+s_pgOfs) { if (s_copyMode && sub==i+s_pgOfs) {
lcd_filled_rect(9, y, DISPLAY_W-1-9, 7); lcd_filled_rect(9, y, DISPLAY_W-1-9, 7);
lcd_rect(8, y-1, DISPLAY_W-1-7, 9, s_copyMode == COPY_MODE ? 0xff : 0x55); lcd_rect(8, y-1, DISPLAY_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
} }
} }
@@ -391,7 +391,7 @@ void menuProcModel(uint8_t event)
uint8_t subN = 1; uint8_t subN = 1;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0*FW, y, STR_NAME); lcd_puts(0*FW, y, STR_NAME);
EditName(PARAM_OFS, y, g_model.name, sizeof(g_model.name), event, sub==subN, m_posHorz); EditName(PARAM_OFS, y, g_model.name, sizeof(g_model.name), event, sub==subN, m_posHorz);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
@@ -433,28 +433,28 @@ void menuProcModel(uint8_t event)
} }
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_ELIMITS); lcd_putsLeft( y, STR_ELIMITS);
menu_lcd_onoff( PARAM_OFS, y, g_model.extendedLimits, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, g_model.extendedLimits, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.extendedLimits,0,1); if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.extendedLimits,0,1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_ETRIMS); lcd_putsLeft( y, STR_ETRIMS);
menu_lcd_onoff( PARAM_OFS, y, g_model.extendedTrims, sub==subN ) ; menu_lcd_onoff( PARAM_OFS, y, g_model.extendedTrims, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.extendedTrims,0,1); if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.extendedTrims,0,1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_TRIMINC); lcd_putsLeft( y, STR_TRIMINC);
lcd_putsnAtt(PARAM_OFS, y, STR_VTRIMINC+LEN_VTRIMINC*g_model.trimInc, LEN_VTRIMINC, (sub==subN ? INVERS:0)); lcd_putsnAtt(PARAM_OFS, y, STR_VTRIMINC+LEN_VTRIMINC*g_model.trimInc, LEN_VTRIMINC, (sub==subN ? INVERS:0));
if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.trimInc,0,4); if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.trimInc,0,4);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_TTRACE); lcd_putsLeft( y, STR_TTRACE);
int8_t idx = 3; int8_t idx = 3;
if (g_model.thrTraceSrc > NUM_POTS) idx = NUM_STICKS+2+3+NUM_PPM+g_model.thrTraceSrc; if (g_model.thrTraceSrc > NUM_POTS) idx = NUM_STICKS+2+3+NUM_PPM+g_model.thrTraceSrc;
else if (g_model.thrTraceSrc > 0) idx = NUM_STICKS+g_model.thrTraceSrc; else if (g_model.thrTraceSrc > 0) idx = NUM_STICKS+g_model.thrTraceSrc;
@@ -464,14 +464,14 @@ void menuProcModel(uint8_t event)
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_TTRIM); lcd_putsLeft( y, STR_TTRIM);
menu_lcd_onoff(PARAM_OFS, y, g_model.thrTrim, sub==subN && m_posHorz==0) ; menu_lcd_onoff(PARAM_OFS, y, g_model.thrTrim, sub==subN && m_posHorz==0) ;
if (sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.thrTrim,0,1); if (sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.thrTrim,0,1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_BEEPCTR); lcd_putsLeft( y, STR_BEEPCTR);
for(uint8_t i=0;i<7;i++) lcd_putsnAtt(PARAM_OFS+i*FW, y, STR_RETA123+LEN_RETA123*i, LEN_RETA123, ((m_posHorz==i) && (sub==subN)) ? BLINK : ((g_model.beepANACenter & (1<<i)) ? INVERS : 0 ) ); for(uint8_t i=0;i<7;i++) lcd_putsnAtt(PARAM_OFS+i*FW, y, STR_RETA123+LEN_RETA123*i, LEN_RETA123, ((m_posHorz==i) && (sub==subN)) ? BLINK : ((g_model.beepANACenter & (1<<i)) ? INVERS : 0 ) );
if(sub==subN){ if(sub==subN){
if((event==EVT_KEY_FIRST(KEY_MENU)) || p1valdiff) { if((event==EVT_KEY_FIRST(KEY_MENU)) || p1valdiff) {
@@ -485,12 +485,12 @@ void menuProcModel(uint8_t event)
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P(0, y, STR_PROTO); lcd_putsLeft( y, STR_PROTO);
lcd_putsnAtt(PARAM_OFS, y, STR_VPROTOS+LEN_VPROTOS*g_model.protocol, LEN_VPROTOS, lcd_putsnAtt(PARAM_OFS, y, STR_VPROTOS+LEN_VPROTOS*g_model.protocol, LEN_VPROTOS,
(sub==subN && m_posHorz==0 ? (s_editMode>0 ? BLINK : INVERS):0)); (sub==subN && m_posHorz==0 ? (s_editMode>0 ? BLINK : INVERS):0));
if (g_model.protocol == PROTO_PPM) { if (g_model.protocol == PROTO_PPM) {
lcd_putsnAtt(PARAM_OFS+4*FW, y, STR_NCHANNELS+LEN_NCHANNELS*(g_model.ppmNCH+2), LEN_NCHANNELS, ((sub==subN && m_posHorz==1) ? ((s_editMode>0) ? BLINK : INVERS) : 0)); lcd_putsnAtt(PARAM_OFS+4*FW, y, STR_NCHANNELS+LEN_NCHANNELS*(g_model.ppmNCH+2), LEN_NCHANNELS, ((sub==subN && m_posHorz==1) ? ((s_editMode>0) ? BLINK : INVERS) : 0));
lcd_puts_P(PARAM_OFS+11*FW, y, PSTR("u")); lcd_puts(PARAM_OFS+11*FW, y, PSTR("u"));
lcd_outdezAtt(PARAM_OFS+11*FW, y, (g_model.ppmDelay*50)+300, ((sub==subN && m_posHorz==2) ? ((s_editMode>0) ? BLINK : INVERS) : 0)); lcd_outdezAtt(PARAM_OFS+11*FW, y, (g_model.ppmDelay*50)+300, ((sub==subN && m_posHorz==2) ? ((s_editMode>0) ? BLINK : INVERS) : 0));
} }
#ifdef DSM2 #ifdef DSM2
@@ -511,7 +511,7 @@ void menuProcModel(uint8_t event)
if (sub==subN && (s_editMode>0 || p1valdiff || (g_model.protocol!=0 && g_model.protocol!=PROTO_DSM2))) { // TODO avoid DSM2 when not defined if (sub==subN && (s_editMode>0 || p1valdiff || (g_model.protocol!=0 && g_model.protocol!=PROTO_DSM2))) { // TODO avoid DSM2 when not defined
switch (m_posHorz) { switch (m_posHorz) {
case 0: case 0:
CHECK_INCDEC_MODELVAR(event,g_model.protocol,0,PROT_MAX); CHECK_INCDEC_MODELVAR(event,g_model.protocol,0,PROTO_MAX-1);
break; break;
case 1: case 1:
#ifdef DSM2 #ifdef DSM2
@@ -531,8 +531,8 @@ void menuProcModel(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
if (g_model.protocol == PROTO_PPM) { if (g_model.protocol == PROTO_PPM) {
lcd_puts_P(0, y, STR_PPMFRAME); lcd_putsLeft( y, STR_PPMFRAME);
lcd_puts_P(PARAM_OFS+3*FW, y, STR_MS); lcd_puts(PARAM_OFS+3*FW, y, STR_MS);
lcd_outdezAtt(PARAM_OFS, y, (int16_t)g_model.ppmFrameLength*5 + 225, ((sub==subN && m_posHorz==0) ? (s_editMode>0 ? BLINK : INVERS) : 0) | PREC1|LEFT); lcd_outdezAtt(PARAM_OFS, y, (int16_t)g_model.ppmFrameLength*5 + 225, ((sub==subN && m_posHorz==0) ? (s_editMode>0 ? BLINK : INVERS) : 0) | PREC1|LEFT);
lcd_putsnAtt(PARAM_OFS+6*FW, y, STR_POSNEG+LEN_POSNEG*g_model.pulsePol, LEN_POSNEG, (sub==subN && m_posHorz==1) ? INVERS : 0); lcd_putsnAtt(PARAM_OFS+6*FW, y, STR_POSNEG+LEN_POSNEG*g_model.pulsePol, LEN_POSNEG, (sub==subN && m_posHorz==1) ? INVERS : 0);
if(sub==subN && (s_editMode>0 || p1valdiff)) { if(sub==subN && (s_editMode>0 || p1valdiff)) {
@@ -549,7 +549,7 @@ void menuProcModel(uint8_t event)
// TODO port PPM16 ppmDelay from er9x // TODO port PPM16 ppmDelay from er9x
#if defined(DSM2) || defined(PXX) #if defined(DSM2) || defined(PXX)
else if (g_model.protocol == PROTO_DSM2 || g_model.protocol == PROTO_PXX) { else if (g_model.protocol == PROTO_DSM2 || g_model.protocol == PROTO_PXX) {
lcd_puts_P(0, y, STR_RXNUM); lcd_putsLeft( y, STR_RXNUM);
lcd_outdezNAtt(PARAM_OFS-3*FW, y, g_model.modelId, ((sub==subN && m_posHorz==0) ? (s_editMode>0 ? BLINK : INVERS) : 0) | LEADING0|LEFT, 2); lcd_outdezNAtt(PARAM_OFS-3*FW, y, g_model.modelId, ((sub==subN && m_posHorz==0) ? (s_editMode>0 ? BLINK : INVERS) : 0) | LEADING0|LEFT, 2);
if (sub==subN && (s_editMode>0 || p1valdiff)) { if (sub==subN && (s_editMode>0 || p1valdiff)) {
@@ -594,16 +594,16 @@ void menuProcPhaseOne(uint8_t event)
uint8_t attr = sub==k ? INVERS : 0; uint8_t attr = sub==k ? INVERS : 0;
switch(i) { switch(i) {
case 0: case 0:
lcd_puts_P(0, y, STR_NAME); lcd_putsLeft( y, STR_NAME);
EditName(10*FW, y, phase->name, sizeof(phase->name), event, attr, m_posHorz); EditName(10*FW, y, phase->name, sizeof(phase->name), event, attr, m_posHorz);
break; break;
case 1: case 1:
lcd_puts_P(0, y, STR_SWITCH); lcd_putsLeft( y, STR_SWITCH);
putsSwitches(10*FW, y, phase->swtch, attr); putsSwitches(10*FW, y, phase->swtch, attr);
if(attr) CHECK_INCDEC_MODELVAR(event, phase->swtch, -MAX_DRSWITCH, MAX_DRSWITCH); if(attr) CHECK_INCDEC_MODELVAR(event, phase->swtch, -MAX_DRSWITCH, MAX_DRSWITCH);
break; break;
case 2: case 2:
lcd_puts_P(0, y, STR_TRIMS); lcd_putsLeft( y, STR_TRIMS);
for (uint8_t t=0; t<NUM_STICKS; t++) { for (uint8_t t=0; t<NUM_STICKS; t++) {
int16_t v = getTrimValue(s_currIdx, t); int16_t v = getTrimValue(s_currIdx, t);
if (v > TRIM_EXTENDED_MAX) { if (v > TRIM_EXTENDED_MAX) {
@@ -625,12 +625,12 @@ void menuProcPhaseOne(uint8_t event)
} }
break; break;
case 3: case 3:
lcd_puts_P(0, y, STR_FADEIN); // TODO lcd_puts_left lcd_putsLeft( y, STR_FADEIN);
lcd_outdezAtt(10*FW, y, phase->fadeIn, attr|LEFT); lcd_outdezAtt(10*FW, y, phase->fadeIn, attr|LEFT);
if(attr) CHECK_INCDEC_MODELVAR(event, phase->fadeIn, 0, 15); if(attr) CHECK_INCDEC_MODELVAR(event, phase->fadeIn, 0, 15);
break; break;
case 4: case 4:
lcd_puts_P(0, y, STR_FADEOUT); lcd_putsLeft( y, STR_FADEOUT);
lcd_outdezAtt(10*FW, y, phase->fadeOut, attr|LEFT); lcd_outdezAtt(10*FW, y, phase->fadeOut, attr|LEFT);
if(attr) CHECK_INCDEC_MODELVAR(event, phase->fadeOut, 0, 15); if(attr) CHECK_INCDEC_MODELVAR(event, phase->fadeOut, 0, 15);
break; break;
@@ -666,7 +666,7 @@ void menuProcPhasesAll(uint8_t event)
putsFlightPhase(0, y, i+1, att); putsFlightPhase(0, y, i+1, att);
lcd_putsnAtt(4*FW, y, p->name, 6, ZCHAR); lcd_putsnAtt(4*FW, y, p->name, 6, ZCHAR);
if (i == 0) { if (i == 0) {
lcd_puts_P(11*FW+FW/2, y, STR_DEFAULT); lcd_puts(11*FW+FW/2, y, STR_DEFAULT);
} }
else { else {
putsSwitches(11*FW+FW/2, y, p->swtch, 0); putsSwitches(11*FW+FW/2, y, p->swtch, 0);
@@ -709,42 +709,42 @@ void menuProcHeli(uint8_t event)
uint8_t subN = 1; uint8_t subN = 1;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_SWASHTYPE); lcd_putsLeft( y, STR_SWASHTYPE);
lcd_putsnAtt( 14*FW, y, STR_VSWASHTYPE+LEN_VSWASHTYPE*g_model.swashR.type, LEN_VSWASHTYPE, (sub==subN ? INVERS:0)); lcd_putsnAtt( 14*FW, y, STR_VSWASHTYPE+LEN_VSWASHTYPE*g_model.swashR.type, LEN_VSWASHTYPE, (sub==subN ? INVERS:0));
if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.swashR.type,0,SWASH_TYPE_NUM); if(sub==subN) CHECK_INCDEC_MODELVAR(event,g_model.swashR.type,0,SWASH_TYPE_NUM);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_COLLECTIVE); lcd_putsLeft( y, STR_COLLECTIVE);
putsChnRaw(14*FW, y, g_model.swashR.collectiveSource, sub==subN ? INVERS : 0); putsChnRaw(14*FW, y, g_model.swashR.collectiveSource, sub==subN ? INVERS : 0);
if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.collectiveSource, 0, NUM_XCHNRAW); if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.collectiveSource, 0, NUM_XCHNRAW);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_SWASHRING); lcd_putsLeft( y, STR_SWASHRING);
lcd_outdezAtt(14*FW, y, g_model.swashR.value, LEFT|(sub==subN ? INVERS : 0)); lcd_outdezAtt(14*FW, y, g_model.swashR.value, LEFT|(sub==subN ? INVERS : 0));
if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.value, 0, 100); if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.value, 0, 100);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_ELEDIRECTION); lcd_putsLeft( y, STR_ELEDIRECTION);
menu_lcd_HYPHINV( 14*FW, y, g_model.swashR.invertELE, sub==subN ) ; menu_lcd_HYPHINV( 14*FW, y, g_model.swashR.invertELE, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.invertELE, 0, 1); if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.invertELE, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_AILDIRECTION); lcd_putsLeft( y, STR_AILDIRECTION);
menu_lcd_HYPHINV( 14*FW, y, g_model.swashR.invertAIL, sub==subN ) ; menu_lcd_HYPHINV( 14*FW, y, g_model.swashR.invertAIL, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.invertAIL, 0, 1); if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.invertAIL, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
}subN++; }subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
lcd_puts_P( 0, y, STR_COLDIRECTION); lcd_putsLeft( y, STR_COLDIRECTION);
menu_lcd_HYPHINV( 14*FW, y, g_model.swashR.invertCOL, sub==subN ) ; menu_lcd_HYPHINV( 14*FW, y, g_model.swashR.invertCOL, sub==subN ) ;
if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.invertCOL, 0, 1); if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.swashR.invertCOL, 0, 1);
if((y+=FH)>7*FH) return; if((y+=FH)>7*FH) return;
@@ -862,7 +862,7 @@ void menuProcCurveOne(uint8_t event)
lcd_outdezAtt(x, y, crv[i], attr); lcd_outdezAtt(x, y, crv[i], attr);
} }
lcd_puts_P(0*FW, 7*FH, STR_MODE); lcd_puts(0*FW, 7*FH, STR_MODE);
lcd_putsnAtt(5*FW-2, 7*FH, STR_CURVMODES+LEN_CURVMODES*(s_editMode<=0)*m_posHorz, LEN_CURVMODES, s_editMode>0 || autoThrStep ? 0 : INVERS); lcd_putsnAtt(5*FW-2, 7*FH, STR_CURVMODES+LEN_CURVMODES*(s_editMode<=0)*m_posHorz, LEN_CURVMODES, s_editMode>0 || autoThrStep ? 0 : INVERS);
if (s_editMode>0 || autoThrStep) { if (s_editMode>0 || autoThrStep) {
@@ -1146,29 +1146,29 @@ void menuProcMixOne(uint8_t event)
uint8_t attr = sub==i ? INVERS : 0; uint8_t attr = sub==i ? INVERS : 0;
switch(i) { switch(i) {
case 0: case 0:
lcd_puts_P( 2*FW,y,STR_SOURCE); lcd_puts( 2*FW,y,STR_SOURCE);
putsChnRaw( FW*10,y,md2->srcRaw,attr); putsChnRaw( FW*10,y,md2->srcRaw,attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->srcRaw, 1,NUM_XCHNRAW); if(attr) CHECK_INCDEC_MODELVAR( event, md2->srcRaw, 1,NUM_XCHNRAW);
break; break;
case 1: case 1:
lcd_puts_P( 2*FW,y,STR_WEIGHT); lcd_puts( 2*FW,y,STR_WEIGHT);
lcd_outdezAtt(FW*10,y,md2->weight,attr|LEFT); lcd_outdezAtt(FW*10,y,md2->weight,attr|LEFT);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->weight, -125,125); if(attr) CHECK_INCDEC_MODELVAR( event, md2->weight, -125,125);
break; break;
case 2: case 2:
lcd_puts_P( 2*FW,y,STR_OFFSET); lcd_puts( 2*FW,y,STR_OFFSET);
lcd_outdezAtt(FW*10,y,md2->sOffset,attr|LEFT); lcd_outdezAtt(FW*10,y,md2->sOffset,attr|LEFT);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->sOffset, -125,125); if(attr) CHECK_INCDEC_MODELVAR( event, md2->sOffset, -125,125);
break; break;
case 3: case 3:
// TODO hidden when src is not a STICK as it has no sense // TODO hidden when src is not a STICK as it has no sense
lcd_puts_P(2*FW, y, STR_TRIM); lcd_puts(2*FW, y, STR_TRIM);
// lcd_putsnAtt(FW*10, y, STR_OFFON+LEN_OFFON*(1-md2->carryTrim), LEN_OFFON, attr); // lcd_putsnAtt(FW*10, y, STR_OFFON+LEN_OFFON*(1-md2->carryTrim), LEN_OFFON, attr);
lcd_putsnAtt(FW*10, y, STR_VMIXTRIMS+LEN_VMIXTRIMS*md2->carryTrim, LEN_VMIXTRIMS, attr); // TODO perhaps could be optimized by reusing STR_OFFON lcd_putsnAtt(FW*10, y, STR_VMIXTRIMS+LEN_VMIXTRIMS*md2->carryTrim, LEN_VMIXTRIMS, attr); // TODO perhaps could be optimized by reusing STR_OFFON
if (attr) CHECK_INCDEC_MODELVAR( event, md2->carryTrim, 0, 2); if (attr) CHECK_INCDEC_MODELVAR( event, md2->carryTrim, 0, 2);
break; break;
case 4: case 4:
lcd_puts_P(2*FW, y, STR_CURVES); lcd_puts(2*FW, y, STR_CURVES);
putsCurve(FW*10, y, md2->curve, attr); putsCurve(FW*10, y, md2->curve, attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->curve, 0,MAX_CURVE5+MAX_CURVE9+7-1); if(attr) CHECK_INCDEC_MODELVAR( event, md2->curve, 0,MAX_CURVE5+MAX_CURVE9+7-1);
if(attr && md2->curve>=CURVE_BASE && event==EVT_KEY_FIRST(KEY_MENU)){ if(attr && md2->curve>=CURVE_BASE && event==EVT_KEY_FIRST(KEY_MENU)){
@@ -1177,17 +1177,17 @@ void menuProcMixOne(uint8_t event)
} }
break; break;
case 5: case 5:
lcd_puts_P( 2*FW,y,STR_SWITCH); lcd_puts( 2*FW,y,STR_SWITCH);
putsSwitches(10*FW, y,md2->swtch,attr); putsSwitches(10*FW, y,md2->swtch,attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->swtch, -MAX_SWITCH, MAX_SWITCH); if(attr) CHECK_INCDEC_MODELVAR( event, md2->swtch, -MAX_SWITCH, MAX_SWITCH);
break; break;
case 6: case 6:
lcd_puts_P( 2*FW,y,STR_FPHASE); lcd_puts( 2*FW,y,STR_FPHASE);
putsFlightPhase(10*FW, y, md2->phase, attr); putsFlightPhase(10*FW, y, md2->phase, attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->phase, -MAX_PHASES, MAX_PHASES); if(attr) CHECK_INCDEC_MODELVAR( event, md2->phase, -MAX_PHASES, MAX_PHASES);
break; break;
case 7: case 7:
lcd_puts_P( 2*FW,y,STR_WARNING); lcd_puts( 2*FW,y,STR_WARNING);
if(md2->mixWarn) if(md2->mixWarn)
lcd_outdezAtt(FW*10,y,md2->mixWarn,attr|LEFT); lcd_outdezAtt(FW*10,y,md2->mixWarn,attr|LEFT);
else else
@@ -1195,27 +1195,27 @@ void menuProcMixOne(uint8_t event)
if(attr) CHECK_INCDEC_MODELVAR( event, md2->mixWarn, 0,3); if(attr) CHECK_INCDEC_MODELVAR( event, md2->mixWarn, 0,3);
break; break;
case 8: case 8:
lcd_puts_P( 2*FW,y,STR_MULTPX); lcd_puts( 2*FW,y,STR_MULTPX);
lcd_putsnAtt(10*FW, y, STR_VMLTPX+LEN_VMLTPX*md2->mltpx, LEN_VMLTPX, attr); lcd_putsnAtt(10*FW, y, STR_VMLTPX+LEN_VMLTPX*md2->mltpx, LEN_VMLTPX, attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->mltpx, 0, 2); if(attr) CHECK_INCDEC_MODELVAR( event, md2->mltpx, 0, 2);
break; break;
case 9: case 9:
lcd_puts_P( 2*FW,y,STR_DELAYDOWN); lcd_puts( 2*FW,y,STR_DELAYDOWN);
lcd_outdezAtt(FW*16,y,md2->delayDown,attr); lcd_outdezAtt(FW*16,y,md2->delayDown,attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->delayDown, 0,15); if(attr) CHECK_INCDEC_MODELVAR( event, md2->delayDown, 0,15);
break; break;
case 10: case 10:
lcd_puts_P( 2*FW,y,STR_DELAYUP); lcd_puts( 2*FW,y,STR_DELAYUP);
lcd_outdezAtt(FW*16,y,md2->delayUp,attr); lcd_outdezAtt(FW*16,y,md2->delayUp,attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->delayUp, 0,15); if(attr) CHECK_INCDEC_MODELVAR( event, md2->delayUp, 0,15);
break; break;
case 11: case 11:
lcd_puts_P( 2*FW,y,STR_SLOWDOWN); lcd_puts( 2*FW,y,STR_SLOWDOWN);
lcd_outdezAtt(FW*16,y,md2->speedDown,attr); lcd_outdezAtt(FW*16,y,md2->speedDown,attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->speedDown, 0,15); if(attr) CHECK_INCDEC_MODELVAR( event, md2->speedDown, 0,15);
break; break;
case 12: case 12:
lcd_puts_P( 2*FW,y,STR_SLOWUP); lcd_puts( 2*FW,y,STR_SLOWUP);
lcd_outdezAtt(FW*16,y,md2->speedUp,attr); lcd_outdezAtt(FW*16,y,md2->speedUp,attr);
if(attr) CHECK_INCDEC_MODELVAR( event, md2->speedUp, 0,15); if(attr) CHECK_INCDEC_MODELVAR( event, md2->speedUp, 0,15);
break; break;
@@ -1254,7 +1254,7 @@ inline void displayMixerLine(uint8_t row, uint8_t mix, uint8_t ch, uint8_t idx,
if (s_copyMode) { if (s_copyMode) {
if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && mix == (s_copySrcIdx + (s_copyTgtOfs<0))) { if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && mix == (s_copySrcIdx + (s_copyTgtOfs<0))) {
/* draw a border around the raw on selection mode (copy/move) */ /* draw a border around the raw on selection mode (copy/move) */
lcd_rect(22, y-1, DISPLAY_W-1-21, 9, s_copyMode == COPY_MODE ? 0xff : 0x55); lcd_rect(22, y-1, DISPLAY_W-1-21, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
} }
if (row == cur) { if (row == cur) {
@@ -1282,7 +1282,7 @@ inline void displayExpoLine(uint8_t row, uint8_t expo, uint8_t ch, uint8_t idx,
if (s_copyMode) { if (s_copyMode) {
if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && expo == (s_copySrcIdx + (s_copyTgtOfs<0))) { if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && expo == (s_copySrcIdx + (s_copyTgtOfs<0))) {
/* draw a border around the raw on selection mode (copy/move) */ /* draw a border around the raw on selection mode (copy/move) */
lcd_rect(18, y-1, DISPLAY_W-18, 9, s_copyMode == COPY_MODE ? 0xff : 0x55); lcd_rect(18, y-1, DISPLAY_W-18, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
} }
if (row == cur) { if (row == cur) {
/* invert the raw when it's the current one */ /* invert the raw when it's the current one */
@@ -1304,7 +1304,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_)
TITLEP(expo ? STR_DREXPO : STR_MIXER); TITLEP(expo ? STR_DREXPO : STR_MIXER);
lcd_outdezAtt(lcd_lastPos+2*FW+FW/2, 0, getExpoMixCount(expo)); lcd_outdezAtt(lcd_lastPos+2*FW+FW/2, 0, getExpoMixCount(expo));
lcd_puts_P(lcd_lastPos, 0, expo ? PSTR("/14") : PSTR("/32")); lcd_puts(lcd_lastPos, 0, expo ? PSTR("/14") : PSTR("/32"));
SIMPLE_MENU_NOTITLE(menuTabModel, expo ? e_ExposAll : e_MixAll, s_maxLines); SIMPLE_MENU_NOTITLE(menuTabModel, expo ? e_ExposAll : e_MixAll, s_maxLines);
uint8_t sub = m_posVert; uint8_t sub = m_posVert;
@@ -1428,7 +1428,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_)
if (s_copyMode) { if (s_copyMode) {
if (s_copyMode == MOVE_MODE && s_pgOfs < cur && cur-s_pgOfs < 8 && s_copySrcCh == ch && s_copyTgtOfs != 0 && i == (s_copySrcIdx + (s_copyTgtOfs<0))) { if (s_copyMode == MOVE_MODE && s_pgOfs < cur && cur-s_pgOfs < 8 && s_copySrcCh == ch && s_copyTgtOfs != 0 && i == (s_copySrcIdx + (s_copyTgtOfs<0))) {
uint8_t y = (cur-s_pgOfs)*FH; uint8_t y = (cur-s_pgOfs)*FH;
lcd_rect(22, y-1, DISPLAY_W-1-21, 9, 0x55); lcd_rect(22, y-1, DISPLAY_W-1-21, 9, DOTTED);
cur++; cur++;
} }
if (s_currIdx == i) { if (s_currIdx == i) {
@@ -1449,7 +1449,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_)
} while (expo ? (i<MAX_EXPOS && ed->chn+1 == ch && ed->mode) : (i<MAX_MIXERS && md->destCh == ch)); } while (expo ? (i<MAX_EXPOS && ed->chn+1 == ch && ed->mode) : (i<MAX_MIXERS && md->destCh == ch));
if (s_copyMode == MOVE_MODE && s_pgOfs < cur && cur-s_pgOfs < 8 && s_copySrcCh == ch && i == (s_copySrcIdx + (s_copyTgtOfs<0))) { if (s_copyMode == MOVE_MODE && s_pgOfs < cur && cur-s_pgOfs < 8 && s_copySrcCh == ch && i == (s_copySrcIdx + (s_copyTgtOfs<0))) {
uint8_t y = (cur-s_pgOfs)*FH; uint8_t y = (cur-s_pgOfs)*FH;
lcd_rect(22, y-1, DISPLAY_W-1-21, 9, 0x55); lcd_rect(22, y-1, DISPLAY_W-1-21, 9, DOTTED);
cur++; cur++;
} }
} }
@@ -1469,7 +1469,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_)
putsChn(0, (cur-s_pgOfs)*FH, ch, attr); // show CHx putsChn(0, (cur-s_pgOfs)*FH, ch, attr); // show CHx
if (s_copyMode == MOVE_MODE && s_copySrcCh == ch) { if (s_copyMode == MOVE_MODE && s_copySrcCh == ch) {
uint8_t y = (cur-s_pgOfs)*FH; uint8_t y = (cur-s_pgOfs)*FH;
lcd_rect(22, y-1, DISPLAY_W-1-21, 9, 0x55); lcd_rect(22, y-1, DISPLAY_W-1-21, 9, DOTTED);
} }
} }
cur++; cur++;
@@ -1622,7 +1622,7 @@ void menuProcCustomSwitches(uint8_t event)
uint8_t k = 0; uint8_t k = 0;
int8_t sub = m_posVert - 1; int8_t sub = m_posVert - 1;
for(uint8_t i=0; i<7; i++){ for(uint8_t i=0; i<7; i++) {
y=(i+1)*FH; y=(i+1)*FH;
k=i+s_pgOfs; k=i+s_pgOfs;
if(k==NUM_CSW) break; if(k==NUM_CSW) break;
@@ -1630,34 +1630,20 @@ void menuProcCustomSwitches(uint8_t event)
CustomSwData &cs = g_model.customSw[k]; CustomSwData &cs = g_model.customSw[k];
//write SW names here //write SW names here
lcd_puts_P(0*FW, y, STR_SW); lcd_puts(0*FW, y, STR_SW);
lcd_putc(2*FW, y, k + (k>8 ? 'A'-9: '1')); lcd_putc(2*FW, y, k + (k>8 ? 'A'-9: '1'));
lcd_putsnAtt(4*FW - 1, y, STR_VCSWFUNC+LEN_VCSWFUNC*cs.func, LEN_VCSWFUNC, m_posHorz==0 ? attr : 0); lcd_putsnAtt(4*FW - 1, y, STR_VCSWFUNC+LEN_VCSWFUNC*cs.func, LEN_VCSWFUNC, m_posHorz==0 ? attr : 0);
uint8_t cstate = CS_STATE(cs.func); uint8_t cstate = CS_STATE(cs.func);
int8_t v1_min=0, v1_max=NUM_XCHNCSW, v2_min=0, v2_max=NUM_XCHNCSW; int8_t v1_min=0, v1_max=NUM_XCHNCSW, v2_min=0, v2_max=NUM_XCHNCSW;
if(cstate == CS_VOFS) if (cstate == CS_VOFS)
{ {
putsChnRaw(12*FW, y, cs.v1, m_posHorz==1 ? attr : 0); putsChnRaw(12*FW-2, y, cs.v1, m_posHorz==1 ? attr : 0);
#if defined(FRSKY) #if defined(FRSKY)
#if defined(FRSKY_HUB) if (cs.v1 > NUM_XCHNCSW-NUM_TELEMETRY-MAX_TIMERS+2) {
if (cs.v1 > NUM_XCHNCSW-NUM_TELEMETRY+3) { putsTelemetryChannel(20*FW, y, cs.v1 - (NUM_XCHNCSW-NUM_TELEMETRY-MAX_TIMERS+3), 128+cs.v2, m_posHorz==2 ? attr : 0);
lcd_outdezAtt(20*FW, y, (128+cs.v2) * 50, m_posHorz==2 ? attr : 0);
v2_min = -128; v2_max = 127;
}
else
#endif
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
if (cs.v1 > NUM_XCHNCSW-NUM_TELEMETRY+2) {
lcd_outdezAtt(20*FW, y, (128+cs.v2) * 4, m_posHorz==2 ? attr : 0);
v2_min = -128; v2_max = 127;
}
else
#endif
if (cs.v1 > NUM_XCHNCSW-NUM_TELEMETRY) {
putsTelemetryChannel(20*FW, y, cs.v1+NUM_TELEMETRY-NUM_XCHNCSW-1, 128+cs.v2, m_posHorz==2 ? attr : 0);
v2_min = -128; v2_max = 127; v2_min = -128; v2_max = 127;
} }
else else
@@ -1671,16 +1657,16 @@ void menuProcCustomSwitches(uint8_t event)
v2_min = -125; v2_max = 125; v2_min = -125; v2_max = 125;
} }
} }
else if(cstate == CS_VBOOL) else if (cstate == CS_VBOOL)
{ {
putsSwitches(13*FW, y, cs.v1, m_posHorz==1 ? attr : 0); putsSwitches(12*FW-2, y, cs.v1, m_posHorz==1 ? attr : 0);
putsSwitches(17*FW, y, cs.v2, m_posHorz==2 ? attr : 0); putsSwitches(17*FW, y, cs.v2, m_posHorz==2 ? attr : 0);
v1_min = -MAX_SWITCH; v1_max = MAX_SWITCH; v1_min = -MAX_SWITCH; v1_max = MAX_SWITCH;
v2_min = -MAX_SWITCH; v2_max = MAX_SWITCH; v2_min = -MAX_SWITCH; v2_max = MAX_SWITCH;
} }
else // cstate == CS_COMP else // cstate == CS_COMP
{ {
putsChnRaw(12*FW, y, cs.v1, m_posHorz==1 ? attr : 0); putsChnRaw(12*FW-2, y, cs.v1, m_posHorz==1 ? attr : 0);
putsChnRaw(17*FW, y, cs.v2, m_posHorz==2 ? attr : 0); putsChnRaw(17*FW, y, cs.v2, m_posHorz==2 ? attr : 0);
} }
@@ -1697,14 +1683,16 @@ void menuProcCustomSwitches(uint8_t event)
{ {
int8_t v1 = cs.v1; int8_t v1 = cs.v1;
CHECK_INCDEC_MODELVAR(event, cs.v1, v1_min, v1_max); CHECK_INCDEC_MODELVAR(event, cs.v1, v1_min, v1_max);
if (cs.v1 == CHOUT_BASE+NUM_CHNOUT+1 && v1 < cs.v1) cs.v2 = -98; if (cstate == CS_VOFS) {
if (cs.v1 == CHOUT_BASE+NUM_CHNOUT+1 && v1 < cs.v1) cs.v2 = -98;
#ifdef FRSKY #ifdef FRSKY
if (cs.v1 == CHOUT_BASE+NUM_CHNOUT+3 && v1 < cs.v1) cs.v2 = -128; if (cs.v1 == CHOUT_BASE+NUM_CHNOUT+3 && v1 < cs.v1) cs.v2 = -128;
#endif #endif
if (cs.v1 == CHOUT_BASE+NUM_CHNOUT && v1 > cs.v1) cs.v2 = 0; if (cs.v1 == CHOUT_BASE+NUM_CHNOUT && v1 > cs.v1) cs.v2 = 0;
#ifdef FRSKY #ifdef FRSKY
if (cs.v1 == CHOUT_BASE+NUM_CHNOUT+2 && v1 > cs.v1) cs.v2 = -98; if (cs.v1 == CHOUT_BASE+NUM_CHNOUT+2 && v1 > cs.v1) cs.v2 = -98;
#endif #endif
}
break; break;
} }
case 2: case 2:
@@ -1838,12 +1826,13 @@ void menuProcSafetySwitches(uint8_t event)
#endif #endif
#ifdef FRSKY #ifdef FRSKY
#define TELEM_COL2 (9*FW+2)
void menuProcTelemetry(uint8_t event) void menuProcTelemetry(uint8_t event)
{ {
#if defined FRSKY_HUB || defined WS_HOW_HIGH #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 12, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, 0}); MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 16, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, 0, 2, 2, 2, 2});
#else #else
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 11, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2}); MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 15, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, 2, 2, 2, 2});
#endif #endif
int8_t sub = m_posVert; int8_t sub = m_posVert;
@@ -1866,16 +1855,16 @@ void menuProcTelemetry(uint8_t event)
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
y=(subN-s_pgOfs)*FH; y=(subN-s_pgOfs)*FH;
lcd_puts_P(0, y, STR_ACHANNEL); lcd_putsLeft( y, STR_ACHANNEL);
lcd_outdezAtt(2*FW, y, 1+i, 0); lcd_outdezAtt(2*FW, y, 1+i, 0);
} }
subN++; subN++;
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
y=(subN-s_pgOfs)*FH; y=(subN-s_pgOfs)*FH;
lcd_puts_P(4, y, STR_RANGE); lcd_puts(4, y, STR_RANGE);
putsTelemetryValue(8*FW, y, g_model.frsky.channels[i].ratio, g_model.frsky.channels[i].type, (sub==subN && m_posHorz==0 ? blink:0)|NO_UNIT|LEFT); putsTelemetryChannel(TELEM_COL2, y, i, 255-g_model.frsky.channels[i].offset, (sub==subN && m_posHorz==0 ? blink:0)|NO_UNIT|LEFT);
lcd_putsnAtt(lcd_lastPos, y, STR_VTELEMUNIT+LEN_VTELEMUNIT*g_model.frsky.channels[i].type, LEN_VTELEMUNIT, (sub==subN && m_posHorz==1 ? blink:0)); lcd_putsnAtt(lcd_lastPos+1, y, STR_VTELEMUNIT+LEN_VTELEMUNIT*g_model.frsky.channels[i].type, LEN_VTELEMUNIT, (sub==subN && m_posHorz==1 ? blink:0));
if (sub==subN && (s_editMode>0 || p1valdiff)) { if (sub==subN && (s_editMode>0 || p1valdiff)) {
if (m_posHorz == 0) if (m_posHorz == 0)
g_model.frsky.channels[i].ratio = checkIncDec(event, g_model.frsky.channels[i].ratio, 0, 255, EE_MODEL); g_model.frsky.channels[i].ratio = checkIncDec(event, g_model.frsky.channels[i].ratio, 0, 255, EE_MODEL);
@@ -1887,31 +1876,19 @@ void menuProcTelemetry(uint8_t event)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
y=(subN-s_pgOfs)*FH; y=(subN-s_pgOfs)*FH;
lcd_puts_P(4, y, STR_OFFSET); lcd_puts(4, y, STR_OFFSET);
putsTelemetryChannel(8*FW, y, i, 0, (sub==subN ? blink:0)|LEFT); putsTelemetryChannel(TELEM_COL2, y, i, 0, (sub==subN ? blink:0)|LEFT);
if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.frsky.channels[i].offset, -127, 127); if(sub==subN) CHECK_INCDEC_MODELVAR(event, g_model.frsky.channels[i].offset, -128, 127);
} }
subN++; subN++;
#if 0
if(s_pgOfs<subN) {
y=(subN-s_pgOfs)*FH;
lcd_puts_P(4, y, STR_BAR);
putsTelemetryChannel(8*FW, y, i, g_model.frsky.channels[i].barMin, (sub==subN && m_posHorz==0 ? blink:0)|LEFT);
putsTelemetryChannel(13*FW, y, i, g_model.frsky.channels[i].barMax, (sub==subN && m_posHorz==1 ? blink:0)|LEFT);
if(sub==subN && m_posHorz==0 && (s_editMode>0 || p1valdiff)) g_model.frsky.channels[i].barMin = checkIncDec(event, g_model.frsky.channels[i].barMin, 0, 255, EE_MODEL);
if(sub==subN && m_posHorz==1 && (s_editMode>0 || p1valdiff)) g_model.frsky.channels[i].barMax = checkIncDec(event, g_model.frsky.channels[i].barMax, 0, 255, EE_MODEL);
}
subN++;
#endif
for (int j=0; j<2; j++) { for (int j=0; j<2; j++) {
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
y=(subN-s_pgOfs)*FH; y=(subN-s_pgOfs)*FH;
lcd_puts_P(4, y, STR_ALARM); lcd_puts(4, y, STR_ALARM);
lcd_putsnAtt(8*FW, y, STR_VALARM+LEN_VALARM*ALARM_LEVEL(i, j), LEN_VALARM, (sub==subN && m_posHorz==0 ? blink:0)); lcd_putsnAtt(TELEM_COL2, y, STR_VALARM+LEN_VALARM*ALARM_LEVEL(i, j), LEN_VALARM, (sub==subN && m_posHorz==0 ? blink:0));
lcd_putsnAtt(12*FW, y, STR_VALARMFN+LEN_VALARMFN*ALARM_GREATER(i, j), LEN_VALARMFN,(sub==subN && m_posHorz==1 ? blink:0)); lcd_putsnAtt(TELEM_COL2+4*FW, y, STR_VALARMFN+LEN_VALARMFN*ALARM_GREATER(i, j), LEN_VALARMFN,(sub==subN && m_posHorz==1 ? blink:0));
putsTelemetryChannel(14*FW, y, i, g_model.frsky.channels[i].alarms_value[j], (sub==subN && m_posHorz==2 ? blink:0) | LEFT); putsTelemetryChannel(TELEM_COL2+6*FW, y, i, g_model.frsky.channels[i].alarms_value[j], (sub==subN && m_posHorz==2 ? blink:0) | LEFT);
if(sub==subN && (s_editMode>0 || p1valdiff)) { if(sub==subN && (s_editMode>0 || p1valdiff)) {
switch (m_posHorz) { switch (m_posHorz) {
@@ -1938,17 +1915,48 @@ void menuProcTelemetry(uint8_t event)
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
if(s_pgOfs<subN) { if(s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH; y = (subN-s_pgOfs)*FH;
lcd_puts_P(0, y, STR_USRPROTO); lcd_putsLeft(y, STR_USRPROTO);
#if defined(WS_HOW_HIGH) #if defined(WS_HOW_HIGH)
#define USR_PROTO_MAX 2 #define USR_PROTO_MAX 2
#else #else
#define USR_PROTO_MAX 1 #define USR_PROTO_MAX 1
#endif #endif
lcd_putsnAtt(10*FW, y, STR_VTELPROTO+LEN_VTELPROTO*g_model.frsky.usrProto, LEN_VTELPROTO, sub==subN ? INVERS:0); lcd_putsnAtt(TELEM_COL2, y, STR_VTELPROTO+LEN_VTELPROTO*g_model.frsky.usrProto, LEN_VTELPROTO, sub==subN ? INVERS:0);
if (sub==subN) if (sub==subN)
CHECK_INCDEC_MODELVAR(event, g_model.frsky.usrProto, 0, USR_PROTO_MAX); CHECK_INCDEC_MODELVAR(event, g_model.frsky.usrProto, 0, USR_PROTO_MAX);
} }
subN++;
#endif #endif
// Bars setup
for (int j=0; j<4; j++) {
if (s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH;
putsStrIdx(0*FW, y, PSTR("Bar"), j+1); // TODO lang
lcd_putsnAtt(5*FW, y, STR_VTELEMBARS+LEN_VTELEMBARS*g_model.frsky.bars[j].source, LEN_VTELEMBARS, sub==subN && m_posHorz==0 ? blink : 0);
if (g_model.frsky.bars[j].source) {
putsTelemetryChannel(TELEM_COL2, y, g_model.frsky.bars[j].source-1, g_model.frsky.bars[j].barMin*4, (sub==subN && m_posHorz==1 ? blink : 0) | LEFT);
putsTelemetryChannel(16*FW-3, y, g_model.frsky.bars[j].source-1, (63-g_model.frsky.bars[j].barMax)*4, (sub==subN && m_posHorz==2 ? blink : 0) | LEFT);
}
else {
if (sub == subN) m_posHorz = 0;
}
if (sub==subN && (s_editMode>0 || p1valdiff)) {
switch (m_posHorz) {
case 0:
CHECK_INCDEC_MODELVAR(event, g_model.frsky.bars[j].source, 0, 9); // TODO enum
break;
case 1:
CHECK_INCDEC_MODELVAR(event, g_model.frsky.bars[j].barMin, 0, 63-g_model.frsky.bars[j].barMax);
break;
case 2:
g_model.frsky.bars[j].barMax = 63 - checkIncDec(event, 63 - g_model.frsky.bars[j].barMax, g_model.frsky.bars[j].barMin, 63, EE_MODEL);
break;
}
}
}
subN++;
}
} }
#endif #endif
+30 -9
View File
@@ -36,7 +36,7 @@
#define WARN_MEM (!(g_eeGeneral.warnOpts & WARN_MEM_BIT)) #define WARN_MEM (!(g_eeGeneral.warnOpts & WARN_MEM_BIT))
#define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 ) #define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 )
#define EEPROM_VER 203 #define EEPROM_VER 204
#ifndef PACK #ifndef PACK
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) #define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
@@ -179,12 +179,14 @@ PACK(typedef struct t_FuncSwData { // Function Switches data
enum TelemetryUnit { enum TelemetryUnit {
UNIT_VOLTS, UNIT_VOLTS,
UNIT_AMPS,
UNIT_RAW, UNIT_RAW,
UNIT_KTS, UNIT_KTS,
UNIT_KMH, UNIT_KMH,
UNIT_MPH, UNIT_MPH,
UNIT_METERS, UNIT_METERS,
UNIT_DEGREES, UNIT_DEGREES,
UNIT_PERCENT,
UNIT_MAX UNIT_MAX
}; };
@@ -195,16 +197,40 @@ PACK(typedef struct t_FrSkyChannelData {
uint8_t alarms_level:4; uint8_t alarms_level:4;
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>) uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
uint8_t multiplier:2; // 0=no multiplier, 1=*2 multiplier uint8_t multiplier:2; // 0=no multiplier, 1=*2 multiplier
uint8_t barMin:4; // minimum for bar display
uint8_t barMax:4; // ditto for max display (would usually = ratio)
int8_t offset; int8_t offset;
}) FrSkyChannelData; }) FrSkyChannelData;
enum BarSource {
BAR_NONE,
BAR_A1,
BAR_A2,
BAR_ALT,
#if defined(FRSKY_HUB)
BAR_RPM,
BAR_FUEL,
BAR_T1,
BAR_T2,
BAR_SPEED,
BAR_CELL,
#endif
BAR_MAX
};
PACK(typedef struct t_FrSkyBarData {
uint16_t source:4;
uint16_t barMin:6; // minimum for bar display
uint16_t barMax:6; // ditto for max display (would usually = ratio)
}) FrSkyBarData;
#define PROTO_NONE 0
#define PROTO_FRSKY_HUB 1 #define PROTO_FRSKY_HUB 1
#define PROTO_WS_HOW_HIGH 2 #define PROTO_WS_HOW_HIGH 2
PACK(typedef struct t_FrSkyData { PACK(typedef struct t_FrSkyData {
FrSkyChannelData channels[2]; FrSkyChannelData channels[2];
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh uint16_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint16_t imperial:1;
uint16_t spare:4;
FrSkyBarData bars[4];
}) FrSkyData; }) FrSkyData;
PACK(typedef struct t_SwashRingData { // Swash Ring data PACK(typedef struct t_SwashRingData { // Swash Ring data
@@ -214,11 +240,6 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data
uint8_t type:5; uint8_t type:5;
uint8_t collectiveSource; uint8_t collectiveSource;
uint8_t value; uint8_t value;
/* TODO BSS everything is in comments in menus.cpp, how should it be used?
uint8_t lim; // 0 mean off 100 full deflection
uint8_t chX; // 2 channels to limit
uint8_t chY; // 2 channels to limit */
}) SwashRingData; }) SwashRingData;
#define TRIM_EXTENDED_MAX 500 #define TRIM_EXTENDED_MAX 500
+14 -14
View File
@@ -442,7 +442,7 @@ void menuProcNMEA1(uint8_t event)
title ('1'); title ('1');
lcd_puts_P ( 2*FW, 1*FH, PSTR("UTC-Time Sat")); lcd_puts ( 2*FW, 1*FH, PSTR("UTC-Time Sat"));
if (rbuf[0][0]) { // show always if data have been received if (rbuf[0][0]) { // show always if data have been received
lcd_putcAtt ( 19*FW, 1*FH, sbuf[2], 0); // satellites in view lcd_putcAtt ( 19*FW, 1*FH, sbuf[2], 0); // satellites in view
@@ -457,12 +457,12 @@ void menuProcNMEA1(uint8_t event)
if ((show_timer == 1) && rbuf[0][0]) { // show the Timer when data have been received if ((show_timer == 1) && rbuf[0][0]) { // show the Timer when data have been received
lcd_puts_P ( 2*FW, 4*FH, PSTR("Timer")); // display "Timer" lcd_puts ( 2*FW, 4*FH, PSTR("Timer")); // display "Timer"
putsTime ( 5*FW, 5*FH, (gpstime-gpstimer), DBLSIZE, DBLSIZE); // display difference as mm:ss putsTime ( 5*FW, 5*FH, (gpstime-gpstimer), DBLSIZE, DBLSIZE); // display difference as mm:ss
} }
else else
{ {
lcd_puts_P ( 2*FW, 4*FH, PSTR("Date")); // show the UTC Date lcd_puts ( 2*FW, 4*FH, PSTR("Date")); // show the UTC Date
if (rbuf[1][0]) { if (rbuf[1][0]) {
lcd_putsnAtt( 2*FW, 5*FH, &rbuf[1][0], 2, APSIZE); // year lcd_putsnAtt( 2*FW, 5*FH, &rbuf[1][0], 2, APSIZE); // year
@@ -561,18 +561,18 @@ void menuProcNMEA2(uint8_t event)
} }
title ('2'); title ('2');
lcd_puts_P ( 1*FW, 1*FH, PSTR("Altitude Sat Max")); lcd_puts ( 1*FW, 1*FH, PSTR("Altitude Sat Max"));
lcd_puts_P ( 16*FW, 3*FH, PSTR("Home")); lcd_puts ( 16*FW, 3*FH, PSTR("Home"));
lcd_puts_P ( 2*FW, 4*FH, PSTR("Lift") ); lcd_puts ( 2*FW, 4*FH, PSTR("Lift") );
lcd_puts_P ( 16*FW, 5*FH, PSTR("Beep") ); lcd_puts ( 16*FW, 5*FH, PSTR("Beep") );
if (beep_on==1) if (beep_on==1)
lcd_puts_P ( 18*FW, 6*FH, PSTR("ON") ); lcd_puts ( 18*FW, 6*FH, PSTR("ON") );
else else
lcd_puts_P ( 17*FW, 6*FH, PSTR("OFF") ); lcd_puts ( 17*FW, 6*FH, PSTR("OFF") );
lcd_outdezNAtt( 20*FW, 4*FH, home_alt, PREC1, 6); // display home_alt, small characters lcd_outdezNAtt( 20*FW, 4*FH, home_alt, PREC1, 6); // display home_alt, small characters
@@ -629,7 +629,7 @@ void menuProcNMEA2(uint8_t event)
lcd_outdezNAtt( 10*FW, 5*FH, lift_alt, DBLSIZE|PREC1, 6); // lift lcd_outdezNAtt( 10*FW, 5*FH, lift_alt, DBLSIZE|PREC1, 6); // lift
lcd_putcAtt ( 11*FW, 6*FH, sbuf[0], 0); // dimension [m/S] lcd_putcAtt ( 11*FW, 6*FH, sbuf[0], 0); // dimension [m/S]
lcd_puts_P ( 12*FW, 6*FH, PSTR("/S") ); lcd_puts ( 12*FW, 6*FH, PSTR("/S") );
} }
} }
else { else {
@@ -663,7 +663,7 @@ void menuProcNMEA3(uint8_t event)
initval (LONG_BUF(1), PACK_RMC, COG); initval (LONG_BUF(1), PACK_RMC, COG);
initval (SHORT_BUF(2), PACK_GGA, SAT); // -> sbuf[2] initval (SHORT_BUF(2), PACK_GGA, SAT); // -> sbuf[2]
title ('3'); title ('3');
lcd_puts_P ( 0*FW, 1*FH, PSTR("GrndSpeed[knt] Sat")); lcd_puts ( 0*FW, 1*FH, PSTR("GrndSpeed[knt] Sat"));
if (rbuf[0][0]) // if first position is 00, buffer is empty, taken as false if (rbuf[0][0]) // if first position is 00, buffer is empty, taken as false
{ // any other value is true { // any other value is true
uint8_t i = 0; uint8_t i = 0;
@@ -683,7 +683,7 @@ void menuProcNMEA3(uint8_t event)
lcd_putcAtt ( 19*FW, 1*FH, sbuf[2], 0); // satellites in view lcd_putcAtt ( 19*FW, 1*FH, sbuf[2], 0); // satellites in view
lcd_puts_P ( 1*FW, 4*FH, PSTR("Course over ground") ); lcd_puts ( 1*FW, 4*FH, PSTR("Course over ground") );
lcd_putsAtt ( 2*FW, 5*FH, VALSTR(1), APSIZE); // course over ground lcd_putsAtt ( 2*FW, 5*FH, VALSTR(1), APSIZE); // course over ground
} }
@@ -717,7 +717,7 @@ void menuProcNMEA4(uint8_t event)
initval (SHORT_BUF(2), PACK_GGA, SAT); // -> sbuf[2] initval (SHORT_BUF(2), PACK_GGA, SAT); // -> sbuf[2]
// title of the screen // title of the screen
title ('4'); title ('4');
lcd_puts_P ( 3*FW, 1*FH, PSTR("Latitude Sat")); // line 1 column 3 lcd_puts ( 3*FW, 1*FH, PSTR("Latitude Sat")); // line 1 column 3
// first buffer into line 2 column 2 // first buffer into line 2 column 2
if (rbuf[0][0]) if (rbuf[0][0])
{ {
@@ -729,7 +729,7 @@ void menuProcNMEA4(uint8_t event)
} }
else else
lcd_putsAtt ( 2*FW, 2*FH, val_unknown, APSIZE); lcd_putsAtt ( 2*FW, 2*FH, val_unknown, APSIZE);
lcd_puts_P ( 3*FW, 4*FH, PSTR("Longitude")); // line 4 column 5 lcd_puts ( 3*FW, 4*FH, PSTR("Longitude")); // line 4 column 5
// second buffer into line 5 column 2 // second buffer into line 5 column 2
if (rbuf[0][0]) if (rbuf[0][0])
{ {
+6 -11
View File
@@ -24,6 +24,7 @@ const pm_char STR_OPEN9X[] PROGMEM =
TR_VFSWFUNC TR_VFSWFUNC
TR_FUNCSOUNDS TR_FUNCSOUNDS
#ifdef FRSKY #ifdef FRSKY
TR_VTELEMBARS
TR_VTELEMUNIT TR_VTELEMUNIT
TR_VALARM TR_VALARM
TR_VALARMFN TR_VALARMFN
@@ -144,19 +145,13 @@ const pm_char STR_ALT[] PROGMEM = TR_ALT;
const pm_char STR_RXBATT[] PROGMEM = TR_RXBATT; const pm_char STR_RXBATT[] PROGMEM = TR_RXBATT;
const pm_char STR_RX[] PROGMEM = TR_RX; const pm_char STR_RX[] PROGMEM = TR_RX;
const pm_char STR_TX[] PROGMEM = TR_TX; const pm_char STR_TX[] PROGMEM = TR_TX;
const pm_char STR_SPD[] PROGMEM = TR_SPD; const pm_char STR_SPDnMAX[] PROGMEM = TR_SPDnMAX;
const pm_char STR_TEMP1[] PROGMEM = TR_TEMP1; const pm_char STR_TEMP1nTEMP2[] PROGMEM = TR_TEMP1nTEMP2;
const pm_char STR_TEMP2[] PROGMEM = TR_TEMP2; const pm_char STR_RPMnFUEL[] PROGMEM = TR_RPMnFUEL;
const pm_char STR_RPM[] PROGMEM = TR_RPM;
const pm_char STR_FUEL[] PROGMEM = TR_FUEL;
const pm_char STR_ACCEL[] PROGMEM = TR_ACCEL; const pm_char STR_ACCEL[] PROGMEM = TR_ACCEL;
const pm_char STR_TELE[] PROGMEM = TR_TELE;
const pm_char STR_RSSI[] PROGMEM = TR_RSSI;
const pm_char STR_NODATA[] PROGMEM = TR_NODATA; const pm_char STR_NODATA[] PROGMEM = TR_NODATA;
const pm_char STR_TM1[] PROGMEM = TR_TM1; const pm_char STR_TM1TM2[] PROGMEM = TR_TM1TM2;
const pm_char STR_TM2[] PROGMEM = TR_TM2; const pm_char STR_THRTHP[] PROGMEM = TR_THRTHP;
const pm_char STR_THR[] PROGMEM = TR_THR;
const pm_char STR_TH[] PROGMEM = TR_TH;
const pm_char STR_TOT[] PROGMEM = TR_TOT; const pm_char STR_TOT[] PROGMEM = TR_TOT;
const pm_char STR_TMR1LATMAXUS[] PROGMEM = TR_TMR1LATMAXUS; const pm_char STR_TMR1LATMAXUS[] PROGMEM = TR_TMR1LATMAXUS;
const pm_char STR_TMR1LATMINUS[] PROGMEM = TR_TMR1LATMINUS; const pm_char STR_TMR1LATMINUS[] PROGMEM = TR_TMR1LATMINUS;
+9 -12
View File
@@ -37,7 +37,8 @@ extern const pm_char STR_OPEN9X[];
#define OFS_VFSWFUNC (OFS_VCSWFUNC + PSIZE(TR_VCSWFUNC)) #define OFS_VFSWFUNC (OFS_VCSWFUNC + PSIZE(TR_VCSWFUNC))
#define OFS_FUNCSOUNDS (OFS_VFSWFUNC + PSIZE(TR_VFSWFUNC)) #define OFS_FUNCSOUNDS (OFS_VFSWFUNC + PSIZE(TR_VFSWFUNC))
#ifdef FRSKY #ifdef FRSKY
#define OFS_VTELEMUNIT (OFS_FUNCSOUNDS + PSIZE(TR_FUNCSOUNDS)) #define OFS_VTELEMBARS (OFS_FUNCSOUNDS + PSIZE(TR_FUNCSOUNDS))
#define OFS_VTELEMUNIT (OFS_VTELEMBARS + PSIZE(TR_VTELEMBARS))
#define OFS_VALARM (OFS_VTELEMUNIT + PSIZE(TR_VTELEMUNIT)) #define OFS_VALARM (OFS_VTELEMUNIT + PSIZE(TR_VTELEMUNIT))
#define OFS_VALARMFN (OFS_VALARM + PSIZE(TR_VALARM)) #define OFS_VALARMFN (OFS_VALARM + PSIZE(TR_VALARM))
#define OFS_VTELPROTO (OFS_VALARMFN + PSIZE(TR_VALARMFN)) #define OFS_VTELPROTO (OFS_VALARMFN + PSIZE(TR_VALARMFN))
@@ -99,6 +100,7 @@ extern const pm_char STR_OPEN9X[];
#define STR_FUNCSOUNDS (STR_OPEN9X + OFS_FUNCSOUNDS) #define STR_FUNCSOUNDS (STR_OPEN9X + OFS_FUNCSOUNDS)
#ifdef FRSKY #ifdef FRSKY
#define STR_VTELEMBARS (STR_OPEN9X + OFS_VTELEMBARS)
#define STR_VTELEMUNIT (STR_OPEN9X + OFS_VTELEMUNIT) #define STR_VTELEMUNIT (STR_OPEN9X + OFS_VTELEMUNIT)
#define STR_VALARM (STR_OPEN9X + OFS_VALARM) #define STR_VALARM (STR_OPEN9X + OFS_VALARM)
#define STR_VALARMFN (STR_OPEN9X + OFS_VALARMFN) #define STR_VALARMFN (STR_OPEN9X + OFS_VALARMFN)
@@ -131,6 +133,7 @@ extern const pm_char STR_OPEN9X[];
// The 0-terminated-strings // The 0-terminated-strings
extern const pm_char STR_POPUPS[]; extern const pm_char STR_POPUPS[];
#define STR_EXIT (STR_POPUPS + OFS_EXIT)
extern const pm_char STR_MENUWHENDONE[]; extern const pm_char STR_MENUWHENDONE[];
extern const pm_char STR_FREE[]; extern const pm_char STR_FREE[];
#define LEN_FREE PSIZE(TR_FREE) #define LEN_FREE PSIZE(TR_FREE)
@@ -223,19 +226,13 @@ extern const pm_char STR_ALT[];
extern const pm_char STR_RXBATT[]; extern const pm_char STR_RXBATT[];
extern const pm_char STR_RX[]; extern const pm_char STR_RX[];
extern const pm_char STR_TX[]; extern const pm_char STR_TX[];
extern const pm_char STR_SPD[]; extern const pm_char STR_SPDnMAX[];
extern const pm_char STR_TEMP1[]; extern const pm_char STR_TEMP1nTEMP2[];
extern const pm_char STR_TEMP2[]; extern const pm_char STR_RPMnFUEL[];
extern const pm_char STR_RPM[];
extern const pm_char STR_FUEL[];
extern const pm_char STR_ACCEL[]; extern const pm_char STR_ACCEL[];
extern const pm_char STR_TELE[];
extern const pm_char STR_RSSI[];
extern const pm_char STR_NODATA[]; extern const pm_char STR_NODATA[];
extern const pm_char STR_TM1[]; extern const pm_char STR_TM1TM2[];
extern const pm_char STR_TM2[]; extern const pm_char STR_THRTHP[];
extern const pm_char STR_THR[];
extern const pm_char STR_TH[];
extern const pm_char STR_TOT[]; extern const pm_char STR_TOT[];
extern const pm_char STR_TMR1LATMAXUS[]; extern const pm_char STR_TMR1LATMAXUS[];
extern const pm_char STR_TMR1LATMINUS[]; extern const pm_char STR_TMR1LATMINUS[];
+23 -10
View File
@@ -277,8 +277,9 @@ void applyExpos(int16_t *anas, uint8_t phase)
} }
} }
/*TODO evaluate impact FORCEINLINE */
bool s_noStickInputs = false; bool s_noStickInputs = false;
FORCEINLINE int16_t getValue(uint8_t i) int16_t getValue(uint8_t i)
{ {
if(i<NUM_STICKS+NUM_POTS) return (s_noStickInputs ? 0 : calibratedStick[i]); if(i<NUM_STICKS+NUM_POTS) return (s_noStickInputs ? 0 : calibratedStick[i]);
else if(i<MIX_FULL/*srcRaw is shifted +1!*/) return 1024; //FULL/MAX else if(i<MIX_FULL/*srcRaw is shifted +1!*/) return 1024; //FULL/MAX
@@ -286,13 +287,18 @@ FORCEINLINE int16_t getValue(uint8_t i)
else if(i<PPM_BASE+NUM_PPM) return g_ppmIns[i-PPM_BASE]*2; else if(i<PPM_BASE+NUM_PPM) return g_ppmIns[i-PPM_BASE]*2;
else if(i<CHOUT_BASE+NUM_CHNOUT) return ex_chans[i-CHOUT_BASE]; else if(i<CHOUT_BASE+NUM_CHNOUT) return ex_chans[i-CHOUT_BASE];
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS) return s_timerVal[i-CHOUT_BASE-NUM_CHNOUT]; else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS) return s_timerVal[i-CHOUT_BASE-NUM_CHNOUT];
#ifdef FRSKY #if defined(FRSKY)
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+2) return frskyTelemetry[i-CHOUT_BASE-NUM_CHNOUT-MAX_TIMERS].value; else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+2) return frskyTelemetry[i-CHOUT_BASE-NUM_CHNOUT-MAX_TIMERS].value;
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+3) return frskyHubData.baroAltitude + baroAltitudeOffset; else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+3) return frskyHubData.baroAltitude + frskyHubData.baroAltitudeOffset;
#endif #endif
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+4) return (frskyHubData.rpm / 2); else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+4) return (frskyHubData.rpm / 2);
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+5) return frskyHubData.fuelLevel;
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+6) return frskyHubData.temperature1;
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+7) return frskyHubData.temperature2;
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+8) return frskyHubData.gpsSpeed_ap;
else if(i<CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+9) return frskyHubData.minCellVolts;
#endif #endif
#endif #endif
else return 0; else return 0;
@@ -354,8 +360,15 @@ bool __getSwitch(int8_t swtch)
if (s == CS_VOFS) { if (s == CS_VOFS) {
#ifdef FRSKY #ifdef FRSKY
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
// Fill the threshold array
if (cs.v1 > CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+2)
barsThresholds[cs.v1-CHOUT_BASE-NUM_CHNOUT-MAX_TIMERS-3] = 128 + cs.v2;
// TODO CELL?
// FUEL, T1, T2, SPEED
if (cs.v1 > CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+4)
y = (128+cs.v2);
// RPMs // RPMs
if (cs.v1 > CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+3) else if (cs.v1 > CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+3)
y = (128+cs.v2) * 25; y = (128+cs.v2) * 25;
else else
#endif #endif
@@ -559,9 +572,9 @@ void alertMessages( const pm_char * s, const pm_char * t )
{ {
lcd_clear(); lcd_clear();
lcd_putsAtt(64-5*FW,0*FH,STR_ALERT,DBLSIZE); lcd_putsAtt(64-5*FW,0*FH,STR_ALERT,DBLSIZE);
lcd_puts_P(0,4*FH,s); lcd_putsLeft(4*FH,s);
lcd_puts_P(0,5*FH,t); lcd_putsLeft(5*FH,t);
lcd_puts_P(0,6*FH, STR_PRESSANYKEYTOSKIP ) ; lcd_putsLeft(6*FH, STR_PRESSANYKEYTOSKIP ) ;
refreshDisplay(); refreshDisplay();
lcdSetRefVolt(g_eeGeneral.contrast); lcdSetRefVolt(g_eeGeneral.contrast);
@@ -650,7 +663,7 @@ void message(const pm_char * s)
{ {
lcd_clear(); lcd_clear();
lcd_putsAtt(64-5*FW, 0*FH, STR_MESSAGE, DBLSIZE); lcd_putsAtt(64-5*FW, 0*FH, STR_MESSAGE, DBLSIZE);
lcd_puts_P(0,4*FW,s); lcd_putsLeft(4*FW,s);
refreshDisplay(); refreshDisplay();
lcdSetRefVolt(g_eeGeneral.contrast); lcdSetRefVolt(g_eeGeneral.contrast);
} }
@@ -659,8 +672,8 @@ void alert(const pm_char * s, bool defaults)
{ {
lcd_clear(); lcd_clear();
lcd_putsAtt(64-5*FW, 0*FH, STR_ALERT, DBLSIZE); lcd_putsAtt(64-5*FW, 0*FH, STR_ALERT, DBLSIZE);
lcd_puts_P(0,4*FH,s); lcd_putsLeft(4*FH,s);
lcd_puts_P(64-LEN_PRESSANYKEY*FW/2, 7*FH, STR_PRESSANYKEY); lcd_puts(64-LEN_PRESSANYKEY*FW/2, 7*FH, STR_PRESSANYKEY);
refreshDisplay(); refreshDisplay();
lcdSetRefVolt(defaults ? 25 : g_eeGeneral.contrast); lcdSetRefVolt(defaults ? 25 : g_eeGeneral.contrast);
AUDIO_ERROR(); AUDIO_ERROR();
+10 -43
View File
@@ -40,26 +40,9 @@
#include <stddef.h> #include <stddef.h>
#include <avr/io.h> #include <avr/io.h>
#define assert(x) #define assert(x)
//disable whole pgmspace functionality for all avr-gcc because
//avr-gcc > 4.2.1 does not work anyway
//http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg239240.html
//http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734
//
//Workarounds:
//
//PSTR is fixed below
//all prog_xx definitions must use APM explicitely
//#define __ATTR_PROGMEM__
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#include "pgmtypes.h" #include "pgmtypes.h"
#ifdef __cplusplus
#define APM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static const pm_char __c[] PROGMEM = (s);&__c[0];}))
#endif
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <avr/sleep.h> #include <avr/sleep.h>
@@ -347,7 +330,7 @@ enum EnumKeys {
#define CHOUT_BASE (PPM_BASE+NUM_PPM) #define CHOUT_BASE (PPM_BASE+NUM_PPM)
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
#define NUM_TELEMETRY 4 #define NUM_TELEMETRY 9
#elif defined(WS_HOW_HIGH) #elif defined(WS_HOW_HIGH)
#define NUM_TELEMETRY 3 #define NUM_TELEMETRY 3
#elif defined(FRSKY) #elif defined(FRSKY)
@@ -397,12 +380,13 @@ enum EnumKeys {
#define MAX_ALERT_TIME 60 #define MAX_ALERT_TIME 60
// TODO enum in myeeprom.h enum Protocols {
#define PROTO_PPM 0 PROTO_PPM,
#define PROTO_PXX 1 PROTO_PXX,
#define PROTO_DSM2 2 PROTO_DSM2,
#define PROTO_PPM16 3 PROTO_PPM16,
#define PROT_MAX 3 PROTO_MAX
};
extern uint8_t heartbeat; extern uint8_t heartbeat;
extern uint32_t inacCounter; extern uint32_t inacCounter;
@@ -444,26 +428,9 @@ void perMain();
/// Bearbeitet alle zeitkritischen Jobs. /// Bearbeitet alle zeitkritischen Jobs.
/// wie z.B. einlesen aller Eingaenge, Entprellung, Key-Repeat.. /// wie z.B. einlesen aller Eingaenge, Entprellung, Key-Repeat..
void per10ms(); void per10ms();
/// Erzeugt periodisch alle Outputs ausser Bildschirmausgaben.
void zeroVariables();
/// Liefert den Zustand des Switches 'swtch'. Die Numerierung erfolgt ab 1 int16_t getValue(uint8_t i);
/// (1=SW_ON, 2=SW_ThrCt, 10=SW_Trainer). 0 Bedeutet not conected.
/// Negative Werte erzeugen invertierte Ergebnisse.
/// Die Funktion putsSwitches(..) erzeugt den passenden Ausdruck.
///
/// \param swtch
/// 0 : not connected. Liefert den Wert 'nc'
/// 1.. MAX_SWITCH : SW_ON .. SW_Trainer
/// -1..-MAX_SWITCH : negierte Werte
/// \param nc Wert, der bei swtch==0 geliefert wird.
bool getSwitch(int8_t swtch, bool nc); bool getSwitch(int8_t swtch, bool nc);
/// Zeigt den Namen des Switches 'swtch' im display an
/// \param x x-koordinate 0..127
/// \param y y-koordinate 0..63 (nur durch 8 teilbar)
/// \param swtch -MAX_SWITCH .. MAX_SWITCH
/// \param att NO_INV,INVERS,BLINK
///
uint8_t getFlightPhase(); uint8_t getFlightPhase();
uint8_t getTrimFlightPhase(uint8_t idx, uint8_t phase); uint8_t getTrimFlightPhase(uint8_t idx, uint8_t phase);
@@ -650,7 +617,7 @@ extern volatile uint16_t g_tmr10ms;
extern volatile uint8_t g_blinkTmr10ms; extern volatile uint8_t g_blinkTmr10ms;
extern uint8_t g_beepCnt; extern uint8_t g_beepCnt;
extern uint8_t g_beepVal[5]; extern uint8_t g_beepVal[5];
// TODO needed?
extern const PROGMEM char modi12x3[]; extern const PROGMEM char modi12x3[];
#include "o9xstrings.h" #include "o9xstrings.h"
+26
View File
@@ -1,6 +1,32 @@
#ifndef __PGMTYPES__ #ifndef __PGMTYPES__
#define __PGMTYPES__ #define __PGMTYPES__
/* this is workaround for g++ bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734 */
#if (((__GNUC__ * 1000) + __GNUC_MINOR__) * 1000 + __GNUC_PATCHLEVEL__) < 4006002
# ifdef __cplusplus
# undef PROGMEM
# define PROGMEM __attribute__(( section(".progmem.data") ))
# undef PSTR
# endif
#endif
/* old (pre 1.8.0) avr-libc does not have progmem macros compatible with new gcc
* note: even for old gcc, definition was wrong. Old gcc was just more tolerant. */
#if (((__AVR_LIBC_MAJOR__ * 1000) + __AVR_LIBC_MINOR__) * 1000 + __AVR_LIBC_REVISION__) < 1008000
# ifndef __PGMSPACE_H_
# warning "This file should be included after <avr/pgmspace.h>"
# endif
# undef PSTR
# undef PGM_P
# undef PGM_VOID_P
# define PGM_P const char *
# define PGM_VOID_P const void *
#endif
#ifndef PSTR
# define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s);&__c[0];}))
#endif
typedef void pm_void; typedef void pm_void;
typedef char pm_char; typedef char pm_char;
typedef unsigned char pm_uchar; typedef unsigned char pm_uchar;
+10 -13
View File
@@ -35,17 +35,15 @@ void menuProcStatistic(uint8_t event)
break; break;
} }
lcd_puts_P( 1*FW, FH*1, STR_TM1); lcd_puts( 1*FW, FH*1, STR_TM1TM2);
putsTime( 5*FW, FH*1, s_timerVal[0], 0, 0); putsTime( 5*FW, FH*1, s_timerVal[0], 0, 0);
lcd_puts_P( 17*FW, FH*1, STR_TM2);
putsTime( 12*FW, FH*1, s_timerVal[1], 0, 0); putsTime( 12*FW, FH*1, s_timerVal[1], 0, 0);
lcd_puts_P( 1*FW, FH*2, STR_THR); lcd_puts( 1*FW, FH*2, STR_THRTHP);
putsTime( 5*FW, FH*2, s_timeCumThr, 0, 0); putsTime( 5*FW, FH*2, s_timeCumThr, 0, 0);
lcd_puts_P( 17*FW, FH*2, STR_TH);
putsTime( 12*FW, FH*2, s_timeCum16ThrP/16, 0, 0); putsTime( 12*FW, FH*2, s_timeCum16ThrP/16, 0, 0);
lcd_puts_P( 17*FW, FH*0, STR_TOT); lcd_puts( 17*FW, FH*0, STR_TOT);
putsTime( 12*FW, FH*0, s_timeCumTot, 0, 0); putsTime( 12*FW, FH*0, s_timeCumTot, 0, 0);
uint16_t traceRd = s_traceCnt>MAXTRACE ? s_traceWr : 0; uint16_t traceRd = s_traceCnt>MAXTRACE ? s_traceWr : 0;
@@ -67,7 +65,6 @@ void menuProcStatistic(uint8_t event)
} }
} }
// TODO ifdef DEBUG
void menuProcDebug(uint8_t event) void menuProcDebug(uint8_t event)
{ {
TITLE(STR_MENUDEBUG); TITLE(STR_MENUDEBUG);
@@ -87,21 +84,21 @@ void menuProcDebug(uint8_t event)
chainMenu(menuMainView); chainMenu(menuMainView);
break; break;
} }
lcd_puts_P( 0*FW, 1*FH, STR_TMR1LATMAXUS); lcd_puts( 0*FW, 1*FH, STR_TMR1LATMAXUS);
lcd_outdez8(15*FW , 1*FH, g_tmr1Latency_max/2 ); lcd_outdez8(15*FW , 1*FH, g_tmr1Latency_max/2 );
lcd_puts_P( 0*FW, 2*FH, STR_TMR1LATMINUS); lcd_puts( 0*FW, 2*FH, STR_TMR1LATMINUS);
lcd_outdez8(15*FW , 2*FH, g_tmr1Latency_min/2 ); lcd_outdez8(15*FW , 2*FH, g_tmr1Latency_min/2 );
lcd_puts_P( 0*FW, 3*FH, STR_TMR1JITTERUS); lcd_puts( 0*FW, 3*FH, STR_TMR1JITTERUS);
lcd_outdez8(15*FW , 3*FH, (g_tmr1Latency_max - g_tmr1Latency_min) /2 ); lcd_outdez8(15*FW , 3*FH, (g_tmr1Latency_max - g_tmr1Latency_min) /2 );
lcd_puts_P( 0*FW, 4*FH, STR_TMAINMAXMS); lcd_puts( 0*FW, 4*FH, STR_TMAINMAXMS);
lcd_outdezAtt(15*FW, 4*FH, (g_timeMain*100)/16, PREC2); lcd_outdezAtt(15*FW, 4*FH, (g_timeMain*100)/16, PREC2);
#ifdef DEBUG #ifdef DEBUG
lcd_puts_P( 0*FW, 5*FH, STR_T10MSUS); lcd_puts( 0*FW, 5*FH, STR_T10MSUS);
lcd_outdez8(15*FW , 5*FH, g_time_per10/2 ); lcd_outdez8(15*FW , 5*FH, g_time_per10/2 );
#endif #endif
#ifndef SIMU #ifndef SIMU
lcd_puts_P( 0*FW, 6*FH, STR_FREESTACKMINB); lcd_puts( 0*FW, 6*FH, STR_FREESTACKMINB);
lcd_outdezAtt(18*FW-1, 6*FH, stack_free(), UNSIGN) ; lcd_outdezAtt(18*FW-1, 6*FH, stack_free(), UNSIGN) ;
#endif #endif
lcd_puts_P( 3*FW, 7*FH, STR_MENUTORESET); lcd_puts( 3*FW, 7*FH, STR_MENUTORESET);
} }
+34 -34
View File
@@ -8,8 +8,8 @@
#define LEN_NCHANNELS 4 #define LEN_NCHANNELS 4
#define TR_NCHANNELS "4CH 6CH 8CH 10CH12CH14CH16CH" #define TR_NCHANNELS "4CH 6CH 8CH 10CH12CH14CH16CH"
#define LEN_VBEEPER 6 #define LEN_VBEEPER 6
#define TR_VBEEPER "Quiet ""NoKey ""xShort""Short ""Norm ""Long ""xLong " #define TR_VBEEPER "Quiet ""NoKey ""xShort""Short ""Norm ""Long ""xLong "
#define LEN_ADCFILTER 4 #define LEN_ADCFILTER 4
#define TR_ADCFILTER "SING""OSMP""FILT" #define TR_ADCFILTER "SING""OSMP""FILT"
@@ -57,7 +57,7 @@
#define TR_VMIXTRIMS "ON ""OFF ""Offset" #define TR_VMIXTRIMS "ON ""OFF ""Offset"
#define LEN_VCSWFUNC 7 #define LEN_VCSWFUNC 7
#define TR_VCSWFUNC "---- ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 " #define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
#define LEN_VFSWFUNC 13 #define LEN_VFSWFUNC 13
#ifdef LOGS #ifdef LOGS
@@ -70,8 +70,11 @@
#define LEN_FUNCSOUNDS 6 #define LEN_FUNCSOUNDS 6
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3" #define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
#define LEN_VTELEMUNIT 4 #define LEN_VTELEMBARS 4
#define TR_VTELEMUNIT "v\0 ""-\0 ""kts\0""km/h""M/h\0""m\0 ""@C\0 " #define TR_VTELEMBARS "---\0""A1\0 ""A2\0 ""ALT\0""RPM\0""FUEL""T1\0 ""T2\0 ""SPD\0""CELL"
#define LEN_VTELEMUNIT 3
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0"
#define LEN_VALARM 3 #define LEN_VALARM 3
#define TR_VALARM "---""Yel""Org""Red" #define TR_VALARM "---""Yel""Org""Red"
@@ -89,8 +92,8 @@
#define LEN_VTEMPLATES 12 #define LEN_VTEMPLATES 12
#define TR_VTEMPLATES "Simple 4-CH ""T-Cut ""V-Tail ""Elevon\\Delta""eCCPM ""Heli Setup ""Servo Test " #define TR_VTEMPLATES "Simple 4-CH ""T-Cut ""V-Tail ""Elevon\\Delta""eCCPM ""Heli Setup ""Servo Test "
#define LEN_VSWASHTYPE 6 #define LEN_VSWASHTYPE 4
#define TR_VSWASHTYPE "--- ""120 ""120X ""140 ""90 " #define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90 "
#define LEN_VKEYS 5 #define LEN_VKEYS 5
#define TR_VKEYS " Menu"" Exit"" Down"" Up""Right"" Left" #define TR_VKEYS " Menu"" Exit"" Down"" Up""Right"" Left"
@@ -107,12 +110,14 @@
#define LEN_VTMRMODES 3 #define LEN_VTMRMODES 3
#define TR_VTMRMODES "OFF""ABS""THs""TH%""THt" #define TR_VTMRMODES "OFF""ABS""THs""TH%""THt"
#define LEN_TELEMCHNS 3
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
#define TR_TELEMCHNS "AD1AD2ALTRPM" #define LEN_TELEMCHNS 4
#define TR_TELEMCHNS "AD1 AD2 ALT RPM FUELT@1 T@2 SPD\0CELL"
#elif defined(WS_HOW_HIGH) #elif defined(WS_HOW_HIGH)
#define LEN_TELEMCHNS 3
#define TR_TELEMCHNS "AD1AD2ALT" #define TR_TELEMCHNS "AD1AD2ALT"
#elif defined(FRSKY) #elif defined(FRSKY)
#define LEN_TELEMCHNS 3
#define TR_TELEMCHNS "AD1AD2" #define TR_TELEMCHNS "AD1AD2"
#endif #endif
@@ -120,8 +125,9 @@
#define TR_DSM2MODE "LP4/LP5DSMonlyDSMX " #define TR_DSM2MODE "LP4/LP5DSMonlyDSMX "
// ZERO TERMINATED STRINGS // ZERO TERMINATED STRINGS
#define TR_POPUPS "[MENU] [EXIT]" #define TR_POPUPS "[MENU]\004[EXIT]"
#define TR_MENUWHENDONE " [MENU] WHEN DONE" #define OFS_EXIT 7
#define TR_MENUWHENDONE "[MENU] WHEN DONE"
#define TR_FREE "free" #define TR_FREE "free"
#define TR_DELETEMODEL "DELETE MODEL" #define TR_DELETEMODEL "DELETE MODEL"
#define TR_COPYINGMODEL "Copying model..." #define TR_COPYINGMODEL "Copying model..."
@@ -143,7 +149,7 @@
#define TR_FADEIN "Fade In" #define TR_FADEIN "Fade In"
#define TR_FADEOUT "Fade Out" #define TR_FADEOUT "Fade Out"
#define TR_DEFAULT "(default)" #define TR_DEFAULT "(default)"
#define TR_CHECKTRIMS "Check Trims" #define TR_CHECKTRIMS "Check\005Trims"
#define TR_SWASHTYPE "Swash Type" #define TR_SWASHTYPE "Swash Type"
#define TR_COLLECTIVE "Collective" #define TR_COLLECTIVE "Collective"
#define TR_SWASHRING "Swash Ring" #define TR_SWASHRING "Swash Ring"
@@ -173,7 +179,7 @@
#define TR_COPYTRIMMENU "COPY TRIM [MENU]" #define TR_COPYTRIMMENU "COPY TRIM [MENU]"
#define TR_CV "CV" #define TR_CV "CV"
#define TR_SW "SW" #define TR_SW "SW"
#define TR_ACHANNEL "A channel" #define TR_ACHANNEL "A\002channel"
#define TR_RANGE "Range" #define TR_RANGE "Range"
#define TR_BAR "Bar" #define TR_BAR "Bar"
#define TR_ALARM "Alarm" #define TR_ALARM "Alarm"
@@ -199,39 +205,33 @@
#define TR_RXCHANNELORD "Rx Channel Ord" #define TR_RXCHANNELORD "Rx Channel Ord"
#define TR_MODE2 "Mode" #define TR_MODE2 "Mode"
#define TR_SLAVE "Slave" #define TR_SLAVE "Slave"
#define TR_MODESRC "mode % src" #define TR_MODESRC "mode\003% src"
#define TR_MULTIPLIER "Multiplier" #define TR_MULTIPLIER "Multiplier"
#define TR_CAL "Cal" #define TR_CAL "Cal"
#define TR_EEPROMV "EEPROM v" #define TR_EEPROMV "EEPROM v"
#define TR_VTRIM "Trim- +" #define TR_VTRIM "Trim- +"
#define TR_BG "BG" #define TR_BG "BG"
#define TR_MENUTOSTART " [MENU] TO START " #define TR_MENUTOSTART "[MENU] TO START"
#define TR_SETMIDPOINT " SET MIDPOINT " #define TR_SETMIDPOINT "SET MIDPOINT"
#define TR_MOVESTICKSPOTS " MOVE STICKS/POTS " #define TR_MOVESTICKSPOTS "MOVE STICKS/POTS"
#define TR_ALT "Alt:" #define TR_ALT "Alt:"
#define TR_RXBATT "Rx Batt:" #define TR_RXBATT "Rx Batt:"
#define TR_RX "Rx:" #define TR_RX "Rx:"
#define TR_TX "Tx:" #define TR_TX "Tx:"
#define TR_SPD "Spd:" #define TR_SPDnMAX "Spd:\008Max:"
#define TR_TEMP1 "T@1:" #define TR_TEMP1nTEMP2 "T@1:\007T@2:"
#define TR_TEMP2 "T@2:" #define TR_RPMnFUEL "RPM:\006Fuel:"
#define TR_RPM "RPM:"
#define TR_FUEL "Fuel:"
#define TR_ACCEL "Acc:" #define TR_ACCEL "Acc:"
#define TR_TELE "Tele:"
#define TR_RSSI "RSSI:"
#define TR_NODATA "NO DATA" #define TR_NODATA "NO DATA"
#define TR_TM1 "TM1" #define TR_TM1TM2 "TM1\015TM2"
#define TR_TM2 "TM2" #define TR_THRTHP "THR\015TH%"
#define TR_THR "THR"
#define TR_TH "TH%"
#define TR_TOT "TOT" #define TR_TOT "TOT"
#define TR_TMR1LATMAXUS "tmr1Lat max us" #define TR_TMR1LATMAXUS "tmr1Lat max\004us"
#define TR_TMR1LATMINUS "tmr1Lat min us" #define TR_TMR1LATMINUS "tmr1Lat min\004us"
#define TR_TMR1JITTERUS "tmr1 Jitter us" #define TR_TMR1JITTERUS "tmr1 Jitter\004us"
#define TR_TMAINMAXMS "tmain max ms" #define TR_TMAINMAXMS "tmain max\010ms"
#define TR_T10MSUS "t10ms us" #define TR_T10MSUS "t10ms\010us"
#define TR_FREESTACKMINB "Free Stack min b" #define TR_FREESTACKMINB "Free Stack min\004b"
#define TR_MENUTORESET "[MENU] to reset" #define TR_MENUTORESET "[MENU] to reset"
#define TR_PPM "PPM" #define TR_PPM "PPM"
#define TR_CH "CH" #define TR_CH "CH"
+31 -32
View File
@@ -57,7 +57,7 @@
#define TR_VMIXTRIMS "ON ""OFF ""Offset" #define TR_VMIXTRIMS "ON ""OFF ""Offset"
#define LEN_VCSWFUNC 7 #define LEN_VCSWFUNC 7
#define TR_VCSWFUNC "---- ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""ET ""OU ""XOU ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 " #define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
#define LEN_VFSWFUNC 13 #define LEN_VFSWFUNC 13
#ifdef LOGS #ifdef LOGS
@@ -70,8 +70,11 @@
#define LEN_FUNCSOUNDS 6 #define LEN_FUNCSOUNDS 6
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3" #define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
#define LEN_VTELEMUNIT 4 #define LEN_VTELEMBARS 4
#define TR_VTELEMUNIT "v\0 ""-\0 ""kts\0""km/h""M/h\0""m\0 ""@C\0 " #define TR_VTELEMBARS "---\0""A1\0 ""A2\0 ""ALT\0""RPM\0""FUEL""T1\0 ""T2\0 ""SPD\0""CELL"
#define LEN_VTELEMUNIT 3
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0"
#define LEN_VALARM 3 #define LEN_VALARM 3
#define TR_VALARM "---""Yel""Org""Red" #define TR_VALARM "---""Yel""Org""Red"
@@ -89,8 +92,8 @@
#define LEN_VTEMPLATES 14 #define LEN_VTEMPLATES 14
#define TR_VTEMPLATES "4 Voies simple""Coupure Gaz ""Empennage V ""Elevon\\Delta ""eCCPM ""Conf.Helico ""Servo Test " #define TR_VTEMPLATES "4 Voies simple""Coupure Gaz ""Empennage V ""Elevon\\Delta ""eCCPM ""Conf.Helico ""Servo Test "
#define LEN_VSWASHTYPE 6 #define LEN_VSWASHTYPE 4
#define TR_VSWASHTYPE "--- ""120 ""120X ""140 ""90 " #define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90 "
#define LEN_VKEYS 5 #define LEN_VKEYS 5
#define TR_VKEYS " Menu"" Exit"" Bas"" Haut""Droit""Gauch" #define TR_VKEYS " Menu"" Exit"" Bas"" Haut""Droit""Gauch"
@@ -107,12 +110,14 @@
#define LEN_VTMRMODES 3 #define LEN_VTMRMODES 3
#define TR_VTMRMODES "OFF""ABS""GZs""GZ%""GZt" #define TR_VTMRMODES "OFF""ABS""GZs""GZ%""GZt"
#define LEN_TELEMCHNS 3
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
#define TR_TELEMCHNS "AD1AD2ALTRPM" #define LEN_TELEMCHNS 4
#define TR_TELEMCHNS "AD1 AD2 ALT RPM FUELT@1 T@2 SPD\0CELL"
#elif defined(WS_HOW_HIGH) #elif defined(WS_HOW_HIGH)
#define LEN_TELEMCHNS 3
#define TR_TELEMCHNS "AD1AD2ALT" #define TR_TELEMCHNS "AD1AD2ALT"
#elif defined(FRSKY) #elif defined(FRSKY)
#define LEN_TELEMCHNS 3
#define TR_TELEMCHNS "AD1AD2" #define TR_TELEMCHNS "AD1AD2"
#endif #endif
@@ -120,8 +125,9 @@
#define TR_DSM2MODE "LP4/LP5DSMonlyDSMX " #define TR_DSM2MODE "LP4/LP5DSMonlyDSMX "
// ZERO TERMINATED STRINGS // ZERO TERMINATED STRINGS
#define TR_POPUPS "[MENU] [EXIT]" #define TR_POPUPS "[MENU]\004[EXIT]"
#define TR_MENUWHENDONE " [MENU]Quand PRET" #define OFS_EXIT 7
#define TR_MENUWHENDONE "[MENU]Quand PRET"
#define TR_FREE "libre" #define TR_FREE "libre"
#define TR_DELETEMODEL "SUPPRIMER MODELE" #define TR_DELETEMODEL "SUPPRIMER MODELE"
#define TR_COPYINGMODEL "Copie..." #define TR_COPYINGMODEL "Copie..."
@@ -143,7 +149,7 @@
#define TR_FADEIN "Fade In" #define TR_FADEIN "Fade In"
#define TR_FADEOUT "Fade Out" #define TR_FADEOUT "Fade Out"
#define TR_DEFAULT "(defaut)" #define TR_DEFAULT "(defaut)"
#define TR_CHECKTRIMS "Verif Trims" #define TR_CHECKTRIMS "Verif\005Trims"
#define TR_SWASHTYPE "Type de Plateau" #define TR_SWASHTYPE "Type de Plateau"
#define TR_COLLECTIVE "Collectif" #define TR_COLLECTIVE "Collectif"
#define TR_SWASHRING "Swash Ring" #define TR_SWASHRING "Swash Ring"
@@ -173,7 +179,7 @@
#define TR_COPYTRIMMENU "COPIER TRIM [MENU]" #define TR_COPYTRIMMENU "COPIER TRIM [MENU]"
#define TR_CV "CV" #define TR_CV "CV"
#define TR_SW "SW" #define TR_SW "SW"
#define TR_ACHANNEL "A voie" #define TR_ACHANNEL "A\002voie"
#define TR_RANGE "Range" #define TR_RANGE "Range"
#define TR_BAR "Bar" #define TR_BAR "Bar"
#define TR_ALARM "Alarme" #define TR_ALARM "Alarme"
@@ -199,40 +205,33 @@
#define TR_RXCHANNELORD "Ordre Voies Rx" #define TR_RXCHANNELORD "Ordre Voies Rx"
#define TR_MODE2 "Mode" #define TR_MODE2 "Mode"
#define TR_SLAVE "Esclave" #define TR_SLAVE "Esclave"
#define TR_MODESRC "mode % src" #define TR_MODESRC "mode\003% src"
#define TR_MULTIPLIER "Multiplieur" #define TR_MULTIPLIER "Multiplieur"
#define TR_CAL "Cal" #define TR_CAL "Cal"
#define TR_EEPROMV "EEPROM v" #define TR_EEPROMV "EEPROM v"
#define TR_VTRIM "Trim- +" #define TR_VTRIM "Trim- +"
#define TR_BG "BG" #define TR_BG "BG"
#define TR_MENUTOSTART "[MENU]POUR DEBUT" #define TR_MENUTOSTART "[MENU]POUR DEBUT"
#define TR_SETMIDPOINT " SET NEUTRE " #define TR_SETMIDPOINT "SET NEUTRE"
#define TR_MOVESTICKSPOTS " BOUGER MANCHES/POTS " #define TR_MOVESTICKSPOTS "BOUGER MANCHES/POTS "
#define TR_ALT "Alt:" #define TR_ALT "Alt:"
#define TR_RXBATT "Rx Batt:" #define TR_RXBATT "Rx Batt:"
#define TR_RX "Rx:" #define TR_RX "Rx:"
#define TR_TX "Tx:" #define TR_TX "Tx:"
#define TR_SPD "Spd:" #define TR_SPDnMAX "Spd:\006Max:"
#define TR_TEMP1 "T@1:" #define TR_TEMP1nTEMP2 "T@1:\007T@2:"
#define TR_TEMP2 "T@2:" #define TR_RPMnFUEL "RPM:\006Fuel:"
#define TR_RPM "RPM:"
#define TR_FUEL "Fuel:"
#define TR_VOLTS "Vlts:"
#define TR_ACCEL "Acc:" #define TR_ACCEL "Acc:"
#define TR_TELE "Tele:"
#define TR_RSSI "RSSI:"
#define TR_NODATA "NO DATA" #define TR_NODATA "NO DATA"
#define TR_TM1 "TM1" #define TR_TM1TM2 "TM1\015TM2"
#define TR_TM2 "TM2" #define TR_THRTHP "THR\015TH%"
#define TR_THR "GAZ"
#define TR_TH "TH%"
#define TR_TOT "TOT" #define TR_TOT "TOT"
#define TR_TMR1LATMAXUS "tmr1Lat max us" #define TR_TMR1LATMAXUS "tmr1Lat max\004us"
#define TR_TMR1LATMINUS "tmr1Lat min us" #define TR_TMR1LATMINUS "tmr1Lat min\004us"
#define TR_TMR1JITTERUS "tmr1 Jitter us" #define TR_TMR1JITTERUS "tmr1 Jitter\004us"
#define TR_TMAINMAXMS "tmain max ms" #define TR_TMAINMAXMS "tmain max\010ms"
#define TR_T10MSUS "t10ms us" #define TR_T10MSUS "t10ms\010us"
#define TR_FREESTACKMINB "Free Stack min b" #define TR_FREESTACKMINB "Free Stack min\004b"
#define TR_MENUTORESET "[MENU]pour reset" #define TR_MENUTORESET "[MENU]pour reset"
#define TR_PPM "PPM" #define TR_PPM "PPM"
#define TR_CH "CH" #define TR_CH "CH"