mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-15 11:05:08 +00:00
16 lines
532 B
C++
16 lines
532 B
C++
#include "ESPEasy_common.h"
|
|
|
|
|
|
String getUnknownString() { return F("Unknown"); }
|
|
|
|
/*********************************************************************************************\
|
|
Bitwise operators
|
|
\*********************************************************************************************/
|
|
bool getBitFromUL(uint32_t number, byte bitnr) {
|
|
return (number >> bitnr) & 1UL;
|
|
}
|
|
|
|
void setBitToUL(uint32_t& number, byte bitnr, bool value) {
|
|
uint32_t newbit = value ? 1UL : 0UL;
|
|
number ^= (-newbit ^ number) & (1UL << bitnr);
|
|
} |