- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Few months ago I created a discussion which I cannot locate.
I tried running I2CM_MasterWriteBuf after xSemaphoreTake.
The semaphore was created using xSemaphoreCreateCounting(1,1);
I used this semaphore because I had 2 tasks that use I2C so I needed a critical section mechanism.
In this scenario, I2CM_MasterWriteBuf hanged.
I think found a solution.
I used xSemaphoreCreateCounting, xSemaphoreTake before running: vTaskStartScheduler();
When I created and used the semaphore in a task, I2CM_MasterWriteBuf worked fine.
Is this the the right solution ?
Thank you,
Zvika
Solved! Go to Solution.
- Labels:
-
PSoC 5 Device Programming
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ZvVe_2582751,
Welcome back to community.
SemaphoreCreateCounting can be called even before the TaskStartScheduler() is called or in a task. But xSemaphoreTake should be called only from the task and not anywhere else or before TaskStartScheduler()
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ZvVe_2582751,
Welcome back to community.
SemaphoreCreateCounting can be called even before the TaskStartScheduler() is called or in a task. But xSemaphoreTake should be called only from the task and not anywhere else or before TaskStartScheduler()
Regards,
Bragadeesh
Bragadeesh