Weather improvements (#1615)

* Added Acurite986 protocol
* Added signal age
* Added myself to about screen
This commit is contained in:
Totoo
2023-11-30 12:36:59 +01:00
committed by GitHub
parent 8846926b68
commit cca0e18f5a
7 changed files with 201 additions and 21 deletions

View File

@@ -183,6 +183,26 @@ class FProtoWeatherBase {
}
return reverse_key;
}
uint8_t subghz_protocol_blocks_crc8(
uint8_t const message[],
size_t size,
uint8_t polynomial,
uint8_t init) {
uint8_t remainder = init;
for (size_t byte = 0; byte < size; ++byte) {
remainder ^= message[byte];
for (uint8_t bit = 0; bit < 8; ++bit) {
if (remainder & 0x80) {
remainder = (remainder << 1) ^ polynomial;
} else {
remainder = (remainder << 1);
}
}
}
return remainder;
}
// General weather data holder
uint8_t sensorType = FPW_Invalid;
uint32_t id = WS_NO_ID;