reduce flash footprint by smarter code generation #4163

a bit of unit tests drama
This commit is contained in:
Andrey 2022-05-15 17:47:14 -04:00
parent 6b3e028ba8
commit aa87eb681c
2 changed files with 12 additions and 1 deletions

View File

@ -51,4 +51,13 @@ void configureRusefiLuaUtilHooks(lua_State* l) {
*/
}
void * hackEngineConfigurationPointer(void *ptr) {
// we know that 'engineConfiguration' was null at the time of initialization in unit tests
#if EFI_UNIT_TEST
intptr_t offset = (intptr_t)ptr;
void * valuePtr = (void *)engineConfiguration + offset;
return valuePtr;
#else
return ptr;
#endif
}

View File

@ -27,3 +27,5 @@ plain_get_float_s * findFloat(const char *name);
float getConfigValueByName(const char *name);
void setConfigValueByName(const char *name, float value);
float getOutputValueByName(const char *name);
void * hackEngineConfigurationPointer(void *ptr);