However, on porting into ESP32, a section of floating point calculations is breaking
the compiler. It simulates perfectly just like the PIC24 version and it builds the c code
without issue. But something is going wrong in the compiler.
Here is the back end of the report file and at the end of that section I have added in the section
of floating point maths commands that I think may be the problem.
Can someone knowledgeable able to analyse exactly what the report is saying about my calculation?
Do I need to ammend the instructions or is it a problem with the files the compiler is using? As
stated above its been fine on the PIC24 series. I really would love to find a fix. I've spent over a week on updating my project to ESP32 and to receive a compile problem right at the end of the road is gut wrenching.
---------------------------------------------------------------------------------
In file included from C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:612,
from C:/FC_ESP/mtxlolin32_lite_sdkconfig/main/esp-project.c:50:
C:/FC_ESP/mtxlolin32_lite_sdkconfig/main/esp-project.c: In function 'FCM_Abs_Calc':
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\ESP\ESP_CAL_Float.c:50:28: error: value computed is not used [-Werror=unused-value]
50 | #define flt_div(a, b) ((a) / (b))
| ^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\ESP\ESP_CAL_Float.c:73:24: note: in expansion of macro 'flt_div'
73 | #define fround(a, b) (flt_div(flt_round(flt_mul(a,pow(10,b))),pow(10,b)))
| ^~~~~~~
C:/FC_ESP/mtxlolin32_lite_sdkconfig/main/esp-project.c
12189 | // Component Macro
| ^~~~~~
cc1.exe: some warnings being treated as errors
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Executing action: all (aliases: build)
Running ninja in directory C:\FC_ESP\mtxlolin32_lite_sdkconfig\build
Executing "ninja all"...
Build Failed.
--------------------------------------------------------------------
(Calculation) Maths commands follows for Abs_Calc. The variables
a, b, c, abs, temperature and humidity are floating point.
a = fadd (temperature,237.6)
b = fmul (17.2694,temperature)
b = fdiv (b,a)
b = exp (b)
b = fmul (b,110.03446012)
b = fmul (b,humidity)
c = fadd (temperature,273.15)
c = fmul (c,8.3145)
abs = fdiv (b,c)
fround(abs,1)
-------------------------------------------------------------------