Fix PC building with MQTT disabled

This commit is contained in:
Kuba Szczodrzyński 2024-02-06 19:52:57 +01:00
parent a2d97204f8
commit 9b3bbcc107
No known key found for this signature in database
GPG Key ID: 43037AC62A600562

View File

@ -152,7 +152,9 @@ void setup()
void loop() void loop()
{ {
haspLoop(); haspLoop();
#if HASP_USE_MQTT
mqttLoop(); mqttLoop();
#endif
// debugLoop(); // Console // debugLoop(); // Console
haspDevice.loop(); haspDevice.loop();
@ -190,7 +192,7 @@ void loop()
haspDevice.loop_5s(); haspDevice.loop_5s();
gpioEvery5Seconds(); gpioEvery5Seconds();
#if defined(HASP_USE_MQTT) #if HASP_USE_MQTT
mqttEvery5Seconds(true); mqttEvery5Seconds(true);
#endif #endif
@ -363,7 +365,9 @@ int main(int argc, char* argv[])
serializeJson(settings, buffer, sizeof(buffer)); serializeJson(settings, buffer, sizeof(buffer));
std::cout << buffer << std::endl << std::flush; std::cout << buffer << std::endl << std::flush;
fflush(stdout); fflush(stdout);
#if HASP_USE_MQTT
mqttSetConfig(settings["mqtt"]); mqttSetConfig(settings["mqtt"]);
#endif
// printf("%s %d\n", __FILE__, __LINE__); // printf("%s %d\n", __FILE__, __LINE__);
// fflush(stdout); // fflush(stdout);