[riot-notifications] [RIOT-OS/RIOT] drivers/periph_common: dac: add dac_play() (#13908)
notifications at github.com
Mon Nov 30 15:42:44 CET 2020
@benpicco commented on this pull request.
> + dac_dds_cb_t cb; /* Called when the current buffer is done */
+ void *cb_arg; /* Callback argument */
+ tim_t timer; /* Timer used for DAC */
+ uint16_t sample_ticks; /* Timer ticks per sample */
+ uint8_t cur; /* Active sample buffer */
+ uint8_t playing; /* DAC is playing */
+ uint8_t is_16bit; /* Sample size is 16 instead of 8 bit */
+static void _timer_cb(void *arg, int chan)
+ struct dac_ctx *ctx = arg;
+ const dac_t dac = ctx - _ctx;
tbh it's also not immediately obvious why this pointer arithmetic works.
I just added the `dac` to the callback struct, it's only 4 additional bytes.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications