imc_kernel.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef INC_IMC_IMC_KERNEL_H_
  2. #define INC_IMC_IMC_KERNEL_H_
  3. #ifndef imcUSE_IMC_KERNEL
  4. #define imcUSE_IMC_KERNEL 1
  5. #endif
  6. #ifndef imcUSE_CHECKPOINT_PASS_COUNTER
  7. #define imcUSE_CHECKPOINT_PASS_COUNTER 0
  8. #endif
  9. #ifndef imcUSE_CHECKPOINT_VOLTAGE_CHECK
  10. #define imcUSE_CHECKPOINT_VOLTAGE_CHECK 0
  11. #endif
  12. #ifndef imcCHECKPOINT_PASS_COUNT
  13. #define imcCHECKPOINT_PASS_COUNT 1000
  14. #endif
  15. #ifndef imcCHECKPOINT_VOLTAGE
  16. #define imcCHECKPOINT_VOLTAGE 4000 //in mV
  17. #endif
  18. #define imcSTM32_CUBE_IDE 0
  19. #define imcMAX_NUM_TASKS 2
  20. #define imcSTACK_SIZE (4096)
  21. #define IMC_GLOBAL __attribute__((section(".imc_global")))
  22. #define portSVC_IMC_REQUEST_CHECKPOINT 6
  23. #define imcREQUEST_CHECKPOINT() \
  24. { \
  25. __asm(" svc #6"); \
  26. }
  27. #include "cmsis_os.h"
  28. void imcInit();
  29. osThreadId_t imcOsThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr);
  30. int needCheckpointExecution();
  31. extern int checkpointCounter;
  32. extern const int checkpoint_pass_count;
  33. #ifndef imcUSE_IMC_EXTENSION
  34. #define imcUSE_IMC_EXTENSION 0
  35. #endif
  36. #endif