- incorrect use of PSTR() on 8266
This commit is contained in:
Blaž Kristan 2021-06-02 08:24:49 +02:00
parent 0a0a766c0d
commit 06caace827
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@ void shortPressAction(uint8_t b)
// publish MQTT message
if (WLED_MQTT_CONNECTED) {
char subuf[64];
sprintf_P(subuf, PSTR(_mqtt_topic_button), mqttDeviceTopic, (int)b);
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
mqtt->publish(subuf, 0, false, "short");
}
}
@ -60,7 +60,7 @@ void handleSwitch(uint8_t b)
if (buttonLongPressed[b] == buttonPressedBefore[b]) return;
if (millis() - buttonPressedTime[b] > WLED_DEBOUNCE_THRESHOLD) { //fire edge event only after 50ms without change (debounce)
if (buttonPressedBefore[b]) { //LOW, falling edge, switch closed
if (buttonPressedBefore[b] ^ (buttonType[b]==BTN_TYPE_SWITCH_ACT_HIGH)) { //LOW, falling edge, switch closed
if (macroButton[b]) applyPreset(macroButton[b]);
else { //turn on
if (!bri) {toggleOnOff(); colorUpdated(NOTIFIER_CALL_MODE_BUTTON);}
@ -75,7 +75,7 @@ void handleSwitch(uint8_t b)
// publish MQTT message
if (WLED_MQTT_CONNECTED) {
char subuf[64];
sprintf_P(subuf, PSTR(_mqtt_topic_button), mqttDeviceTopic, (int)b);
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
mqtt->publish(subuf, 0, false, (buttonPressedBefore[b] ^ (buttonType[b]==BTN_TYPE_SWITCH_ACT_HIGH)) ? "on" : "off");
}
@ -198,7 +198,7 @@ void handleButton()
// publish MQTT message
if (WLED_MQTT_CONNECTED) {
char subuf[64];
sprintf_P(subuf, PSTR(_mqtt_topic_button), mqttDeviceTopic, (int)b);
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
mqtt->publish(subuf, 0, false, "long");
}
@ -226,7 +226,7 @@ void handleButton()
// publish MQTT message
if (WLED_MQTT_CONNECTED) {
char subuf[64];
sprintf_P(subuf, PSTR(_mqtt_topic_button), mqttDeviceTopic, (int)b);
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
mqtt->publish(subuf, 0, false, "double");
}
} else buttonWaitTime[b] = millis();

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2106021
#define VERSION 2106022
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG