|
|
@ -40,7 +40,7 @@ void DisplayClass::Run() { |
|
|
|
int8_t last_packet_snr; |
|
|
|
int8_t last_packet_snr; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
TickType_t last_packet_tick; |
|
|
|
TickType_t last_packet_tick; |
|
|
|
messages::UGV_State state; |
|
|
|
messages::UGV_Status status; |
|
|
|
|
|
|
|
|
|
|
|
ESP_LOGD(TAG, "Started display thread"); |
|
|
|
ESP_LOGD(TAG, "Started display thread"); |
|
|
|
while (true) { |
|
|
|
while (true) { |
|
|
@ -52,7 +52,7 @@ void DisplayClass::Run() { |
|
|
|
|
|
|
|
|
|
|
|
comms_->Lock(); |
|
|
|
comms_->Lock(); |
|
|
|
last_packet_tick = comms_->last_packet_tick; |
|
|
|
last_packet_tick = comms_->last_packet_tick; |
|
|
|
state = comms_->status.state(); |
|
|
|
status.CopyFrom(comms_->status); |
|
|
|
#ifdef COMMS_SX127X |
|
|
|
#ifdef COMMS_SX127X |
|
|
|
last_packet_rssi = comms_->last_packet_rssi; |
|
|
|
last_packet_rssi = comms_->last_packet_rssi; |
|
|
|
last_packet_snr = comms_->last_packet_snr; |
|
|
|
last_packet_snr = comms_->last_packet_snr; |
|
|
@ -71,7 +71,7 @@ void DisplayClass::Run() { |
|
|
|
heap_info.total_free_bytes); |
|
|
|
heap_info.total_free_bytes); |
|
|
|
|
|
|
|
|
|
|
|
oled->setCursor(4, 3 * 8); |
|
|
|
oled->setCursor(4, 3 * 8); |
|
|
|
oled->printf("state: %d", (int)state); |
|
|
|
oled->printf("state: %d", status.state()); |
|
|
|
|
|
|
|
|
|
|
|
if (last_packet_tick > 0) { |
|
|
|
if (last_packet_tick > 0) { |
|
|
|
double time_since_last_packet = |
|
|
|
double time_since_last_packet = |
|
|
@ -89,6 +89,8 @@ void DisplayClass::Run() { |
|
|
|
oled->setCursor(4, 4 * 8); |
|
|
|
oled->setCursor(4, 4 * 8); |
|
|
|
oled->print("no pkt rx"); |
|
|
|
oled->print("no pkt rx"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
oled->setCursor(4, 5 * 8); |
|
|
|
|
|
|
|
oled->printf("yaw angle: %f", status.yaw_angle()); |
|
|
|
} while (oled->nextPage()); |
|
|
|
} while (oled->nextPage()); |
|
|
|
vTaskDelay(pdMS_TO_TICKS(1000)); |
|
|
|
vTaskDelay(pdMS_TO_TICKS(1000)); |
|
|
|
} |
|
|
|
} |
|
|
|