From f112ffa1e6e4a2e3bc3c6754f2e6ed7de030c12f Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 1 May 2015 16:03:03 +0000 Subject: DAC driver *almost* done. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7934 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/dac.h | 45 ++++++++------------------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) (limited to 'os/hal/include') diff --git a/os/hal/include/dac.h b/os/hal/include/dac.h index 08bec7271..9b892bf44 100644 --- a/os/hal/include/dac.h +++ b/os/hal/include/dac.h @@ -186,46 +186,17 @@ typedef enum { * @notapi */ #define _dac_isr_full_code(dacp) { \ - if ((dacp)->grpp->circular) { \ - /* Callback handling.*/ \ - if ((dacp)->grpp->end_cb != NULL) { \ - if ((dacp)->depth > 1) { \ - /* Invokes the callback passing the 2nd half of the buffer.*/ \ - size_t half = (dacp)->depth / 2; \ - size_t half_index = half * (dacp)->grpp->num_channels; \ - (dacp)->grpp->end_cb(dacp, (dacp)->samples + half_index, half); \ - } \ - else { \ - /* Invokes the callback passing the whole buffer.*/ \ - (dacp)->grpp->end_cb(dacp, (dacp)->samples, (dacp)->depth); \ - } \ - } \ - } \ - else { \ - /* End conversion.*/ \ - dac_lld_stop_conversion(dacp); \ - if ((dacp)->grpp->end_cb != NULL) { \ - (dacp)->state = DAC_COMPLETE; \ - if ((dacp)->depth > 1) { \ - /* Invokes the callback passing the 2nd half of the buffer.*/ \ - size_t half = (dacp)->depth / 2; \ - size_t half_index = half * (dacp)->grpp->num_channels; \ - (dacp)->grpp->end_cb(dacp, (dacp)->samples + half_index, half); \ - } \ - else { \ - /* Invokes the callback passing the whole buffer.*/ \ - (dacp)->grpp->end_cb(dacp, (dacp)->samples, (dacp)->depth); \ - } \ - if ((dacp)->state == DAC_COMPLETE) { \ - (dacp)->state = DAC_READY; \ - (dacp)->grpp = NULL; \ - } \ + if ((dacp)->grpp->end_cb != NULL) { \ + if ((dacp)->depth > 1) { \ + /* Invokes the callback passing the 2nd half of the buffer.*/ \ + size_t half = (dacp)->depth / 2; \ + size_t half_index = half * (dacp)->grpp->num_channels; \ + (dacp)->grpp->end_cb(dacp, (dacp)->samples + half_index, half); \ } \ else { \ - (dacp)->state = DAC_READY; \ - (dacp)->grpp = NULL; \ + /* Invokes the callback passing the whole buffer.*/ \ + (dacp)->grpp->end_cb(dacp, (dacp)->samples, (dacp)->depth); \ } \ - _dac_wakeup_isr(dacp); \ } \ } -- cgit v1.2.3