Print start time on display. Search by meeting instead of session but get both session and meeting data
This commit is contained in:
1 parent
3ec87ada9c
commit
c0e71374eb
2 files changed
+192
-26
No files matched your search
+16
-9
@@ -17,13 +17,13 @@ extern "C" {
|
||||
}
|
||||
|
||||
static UBYTE displayBuffer[(EPD_4IN2_V2_WIDTH / 8) * EPD_4IN2_V2_HEIGHT];
|
||||
static constexpr UWORD COUNTER_WIDTH = 200;
|
||||
static constexpr UWORD COUNTER_HEIGHT = 24;
|
||||
static constexpr UWORD COUNTER_WIDTH = 400;
|
||||
static constexpr UWORD COUNTER_HEIGHT = 38;
|
||||
static constexpr UWORD COUNTER_Y = 20;
|
||||
static UBYTE counterBuffer[(COUNTER_WIDTH / 8) * COUNTER_HEIGHT];
|
||||
static int counter = 0;
|
||||
|
||||
race_info_t race_data;
|
||||
data_struct_t race_data;
|
||||
SemaphoreHandle_t dataMutex;
|
||||
|
||||
void wifi_connect() {
|
||||
@@ -81,7 +81,7 @@ bool readLocalTime(struct tm* result) {
|
||||
}
|
||||
|
||||
void display_loop(void *pvParameters) {
|
||||
static race_info_t local_data;
|
||||
static data_struct_t local_data;
|
||||
while (true) {
|
||||
static unsigned long lastRefresh = 0;
|
||||
static char counterStr[32];
|
||||
@@ -105,16 +105,24 @@ void display_loop(void *pvParameters) {
|
||||
}
|
||||
|
||||
|
||||
if (race_data.session_key == 0) {
|
||||
if (local_data.meeting_info.meeting_key == 0) {
|
||||
snprintf(counterStr, sizeof(counterStr), "Counter: %d", counter);
|
||||
Serial.print("");
|
||||
Serial.println(counterStr);
|
||||
} else {
|
||||
snprintf(counterStr, sizeof(counterStr), "%s", race_data.circuit_short_name);
|
||||
snprintf(counterStr, sizeof(counterStr), "%s", local_data.meeting_info.meeting_name);
|
||||
}
|
||||
|
||||
Paint_Clear(WHITE);
|
||||
Paint_DrawString_EN(10, 0, counterStr, &Font16, WHITE, BLACK);
|
||||
|
||||
if (local_data.session_info.date_start[0] != 0) {
|
||||
Serial.print("");
|
||||
Serial.printf("date start: %s\n", local_data.session_info.date_start);
|
||||
Paint_DrawString_EN(10, 22, local_data.session_info.date_start, &Font16, WHITE, BLACK);
|
||||
}
|
||||
|
||||
|
||||
Paint_DrawString_EN(10, 0, counterStr, &Font16, WHITE, BLACK);
|
||||
|
||||
EPD_4IN2_V2_PartialDisplay(
|
||||
counterBuffer,
|
||||
@@ -149,14 +157,13 @@ void setup() {
|
||||
Paint_SelectImage(displayBuffer);
|
||||
Paint_Clear(WHITE);
|
||||
Paint_DrawString_EN(10, 0, "F1 Display Booting...", &Font16, WHITE, BLACK);
|
||||
Paint_DrawString_EN(10, COUNTER_Y, "Counter: 0", &Font16, WHITE, BLACK);
|
||||
EPD_4IN2_V2_Display(displayBuffer);
|
||||
|
||||
DEV_Delay_ms(500);
|
||||
|
||||
wifi_connect();
|
||||
sync_time();
|
||||
printf("Begin display loop.\n");
|
||||
Serial.println("Begin display loop.\n");
|
||||
|
||||
Paint_NewImage(counterBuffer, COUNTER_WIDTH, COUNTER_HEIGHT, ROTATE_0, WHITE);
|
||||
Paint_SelectImage(counterBuffer);
|
||||
|
||||
Reference in new issue
Block a user