From 18fb8f676f0f650d83f69bc29ab45b04b73e86c1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Mar 2011 10:09:57 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2808 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/adc.h | 55 +++++++++++++++++++++------------------------ os/hal/include/can.h | 2 +- os/hal/include/mac.h | 2 +- os/hal/include/mmc_spi.h | 28 +++++++++++------------ os/hal/include/pal.h | 6 ++--- os/hal/include/serial_usb.h | 10 ++++----- os/hal/include/spi.h | 28 +++++++++++------------ 7 files changed, 64 insertions(+), 67 deletions(-) (limited to 'os/hal/include') diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h index d94d99aa3..8bc013b38 100644 --- a/os/hal/include/adc.h +++ b/os/hal/include/adc.h @@ -92,9 +92,9 @@ typedef enum { * @notapi */ #define _adc_reset_i(adcp) { \ - if ((adcp)->ad_thread != NULL) { \ - Thread *tp = (adcp)->ad_thread; \ - (adcp)->ad_thread = NULL; \ + if ((adcp)->thread != NULL) { \ + Thread *tp = (adcp)->thread; \ + (adcp)->thread = NULL; \ tp->p_u.rdymsg = RDY_RESET; \ chSchReadyI(tp); \ } \ @@ -108,9 +108,9 @@ typedef enum { * @notapi */ #define _adc_reset_s(adcp) { \ - if ((adcp)->ad_thread != NULL) { \ - Thread *tp = (adcp)->ad_thread; \ - (adcp)->ad_thread = NULL; \ + if ((adcp)->thread != NULL) { \ + Thread *tp = (adcp)->thread; \ + (adcp)->thread = NULL; \ chSchWakeupS(tp, RDY_RESET); \ } \ } @@ -123,9 +123,9 @@ typedef enum { * @notapi */ #define _adc_wakeup_isr(adcp) { \ - if ((adcp)->ad_thread != NULL) { \ - Thread *tp = (adcp)->ad_thread; \ - (adcp)->ad_thread = NULL; \ + if ((adcp)->thread != NULL) { \ + Thread *tp = (adcp)->thread; \ + (adcp)->thread = NULL; \ chSysLockFromIsr(); \ tp->p_u.rdymsg = RDY_OK; \ chSchReadyI(tp); \ @@ -152,9 +152,8 @@ typedef enum { * @notapi */ #define _adc_isr_half_code(adcp) { \ - if ((adcp)->ad_grpp->acg_endcb != NULL) { \ - (adcp)->ad_grpp->acg_endcb(adcp, (adcp)->ad_samples, \ - (adcp)->ad_depth / 2); \ + if ((adcp)->grpp->end_cb != NULL) { \ + (adcp)->grpp->end_cb(adcp, (adcp)->samples, (adcp)->depth / 2); \ } \ } @@ -173,40 +172,38 @@ typedef enum { * @notapi */ #define _adc_isr_full_code(adcp) { \ - if ((adcp)->ad_grpp->acg_circular) { \ + if ((adcp)->grpp->circular) { \ /* Callback handling.*/ \ - if ((adcp)->ad_grpp->acg_endcb != NULL) { \ - if ((adcp)->ad_depth > 1) { \ + if ((adcp)->grpp->end_cb != NULL) { \ + if ((adcp)->depth > 1) { \ /* Invokes the callback passing the 2nd half of the buffer.*/ \ - size_t half = (adcp)->ad_depth / 2; \ - (adcp)->ad_grpp->acg_endcb(adcp, (adcp)->ad_samples + half, half); \ + size_t half = (adcp)->depth / 2; \ + (adcp)->grpp->end_cb(adcp, (adcp)->samples + half, half); \ } \ else { \ /* Invokes the callback passing the whole buffer.*/ \ - (adcp)->ad_grpp->acg_endcb(adcp, (adcp)->ad_samples, \ - (adcp)->ad_depth); \ + (adcp)->grpp->end_cb(adcp, (adcp)->samples, (adcp)->depth); \ } \ } \ } \ else { \ /* End conversion.*/ \ adc_lld_stop_conversion(adcp); \ - if ((adcp)->ad_grpp->acg_endcb != NULL) { \ - (adcp)->ad_state = ADC_COMPLETE; \ - if ((adcp)->ad_depth > 1) { \ + if ((adcp)->grpp->end_cb != NULL) { \ + (adcp)->state = ADC_COMPLETE; \ + if ((adcp)->depth > 1) { \ /* Invokes the callback passing the 2nd half of the buffer.*/ \ - size_t half = (adcp)->ad_depth / 2; \ - (adcp)->ad_grpp->acg_endcb(adcp, (adcp)->ad_samples + half, half); \ + size_t half = (adcp)->depth / 2; \ + (adcp)->grpp->end_cb(adcp, (adcp)->samples + half, half); \ } \ else { \ /* Invokes the callback passing the whole buffer.*/ \ - (adcp)->ad_grpp->acg_endcb(adcp, (adcp)->ad_samples, \ - (adcp)->ad_depth); \ + (adcp)->grpp->end_cb(adcp, (adcp)->samples, (adcp)->depth); \ } \ - if ((adcp)->ad_state == ADC_COMPLETE) \ - (adcp)->ad_state = ADC_READY; \ + if ((adcp)->state == ADC_COMPLETE) \ + (adcp)->state = ADC_READY; \ } \ - (adcp)->ad_grpp = NULL; \ + (adcp)->grpp = NULL; \ _adc_wakeup_isr(adcp); \ } \ } diff --git a/os/hal/include/can.h b/os/hal/include/can.h index dc258193a..d294f0b08 100644 --- a/os/hal/include/can.h +++ b/os/hal/include/can.h @@ -103,7 +103,7 @@ typedef enum { * * @iclass */ -#define canAddFlagsI(canp, mask) ((canp)->cd_status |= (mask)) +#define canAddFlagsI(canp, mask) ((canp)->status |= (mask)) /*===========================================================================*/ /* External declarations. */ diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h index 8978f007e..81d8ea27f 100644 --- a/os/hal/include/mac.h +++ b/os/hal/include/mac.h @@ -64,7 +64,7 @@ * @api */ #if CH_USE_EVENTS || defined(__DOXYGEN__) -#define macGetReceiveEventSource(macp) (&(macp)->md_rdevent) +#define macGetReceiveEventSource(macp) (&(macp)->rdevent) #endif /** diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h index 241fae54a..9f717ed39 100644 --- a/os/hal/include/mmc_spi.h +++ b/os/hal/include/mmc_spi.h @@ -18,7 +18,7 @@ */ /** - * @file mmc_spi.h + * @file spi.h * @brief MMC over SPI driver header. * * @addtogroup MMC_SPI @@ -133,47 +133,47 @@ typedef struct { /** * @brief Driver state. */ - mmcstate_t mmc_state; + mmcstate_t state; /** * @brief Current configuration data. */ - const MMCConfig *mmc_config; + const MMCConfig *config; /** * @brief SPI driver associated to this MMC driver. */ - SPIDriver *mmc_spip; + SPIDriver *spip; /** * @brief SPI low speed configuration used during initialization. */ - const SPIConfig *mmc_lscfg; + const SPIConfig *lscfg; /** * @brief SPI high speed configuration used during transfers. */ - const SPIConfig *mmc_hscfg; + const SPIConfig *hscfg; /** * @brief Write protect status query function. */ - mmcquery_t mmc_is_protected; + mmcquery_t is_protected; /** * @brief Insertion status query function. */ - mmcquery_t mmc_is_inserted; + mmcquery_t is_inserted; /** * @brief Card insertion event source. */ - EventSource mmc_inserted_event; + EventSource inserted_event; /** * @brief Card removal event source. */ - EventSource mmc_removed_event; + EventSource removed_event; /** * @brief MMC insertion polling timer. */ - VirtualTimer mmc_vt; + VirtualTimer vt; /** * @brief Insertion counter. */ - uint_fast8_t mmc_cnt; + uint_fast8_t cnt; } MMCDriver; /*===========================================================================*/ @@ -188,7 +188,7 @@ typedef struct { * * @api */ -#define mmcGetDriverState(mmcp) ((mmcp)->mmc_state) +#define mmcGetDriverState(mmcp) ((mmcp)->state) /** * @brief Returns the write protect status. @@ -200,7 +200,7 @@ typedef struct { * * @api */ -#define mmcIsWriteProtected(mmcp) ((mmcp)->mmc_is_protected()) +#define mmcIsWriteProtected(mmcp) ((mmcp)->is_protected()) /*===========================================================================*/ /* External declarations. */ diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h index 6f3c4a7e5..e7a7f90c4 100644 --- a/os/hal/include/pal.h +++ b/os/hal/include/pal.h @@ -123,17 +123,17 @@ typedef struct { /** * @brief Port identifier. */ - ioportid_t bus_portid; + ioportid_t portid; /** * @brief Bus mask aligned to port bit 0. * @note The bus mask implicitly define the bus width. A logical AND is * performed on the bus data. */ - ioportmask_t bus_mask; + ioportmask_t mask; /** * @brief Offset, within the port, of the least significant bit of the bus. */ - uint_fast8_t bus_offset; + uint_fast8_t offset; } IOBus; /*===========================================================================*/ diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index 3cfa1441b..b1d90cfb5 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -85,23 +85,23 @@ typedef struct { /** * @brief USB driver to use. */ - USBDriver *usbp; + USBDriver *usbp; /** * @brief USB driver configuration structure. */ - USBConfig usb_config; + USBConfig usb_config; /* * @brief Endpoint used for data transmission. */ - usbep_t data_request_ep; + usbep_t data_request_ep; /* * @brief Endpoint used for data reception. */ - usbep_t data_available_ep; + usbep_t data_available_ep; /* * @brief Endpoint used for interrupt request. */ - usbep_t interrupt_request_ep; + usbep_t interrupt_request_ep; } SerialUSBConfig; /** diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h index ccf3e4e63..29ea01e4d 100644 --- a/os/hal/include/spi.h +++ b/os/hal/include/spi.h @@ -120,7 +120,7 @@ typedef enum { * @iclass */ #define spiStartIgnoreI(spip, n) { \ - (spip)->spd_state = SPI_ACTIVE; \ + (spip)->state = SPI_ACTIVE; \ spi_lld_ignore(spip, n); \ } @@ -142,7 +142,7 @@ typedef enum { * @iclass */ #define spiStartExchangeI(spip, n, txbuf, rxbuf) { \ - (spip)->spd_state = SPI_ACTIVE; \ + (spip)->state = SPI_ACTIVE; \ spi_lld_exchange(spip, n, txbuf, rxbuf); \ } @@ -162,7 +162,7 @@ typedef enum { * @iclass */ #define spiStartSendI(spip, n, txbuf) { \ - (spip)->spd_state = SPI_ACTIVE; \ + (spip)->state = SPI_ACTIVE; \ spi_lld_send(spip, n, txbuf); \ } @@ -182,7 +182,7 @@ typedef enum { * @iclass */ #define spiStartReceiveI(spip, n, rxbuf) { \ - (spip)->spd_state = SPI_ACTIVE; \ + (spip)->state = SPI_ACTIVE; \ spi_lld_receive(spip, n, rxbuf); \ } @@ -215,9 +215,9 @@ typedef enum { * @notapi */ #define _spi_wait_s(spip) { \ - chDbgAssert((spip)->spd_thread == NULL, \ + chDbgAssert((spip)->thread == NULL, \ "_spi_wait(), #1", "already waiting"); \ - (spip)->spd_thread = chThdSelf(); \ + (spip)->thread = chThdSelf(); \ chSchGoSleepS(THD_STATE_SUSPENDED); \ } @@ -229,9 +229,9 @@ typedef enum { * @notapi */ #define _spi_wakeup_isr(spip) { \ - if ((spip)->spd_thread != NULL) { \ - Thread *tp = (spip)->spd_thread; \ - (spip)->spd_thread = NULL; \ + if ((spip)->thread != NULL) { \ + Thread *tp = (spip)->thread; \ + (spip)->thread = NULL; \ chSysLockFromIsr(); \ chSchReadyI(tp); \ chSysUnlockFromIsr(); \ @@ -257,11 +257,11 @@ typedef enum { * @notapi */ #define _spi_isr_code(spip) { \ - if ((spip)->spd_config->spc_endcb) { \ - (spip)->spd_state = SPI_COMPLETE; \ - (spip)->spd_config->spc_endcb(spip); \ - if ((spip)->spd_state == SPI_COMPLETE) \ - (spip)->spd_state = SPI_READY; \ + if ((spip)->config->end_cb) { \ + (spip)->state = SPI_COMPLETE; \ + (spip)->config->end_cb(spip); \ + if ((spip)->state == SPI_COMPLETE) \ + (spip)->state = SPI_READY; \ } \ _spi_wakeup_isr(spip); \ } -- cgit v1.2.3