mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 17:55:28 +03:00
Fix loop var init (#4725)
This commit is contained in:
parent
5f95df5124
commit
1eb6656766
3 changed files with 6 additions and 6 deletions
|
@ -1123,7 +1123,7 @@ static void loadSlowState(blackboxSlowState_t *slow)
|
|||
#endif
|
||||
|
||||
#ifdef USE_TEMPERATURE_SENSOR
|
||||
for (uint8_t index; index < MAX_TEMP_SENSORS; ++index) {
|
||||
for (uint8_t index = 0; index < MAX_TEMP_SENSORS; ++index) {
|
||||
valid_temp = getSensorTemperature(index, slow->tempSensorTemperature + index);
|
||||
if (!valid_temp) slow->tempSensorTemperature[index] = TEMPERATURE_INVALID_VALUE;
|
||||
}
|
||||
|
|
|
@ -1207,7 +1207,7 @@ static void cliTempSensor(char *cmdline)
|
|||
sensorConfig->alarm_min = alarm_min;
|
||||
sensorConfig->alarm_max = alarm_max;
|
||||
sensorConfig->osdSymbol = osdSymbol;
|
||||
for (uint8_t index; index < TEMPERATURE_LABEL_LEN; ++index) {
|
||||
for (uint8_t index = 0; index < TEMPERATURE_LABEL_LEN; ++index) {
|
||||
sensorConfig->label[index] = toupper(label[index]);
|
||||
if (label[index] == '\0') break;
|
||||
}
|
||||
|
|
|
@ -1448,12 +1448,12 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
|||
for (uint8_t index = 0; index < MAX_TEMP_SENSORS; ++index) {
|
||||
const tempSensorConfig_t *sensorConfig = tempSensorConfig(index);
|
||||
sbufWriteU8(dst, sensorConfig->type);
|
||||
for (uint8_t addrIndex; addrIndex < 8; ++addrIndex)
|
||||
for (uint8_t addrIndex = 0; addrIndex < 8; ++addrIndex)
|
||||
sbufWriteU8(dst, ((uint8_t *)&sensorConfig->address)[addrIndex]);
|
||||
sbufWriteU16(dst, sensorConfig->alarm_min);
|
||||
sbufWriteU16(dst, sensorConfig->alarm_max);
|
||||
sbufWriteU8(dst, sensorConfig->osdSymbol);
|
||||
for (uint8_t labelIndex; labelIndex < 4; ++labelIndex)
|
||||
for (uint8_t labelIndex = 0; labelIndex < 4; ++labelIndex)
|
||||
sbufWriteU8(dst, sensorConfig->label[labelIndex]);
|
||||
}
|
||||
break;
|
||||
|
@ -2788,13 +2788,13 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
for (uint8_t index = 0; index < MAX_TEMP_SENSORS; ++index) {
|
||||
tempSensorConfig_t *sensorConfig = tempSensorConfigMutable(index);
|
||||
sensorConfig->type = sbufReadU8(src);
|
||||
for (uint8_t addrIndex; addrIndex < 8; ++addrIndex)
|
||||
for (uint8_t addrIndex = 0; addrIndex < 8; ++addrIndex)
|
||||
((uint8_t *)&sensorConfig->address)[addrIndex] = sbufReadU8(src);
|
||||
sensorConfig->alarm_min = sbufReadU16(src);
|
||||
sensorConfig->alarm_max = sbufReadU16(src);
|
||||
tmp_u8 = sbufReadU8(src);
|
||||
sensorConfig->osdSymbol = tmp_u8 > TEMP_SENSOR_SYM_COUNT ? 0 : tmp_u8;
|
||||
for (uint8_t labelIndex; labelIndex < 4; ++labelIndex)
|
||||
for (uint8_t labelIndex = 0; labelIndex < 4; ++labelIndex)
|
||||
sensorConfig->label[labelIndex] = toupper(sbufReadU8(src));
|
||||
}
|
||||
} else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue