This commit is contained in:
2025-12-12 08:35:20 +01:00
committed by example
parent 356d7de2cf
commit 0ce45a133b
23 changed files with 616 additions and 135 deletions

View File

@@ -5,4 +5,22 @@ int hex2bytes(const char *str, uint8_t *bytes, int32_t length);
void bytes2hex(const uint8_t *bytes, int32_t length, char *str, int32_t strLength);
int Rssi2Quality(sint8 rssi);
class Debounce
{
static constexpr uint8_t UPPER = 0b10000000;
static constexpr uint8_t LOWER = 0b01111111;
public:
Debounce();
Debounce(bool signal);
void init(bool signal);
/* Return value:
* 0: no change
* -1: LOW/False (falling edge)
* 1: HIGH/True (rising edge)
*/
int8_t debounce(bool signal);
private:
uint8_t state;
};
#endif