Add comments and clean up.
[bertos.git] / bertos / cpu / cortex-m3 / drv / adc_sam3.c
index 7dd48bf650584aeac165613c71d940fe784a3465..e1e43a97bf9cb29a8dd94b1d3c617991a126ff5c 100644 (file)
 #include <io/cm3.h>
 
 
+/* We use event to signal the end of conversion */
 static Event data_ready;
+/* The last converted data */
 static uint32_t data;
 
 /**
  * ADC ISR.
+ *
+ * The interrupt is connected to ready data, so when the
+ * adc ends the conversion we generate an event and then
+ * we return the converted value.
+ *
+ * \note to clear the Ready data bit and End of conversion
+ * bit we should read the Last Converted Data register, otherwise
+ * the ready data interrupt loop on this call.
  */
 static DECLARE_ISR(adc_conversion_end_irq)
 {