Skip to content

Commit a351728

Browse files
basmeermanclaude
andcommitted
fix: forward-declare mqttSetSolarDebug before use in callback
The MQTT receive callback references mqttSetSolarDebug before its definition. Add static forward declaration to fix the firmware build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4aabc01 commit a351728

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

SmartEVSE-3/src/esp32.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ void writeMqttCaCert(const String& cert) {
618618
}
619619

620620
#if MQTT
621+
static void mqttSetSolarDebug(bool enabled); // forward declaration
622+
621623
void mqtt_receive_callback(const String topic, const String payload) {
622624
mqtt_command_t cmd;
623625
if (!mqtt_parse_command(MQTTprefix.c_str(), topic.c_str(), payload.c_str(), &cmd))
@@ -1304,7 +1306,7 @@ void mqttPublishSolarDebug(void) {
13041306
}
13051307
}
13061308

1307-
void mqttSetSolarDebug(bool enabled) {
1309+
static void mqttSetSolarDebug(bool enabled) {
13081310
SolarDebugEnabled = enabled;
13091311
if (!enabled) SolarDebugLastPublish = 0;
13101312
}

SmartEVSE-3/src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ extern void CheckRFID(void);
326326
extern void mqttPublishData();
327327
extern void mqttSmartEVSEPublishData();
328328
extern void mqttPublishSolarDebug(void);
329-
extern void mqttSetSolarDebug(bool enabled);
330329
extern bool MQTTclientSmartEVSE_AppConnected;
331330
extern void DisconnectEvent(void);
332331
extern char EVCCID[32];

0 commit comments

Comments
 (0)