mirror of
https://github.com/wled/WLED.git
synced 2025-04-25 23:37:18 +00:00
Bugfix.
- incorrect use of PSTR() on 8266
This commit is contained in:
parent
0a0a766c0d
commit
06caace827
@ -21,7 +21,7 @@ void shortPressAction(uint8_t b)
|
|||||||
// publish MQTT message
|
// publish MQTT message
|
||||||
if (WLED_MQTT_CONNECTED) {
|
if (WLED_MQTT_CONNECTED) {
|
||||||
char subuf[64];
|
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");
|
mqtt->publish(subuf, 0, false, "short");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ void handleSwitch(uint8_t b)
|
|||||||
if (buttonLongPressed[b] == buttonPressedBefore[b]) return;
|
if (buttonLongPressed[b] == buttonPressedBefore[b]) return;
|
||||||
|
|
||||||
if (millis() - buttonPressedTime[b] > WLED_DEBOUNCE_THRESHOLD) { //fire edge event only after 50ms without change (debounce)
|
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]);
|
if (macroButton[b]) applyPreset(macroButton[b]);
|
||||||
else { //turn on
|
else { //turn on
|
||||||
if (!bri) {toggleOnOff(); colorUpdated(NOTIFIER_CALL_MODE_BUTTON);}
|
if (!bri) {toggleOnOff(); colorUpdated(NOTIFIER_CALL_MODE_BUTTON);}
|
||||||
@ -75,7 +75,7 @@ void handleSwitch(uint8_t b)
|
|||||||
// publish MQTT message
|
// publish MQTT message
|
||||||
if (WLED_MQTT_CONNECTED) {
|
if (WLED_MQTT_CONNECTED) {
|
||||||
char subuf[64];
|
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");
|
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
|
// publish MQTT message
|
||||||
if (WLED_MQTT_CONNECTED) {
|
if (WLED_MQTT_CONNECTED) {
|
||||||
char subuf[64];
|
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");
|
mqtt->publish(subuf, 0, false, "long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ void handleButton()
|
|||||||
// publish MQTT message
|
// publish MQTT message
|
||||||
if (WLED_MQTT_CONNECTED) {
|
if (WLED_MQTT_CONNECTED) {
|
||||||
char subuf[64];
|
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");
|
mqtt->publish(subuf, 0, false, "double");
|
||||||
}
|
}
|
||||||
} else buttonWaitTime[b] = millis();
|
} else buttonWaitTime[b] = millis();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// 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
|
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||||
//#define WLED_USE_MY_CONFIG
|
//#define WLED_USE_MY_CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user