avoiding magic constant

This commit is contained in:
rusefi 2018-12-24 00:15:00 -05:00
parent 7f5d352ecd
commit d56050dada
3 changed files with 2 additions and 4 deletions

View File

@ -10,8 +10,6 @@
#ifndef EFIFEATURES_H_ #ifndef EFIFEATURES_H_
#define EFIFEATURES_H_ #define EFIFEATURES_H_
#define EFI_CLOCK_LOCKS FALSE
#define EFI_GPIO_HARDWARE TRUE #define EFI_GPIO_HARDWARE TRUE
#define EFI_FSIO TRUE #define EFI_FSIO TRUE

View File

@ -269,7 +269,7 @@ static int rtcStartTime;
static void timeInfo(void) { static void timeInfo(void) {
scheduleMsg(logger, "chTimeNow as seconds = %d", getTimeNowSeconds()); scheduleMsg(logger, "chTimeNow as seconds = %d", getTimeNowSeconds());
scheduleMsg(logger, "hal seconds = %d", halTime.get() / 168000000LL); scheduleMsg(logger, "hal seconds = %d", halTime.get() / (long)CORE_CLOCK);
#if EFI_RTC || defined(__DOXYGEN__) #if EFI_RTC || defined(__DOXYGEN__)
int unix = rtcGetTimeUnixSec(&RTCD1) - rtcStartTime; int unix = rtcGetTimeUnixSec(&RTCD1) - rtcStartTime;

View File

@ -61,7 +61,7 @@ static void lcdSleep(int period) {
if (BUSY_WAIT_DELAY) { if (BUSY_WAIT_DELAY) {
// this mode is useful for displaying messages to report OS fatal issues // this mode is useful for displaying messages to report OS fatal issues
int ticks = 168000000 / 1000000 * period; int ticks = CORE_CLOCK / 1000000 * period;
int a = 0; int a = 0;
for (int i = 0; i < ticks; i++) for (int i = 0; i < ticks; i++)
a += i; a += i;