| 1234567891011121314151617181920 |
- #include "ImC/imc_kernel.h"
- #include "stm32l5xx.h"
- int checkpointCounter = 0;
- const int checkpoint_pass_count = imcCHECKPOINT_PASS_COUNT;
- void imcInit()
- {
- FPU->FPCCR &= ~(FPU_FPCCR_LSPEN_Msk); // turn off lazy stacking
- }
- int needCheckpointExecution() {
- if (checkpointCounter == checkpoint_pass_count) {
- checkpointCounter = 0;
- return 1;
- } else {
- checkpointCounter++;
- return 0;
- }
- }
|