From ddfee50ab6c18b477096c9d628933bb2c623c531 Mon Sep 17 00:00:00 2001 From: rusefi Date: Wed, 26 Dec 2018 21:35:52 -0500 Subject: [PATCH] better location for CORE_CLOCK --- firmware/config/stm32f4ems/chconf.h | 3 +++ firmware/config/stm32f7ems/chconf.h | 3 +++ firmware/global.h | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/firmware/config/stm32f4ems/chconf.h b/firmware/config/stm32f4ems/chconf.h index 53fd89842e..0085bd20a0 100644 --- a/firmware/config/stm32f4ems/chconf.h +++ b/firmware/config/stm32f4ems/chconf.h @@ -28,6 +28,9 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ +// todo: access some existing configuration field +#define CORE_CLOCK 168000000 + #define _CHIBIOS_RT_CONF_ #define PORT_IDLE_THREAD_STACK_SIZE 1024 diff --git a/firmware/config/stm32f7ems/chconf.h b/firmware/config/stm32f7ems/chconf.h index a20066b2ad..5e80032bed 100644 --- a/firmware/config/stm32f7ems/chconf.h +++ b/firmware/config/stm32f7ems/chconf.h @@ -28,6 +28,9 @@ #ifndef CHCONF_H #define CHCONF_H +// todo: access some existing configuration field +#define CORE_CLOCK 168000000 + #define _CHIBIOS_RT_CONF_ #if !defined(EFI_CLOCK_LOCKS) || defined(__DOXYGEN__) diff --git a/firmware/global.h b/firmware/global.h index 993bbeacdc..9eaa3272e3 100644 --- a/firmware/global.h +++ b/firmware/global.h @@ -115,11 +115,9 @@ int getRemainingStack(thread_t *otp); } #endif /* __cplusplus */ -// todo: access some existing configuration field -#define CORE_CLOCK 168000000 // 168 ticks in microsecond -#define US_TO_NT_MULTIPLIER 168 +#define US_TO_NT_MULTIPLIER (CORE_CLOCK / 1000000) /** * converts efitimeus_t to efitick_t