Merge pull request #829 from marsman7/fix-compiling_error_with_hasp_use_custom_0

Fix compiling errors when HASP_USE_CUSTOM set to zero
This commit is contained in:
fvanroie 2024-12-04 13:25:40 +01:00 committed by GitHub
commit d8ee62ba7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,7 @@
#include "hasplib.h"
#if defined(HASP_USE_CUSTOM) && false // <-- set this to true in your code
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0 && false // <-- set this to true in your code
#include "hasp_debug.h"

View File

@ -6,7 +6,7 @@
#include "hasplib.h"
#if defined(HASP_USE_CUSTOM) && false // <-- set this to true in your code
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0 && false // <-- set this to true in your code
#include "hasp_debug.h"

View File

@ -9,7 +9,7 @@
#define HASP_CUSTOM_H
#include "hasplib.h"
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
/* This function is called at boot */
void custom_setup();

View File

@ -452,7 +452,7 @@ void dispatch_topic_payload(const char* topic, const char* payload, bool update,
}
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
if(topic == strstr_P(topic, PSTR(MQTT_TOPIC_CUSTOM "/"))) { // startsWith custom
topic += 7u;
custom_topic_payload(topic, (char*)payload, source);
@ -1295,7 +1295,7 @@ void dispatch_send_sensordata(const char*, const char*, uint8_t source)
haspDevice.get_sensors(doc);
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_get_sensors(doc);
#endif

View File

@ -32,7 +32,7 @@ void task_every_second_cb(lv_task_t* task)
telnetEverySecond();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_second();
#endif
// debugEverySecond();
@ -53,7 +53,7 @@ void task_every_second_cb(lv_task_t* task)
break;
case 3:
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_5seconds();
#endif
break;

View File

@ -70,6 +70,6 @@
#endif
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
#include "custom/my_custom.h"
#endif

View File

@ -136,7 +136,7 @@ void setup()
slaveSetup();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_setup();
#endif
@ -195,7 +195,7 @@ IRAM_ATTR void loop()
consoleLoop();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_loop();
#endif
@ -222,7 +222,7 @@ IRAM_ATTR void loop()
telnetEverySecond();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_second();
#endif
// debugEverySecond();
@ -243,7 +243,7 @@ IRAM_ATTR void loop()
// gpioEvery5Seconds();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_5seconds();
#endif
break;

View File

@ -371,7 +371,7 @@ void onMqttConnect(esp_mqtt_client_handle_t client)
// mqttSubscribeTo(mqttGroupTopic + subtopic);
// mqttSubscribeTo(mqttNodeTopic + subtopic);
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
String subtopic = F(MQTT_TOPIC_CUSTOM "/#");
mqttSubscribeTo(mqttGroupCommandTopic + subtopic);
mqttSubscribeTo(mqttNodeCommandTopic + subtopic);

View File

@ -328,7 +328,7 @@ static void onConnect(void* context, MQTTAsync_successData* response)
topic = mqttNodeTopic + "config/#";
mqtt_subscribe(mqtt_client, topic.c_str());
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
topic = mqttGroupTopic + MQTT_TOPIC_CUSTOM "/#";
mqtt_subscribe(mqtt_client, topic.c_str());

View File

@ -269,7 +269,7 @@ static void onConnect(void* context)
topic = mqttNodeTopic + "config/#";
mqtt_subscribe(mqtt_client, topic.c_str());
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
topic = mqttGroupTopic + MQTT_TOPIC_CUSTOM "/#";
mqtt_subscribe(mqtt_client, topic.c_str());

View File

@ -311,7 +311,7 @@ void mqttStart()
snprintf_P(topic, sizeof(topic), PSTR("%s" MQTT_TOPIC_CONFIG "/#"), mqttNodeTopic);
mqttSubscribeTo(topic);
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
snprintf_P(topic, sizeof(topic), PSTR("%s" MQTT_TOPIC_CUSTOM "/#"), mqttGroupTopic);
mqttSubscribeTo(topic);
snprintf_P(topic, sizeof(topic), PSTR("%s" MQTT_TOPIC_CUSTOM "/#"), mqttNodeTopic);

View File

@ -776,7 +776,7 @@ bool gpioIsSystemPin(uint8_t gpio)
return true;
}
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
if(custom_pin_in_use(gpio)) {
LOG_DEBUG(TAG_GPIO, F(D_BULLET D_GPIO_PIN " %d => Custom"), gpio);
return true;