Closed Akskaypohankar closed 6 years ago
Not sure but what I see in your code inside update7seg()
is that you call portENTER_CRITICAL(&timerMux)
, but you never call portEXIT_CRITICAL(&timerMux)
.
That might block future updates.
Additional info: Remark in portmacro.h:
Remark: For the ESP32, portENTER_CRITICAL and portENTER_CRITICAL_ISR both alias vTaskEnterCritical, meaning
that either function can be called both from ISR as well as task context. This is not standard FreeRTOS
behaviour; please keep this in mind if you need any compatibility with other FreeRTOS implementations.
You call portENTER_CRITICAL_ISR in the timer ISR routine and then portENTER_CRITICAL again in update7seg(). That is double call of the same according to portmacro.h
I'm by no means an expert, so others can feel free to correct me if I'm wrong, but a few things strike me as potential issues :
This issue is closed, because it looks as if it is not a bug or problem with the ESP32 Arduino core or its support libraries. For general API usage questions or help on specific coding challenges, please visit the arduino-esp32 Gitter channel. If you feel this issue was closed in error, reopen it and comment, why you think this is a bug in the Arduino-Core.
----------------------------- Remove above -----------------------------
Hardware:
Board: ?ESP32 things sparkfun Core Installation/update date: 11/jul/2017 IDE name: Arduino IDE Flash Frequency: 80Mhz Upload Speed: 115200.
Description:
HI, this is what I need to do, I need a countdown timer running in the background along with the main loop. a max7219 with 4 digs 7 seg display is used to show the countdown of time left in seconds. some 4X3 keyboard related task needs to be performed while the timer is running in the background and the time should be displayed on the 7 seg display.
I used following code but it worked perfectly until I added keyboard related programmes. now timer starts counts dawn from 100 to 98 and then suddenly stops but the main loop of the keyboard is working what am I doing wrong?
Sketch:
Enable Core debug level: Debug on tools menu of Arduino IDE, then put the serial output here