mirror of https://github.com/FOME-Tech/fome-fw.git
reducing code duplication with prod code & fixing simulator
This commit is contained in:
parent
7e16cbd144
commit
8155cf6234
|
@ -265,12 +265,15 @@ efitick_t getTimeNowNt(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
|
#if ! EFI_UNIT_TEST
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* number of SysClock ticks in one ms
|
* number of SysClock ticks in one ms
|
||||||
*/
|
*/
|
||||||
#define TICKS_IN_MS (CH_CFG_ST_FREQUENCY / 1000)
|
#define TICKS_IN_MS (CH_CFG_ST_FREQUENCY / 1000)
|
||||||
|
|
||||||
|
|
||||||
// todo: this overflows pretty fast!
|
// todo: this overflows pretty fast!
|
||||||
efitimems_t currentTimeMillis(void) {
|
efitimems_t currentTimeMillis(void) {
|
||||||
// todo: migrate to getTimeNowUs? or not?
|
// todo: migrate to getTimeNowUs? or not?
|
||||||
|
@ -281,8 +284,7 @@ efitimems_t currentTimeMillis(void) {
|
||||||
efitimesec_t getTimeNowSeconds(void) {
|
efitimesec_t getTimeNowSeconds(void) {
|
||||||
return currentTimeMillis() / 1000;
|
return currentTimeMillis() / 1000;
|
||||||
}
|
}
|
||||||
|
#endif /* EFI_UNIT_TEST */
|
||||||
#endif /* EFI_PROD_CODE */
|
|
||||||
|
|
||||||
static void resetAccel(void) {
|
static void resetAccel(void) {
|
||||||
engine->engineLoadAccelEnrichment.resetAE();
|
engine->engineLoadAccelEnrichment.resetAE();
|
||||||
|
@ -837,6 +839,6 @@ int getRusEfiVersion(void) {
|
||||||
if (initBootloader() != 0)
|
if (initBootloader() != 0)
|
||||||
return 123;
|
return 123;
|
||||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||||
return 20191018;
|
return 20191028;
|
||||||
}
|
}
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
|
@ -16,16 +16,6 @@ efitimeus_t getTimeNowUs(void) {
|
||||||
return chVTGetSystemTimeX() * (1000000 / CH_CFG_ST_FREQUENCY);
|
return chVTGetSystemTimeX() * (1000000 / CH_CFG_ST_FREQUENCY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo; reduce code duplication with prod code?
|
|
||||||
efitimems_t currentTimeMillis(void) {
|
|
||||||
return chVTGetSystemTimeX() / 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo; reduce code duplication with prod code?
|
|
||||||
efitimesec_t getTimeNowSeconds(void) {
|
|
||||||
return currentTimeMillis() / CH_CFG_ST_FREQUENCY;
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t wt_writes(void *ip, const uint8_t *bp, size_t n) {
|
static size_t wt_writes(void *ip, const uint8_t *bp, size_t n) {
|
||||||
printToConsole((char*)bp);
|
printToConsole((char*)bp);
|
||||||
return CONSOLE_PORT->vmt->write(CONSOLE_PORT, bp, n);
|
return CONSOLE_PORT->vmt->write(CONSOLE_PORT, bp, n);
|
||||||
|
|
|
@ -76,11 +76,6 @@ void applyNewConfiguration(void);
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
/**
|
|
||||||
* number of SysClock ticks in one ms
|
|
||||||
*/
|
|
||||||
#define TICKS_IN_MS (CH_FREQUENCY / 1000)
|
|
||||||
|
|
||||||
#define hal_lld_get_counter_value() 0
|
#define hal_lld_get_counter_value() 0
|
||||||
|
|
||||||
#endif /* GLOBAL_H_ */
|
#endif /* GLOBAL_H_ */
|
||||||
|
|
Loading…
Reference in New Issue