kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
Display Battery Volts TTGO 2.1.6
rodzic
cd3b34c494
commit
684253ce0e
|
@ -1767,6 +1767,7 @@ void setup()
|
|||
axp.clearIRQ();
|
||||
}
|
||||
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)
|
||||
delay(500);
|
||||
}
|
||||
|
|
|
@ -1445,7 +1445,23 @@ void Display::drawGPS(DispEntry *de) {
|
|||
void Display::drawBatt(DispEntry *de) {
|
||||
float val;
|
||||
char buf[30];
|
||||
if(!axp192_found) return;
|
||||
// if(!axp192_found) 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 );
|
||||
switch(de->extra[0]) {
|
||||
|
@ -1487,6 +1503,7 @@ void Display::drawBatt(DispEntry *de) {
|
|||
xSemaphoreGive( axpSemaphore );
|
||||
rdis->setFont(de->fmt);
|
||||
drawString(de, buf);
|
||||
}
|
||||
}
|
||||
|
||||
void Display::drawText(DispEntry *de) {
|
||||
|
|
Ładowanie…
Reference in New Issue