Skip to content

Commit

Permalink
📦 Moves utilities to own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
runeharlyk committed Nov 14, 2024
1 parent 0d596d9 commit f2d8611
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 95 deletions.
4 changes: 2 additions & 2 deletions esp32/lib/ESP32-sveltekit/BatteryService.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
**/

#include <event_socket.h>
#include <JsonUtils.h>
#include <utils/json_utils.h>
#include <Peripherals.h>
#include <timing.h>
#include <utils/timing.h>

#define ADC_VOLTAGE 0
#define ADC_CURRENT 1
Expand Down
2 changes: 1 addition & 1 deletion esp32/lib/ESP32-sveltekit/MotionService.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <event_socket.h>
#include <Kinematics.h>
#include <ServoController.h>
#include <timing.h>
#include <utils/timing.h>
#include <MathUtils.h>

#include <gait/state.h>
Expand Down
2 changes: 1 addition & 1 deletion esp32/lib/ESP32-sveltekit/Peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <stateful_persistence.h>
#include <stateful_service.h>
#include <MathUtils.h>
#include <timing.h>
#include <utils/timing.h>
#include <filesystem.h>
#include <features.h>
#include <settings/peripherals_settings.h>
Expand Down
58 changes: 0 additions & 58 deletions esp32/lib/ESP32-sveltekit/SettingValue.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions esp32/lib/ESP32-sveltekit/SettingValue.h

This file was deleted.

2 changes: 1 addition & 1 deletion esp32/lib/ESP32-sveltekit/ap_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <stateful_service_endpoint.h>
#include <stateful_persistence.h>
#include <settings/ap_settings.h>
#include <timing.h>
#include <utils/timing.h>
#include <WiFi.h>

class APService : public StatefulService<APSettings> {
Expand Down
6 changes: 3 additions & 3 deletions esp32/lib/ESP32-sveltekit/settings/ap_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <WiFi.h>
#include <IPAddress.h>
#include <ArduinoJson.h>
#include <JsonUtils.h>
#include <string_utilities.h>
#include <IPUtils.h>
#include <utils/json_utils.h>
#include <utils/string_utils.h>
#include <utils/ip_utils.h>
#include <state_result.h>

#include <DNSServer.h>
Expand Down
6 changes: 3 additions & 3 deletions esp32/lib/ESP32-sveltekit/settings/wifi_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <WiFi.h>
#include <IPAddress.h>
#include <ArduinoJson.h>
#include <JsonUtils.h>
#include <IPUtils.h>
#include <string_utilities.h>
#include <utils/json_utils.h>
#include <utils/ip_utils.h>
#include <utils/string_utils.h>
#include <state_result.h>

#ifndef FACTORY_WIFI_SSID
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define JsonUtils_h

#include <Arduino.h>
#include <IPUtils.h>
#include <utils/ip_utils.h>
#include <ArduinoJson.h>

class JsonUtils {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@
} \
}

#define CALLS_PER_SECOND(name) \
static unsigned long name##_count = 0; \
static unsigned long last_time = 0; \
name##_count++; \
if (millis() - last_time >= 1000) { \
Serial.printf("%s: %lu calls per second\n", #name, name##_count); \
name##_count = 0; \
last_time = millis(); \
}

#endif
2 changes: 1 addition & 1 deletion esp32/lib/ESP32-sveltekit/wifi_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <ESPmDNS.h>

#include <filesystem.h>
#include <timing.h>
#include <utils/timing.h>
#include <stateful_service.h>
#include <stateful_persistence.h>
#include <stateful_service_endpoint.h>
Expand Down

0 comments on commit f2d8611

Please sign in to comment.