unused code hangs program
Posted: Thu Sep 13, 2018 5:07 pm
Update: my test seemed to indicate a suggested solution (see below), but when applied to my app, the code continues to hang. So I do not have a solution
I had have this weird situation.
Starting point: some code working normally.
What I did: included a trivial 4 line function with settimeofday() in it. I only added the code of the function, no calls!
Result: compiled normally (as expected), but hangs right after:
I (304) cpu_start: Pro cpu start user code"
Instead of the regular:
I (304) cpu_start: Pro cpu start user code
I (97) cpu_start: Starting scheduler on PRO CPU.
In other words before the code could output something it hang [edit: this is due to hanging in app_main, before the scheduler is started].
The Solution (or so I thought), include:
#include "time.h"
Note I had only:
#include "sys/time.h"
Which was sufficient to compile.
I presume there is an ugly bug lurking somewhere (tested on ESP32-WROOM).
I had have this weird situation.
Starting point: some code working normally.
What I did: included a trivial 4 line function with settimeofday() in it. I only added the code of the function, no calls!
Result: compiled normally (as expected), but hangs right after:
I (304) cpu_start: Pro cpu start user code"
Instead of the regular:
I (304) cpu_start: Pro cpu start user code
I (97) cpu_start: Starting scheduler on PRO CPU.
In other words before the code could output something it hang [edit: this is due to hanging in app_main, before the scheduler is started].
The Solution (or so I thought), include:
#include "time.h"
Note I had only:
#include "sys/time.h"
Which was sufficient to compile.
I presume there is an ugly bug lurking somewhere (tested on ESP32-WROOM).