1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #20134 from benpicco/cpu/sam0_common-adc_continuous-fix

cpu/sam0_common: fix adc_continuous_sample()
This commit is contained in:
benpicco 2023-12-01 20:05:27 +00:00 committed by GitHub
commit 182700fef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -24,6 +24,7 @@
#include <inttypes.h>
#include <stdio.h>
#include "cpu.h"
#include "mutex.h"
#include "thread.h"
#include "sched.h"

View File

@ -389,14 +389,10 @@ void adc_continuous_begin(adc_res_t res)
int32_t adc_continuous_sample(adc_t line)
{
int val;
assert(line < ADC_NUMOF);
assert(mutex_trylock(&_lock) == 0);
mutex_lock(&_lock);
val = _sample(line) << _shift;
mutex_unlock(&_lock);
return val;
return _sample(line) << _shift;
}
void adc_continuous_stop(void)