kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
Merge branch 'displayvolts' of https://github.com/eben80/rdz_ttgo_sonde into eben80-displayvolts
commit
b783806593
|
@ -1929,6 +1929,7 @@ void setup()
|
||||||
axp.clearIRQ();
|
axp.clearIRQ();
|
||||||
}
|
}
|
||||||
int ndevices = scanI2Cdevice();
|
int ndevices = scanI2Cdevice();
|
||||||
|
if (sonde.fingerprint == 31) { pinMode(35, INPUT); }
|
||||||
if (sonde.fingerprint != 17 || ndevices > 0) break; // only retry for fingerprint 17 (startup problems of new t-beam with oled)
|
if (sonde.fingerprint != 17 || ndevices > 0) break; // only retry for fingerprint 17 (startup problems of new t-beam with oled)
|
||||||
delay(500);
|
delay(500);
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ timeaction=#,#,#
|
||||||
7,0=gV
|
7,0=gV
|
||||||
7,2=xd=
|
7,2=xd=
|
||||||
7,4=gD
|
7,4=gD
|
||||||
7,12=gI°
|
7,12=gI°
|
||||||
|
|
||||||
############
|
############
|
||||||
@BatteryOLED
|
@BatteryOLED
|
||||||
|
@ -211,16 +211,17 @@ timer=-1,-1,-1
|
||||||
key1action=+,0,F,W
|
key1action=+,0,F,W
|
||||||
key2action=>,#,#,#
|
key2action=>,#,#,#
|
||||||
timeaction=#,#,#
|
timeaction=#,#,#
|
||||||
fonts=0,1
|
fonts=1,1
|
||||||
0,0=xBat.Status:
|
0,0=xBattery Status
|
||||||
0,12=bS
|
0,16=bS
|
||||||
1,0=xBatt:
|
2,0=xVoltage:
|
||||||
1,6=bVV
|
fonts=7,7
|
||||||
2,0=bCmA (charge)
|
6,10=bVV
|
||||||
3,0=bDmA (disch.)
|
#2,0=bCmA (charge)
|
||||||
4,0=xUSB:
|
#3,0=bDmA (disch.)
|
||||||
4,5=bUV
|
#4,0=xUSB:
|
||||||
5,5=bImA
|
#4,5=bUV
|
||||||
6,0=xTemp:
|
#5,5=bImA
|
||||||
6,5=bT C
|
#6,0=xTemp:
|
||||||
|
#6,5=bT C
|
||||||
|
|
||||||
|
|
|
@ -1560,7 +1560,23 @@ void Display::drawGPS(DispEntry *de) {
|
||||||
void Display::drawBatt(DispEntry *de) {
|
void Display::drawBatt(DispEntry *de) {
|
||||||
float val;
|
float val;
|
||||||
char buf[30];
|
char buf[30];
|
||||||
if(!axp192_found) return;
|
if(!axp192_found && sonde.fingerprint != 31) return;
|
||||||
|
if (!axp192_found && sonde.fingerprint == 31)
|
||||||
|
{
|
||||||
|
xSemaphoreTake(axpSemaphore, portMAX_DELAY);
|
||||||
|
switch (de->extra[0])
|
||||||
|
{
|
||||||
|
case 'V':
|
||||||
|
val = (float)(analogRead(35)) / 4095 * 2 * 3.3 * 1.1;
|
||||||
|
snprintf(buf, 30, "%.2f%s", val, de->extra + 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*buf = 0;
|
||||||
|
}
|
||||||
|
xSemaphoreGive(axpSemaphore);
|
||||||
|
rdis->setFont(de->fmt);
|
||||||
|
drawString(de, buf);
|
||||||
|
} else {
|
||||||
|
|
||||||
xSemaphoreTake( axpSemaphore, portMAX_DELAY );
|
xSemaphoreTake( axpSemaphore, portMAX_DELAY );
|
||||||
switch(de->extra[0]) {
|
switch(de->extra[0]) {
|
||||||
|
@ -1602,6 +1618,7 @@ void Display::drawBatt(DispEntry *de) {
|
||||||
xSemaphoreGive( axpSemaphore );
|
xSemaphoreGive( axpSemaphore );
|
||||||
rdis->setFont(de->fmt);
|
rdis->setFont(de->fmt);
|
||||||
drawString(de, buf);
|
drawString(de, buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Display::drawText(DispEntry *de) {
|
void Display::drawText(DispEntry *de) {
|
||||||
|
|
Ładowanie…
Reference in New Issue