Skip to content

Commit

Permalink
renames and moves
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Dec 29, 2024
1 parent 5335789 commit 9c5b7d0
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 45 deletions.
30 changes: 15 additions & 15 deletions include/YaSolR.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ extern void yasolr_boot();
extern void yasolr_configure();
extern void yasolr_divert();

extern void yasolr_start_config();
extern void yasolr_start_display();
extern void yasolr_start_ds18();
extern void yasolr_start_grid();
extern void yasolr_start_jsy_remote_listener();
extern void yasolr_start_jsy();
extern void yasolr_start_lights();
extern void yasolr_start_logging();
extern void yasolr_start_mqtt();
extern void yasolr_start_network();
extern void yasolr_start_pzem();
extern void yasolr_start_system();
extern void yasolr_start_trial();
extern void yasolr_start_web_server();
extern void yasolr_start_zcd();
extern void yasolr_init_config();
extern void yasolr_init_display();
extern void yasolr_init_ds18();
extern void yasolr_init_grid();
extern void yasolr_init_jsy_remote_listener();
extern void yasolr_init_jsy();
extern void yasolr_init_lights();
extern void yasolr_init_logging();
extern void yasolr_init_mqtt();
extern void yasolr_init_network();
extern void yasolr_init_pzem();
extern void yasolr_init_system();
extern void yasolr_init_trial();
extern void yasolr_init_web_server();
extern void yasolr_init_zcd();

extern void yasolr_configure_logging();
28 changes: 14 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ Mycila::RouterOutput output2("output2", dimmerO2, bypassRelayO2);

void setup() {
yasolr_boot();
yasolr_start_config();
yasolr_init_config();

yasolr_configure();

yasolr_start_display();
yasolr_start_ds18();
yasolr_start_grid();
yasolr_start_jsy();
yasolr_start_lights();
yasolr_start_logging();
yasolr_start_mqtt();
yasolr_start_network();
yasolr_start_pzem();
yasolr_start_system();
yasolr_start_trial();
yasolr_start_web_server();
yasolr_start_zcd();
yasolr_init_display();
yasolr_init_ds18();
yasolr_init_grid();
yasolr_init_jsy();
yasolr_init_lights();
yasolr_init_logging();
yasolr_init_mqtt();
yasolr_init_network();
yasolr_init_pzem();
yasolr_init_system();
yasolr_init_trial();
yasolr_init_web_server();
yasolr_init_zcd();

yasolr_configure_logging();

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_config.cpp → src/yasolr_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Mycila::Config config;

void yasolr_start_config() {
void yasolr_init_config() {
// setup config system
config.begin("YASOLR");
config.configure(KEY_ADMIN_PASSWORD);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_display.cpp → src/yasolr_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum class DisplayKind {
DISPLAY_OUTPUT2,
};

void yasolr_start_display() {
void yasolr_init_display() {
if (config.getBool(KEY_ENABLE_DISPLAY)) {
assert(!display);
assert(!displayCarouselTask);
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_ds18.cpp → src/yasolr_ds18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Mycila::DS18* ds18O2;
Mycila::DS18* ds18Sys;
Mycila::Task* ds18Task;

void yasolr_start_ds18() {
void yasolr_init_ds18() {
uint8_t count = 0;

if (config.getBool(KEY_ENABLE_DS18_SYSTEM)) {
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_grid.cpp → src/yasolr_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ float yasolr_frequency() {
return 0;
}

void yasolr_start_grid() {
void yasolr_init_grid() {
grid.localMetrics().setExpiration(10000); // local is fast
grid.remoteMetrics().setExpiration(10000); // remote JSY is fast
grid.pzemMetrics().setExpiration(10000); // local is fast
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_jsy.cpp → src/yasolr_jsy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Mycila::JSY* jsy;
Mycila::Task* jsyTask;
Mycila::TaskManager* jsyTaskManager;

void yasolr_start_jsy() {
void yasolr_init_jsy() {
if (config.getBool(KEY_ENABLE_JSY)) {
assert(!jsy);
assert(!jsyTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void onData(AsyncUDPPacket packet) {
}
}

void yasolr_start_jsy_remote_listener() {
void yasolr_init_jsy_remote_listener() {
if (config.getBool(KEY_ENABLE_JSY_REMOTE)) {
logger.info(TAG, "Enable JSY Remote Listener");

Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_lights.cpp → src/yasolr_lights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Mycila::Task lightsTask("Lights", [](void* params) {
}
});

void yasolr_start_lights() {
void yasolr_init_lights() {
if (config.getBool(KEY_ENABLE_LIGHTS))
lights.begin(config.getLong(KEY_PIN_LIGHTS_GREEN), config.getLong(KEY_PIN_LIGHTS_YELLOW), config.getLong(KEY_PIN_LIGHTS_RED));

Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_logging.cpp → src/yasolr_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Mycila::Task loggingTask("Debug", [](void* params) {
pzemTaskManager->log();
});

void yasolr_start_logging() {
void yasolr_init_logging() {
#ifdef APP_MODEL_PRO
WebSerial.setID(Mycila::AppInfo.firmware.c_str());
WebSerial.setTitle((Mycila::AppInfo.name + " Web Console").c_str());
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_mqtt.cpp → src/yasolr_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void haDiscovery() {
haDiscovery.end();
}

void yasolr_start_mqtt() {
void yasolr_init_mqtt() {
if (config.getBool(KEY_ENABLE_MQTT)) {
assert(!mqtt);
assert(!mqttConnectTask);
Expand Down
4 changes: 2 additions & 2 deletions src/fn/yasolr_start_network.cpp → src/yasolr_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ Mycila::Task networkStartTask("Network Start", Mycila::TaskType::ONCE, [](void*
logger.info(TAG, "Enable mDNS");
MDNS.addService("http", "tcp", 80);

yasolr_start_jsy_remote_listener();
yasolr_init_jsy_remote_listener();

if (mqttConnectTask)
mqttConnectTask->resume();
}
});

void yasolr_start_network() {
void yasolr_init_network() {
// NTP
Mycila::NTP.setTimeZone(config.get(KEY_NTP_TIMEZONE));

Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_pzem.cpp → src/yasolr_pzem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Mycila::Task* pzemO2PairingTask;
Mycila::Task* pzemTask;
Mycila::TaskManager* pzemTaskManager;

void yasolr_start_pzem() {
void yasolr_init_pzem() {
uint8_t count = 0;

if (config.getBool(KEY_ENABLE_OUTPUT1_PZEM)) {
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_system.cpp → src/yasolr_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Mycila::Task safeBootTask("SafeBoot", Mycila::TaskType::ONCE, [](void* params) {
Mycila::System::restartFactory("safeboot");
});

void yasolr_start_system() {
void yasolr_init_system() {
resetTask.setManager(coreTaskManager);
restartTask.setManager(coreTaskManager);
safeBootTask.setManager(coreTaskManager);
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_trial.cpp → src/yasolr_trial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Mycila::Task* trialTask;
#endif

void yasolr_start_trial() {
void yasolr_init_trial() {
#ifdef APP_MODEL_TRIAL
Mycila::Trial.begin();
Mycila::Trial.validate();
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_website.cpp → src/yasolr_website.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void rest_api() {
});
}

void yasolr_start_web_server() {
void yasolr_init_web_server() {
logger.info(TAG, "Initializing Web Server");

// Middleware
Expand Down
2 changes: 1 addition & 1 deletion src/fn/yasolr_start_zcd.cpp → src/yasolr_zcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Mycila::PulseAnalyzer* pulseAnalyzer;
Mycila::Task* zcdTask;

void yasolr_start_zcd() {
void yasolr_init_zcd() {
if (config.getBool(KEY_ENABLE_ZCD)) {
assert(!pulseAnalyzer);
assert(!zcdTask);
Expand Down

0 comments on commit 9c5b7d0

Please sign in to comment.