imc_kernel.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 3620 //in mV
  17. #endif
  18. #define imcSTM32_CUBE_IDE 0
  19. #define imcMAX_NUM_TASKS 5
  20. #define imcSTACK_SIZE (4096)
  21. #define IMC_GLOBAL __attribute__((section(".imc_global")))
  22. #define portSVC_IMC_REQUEST_CHECKPOINT 6
  23. #define portSVC_IMC_CHECKPOINT_ALL_TASKS 7
  24. #define imcREQUEST_CHECKPOINT() \
  25. { \
  26. __asm(" svc #6"); \
  27. }
  28. #include "cmsis_os.h"
  29. void imcInit();
  30. osThreadId_t imcOsThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr);
  31. void vImcInvalidateRecovery();
  32. int needCheckpointExecution();
  33. extern int checkpointCounter;
  34. extern const int checkpoint_pass_count;
  35. #ifndef imcUSE_IMC_EXTENSION
  36. #define imcUSE_IMC_EXTENSION 0
  37. #endif
  38. #endif