void SysTick_Handler(void) { // reload the hardware watchdog runFeedIWDG(); avgVolts = adcAvgVolts * ADC_TO_VOLTS; avgAmps = (adcAvgAmps - adcAmpsOffset) * adcToAmps; maxAmps = (adcMaxAmps - adcAmpsOffset) * adcToAmps; runWatchDog(); idlePercent = 100.0f * (idleCounter-oldIdleCounter) * minCycles / totalCycles; oldIdleCounter = idleCounter; totalCycles = 0; runRpm(); runThrotLim(fetDutyCycle); if (commandMode == CLI_MODE) cliCheck(); else binaryCheck(); runMilis++; }
void SysTick_Handler(void) { // reload the hardware watchdog runFeedIWDG(); //计算空闲时间百分比 通过串口发送给上位机 没什么用途 idlePercent = 100.0f * (idleCounter-oldIdleCounter) * minCycles / totalCycles; // 空闲时间百分比 = 100 * (本次循环次数 - 上次循环次数) * 最小周期 / 总共周期 oldIdleCounter = idleCounter; totalCycles = 0; simplebgc_process_inqueue();//parse input from uart2 and send to uart3 simplewofl_process_inqueue();//parse input from uart3 and send to uart2 canProcess(); cliCheck(); //ascii runMilis++; }