From 40a190e324ebeef766a17cd65d9188ac5c94ef2e Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 15 Oct 2020 00:02:48 +0200 Subject: [PATCH] some cleanup --- .../include/LedDisplayController.h | 14 +++++++------- .../src/LedDisplayController.cpp | 8 ++++---- .../src/OmobiLedDisplay.cpp | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h b/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h index 9d8bee0..d5a8064 100644 --- a/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h +++ b/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h @@ -5,8 +5,8 @@ #include #include #include -#include "esp_task_wdt.h" #include +#include "esp_task_wdt.h" class LedDisplayController { @@ -32,7 +32,7 @@ public: ScrollSpeedParameter, ScrollCountParameter, IndexParameter, - DisplayTextSetParameterCount + DisplayTextSetParameterCount /*!< Just for helping purposes */ }; enum GetSetTextSetParameterExitCode @@ -46,8 +46,8 @@ public: InternalError }; - static const uint16_t MaximumTextSets = 6; - static const uint16_t MaximumTextLength = 256; + static const uint16_t maximumTextSets = 6; + static const uint16_t maximumTextLength = 256; void loop(); @@ -84,19 +84,19 @@ private: // storage structs typedef struct text_set_t { - char text[MaximumTextLength]; + char text[maximumTextLength]; bool active; uint16_t runtime; char color[7]; text_align_t alignment; bool scroll; - int scrollSpeed; + int scrollSpeed; /*!< Between 0 and 10 */ uint16_t scrollCount; } text_set_t; typedef struct sets_t { - text_set_t sets[MaximumTextSets]; + text_set_t sets[maximumTextSets]; char valid[3]; } sets_t; diff --git a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp index 5190722..c9f6a6d 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp @@ -49,7 +49,7 @@ void LedDisplayController::loop() String LedDisplayController::getTextSetParameter(int index, DisplayTextSetParameter parameter) { - if (index < 0 || index > this->MaximumTextSets || parameter < 0 || parameter >= DisplayTextSetParameterCount) + if (index < 0 || index > this->maximumTextSets || parameter < 0 || parameter >= DisplayTextSetParameterCount) return ""; String value = ""; @@ -101,7 +101,7 @@ void LedDisplayController::disp_start_set() //Serial.printf("[%lu] Meet start set condition. Curr set is %d. \n", millis(), text_curr_nr); if (0 < text_set_starttime || text_sets.sets[text_curr_nr].text == '\0' || text_sets.sets[text_curr_nr].active == false) text_curr_nr++; - if (text_curr_nr == MaximumTextSets) + if (text_curr_nr == maximumTextSets) text_curr_nr = 0; text_pass = 0; if (text_sets.sets[text_curr_nr].text != '\0' && text_sets.sets[text_curr_nr].active == true) @@ -181,7 +181,7 @@ LedDisplayController::GetSetTextSetParameterExitCode LedDisplayController::getSe { if (parameter < 0 || parameter >= DisplayTextSetParameterCount) return InvalidParameterError; - else if (index < 0 || index >= this->MaximumTextSets) + else if (index < 0 || index >= this->maximumTextSets) return IndexOutOfRangeError; else if (value == nullptr) return ValueIsNullptrError; @@ -318,7 +318,7 @@ bool LedDisplayController::loadTextSets() strncpy(defaultTextSets.valid, "OK", sizeof(defaultTextSets.valid)); - for (int i = 0; i < this->MaximumTextSets; i++) + for (int i = 0; i < this->maximumTextSets; i++) { text_set_t defaultTextSet{ "", diff --git a/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp b/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp index dbfa1dc..d4aa2fa 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp @@ -45,7 +45,7 @@ void OmobiLedDisplay::onDataReceived(String dataString) case GetAllTextSetsCommand: { // cycle through all text sets - for (int textSetIndex = 0; textSetIndex < LedDisplayController::MaximumTextSets; textSetIndex++) + for (int textSetIndex = 0; textSetIndex < LedDisplayController::maximumTextSets; textSetIndex++) { if (this->ledDisplayController->getTextSetParameter(textSetIndex, LedDisplayController::TextParameter) == "") continue; @@ -75,8 +75,8 @@ void OmobiLedDisplay::onDataReceived(String dataString) } replyStatus = Success; - replyData["maximumTextSets"] = LedDisplayController::MaximumTextSets; - replyData["maximumTextLength"] = LedDisplayController::MaximumTextLength; + replyData["maximumTextSets"] = LedDisplayController::maximumTextSets; + replyData["maximumTextLength"] = LedDisplayController::maximumTextLength; break; }