aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32L1xx/DAC/main.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-01-01 17:09:22 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-01-01 17:09:22 +0000
commit60c04d66ec3c383febd9c9324e166aec2adb6e38 (patch)
tree57718e12cef2f2a9d3703b137edf087446ac85d5 /testhal/STM32/STM32L1xx/DAC/main.c
parentde7b311986e639eec1d8e808ea80bdf0b9989f09 (diff)
downloadChibiOS-60c04d66ec3c383febd9c9324e166aec2adb6e38.tar.gz
ChibiOS-60c04d66ec3c383febd9c9324e166aec2adb6e38.tar.bz2
ChibiOS-60c04d66ec3c383febd9c9324e166aec2adb6e38.zip
Fixed small errors caused by recent changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12520 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'testhal/STM32/STM32L1xx/DAC/main.c')
-rw-r--r--testhal/STM32/STM32L1xx/DAC/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/testhal/STM32/STM32L1xx/DAC/main.c b/testhal/STM32/STM32L1xx/DAC/main.c
index 28ce69ffe..3540dc778 100644
--- a/testhal/STM32/STM32L1xx/DAC/main.c
+++ b/testhal/STM32/STM32L1xx/DAC/main.c
@@ -59,16 +59,16 @@ 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) {
+static void end_cb1(DACDriver *dacp) {
(void)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) {