Comments (3)
The scheduler is not running until after the end of the setup() function. Therefore calling for a task delay via vTaskDelay is meaningless.
Also no tasks have been created, so except for the idle task running the contents of loop() function, your code has no tasks running with any priority.
Suggestion, read the documentation. Follow the examples provided, and you will find it will be easier.
from arduino_freertos_library.
However it runs perfectly with ESP32 in Arduino IDE,
#include <Arduino.h>
void setup()
{
Serial.begin(9600);
while (!Serial)
{
;
}
Serial.print("Setup and loop task running with priority ");
Serial.println(uxTaskPriorityGet(NULL));
vTaskDelay(1000 / portTICK_PERIOD_MS);
Serial.println("OK");
}
void loop() {}
It gives expected output (with delay of 1000ms):
Setup and loop task running with priority 1
OK
Actually the code is shamelessly copied from the guide Digi-Key
@feilipu I am wondering why "OK" is not printed for the Arduino Mega 2560?
from arduino_freertos_library.
The ESP32 is a totally different 240MHz / dual core 32-bit thing.
Their IDF uses FreeRTOS to schedule WiFI / Bluetooth activities under the cover.
The "OK" is not printed because the vTaskDelay()
function is waiting for an increment that never happens (because the scheduler is not running). Your results will be completely random at that point.
Actually the code is shamelessly copied from the guide Digi-Key.
I suggest to use the examples installed with this library, and available here.
from arduino_freertos_library.
Related Issues (20)
- STM32FreeRTOS myservo can not work. HOT 2
- what is the difference of three freertos? HOT 5
- FreeRTOS automatically restarts after the last task has finished on Arduino Mega 2560 HOT 7
- Is it possible to implement a system timer interrupt version (rather than WDT) compatible with Arduino IDE? HOT 2
- Generic device support HOT 3
- RTOS Example Compile Error HOT 4
- Where is the define of TaskControlBlock_t in task.h? HOT 1
- define delay() to vTaskDelay() HOT 3
- Arduino delay() changed its behavior to not do busy wait anymore HOT 19
- INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil && avr/io.h: No such file or directory HOT 3
- Arduino Due support HOT 4
- lgt8f328p compatibility HOT 22
- Arduino R4 HOT 5
- [Q] Unable to change FreeRTOSConfig.h for a single sketch on Arduino IDE 2.2.1 HOT 1
- Casting error on vPortDelay function
- Issue with delay(); HOT 1
- Teensy support HOT 4
- FAQ (for anyone who wishes to ask..) HOT 5
- Support for AWS FreeRTOS ESP32 HOT 1
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 arduino_freertos_library.