[Taranis] Bug on voltage gauge when voltage < mininimum of the gauge

This commit is contained in:
bsongis@gmail.com
2013-03-28 09:18:58 +00:00
parent c0a509e3fa
commit b4e2086506
4 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -883,7 +883,7 @@ getvalue_t getValue(uint8_t i)
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_RSSI_TX) return frskyData.rssi[1].value;
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_RSSI_RX) return frskyData.rssi[0].value;
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_A2) return frskyData.analog[i+1-MIXSRC_FIRST_TELEM+1-TELEM_A1].value;
#if defined(PCBTARANIS)
#if defined(FRSKY_SPORT)
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_ALT) return frskyData.hub.baroAltitude;
#elif defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_ALT) return TELEMETRY_ALT_BP;
+1 -1
View File
@@ -453,7 +453,7 @@ uint16_t anaIn(uint8_t chan)
{
#if defined(PCBTARANIS)
if (chan == 8)
return 2400;
return 1000;
#elif defined(PCBGRUVIN9X)
if (chan == 7)
return 150;
+1 -2
View File
@@ -65,8 +65,7 @@ void rotencPoll()
asm(" rjmp 1f") ;
asm("1:") ;
// asm(" nop") ;
// asm(" nop") ;
uint8_t rotary ;
rotary = PINA ;
DDRA = 0xFF ; // Back to all outputs
+4 -4
View File
@@ -217,12 +217,12 @@ void displaySliders()
#define BAR_VOLUME_X BAR_X+147
#define BAR_TIME_X BAR_X+168
void displayTopBarGauge(xcoord_t x, uint8_t count, bool blinking=false)
void displayTopBarGauge(xcoord_t x, int count, bool blinking=false)
{
if (!blinking || BLINK_ON_PHASE)
lcd_filled_rect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
count = min((uint8_t)10, count);
for (uint8_t i=0; i<count; i+=2)
count = min(10, count);
for (int i=0; i<count; i+=2)
lcd_vline(x+2+i, BAR_Y+3, 3);
}
@@ -302,7 +302,7 @@ void displayTopBar()
lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND);
/* The inside of the Batt gauge */
uint8_t count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin);
int count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin);
displayTopBarGauge(BAR_BATT_X+FW, count, g_vbat100mV <= g_eeGeneral.vBatWarn);
/* The inside of the RSSI gauge */