@@ -111,8 +111,8 @@ static void adc_gecko_irq_handler(const struct device *dev)
111
111
struct adc_gecko_config * config = (struct adc_gecko_config * )dev -> config ;
112
112
uint16_t result ;
113
113
uint8_t ainsel ;
114
-
115
114
uint32_t flags = ADC_IntGet (ADC0 ); /* get all interrupt flags */
115
+
116
116
if (flags & ADC_IF_SINGLE ) {
117
117
ADC_IntClear (config -> base , flags );
118
118
@@ -252,6 +252,7 @@ static int adc_gecko_channel_setup(const struct device *dev,
252
252
const struct adc_channel_cfg * channel_cfg )
253
253
{
254
254
struct adc_gecko_config * config = (struct adc_gecko_config * )dev -> config ;
255
+
255
256
if (channel_cfg -> channel_id >= config -> num_channels ) {
256
257
LOG_ERR ("unsupported channel id '%d'" , channel_cfg -> channel_id );
257
258
return - ENOTSUP ;
@@ -328,6 +329,7 @@ static int adc_gecko_init(const struct device *dev)
328
329
struct adc_gecko_config * config = (struct adc_gecko_config * )dev -> config ;
329
330
ADC_Init_TypeDef init = ADC_INIT_DEFAULT ;
330
331
struct adc_gecko_data * data = dev -> data ;
332
+
331
333
data -> dev = dev ;
332
334
333
335
config -> irq_configure ();
@@ -366,7 +368,7 @@ static int adc_gecko_init(const struct device *dev)
366
368
.channel_setup = adc_gecko_channel_setup, \
367
369
.read = adc_gecko_read, \
368
370
.ref_internal = DT_INST_PROP(inst, vref_mv), \
369
- IF_ENABLED(CONFIG_ADC_ASYNC, (.read_async = adc_gecko_read_async, ))}; \
371
+ IF_ENABLED(CONFIG_ADC_ASYNC, (.read_async = adc_gecko_read_async,))}; \
370
372
\
371
373
static struct adc_gecko_config adc_gecko_config##inst = { \
372
374
.num_channels = ADC_GECKO_CHANNEL_NUM, \
0 commit comments