mirror of https://github.com/ArduPilot/ardupilot
AP_Math: reduce variable scope in crc_crc8
This commit is contained in:
parent
90fc2be79d
commit
dd0283d537
|
@ -49,11 +49,10 @@ static const uint8_t crc8_table[] = {
|
|||
*/
|
||||
uint8_t crc_crc8(const uint8_t *p, uint8_t len)
|
||||
{
|
||||
uint16_t i;
|
||||
uint16_t crc = 0x0;
|
||||
|
||||
while (len--) {
|
||||
i = (crc ^ *p++) & 0xFF;
|
||||
const uint16_t i = (crc ^ *p++) & 0xFF;
|
||||
crc = (crc8_table[i] ^ (crc << 8)) & 0xFF;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue