diff options
author | gdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01> | 2018-12-15 17:50:05 +0000 |
---|---|---|
committer | gdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01> | 2018-12-15 17:50:05 +0000 |
commit | f20ecc78178fc8cdfa682e100398c240224dbb4a (patch) | |
tree | 64272a45778baea1c1deed82d9223c3ddc87f6e7 /testhal/STM32/STM32F1xx | |
parent | 984f865b45b110915616c3c9629fe47b064bed99 (diff) | |
download | ChibiOS-f20ecc78178fc8cdfa682e100398c240224dbb4a.tar.gz ChibiOS-f20ecc78178fc8cdfa682e100398c240224dbb4a.tar.bz2 ChibiOS-f20ecc78178fc8cdfa682e100398c240224dbb4a.zip |
HAL callbacks rework.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12470 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'testhal/STM32/STM32F1xx')
-rw-r--r-- | testhal/STM32/STM32F1xx/ADC/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/testhal/STM32/STM32F1xx/ADC/main.c b/testhal/STM32/STM32F1xx/ADC/main.c index 32e5b82a8..fa466c2fa 100644 --- a/testhal/STM32/STM32F1xx/ADC/main.c +++ b/testhal/STM32/STM32F1xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_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;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
|