mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-19 17:26:38 +00:00
Fix compiling errors when HASP_USE_CUSTOM set to zero
This commit is contained in:
parent
9a3e9c03b8
commit
932805d3bd
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user