From e47644864d5d9a3ca0c201ad270ce993a1cb543f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 4 Mar 2013 08:17:33 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5351 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c | 10 ++++++---- os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c index 7979c37a9..2a1725e0d 100644 --- a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c +++ b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c @@ -41,6 +41,8 @@ /* Driver local variables and types. */ /*===========================================================================*/ +static edma_channel_config_t channels[SPC5_EDMA_NCHANNELS]; + /*===========================================================================*/ /* Driver local functions. */ /*===========================================================================*/ @@ -67,22 +69,22 @@ void edmaInit(void) { * * @param[in] ccfg channel configuration * @return The channel TCD pointer. - * @retval NULL if the channel cannot be allocated. + * @retval EDMA_ERROR if the channel cannot be allocated. * * @special */ -edma_tcd_t *edmaAllocChannel(const edma_channel_config_t *ccfg) { +edma_channel_t edmaAllocChannel(const edma_channel_config_t *ccfg) { } /** * @brief EDMA channel allocation. * - * @param[in] tcd channel TCD pointer + * @param[in] channel the channel number * * @special */ -void edmaReleaseChannel(edma_tcd_t *tcd) { +void edmaReleaseChannel(edma_channel_t channel) { } diff --git a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h index 3aa899122..b0506e7b5 100644 --- a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h +++ b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h @@ -33,6 +33,11 @@ /* Driver constants. */ /*===========================================================================*/ +/** + * @brief EDMA channel allocation error. + */ +#define EDMA_ERROR -1 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -45,6 +50,11 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief Type of and EDMA channel number. + */ +typedef int32_t edma_channel_t; + /** * @brief Type of an EDMA TCD. */ @@ -64,11 +74,10 @@ typedef void (*edma_isr_t)(edma_tcd_t *tcd, void *p); * @brief Type of an EDMA channel configuration structure. */ typedef struct { - uint32_t dma_periph; /**< @brief Peripheral associated to - the channel. */ + uint32_t dma_periph; /**< @brief Peripheral to be + associated to the channel. */ edma_isr_t dma_func; /**< @brief Channel ISR callback. */ void *dma_param; /**< @brief Channel callback param. */ - } edma_channel_config_t; /*===========================================================================*/ @@ -83,8 +92,8 @@ typedef struct { extern "C" { #endif void edmaInit(void); - edma_tcd_t *edmaAllocChannel(const edma_channel_config_t *ccfg); - void edmaReleaseChannel(edma_tcd_t *tcd); + edma_channel_t edmaAllocChannel(const edma_channel_config_t *ccfg); + void edmaReleaseChannel(edma_channel_t *channel); #ifdef __cplusplus } #endif