imc_kernel.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 4100 //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 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. void vImcInvalidateRecovery();
  31. int needCheckpointExecution();
  32. extern int checkpointCounter;
  33. extern const int checkpoint_pass_count;
  34. #ifndef imcUSE_IMC_EXTENSION
  35. #define imcUSE_IMC_EXTENSION 0
  36. #endif
  37. #endif