Hi,


> The easy option is to comment out the two calls, but I don't know if that'
s
> deemed acceptable, especially as other adc drivers do the same?





I do not think this is correct since it is better to disable and detach the
interrupt

when we close the device.




Instead I think the the enabling and attaching should be moved from sam_adc_
initialize()

to sam_adc_setup() which is called every time the driver is opened from the
application.

Similar to SAMv7 ADC driver:

https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/samv7/sam
_afec.c#L845





This would ensure the interrupt is enabled and attached when the driver is
opened


and disabled and detached when it is closed.




Best regards,

Michal Lenc

Reply via email to