monitoring.c 416 B

123456789101112131415161718
  1. #include "at32f403a_407.h"
  2. #include "monitoring.h"
  3. static uint16_t int_err[4]; // Внутренние ошибки модуля
  4. // state == true (есть ошибка, нужно установить бит)
  5. void mon_set_err(err_word_t word_index, err_code_t err_code, bool state)
  6. {
  7. if (state)
  8. int_err[word_index] |= 1 << err_code;
  9. else
  10. int_err[word_index] &= ~(1 << err_code);
  11. }