aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32L4xx/GPT-ADC/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/STM32L4xx/GPT-ADC/main.c')
-rw-r--r--testhal/STM32/STM32L4xx/GPT-ADC/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/testhal/STM32/STM32L4xx/GPT-ADC/main.c b/testhal/STM32/STM32L4xx/GPT-ADC/main.c
index b7212a962..b7d0875f8 100644
--- a/testhal/STM32/STM32L4xx/GPT-ADC/main.c
+++ b/testhal/STM32/STM32L4xx/GPT-ADC/main.c
@@ -44,16 +44,16 @@ adcsample_t samples1[ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH];
* ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
(void)adcp;
/* Updating counters.*/
- if (samples1 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}