diff --git a/firmware/Makefile b/firmware/Makefile index 2f755a06ce..2ea0051a83 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -293,8 +293,8 @@ ULIBS = -lm ############################################################################## ifeq ($(USE_FPU),yes) - USE_OPT += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant - USE_CPPOPT += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant + USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 + USE_CPPOPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 DDEFS += -DCORTEX_USE_FPU=TRUE else DDEFS += -DCORTEX_USE_FPU=FALSE diff --git a/firmware/controllers/sensors/thermistors.cpp b/firmware/controllers/sensors/thermistors.cpp index 78d486ee31..c36781fcbb 100644 --- a/firmware/controllers/sensors/thermistors.cpp +++ b/firmware/controllers/sensors/thermistors.cpp @@ -133,16 +133,20 @@ void setThermistorConfiguration(ThermistorConf * tc, float tempC1, float r1, flo } void prepareThermistorCurve(ThermistorConf * config) { - efiAssertVoid(config!=NULL, "therm config"); + efiAssertVoid(config!=NULL, "therm config"); float T1 = config->tempC_1 + KELV; float T2 = config->tempC_2 + KELV; float T3 = config->tempC_3 + KELV; scheduleMsg(logger, "T1=%..100000f/T2=%..100000f/T3=%..100000f", T1, T2, T3); float L1 = logf(config->resistance_1); + if (L1 == config->resistance_1) { + firmwareError("log is broken?"); + } float L2 = logf(config->resistance_2); float L3 = logf(config->resistance_3); - scheduleMsg(logger, "R1=%..100000f/R2=%..100000f/R3=%..100000f", config->resistance_1, config->resistance_2, config->resistance_3); + scheduleMsg(logger, "R1=%..100000f/R2=%..100000f/R3=%..100000f", config->resistance_1, config->resistance_2, + config->resistance_3); scheduleMsg(logger, "L1=%..100000f/L2=%..100000f/L3=%..100000f", L1, L2, L3); float Y1 = 1 / T1; @@ -156,12 +160,12 @@ void prepareThermistorCurve(ThermistorConf * config) { scheduleMsg(logger, "U2=%..100000f/U3=%..100000f", U2, U3); - config->s_h_c = (U3 - U2) / (L3 - L2) * pow(L1 + L2 + L3, -1); config->s_h_b = U2 - config->s_h_c * (L1 * L1 + L1 * L2 + L2 * L2); config->s_h_a = Y1 - (config->s_h_b + L1 * L1 * config->s_h_c) * L1; - scheduleMsg(logger, "s_h_c=%..100000f/s_h_b=%..100000f/s_h_a=%..100000f", config->s_h_c, config->s_h_b, config->s_h_a); + scheduleMsg(logger, "s_h_c=%..100000f/s_h_b=%..100000f/s_h_a=%..100000f", config->s_h_c, config->s_h_b, + config->s_h_a); } diff --git a/firmware/svnversion.h b/firmware/svnversion.h index 800fa8c657..a15aaa738d 100644 --- a/firmware/svnversion.h +++ b/firmware/svnversion.h @@ -1,5 +1,5 @@ // This file was generated by Version2Header -// Wed Feb 18 21:12:04 EST 2015 +// Wed Feb 18 22:08:55 EST 2015 #ifndef VCS_VERSION -#define VCS_VERSION "6940" +#define VCS_VERSION "6947" #endif