Comments (3)
Awesome! Thank you for this helpful info. I have not played with the Uno port of FreeRTOS, so I'm glad to hear it works. From what I've found, the setup()
and loop()
functions both run in a task in the ESP-ISF RTOS, which is why vTaskDelay()
and vTaskDelete()
work.
I'm not sure how the Uno port of FreeRTOS works, so I'm not surprised to hear that setup()
is not inside a task. Perhaps loop()
is in a task? Could you try running Serial.println(uxTaskPriorityGet(NULL));
in loop()
to see if it prints out a priority? If that works, it means loop()
is inside a task. If it fails, it means loop exists outside the scheduler (and you probably don't want to use loop()
if that's the case).
from introduction-to-rtos.
That was a great tip Shawn, thank you.
Calling uxTaskPriorityGet(NULL)
in loop function returned 0 and I also tried Serial.println(pcTaskGetName(NULL));
which also return the name IDLE
. On a side note, FreeRTOS documentation states that there should always be at least one task ready to be run and functions like vTaskDelay()
should not be called from it.
Strangely calling uxTaskPriorityGet(NULL)
in the setup function return a decimal 10 even though configMAX_PRIORITIES
is defined as 4 in FreeRTOSConfig.h file.
As I was discovering around, I also found about vTaskList
(reference) which returns an ASCII based task list table of all tasks. The returned table (example) shows all the tasks running, their states, priorities, and stack high water mark.
from introduction-to-rtos.
Just a follow-up for future reference.
Calling uxTaskGetNumberOfTasks()
in the setup function returns 0. Which means there are no tasks present while the setup function is running.
Reminder. This is only true for the Arduino Uno port of FreeRTOS.
from introduction-to-rtos.
Related Issues (6)
- suspended task deletion program stops and does not switch to another task
- Part 10 deadlock demo timeout solution: tasks attempt to give/return mutexes that have never been taken HOT 4
- Something wrong in part 6 (Mutex demo)
- Question: How code is working without the use of vTaskDelay() in tasks? HOT 2
- Solution example not compileing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from introduction-to-rtos.