FrSky flash saving (64bytes)

Condensed display of Mixers lines in MIXER menu (by Max)
MOD_EXTRA_ROTARY_ENCODERS added (by Max): on v4.1 it adds the support of an extension board for 3 more rotary encoders
This commit is contained in:
bsongis
2012-04-11 18:38:59 +00:00
parent 9de279b819
commit ddcf6db9f7
9 changed files with 97 additions and 36 deletions
+9 -4
View File
@@ -571,7 +571,7 @@ inline void FRSKY10mspoll(void)
else {
*ptr++ = (g_eeGeneral.beeperMode != e_mode_quiet ? ((2+alarm+g_model.frsky.rssiAlarms[alarm].level) % 4) : alarm_off);
*ptr++ = 0x00 ;
frskyPushValue(ptr, 50+g_model.frsky.rssiAlarms[alarm].value);
frskyPushValue(ptr, getRssiAlarmValue(alarm));
*ptr++ = (RSSI1PKT-alarm); // f7 - f6
}
@@ -936,11 +936,11 @@ void displayRssiLine()
lcd_hline(0, 55, 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, (frskyRSSI[1].value < 50 + g_model.frsky.rssiAlarms[0].value) ? DOTTED : SOLID);
lcd_filled_rect(26, 58, 9*frskyRSSI[1].value/25, 5, (frskyRSSI[1].value < getRssiAlarmValue(1)) ? DOTTED : SOLID);
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, (frskyRSSI[0].value < 50 + g_model.frsky.rssiAlarms[0].value) ? DOTTED : SOLID);
lcd_filled_rect(66+36-v, 58, v, 5, (frskyRSSI[0].value < getRssiAlarmValue(0)) ? DOTTED : SOLID);
}
else {
lcd_putsAtt(7*FW, 7*FH+1, STR_NODATA, BLINK);
@@ -1001,6 +1001,11 @@ uint8_t getTelemCustomField(uint8_t line, uint8_t col)
return result;
}
NOINLINE uint8_t getRssiAlarmValue(uint8_t alarm)
{
return (50 + g_model.frsky.rssiAlarms[alarm].value);
}
void menuProcFrsky(uint8_t event)
{
switch (event) {
@@ -1099,7 +1104,7 @@ void menuProcFrsky(uint8_t event)
else if (source <= TELEM_A2)
threshold = g_model.frsky.channels[source-TELEM_A1].alarms_value[0];
else if (source <= TELEM_RSSI_RX)
threshold = 50 + g_model.frsky.rssiAlarms[0].value; /* TODO flash saving, it's called 3 times */
threshold = getRssiAlarmValue(source-TELEM_RSSI_TX);
else
threshold = convertTelemValue(source, barsThresholds[source-TELEM_ALT]);
int16_t barMin = convertTelemValue(source, bmin);