aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-05-01 16:03:03 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-05-01 16:03:03 +0000
commitf112ffa1e6e4a2e3bc3c6754f2e6ed7de030c12f (patch)
treef749c32285d3d414cd2e6e8e6c2c2b72d2807a7e /os/hal/include
parent11dde993c286108892d4885811a59d4a2e6338b9 (diff)
downloadChibiOS-f112ffa1e6e4a2e3bc3c6754f2e6ed7de030c12f.tar.gz
ChibiOS-f112ffa1e6e4a2e3bc3c6754f2e6ed7de030c12f.tar.bz2
ChibiOS-f112ffa1e6e4a2e3bc3c6754f2e6ed7de030c12f.zip
DAC driver *almost* done.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7934 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/dac.h45
1 files changed, 8 insertions, 37 deletions
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); \
} \
}