From f90199f0f6638fdf265c46859f3596144fddbc45 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 14 Apr 2025 22:54:25 +0100 Subject: [PATCH] refresh rate for the table and its cells --- lib/cursesAtHome/src/UITable.cpp | 3 ++- src/main.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/cursesAtHome/src/UITable.cpp b/lib/cursesAtHome/src/UITable.cpp index a9bd6f2..8c4ab22 100644 --- a/lib/cursesAtHome/src/UITable.cpp +++ b/lib/cursesAtHome/src/UITable.cpp @@ -47,7 +47,7 @@ uint16_t UITable::getContentAreaHeight() { this->getTitleAreaHeight(); } -/* +/* * This was hardcoded for the relative and had a warning for that but * I recon its dynamic enough for now */ @@ -59,6 +59,7 @@ void UITable::setup() { for (int r = 0; r < ROWS; r++) { int16_t xOffset = this->getContentAreaX0(); for (int c = 0; c < COLUMNS; c++) { + this->tableData[r * COLUMNS + c]->refreshRate = this->refreshRate; this->tableData[r * COLUMNS + c]->decor->textSize = this->decor->textSize; this->tableData[r * COLUMNS + c]->decor->hasBorder = false; this->tableData[r * COLUMNS + c]->dims.x = xOffset + CELL_MARGIN; diff --git a/src/main.cpp b/src/main.cpp index e8c624b..2ea2433 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,8 @@ to have more ways to run analytics #include #include #include +// #include +// #include #define UART1_TX 19 #define UART1_RX 18 @@ -81,9 +83,9 @@ void setup() { Serial2.begin(115200, SERIAL_8N1, UART1_RX, UART1_TX); Serial2.flush(); - Serial2.println(F("=== ESP32 SimRacing DashDisplay ===")); + Serial2.print(F("\r=== ESP32 SimRacing DashDisplay ===\r\n")); - Serial2.println(F("* Initiating display")); + Serial2.print(F("* Initiating display\r\n")); initialDisplaySetup(gfx); // Setup the relative @@ -98,6 +100,7 @@ void setup() { relativeDecor->textSize = 2; relative->dims.x = gfx->width() - relative->dims.width; relative->dims.y = gfx->height() - relative->dims.height; + relative->refreshRate = 750; relative->setup(); relative->drawBox(); ui->relative = relative; @@ -208,6 +211,12 @@ void setup() { // } // } + // nvs_handle_t handle; + // nvs_open("storage", NVS_READWRITE, &handle); + // nvs_set_i32(handle, "counter", 42); + // nvs_commit(handle); + // nvs_close(handle); + Serial2.println("* Ready for loop"); }