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:
commit
182700fef4
@ -24,6 +24,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "cpu.h"
|
||||||
#include "mutex.h"
|
#include "mutex.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "sched.h"
|
#include "sched.h"
|
||||||
|
@ -389,14 +389,10 @@ void adc_continuous_begin(adc_res_t res)
|
|||||||
|
|
||||||
int32_t adc_continuous_sample(adc_t line)
|
int32_t adc_continuous_sample(adc_t line)
|
||||||
{
|
{
|
||||||
int val;
|
|
||||||
assert(line < ADC_NUMOF);
|
assert(line < ADC_NUMOF);
|
||||||
|
assert(mutex_trylock(&_lock) == 0);
|
||||||
|
|
||||||
mutex_lock(&_lock);
|
return _sample(line) << _shift;
|
||||||
val = _sample(line) << _shift;
|
|
||||||
mutex_unlock(&_lock);
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void adc_continuous_stop(void)
|
void adc_continuous_stop(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user