code sanitizations

This commit is contained in:
cyberman54 2022-08-16 13:27:48 +02:00
parent 4f46fb21fd
commit 27fd296753
6 changed files with 4 additions and 18 deletions

View File

@ -138,7 +138,6 @@ void dp_init(bool verbose) {
#endif #endif
#endif // HAS_LORA #endif // HAS_LORA
} // verbose } // verbose
dp_power(cfg.screenon); // set display off if disabled dp_power(cfg.screenon); // set display off if disabled
@ -182,7 +181,6 @@ void dp_refresh(bool nextPage) {
dp->setCursor(0, 0); dp->setCursor(0, 0);
switch (DisplayPage) { switch (DisplayPage) {
// page 0: pax + parameters overview // page 0: pax + parameters overview
// page 1: pax + lorawan parameters // page 1: pax + lorawan parameters
// page 2: pax + GPS lat/lon // page 2: pax + GPS lat/lon
@ -398,7 +396,6 @@ void dp_refresh(bool nextPage) {
DisplayPage++; DisplayPage++;
break; break;
#endif #endif
} // switch (page) } // switch (page)
} // dp_refresh } // dp_refresh

View File

@ -84,7 +84,6 @@ static const char TAG[] = __FILE__;
char clientId[20] = {0}; // unique ClientID char clientId[20] = {0}; // unique ClientID
void setup() { void setup() {
char features[100] = ""; char features[100] = "";
// disable brownout detection // disable brownout detection
@ -487,7 +486,6 @@ void setup() {
RTC_runmode = RUNMODE_NORMAL; RTC_runmode = RUNMODE_NORMAL;
vTaskDelete(NULL); vTaskDelete(NULL);
} // setup() } // setup()
void loop() { vTaskDelete(NULL); } void loop() { vTaskDelete(NULL); }

View File

@ -58,7 +58,6 @@ void PayloadConvert::addConfig(configData_t value) {
void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float cputemp, void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float cputemp,
uint32_t mem, uint8_t reset0, uint32_t mem, uint8_t reset0,
uint32_t restarts) { uint32_t restarts) {
buffer[cursor++] = highByte(voltage); buffer[cursor++] = highByte(voltage);
buffer[cursor++] = lowByte(voltage); buffer[cursor++] = lowByte(voltage);
buffer[cursor++] = (byte)((uptime & 0xFF00000000000000) >> 56); buffer[cursor++] = (byte)((uptime & 0xFF00000000000000) >> 56);

View File

@ -39,7 +39,6 @@ void do_reset(bool warmstart) {
} }
void do_after_reset(void) { void do_after_reset(void) {
struct timeval sleep_stop_time; struct timeval sleep_stop_time;
uint64_t sleep_time_ms; uint64_t sleep_time_ms;
@ -54,7 +53,6 @@ void do_after_reset(void) {
#endif #endif
switch (rtc_get_reset_reason(0)) { switch (rtc_get_reset_reason(0)) {
case POWERON_RESET: // 0x01 Vbat power on reset case POWERON_RESET: // 0x01 Vbat power on reset
case RTCWDT_BROWN_OUT_RESET: // 0x0f Reset when the vdd voltage is not case RTCWDT_BROWN_OUT_RESET: // 0x0f Reset when the vdd voltage is not
// stable // stable
@ -102,7 +100,6 @@ void do_after_reset(void) {
} }
void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) { void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) {
ESP_LOGI(TAG, "Preparing to sleep..."); ESP_LOGI(TAG, "Preparing to sleep...");
RTC_runmode = RUNMODE_SLEEP; RTC_runmode = RUNMODE_SLEEP;
@ -205,4 +202,6 @@ void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) {
esp_deep_sleep_start(); esp_deep_sleep_start();
} }
unsigned long long uptime() { return (RTC_millis + esp_timer_get_time() / 1000); } unsigned long long uptime() {
return (RTC_millis + esp_timer_get_time() / 1000);
}

View File

@ -67,7 +67,6 @@ int print_to_sd_card(const char *fmt, va_list args) {
#endif #endif
bool openFile(FILE **fd, const char *filename) { bool openFile(FILE **fd, const char *filename) {
char _filename[50]; char _filename[50];
sprintf(_filename, "%s%s", MOUNT_POINT, filename); sprintf(_filename, "%s%s", MOUNT_POINT, filename);
@ -81,7 +80,6 @@ bool openFile(FILE **fd, const char *filename) {
} // openfile } // openfile
bool sdcard_init(bool create) { bool sdcard_init(bool create) {
esp_err_t ret; esp_err_t ret;
// for usage of SD drivers on ESP32 platform see // for usage of SD drivers on ESP32 platform see
@ -171,7 +169,6 @@ bool sdcard_init(bool create) {
snprintf(bufferFilename, sizeof(bufferFilename), "/%s.csv", SDCARD_FILE_NAME); snprintf(bufferFilename, sizeof(bufferFilename), "/%s.csv", SDCARD_FILE_NAME);
if (openFile(&data_file, bufferFilename)) { if (openFile(&data_file, bufferFilename)) {
fpos_t position; fpos_t position;
fgetpos(data_file, &position); fgetpos(data_file, &position);
@ -207,7 +204,6 @@ bool sdcard_init(bool create) {
#endif #endif
return useSDCard; return useSDCard;
} // sdcard_init } // sdcard_init
void sdcard_flush(void) { void sdcard_flush(void) {
@ -236,7 +232,6 @@ void sdcard_close(void) {
void sdcardWriteData(uint16_t noWifi, uint16_t noBle, void sdcardWriteData(uint16_t noWifi, uint16_t noBle,
__attribute__((unused)) uint16_t voltage) { __attribute__((unused)) uint16_t voltage) {
if (!useSDCard) if (!useSDCard)
return; return;
@ -264,4 +259,4 @@ void sdcardWriteData(uint16_t noWifi, uint16_t noBle,
fprintf(data_file, "\n"); fprintf(data_file, "\n");
} }
#endif // (HAS_SDCARD) #endif // (HAS_SDCARD)

View File

@ -25,7 +25,6 @@ void initSendDataTimer(uint8_t sendcycle) {
// put data to send in RTos Queues used for transmit over channels Lora and SPI // put data to send in RTos Queues used for transmit over channels Lora and SPI
void SendPayload(uint8_t port) { void SendPayload(uint8_t port) {
ESP_LOGD(TAG, "sending Payload for Port %d", port); ESP_LOGD(TAG, "sending Payload for Port %d", port);
MessageBuffer_t SendBuffer; // contains MessageSize, MessagePort, Message[] MessageBuffer_t SendBuffer; // contains MessageSize, MessagePort, Message[]
@ -69,7 +68,6 @@ void SendPayload(uint8_t port) {
#ifdef HAS_MQTT #ifdef HAS_MQTT
mqtt_enqueuedata(&SendBuffer); mqtt_enqueuedata(&SendBuffer);
#endif #endif
} // SendPayload } // SendPayload
// timer triggered function to prepare payload to send // timer triggered function to prepare payload to send