diff options
Diffstat (limited to 'testhal/STM32/STM32F3xx')
-rw-r--r-- | testhal/STM32/STM32F3xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/ADC_DUAL/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/DAC/main.c | 10 |
3 files changed, 12 insertions, 16 deletions
diff --git a/testhal/STM32/STM32F3xx/ADC/main.c b/testhal/STM32/STM32F3xx/ADC/main.c index a6659f4e8..9305f505b 100644 --- a/testhal/STM32/STM32F3xx/ADC/main.c +++ b/testhal/STM32/STM32F3xx/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;
}
}
diff --git a/testhal/STM32/STM32F3xx/ADC_DUAL/main.c b/testhal/STM32/STM32F3xx/ADC_DUAL/main.c index e8eadbeb7..6518965c8 100644 --- a/testhal/STM32/STM32F3xx/ADC_DUAL/main.c +++ b/testhal/STM32/STM32F3xx/ADC_DUAL/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;
}
}
diff --git a/testhal/STM32/STM32F3xx/DAC/main.c b/testhal/STM32/STM32F3xx/DAC/main.c index aa791bf82..74491a0d0 100644 --- a/testhal/STM32/STM32F3xx/DAC/main.c +++ b/testhal/STM32/STM32F3xx/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) {
|