increase lora throughput and improve receiver display
This commit is contained in:
@@ -312,7 +312,15 @@ static void render_receiver_sender(uint8_t index) {
|
||||
display.setCursor(0, 0);
|
||||
uint8_t bat = status.has_data ? status.last_data.battery_percent : 0;
|
||||
if (status.has_data) {
|
||||
display.printf("%s B%u", status.last_data.device_id, bat);
|
||||
const char *device_id = status.last_data.device_id;
|
||||
if (strlen(device_id) >= 4 && strncmp(device_id, "dd3-", 4) == 0) {
|
||||
device_id += 4;
|
||||
}
|
||||
if (status.last_data.link_valid) {
|
||||
display.printf("%s R:%d S:%.1f", device_id, status.last_data.link_rssi_dbm, status.last_data.link_snr_db);
|
||||
} else {
|
||||
display.printf("%s B%u", device_id, bat);
|
||||
}
|
||||
} else {
|
||||
display.printf("%s B--", status.last_data.device_id);
|
||||
}
|
||||
@@ -342,11 +350,7 @@ static void render_receiver_sender(uint8_t index) {
|
||||
display.setCursor(0, 48);
|
||||
display.printf("L2 %.0fW", status.last_data.phase_power_w[1]);
|
||||
display.setCursor(0, 56);
|
||||
if (status.last_data.link_valid) {
|
||||
display.printf("R:%d S:%.1f", status.last_data.link_rssi_dbm, status.last_data.link_snr_db);
|
||||
} else {
|
||||
display.printf("L3 %.0fW", status.last_data.phase_power_w[2]);
|
||||
}
|
||||
display.printf("L3 %.0fW", status.last_data.phase_power_w[2]);
|
||||
display.display();
|
||||
}
|
||||
|
||||
@@ -368,7 +372,10 @@ void display_tick() {
|
||||
bool ctrl_high = digitalRead(PIN_OLED_CTRL) == HIGH;
|
||||
|
||||
bool in_boot_window = (millis() - g_boot_ms) < OLED_AUTO_OFF_MS;
|
||||
if (in_boot_window) {
|
||||
if (g_role == DeviceRole::Receiver) {
|
||||
g_oled_on = true;
|
||||
g_oled_off_start = 0;
|
||||
} else if (in_boot_window) {
|
||||
g_oled_on = true;
|
||||
} else {
|
||||
if (ctrl_high) {
|
||||
|
||||
Reference in New Issue
Block a user