Store error flags in error memory if they cause a panic event.
This commit is contained in:
		| @@ -43,7 +43,7 @@ | ||||
| #include <stm-periph/rcc-manager.h> | ||||
|  | ||||
| #define check_flag_persistent(flag) ((flag)->persistency && (flag)->persistency->persistency) | ||||
| #define get_flag_weight(flag) ((flag)->weight ? (flag->weight->weight) : SAFETY_FLAG_CONFIG_WEIGHT_NONE) | ||||
| #define get_flag_weight(flag) ((flag)->weight ? ((flag)->weight->weight) : SAFETY_FLAG_CONFIG_WEIGHT_NONE) | ||||
|  | ||||
| struct safety_weight { | ||||
| 		uint32_t start_dummy; | ||||
| @@ -388,7 +388,8 @@ static int report_error(enum safety_flag flag, uint32_t key, bool prevent_error_ | ||||
| 			flags[i].error_state_inv = !flags[i].error_state; | ||||
| 			flags[i].key = key; | ||||
|  | ||||
| 			if (check_flag_persistent(&flags[i]) && !old_state && !prevent_error_mem_enty) { | ||||
| 			if ((check_flag_persistent(&flags[i]) && !old_state && !prevent_error_mem_enty) ||  | ||||
| 				get_flag_weight(&flags[i]) == SAFETY_FLAG_CONFIG_WEIGHT_PANIC) { | ||||
| 				err_mem_entry.counter = 1; | ||||
| 				err_mem_entry.flag_num = flag_enum_to_flag_no(flags[i].flag); | ||||
| 				err_mem_entry.type = SAFETY_MEMORY_ERR_ENTRY_FLAG; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user