mirror of
https://github.com/wled/WLED.git
synced 2025-07-23 10:46:33 +00:00
renamed functions, changed timeout to 24ms
This commit is contained in:
parent
e16d3bf040
commit
fd3b47908b
@ -230,8 +230,8 @@ void deletePreset(byte index);
|
|||||||
bool getPresetName(byte index, String& name);
|
bool getPresetName(byte index, String& name);
|
||||||
|
|
||||||
//remote.cpp
|
//remote.cpp
|
||||||
void handleRemote(uint8_t *data, size_t len);
|
void handleWiZdata(uint8_t *incomingData, size_t len);
|
||||||
void processESPNowButton();
|
void handleRemote();
|
||||||
|
|
||||||
//set.cpp
|
//set.cpp
|
||||||
bool isAsterisksOnly(const char* str, byte maxLen);
|
bool isAsterisksOnly(const char* str, byte maxLen);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "wled.h"
|
#include "wled.h"
|
||||||
#ifndef WLED_DISABLE_ESPNOW
|
#ifndef WLED_DISABLE_ESPNOW
|
||||||
|
|
||||||
#define ESPNOW_BUSWAIT_TIMEOUT 30 // timeout in ms to wait for bus to finish updating
|
#define ESPNOW_BUSWAIT_TIMEOUT 24 // one frame timeout to wait for bus to finish updating
|
||||||
|
|
||||||
#define NIGHT_MODE_DEACTIVATED -1
|
#define NIGHT_MODE_DEACTIVATED -1
|
||||||
#define NIGHT_MODE_BRIGHTNESS 5
|
#define NIGHT_MODE_BRIGHTNESS 5
|
||||||
@ -182,7 +182,7 @@ static bool remoteJson(int button)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Callback function that will be executed when data is received
|
// Callback function that will be executed when data is received
|
||||||
void handleRemote(uint8_t *incomingData, size_t len) {
|
void handleWiZdata(uint8_t *incomingData, size_t len) {
|
||||||
message_structure_t *incoming = reinterpret_cast<message_structure_t *>(incomingData);
|
message_structure_t *incoming = reinterpret_cast<message_structure_t *>(incomingData);
|
||||||
|
|
||||||
if (strcmp(last_signal_src, linked_remote) != 0) {
|
if (strcmp(last_signal_src, linked_remote) != 0) {
|
||||||
@ -212,7 +212,8 @@ void handleRemote(uint8_t *incomingData, size_t len) {
|
|||||||
last_seq = cur_seq;
|
last_seq = cur_seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
void processESPNowButton() {
|
// process ESPNow button data (acesses FS, should not be called while update to avoid glitches)
|
||||||
|
void handleRemote() {
|
||||||
if(ESPNowButton > 0) {
|
if(ESPNowButton > 0) {
|
||||||
if (!remoteJson(ESPNowButton))
|
if (!remoteJson(ESPNowButton))
|
||||||
switch (ESPNowButton) {
|
switch (ESPNowButton) {
|
||||||
@ -236,5 +237,5 @@ void processESPNowButton() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
void handleRemote(uint8_t *incomingData, size_t len) {}
|
void handleRemote() {}
|
||||||
#endif
|
#endif
|
||||||
|
@ -979,7 +979,7 @@ void espNowReceiveCB(uint8_t* address, uint8_t* data, uint8_t len, signed int rs
|
|||||||
|
|
||||||
// handle WiZ Mote data
|
// handle WiZ Mote data
|
||||||
if (data[0] == 0x91 || data[0] == 0x81 || data[0] == 0x80) {
|
if (data[0] == 0x91 || data[0] == 0x81 || data[0] == 0x80) {
|
||||||
handleRemote(data, len);
|
handleWiZdata(data, len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ void WLED::loop()
|
|||||||
handleIR();
|
handleIR();
|
||||||
#endif
|
#endif
|
||||||
#ifndef WLED_DISABLE_ESPNOW
|
#ifndef WLED_DISABLE_ESPNOW
|
||||||
processESPNowButton();
|
handleRemote();
|
||||||
#endif
|
#endif
|
||||||
#ifndef WLED_DISABLE_ALEXA
|
#ifndef WLED_DISABLE_ALEXA
|
||||||
handleAlexa();
|
handleAlexa();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user