Clang format changes for more readability

This commit is contained in:
2026-03-03 14:11:55 -05:00
parent cdbabe0e58
commit cfe7332899
8 changed files with 554 additions and 117 deletions

View File

@@ -11,7 +11,8 @@
#include "appstate.hpp"
#include "types.hpp"
internal esp_err_t api_system_info_handler(httpd_req_t *req) {
internal esp_err_t api_system_info_handler(httpd_req_t *req)
{
httpd_resp_set_type(req, "application/json");
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
@@ -21,13 +22,20 @@ internal esp_err_t api_system_info_handler(httpd_req_t *req) {
esp_chip_info(&chip_info);
const char *model = "ESP32-S3";
if (chip_info.model == CHIP_ESP32) {
if (chip_info.model == CHIP_ESP32)
{
model = "ESP32";
} else if (chip_info.model == CHIP_ESP32S2) {
}
else if (chip_info.model == CHIP_ESP32S2)
{
model = "ESP32-S2";
} else if (chip_info.model == CHIP_ESP32S3) {
}
else if (chip_info.model == CHIP_ESP32S3)
{
model = "ESP32-S3";
} else if (chip_info.model == CHIP_ESP32C3) {
}
else if (chip_info.model == CHIP_ESP32C3)
{
model = "ESP32-C3";
}
@@ -43,9 +51,12 @@ internal esp_err_t api_system_info_handler(httpd_req_t *req) {
cJSON_AddStringToObject(root, "firmware", app_desc->version);
const char *conn_type = "offline";
if (g_Ethernet_Initialized) {
if (g_Ethernet_Initialized)
{
conn_type = "ethernet";
} else if (g_Wifi_Initialized) {
}
else if (g_Wifi_Initialized)
{
conn_type = "wifi";
}
cJSON_AddStringToObject(root, "connection", conn_type);

View File

@@ -7,7 +7,8 @@
internal void restart_timer_callback(void *arg) { esp_restart(); }
internal esp_err_t api_system_reboot_handler(httpd_req_t *req) {
internal esp_err_t api_system_reboot_handler(httpd_req_t *req)
{
httpd_resp_set_type(req, "application/json");
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");