Safety: Fix different spelling mistakes for persistence

This commit is contained in:
Mario Hüttel 2021-03-18 22:50:13 +01:00
parent b560a91673
commit dca696cd6a
3 changed files with 13 additions and 13 deletions

View File

@ -144,8 +144,8 @@ struct config_override {
} weight_override;
struct {
uint8_t flag;
bool persistance;
} persistance_override;
bool persistence;
} persistence_override;
} entry;
};

View File

@ -345,7 +345,7 @@ static int flag_weight_table_crc_check(void)
* @brief Check the CRC chacksum of the flag persistence table
* @return 0 if CRC is valid, else -1.
*/
static int flag_persistency_table_crc_check(void)
static int flag_persistence_table_crc_check(void)
{
crc_unit_reset();
crc_unit_input_array((uint32_t*)flag_persistencies, wordsize_of(flag_persistencies));
@ -463,10 +463,10 @@ static void apply_config_overrides(void)
}
break;
case SAFETY_MEMORY_CONFIG_OVERRIDE_PERSISTENCE:
flag_enum = flag_no_to_flag_enum(override.entry.persistance_override.flag);
flag_enum = flag_no_to_flag_enum(override.entry.persistence_override.flag);
flag = find_error_flag(flag_enum);
if (flag && flag->persistence) {
flag->persistence->persistence = override.entry.persistance_override.persistance;
flag->persistence->persistence = override.entry.persistence_override.persistence;
}
break;
default:
@ -898,7 +898,7 @@ static void safety_controller_handle_safety_adc()
* flag is set.
* 2) The flag weight table is CRC checked. In case of an error, the @ref ERR_FLAG_SAFETY_TAB_CORRUPT flag is set.
* Aditionally, the default flag weights are restored from Flash.
* 3) The flag persistency table is CRC checked. In case of an error, the @ref ERR_FLAG_SAFETY_TAB_CORRUPT flag is set.
* 3) The flag persistence table is CRC checked. In case of an error, the @ref ERR_FLAG_SAFETY_TAB_CORRUPT flag is set.
* Aditionally, the default values of the flag persistence is restored from Flash.
* 4) Check the Overtemperature flag configuration structure
*/
@ -924,8 +924,8 @@ static void safety_controller_handle_memory_checks(void)
init_safety_flag_weight_table_from_default();
}
/* If persistency table is broken, reinit to default and set flag */
if(flag_persistency_table_crc_check()) {
/* If persistence table is broken, reinit to default and set flag */
if(flag_persistence_table_crc_check()) {
safety_controller_report_error(ERR_FLAG_SAFETY_TAB_CORRUPT);
init_safety_flag_persistencies_from_default();
}

View File

@ -488,8 +488,8 @@ static uint32_t convert_config_override_to_word(const struct config_override *co
data |= ((uint32_t)conf_override->entry.weight_override.weight) << 8;
} else if (conf_override->type == SAFETY_MEMORY_CONFIG_OVERRIDE_PERSISTENCE) {
data |= 0xBB00008EUL;
data |= ((uint32_t)conf_override->entry.persistance_override.flag) << 16;
data |= ((uint32_t)(conf_override->entry.persistance_override.persistance ? 1UL : 0UL)) << 8;
data |= ((uint32_t)conf_override->entry.persistence_override.flag) << 16;
data |= ((uint32_t)(conf_override->entry.persistence_override.persistence ? 1UL : 0UL)) << 8;
}
return data;
@ -596,10 +596,10 @@ int safety_memory_get_config_override(uint32_t idx, struct config_override *conf
config_override->entry.weight_override.weight = (data & 0xFF00UL) >> 8;
break;
case 0x8E:
/* persistance override */
/* persistence override */
config_override->type = SAFETY_MEMORY_CONFIG_OVERRIDE_PERSISTENCE;
config_override->entry.persistance_override.flag = (data & 0xFF0000UL) >> 16;
config_override->entry.persistance_override.persistance = ((data & 0xFF00UL) >> 8) ? true : false;
config_override->entry.persistence_override.flag = (data & 0xFF0000UL) >> 16;
config_override->entry.persistence_override.persistence = ((data & 0xFF00UL) >> 8) ? true : false;
break;
default:
return -2;