mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-08 07:16:08 +00:00
FreeRTOS
This commit is contained in:
@@ -76,7 +76,7 @@ void app_main(void)
|
|||||||
|
|
||||||
void task1(void *pvParameters) {
|
void task1(void *pvParameters) {
|
||||||
while (1) {
|
while (1) {
|
||||||
if (xSemaphoreTake(xMutex, portMAX_DELAY)) {
|
if (xSemaphoreTake(xMutex, 1500)) {
|
||||||
printf("Task 1 is running\n");
|
printf("Task 1 is running\n");
|
||||||
printf("This is Task #1\n\n");
|
printf("This is Task #1\n\n");
|
||||||
vTaskDelay((500)); // Delay for 1 second
|
vTaskDelay((500)); // Delay for 1 second
|
||||||
@@ -88,7 +88,7 @@ void task1(void *pvParameters) {
|
|||||||
|
|
||||||
void task2(void *pvParameters) {
|
void task2(void *pvParameters) {
|
||||||
while (1) {
|
while (1) {
|
||||||
if (xSemaphoreTake(xMutex, portMAX_DELAY)) {
|
if (xSemaphoreTake(xMutex, 1500)) {
|
||||||
printf("Task 2 is running\n");
|
printf("Task 2 is running\n");
|
||||||
printf("This is Task #2\n\n");
|
printf("This is Task #2\n\n");
|
||||||
vTaskDelay((2000)); // Delay for 2 seconds
|
vTaskDelay((2000)); // Delay for 2 seconds
|
||||||
|
Reference in New Issue
Block a user