updated some comments after migrating stuff from other Project

This commit is contained in:
2024-05-30 23:48:26 +02:00
parent cf76ea7cc7
commit 5ee0a23a6d
9 changed files with 17 additions and 80 deletions

View File

@@ -1,42 +0,0 @@
#include "oled_display.h"
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);
void OLED_Init()
{
// reset OLED display via software
pinMode(OLED_RST, OUTPUT);
digitalWrite(OLED_RST, LOW);
delay(20);
digitalWrite(OLED_RST, HIGH);
// initialize OLED
Wire.begin(OLED_SDA, OLED_SCL);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false))
{ // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation failed"));
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
display.print("DISPLAY INIT");
display.display();
}
void OLED_Process()
{
display.clearDisplay();
display.setCursor(0, 0);
display.printf("LiPo: %d%%\n", globals.battery_level);
display.print(PersistenceData.activeFaction == FACTION_1 ? "> " : " ");
display.printf("%-5s: %02d:%02d:%02d\n", PersistenceData.faction_1_timer, PersistenceData.faction_1_timer / 3600, (PersistenceData.faction_1_timer / 60) % 60, PersistenceData.faction_1_timer % 60);
display.print(PersistenceData.activeFaction == FACTION_2 ? "> " : " ");
display.printf("%-5s: %02d:%02d:%02d\n", PersistenceData.faction_2_timer, PersistenceData.faction_2_timer / 3600, (PersistenceData.faction_2_timer / 60) % 60, PersistenceData.faction_2_timer % 60);
display.print(PersistenceData.activeFaction == FACTION_3 ? "> " : " ");
display.printf("%-5s: %02d:%02d:%02d\n", PersistenceData.faction_3_timer, PersistenceData.faction_3_timer / 3600, (PersistenceData.faction_3_timer / 60) % 60, PersistenceData.faction_3_timer % 60);
display.display();
}

View File

@@ -1,7 +1,7 @@
/**
* @file webui.cpp
*
* @brief Implementation file for web-based user interface (WebUI) functions in the ChainLube application.
* @brief Implementation file for web-based user interface (WebUI) functions in the DE-Timer application.
*
* This file contains the implementation of functions related to the initialization and processing of the
* web-based user interface (WebUI). It includes the setup of LittleFS, handling of firmware version checks,
@@ -37,7 +37,7 @@ void parseWebsocketString(char *data, char *identifierBuffer, size_t identifierB
int findIndexByString(const char *searchString, const char *const *array, int arraySize);
/**
* @brief Initializes the web-based user interface (WebUI) for the ChainLube application.
* @brief Initializes the web-based user interface (WebUI) for the DE-Timer application.
*
* This function sets up the necessary components for the WebUI, including mounting LittleFS,
* performing flash version checks, initializing mDNS, and configuring the web server with
@@ -93,7 +93,7 @@ void initWebUI()
}
/**
* @brief Processes the web server functionality for the ChainLube application.
* @brief Processes the web server functionality for the DE-Timer application.
*
* This function performs periodic processing tasks for the web server, including cleaning up
* WebSocket clients and refreshing client data when WebSocket connections are active. It ensures
@@ -117,7 +117,7 @@ void Webserver_Process()
}
/**
* @brief Shuts down the web server functionality for the ChainLube application.
* @brief Shuts down the web server functionality for the DE-Timer application.
*
* This function closes all WebSocket connections and terminates the web server. It is intended
* to be called when the application is being shut down or when there is a need to deactivate the