mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
fix a lot of nuisances reported by cppcheck (#4872)
* fix a lot of nuisances reported by cppcheck * fix portduino
This commit is contained in:
@@ -48,11 +48,10 @@ extern "C" void bootloader_util_app_start(uint32_t start_addr);
|
||||
|
||||
static uint16_t crc16(const uint8_t *data_p, uint8_t length)
|
||||
{
|
||||
uint8_t x;
|
||||
uint16_t crc = 0xFFFF;
|
||||
|
||||
while (length--) {
|
||||
x = crc >> 8 ^ *data_p++;
|
||||
uint8_t x = crc >> 8 ^ *data_p++;
|
||||
x ^= x >> 4;
|
||||
crc = (crc << 8) ^ ((uint16_t)(x << 12)) ^ ((uint16_t)(x << 5)) ^ ((uint16_t)x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user