#include "errors.h" #include "stm32f3xx_hal.h" SlaveErrorData error_data; void set_error_source(int source) { if (!error_data.error_sources) { error_data.errors_since = HAL_GetTick(); } error_data.error_sources |= source; } void clear_error_source(int source) { error_data.error_sources &= ~source; }