Implement DELAY_NS with CYCCNT on Cortex-M7 (#12283)

This commit is contained in:
Nils Hasenbanck
2018-11-01 22:11:51 +01:00
committed by Scott Lahteine
parent f5498168ae
commit cafabf2055
4 changed files with 74 additions and 47 deletions

View File

@ -30,6 +30,7 @@
#include "HAL.h"
#include "../../inc/MarlinConfig.h"
#include "../shared/Delay.h"
#if ENABLED(EEPROM_EMULATED_WITH_SRAM)
#if STM32F7xx
@ -80,6 +81,11 @@ uint16_t HAL_adc_result;
// HAL initialization task
void HAL_init(void) {
// Needed for DELAY_NS() / DELAY_US() on CORTEX-M7
#if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7
enableCycleCounter();
#endif
FastIO_init();
#if ENABLED(SDSUPPORT)