Closed tomvanbraeckel closed 3 months ago
Maybe you should use FreeRTOS queues directly if your driver depends on ISRs? rg_queue
isn't meant to replicate the full FreeRTOS API, just enough for message passing between threads/tasks.
On the other hand I can see why you'd want to standardize on rg_queue
across our entire codebase and messages_waiting
is definitely a good addition. So I'm not really opposed to merging the PR as is.
Maybe just change uint32_t
for size_t
because rg_queue_create
establishes that our item counts are size_t
s?
I originally used FreeRTOS queues directly, but then I noticed there are rg_ equivalents for it, so I thought it would be preferred to use those. I understand you wouldn't want to copy the whole API, but I guess for this one or two it's fine.
Point taken on the size_t. Fixed!
Oh dear, I messed up with my git incompetence. Hopefully it's all good now.
I'm ready to upstream the piezo buzzer audio driver, and this adds 2 simple helper functions that are needed for it.