This repository was archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
dev notes
Valera edited this page Jan 6, 2018
·
2 revisions
You want to understand how does this library works? Great! This article is specially for it.
Of course, we need timer. After all, esp_timer became best choice - it provide flexible API and low latency. Next, all system should be thread-safe, so we need semaphores and queues.
After some thinking, I found that best way is to queue events and handle it directly from timer's callback. If timer isn't started, I just start one-shot with zero delay.
How can I mix different frequecies in same mixer?
-
esp_timer_handle_t timer- timer for this instance. -
SemaphoreHandle_t mutex- main mutex for thread-unsafe resources. -
SemaphoreHandle_t timerMutex- counting semaphore with two states. Given if timer is active and any event will be handled. -
QueueHandle_t queue- queue for all events. -
dac_channel_t dacCh- it is pretty clear.