aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F4xx/DAC/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/STM32F4xx/DAC/main.c')
-rw-r--r--testhal/STM32/STM32F4xx/DAC/main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/testhal/STM32/STM32F4xx/DAC/main.c b/testhal/STM32/STM32F4xx/DAC/main.c
index 4b038ea72..d4844441e 100644
--- a/testhal/STM32/STM32F4xx/DAC/main.c
+++ b/testhal/STM32/STM32F4xx/DAC/main.c
@@ -59,16 +59,14 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = {
* DAC streaming callback.
*/
size_t nx = 0, ny = 0, nz = 0;
-static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) {
-
- (void)dacp;
+static void end_cb1(DACDriver *dacp) {
nz++;
- if (dac_buffer == buffer) {
- nx += n;
+ if (dacIsBufferComplete(dacp)) {
+ nx += DAC_BUFFER_SIZE / 2;
}
else {
- ny += n;
+ ny += DAC_BUFFER_SIZE / 2;
}
if ((nz % 1000) == 0) {