From 4e68b68d5a799300bcbbfb3fdff0ea584239bcb0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Feb 2011 09:51:16 +0000 Subject: USB rework, step 2. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2714 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/usb.h | 17 +- os/hal/platforms/STM32/usb_lld.c | 234 ++++++++++++++++----- os/hal/platforms/STM32/usb_lld.h | 108 +++++----- os/hal/src/usb.c | 427 +++++++++++++++++++++------------------ testhal/STM32/USB_CDC/halconf.h | 2 +- testhal/STM32/USB_CDC/main.c | 66 +++++- 6 files changed, 546 insertions(+), 308 deletions(-) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index 9f0d95837..e5f309bd3 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -73,6 +73,9 @@ #define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 #define USB_FEATURE_TEST_MODE 2 +#define USB_EARLY_SET_ADDRESS 0 +#define USB_LATE_SET_ADDRESS 1 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -296,10 +299,9 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * * @api */ -#define usbSetupTransfer(usbp, buf, n, endcb) { \ - (usbp)->usb_ep0next = (buf); \ - (usbp)->usb_ep0n = (n); \ - (usbp)->usb_ep0endcb = (endcb); \ +#define usbSetupTransfer(usbp, buf, n) { \ + (usbp)->ep0next = (buf); \ + (usbp)->ep0n = (n); \ } /*===========================================================================*/ @@ -315,6 +317,13 @@ extern "C" { void usbStop(USBDriver *usbp); void usbInitEndpointI(USBDriver *usbp, usbep_t ep, USBEndpointState *epp, const USBEndpointConfig *epcp); + void usbDisableEndpointsI(USBDriver *usbp); + bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n); + bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n); + bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep); + bool_t usbStallTransmitI(USBDriver *usbp, usbep_t ep); void _usb_reset(USBDriver *usbp); void _usb_ep0in(USBDriver *usbp, usbep_t ep); void _usb_ep0out(USBDriver *usbp, usbep_t ep); diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index 3fe6771ea..c55251d9b 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -62,7 +62,7 @@ static const USBEndpointConfig ep0config = { _usb_ep0out, 0x40, 0x40, - EPR_EP_TYPE_CONTROL | EPR_STAT_TX_STALL | EPR_STAT_RX_VALID, + EPR_EP_TYPE_CONTROL | EPR_STAT_TX_NAK | EPR_STAT_RX_VALID, 0x40, 0x80 }; @@ -71,6 +71,58 @@ static const USBEndpointConfig ep0config = { /* Driver local functions. */ /*===========================================================================*/ +/** + * @brief Copies a packet from memory into a packet buffer. + * + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the endpoint data + * @param[in] n maximum number of bytes to copy + */ +static void write_packet(usbep_t ep, const uint8_t *buf, size_t n){ + uint32_t *pmap; + stm32_usb_descriptor_t *udp; + size_t count; + + udp = USB_GET_DESCRIPTOR(ep); + pmap = USB_ADDR2PTR(udp->TXADDR); + udp->TXCOUNT = n; + count = (n + 1) / 2; + while (count) { + *pmap++ = *(uint16_t *)buf; + buf += 2; + count--; + } + EPR_SET_STAT_TX(ep, EPR_STAT_TX_VALID); +} + +/** + * @brief Copies a packet from a packet buffer into memory. + * + * @param[in] ep endpoint number + * @param[in] buf buffer where to copy the endpoint data + * @param[in] n maximum number of bytes to copy + * @return The packet size. + * @retval 0 Special case, zero sized packet. + */ +static size_t read_packet(usbep_t ep, uint8_t *buf, size_t n){ + uint32_t *pmap; + stm32_usb_descriptor_t *udp; + size_t count; + + udp = USB_GET_DESCRIPTOR(ep); + pmap = USB_ADDR2PTR(udp->RXADDR); + count = udp->RXCOUNT & RXCOUNT_COUNT_MASK; + if (n > count) + n = count; + count = (n + 1) / 2; + while (count) { + *(uint16_t *)buf = (uint16_t)*pmap++; + buf += 2; + count--; + } + return n; +} + /*===========================================================================*/ /* Driver interrupt handlers. */ /*===========================================================================*/ @@ -95,6 +147,7 @@ CH_IRQ_HANDLER(USB_HP_IRQHandler) { */ CH_IRQ_HANDLER(USB_LP_IRQHandler) { uint32_t istr; + size_t n; USBDriver *usbp = &USBD1; CH_IRQ_PROLOGUE(); @@ -104,15 +157,15 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { /* USB bus reset condition handling.*/ if (istr & ISTR_RESET) { _usb_reset(usbp); - if (usbp->usb_config->uc_event_cb) - usbp->usb_config->uc_event_cb(usbp, USB_EVENT_RESET); + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_RESET); STM32_USB->ISTR = ~ISTR_RESET; } /* SOF handling.*/ if (istr & ISTR_SOF) { - if (usbp->usb_config->uc_sof_cb) - usbp->usb_config->uc_sof_cb(usbp); + if (usbp->config->sof_cb) + usbp->config->sof_cb(usbp); STM32_USB->ISTR = ~ISTR_SOF; } @@ -120,19 +173,55 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { while (istr & ISTR_CTR) { uint32_t ep; uint32_t epr = STM32_USB->EPR[ep = istr & ISTR_EP_ID_MASK]; - const USBEndpointConfig *epcp = usbp->usb_ep[ep]->uep_config; + const USBEndpointConfig *epcp = usbp->ep[ep]->config; if (epr & EPR_CTR_TX) { /* IN endpoint, transmission.*/ EPR_CLEAR_CTR_TX(ep); - if (epcp->uepc_in_cb) - epcp->uepc_in_cb(usbp, ep); + n = USB_GET_DESCRIPTOR(ep)->TXCOUNT; + usbp->ep[ep]->txbuf += n; + usbp->ep[ep]->txcnt += n; + usbp->ep[ep]->txsize -= n; + if (usbp->ep[ep]->txsize > 0) { + /* Transfer not completed, there are more packets to send.*/ + if (usbp->ep[ep]->txsize > epcp->in_maxsize) + n = epcp->in_maxsize; + else + n = usbp->ep[ep]->txsize; + write_packet(ep, usbp->ep[ep]->txbuf, n); + } + else { + /* Transfer completed, invoking the callback, if defined.*/ + if (epcp->in_cb) + epcp->in_cb(usbp, ep); + } } if (epr & EPR_CTR_RX) { - /* OUT endpoint, receive.*/ EPR_CLEAR_CTR_RX(ep); - if (epcp->uepc_out_cb) - epcp->uepc_out_cb(usbp, ep); + /* OUT endpoint, receive.*/ + if ((epr & EPR_SETUP) && (ep == 0)) { + /* Special case, setup packet for EP0, enforcing a reset of the + EP0 state machine for robustness.*/ + usbp->ep0state = USB_EP0_WAITING_SETUP; + read_packet(0, usbp->setup, 8); + epcp->out_cb(usbp, ep); + } + else { + n = read_packet(ep, usbp->ep[ep]->rxbuf, usbp->ep[ep]->rxsize); + usbp->ep[ep]->rxbuf += n; + usbp->ep[ep]->rxcnt += n; + usbp->ep[ep]->rxsize -= n; + usbp->ep[ep]->rxpkts -= 1; + if (usbp->ep[ep]->rxpkts > 0) { + /* Transfer not completed, there are more packets to receive.*/ + EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); + } + else { + /* Transfer completed, invoking the callback, if defined.*/ + if (epcp->out_cb) + epcp->out_cb(usbp, ep); + } + } } istr = STM32_USB->ISTR; } @@ -169,7 +258,7 @@ void usb_lld_init(void) { */ void usb_lld_start(USBDriver *usbp) { - if (usbp->usb_state == USB_STOP) { + if (usbp->state == USB_STOP) { /* Clock activation.*/ #if STM32_USB_USE_USB1 if (&USBD1 == usbp) { @@ -202,7 +291,7 @@ void usb_lld_start(USBDriver *usbp) { void usb_lld_stop(USBDriver *usbp) { /* If in ready state then disables the USB clock.*/ - if (usbp->usb_state == USB_STOP) { + if (usbp->state == USB_STOP) { #if STM32_ADC_USE_ADC1 if (&USBD1 == usbp) { NVICDisableVector(USB_HP_CAN1_TX_IRQn); @@ -234,14 +323,14 @@ void usb_lld_reset(USBDriver *usbp) { /*CNTR_WKUPM | CNTR_ERRM | CNTR_PMAOVRM |*/ CNTR_CTRM; /* The SOF interrupt is only enabled if a callback is defined for this service because it is an high rate source.*/ - if (usbp->usb_config->uc_sof_cb != NULL) + if (usbp->config->sof_cb != NULL) cntr |= CNTR_SOFM; STM32_USB->CNTR = cntr; /* EP0 initialization.*/ memset(&ep0state, 0, sizeof ep0state); - ep0state.uep_config = &ep0config; - usbp->usb_ep[0] = &ep0state; + ep0state.config = &ep0config; + usbp->ep[0] = &ep0state; usb_lld_init_endpoint(usbp, 0); } @@ -249,14 +338,12 @@ void usb_lld_reset(USBDriver *usbp) { * @brief Sets the USB address. * * @param[in] usbp pointer to the @p USBDriver object - * @param[in] addr the USB address * * @notapi */ -void usb_lld_set_address(USBDriver *usbp, uint8_t addr) { +void usb_lld_set_address(USBDriver *usbp) { - (void)usbp; - STM32_USB->DADDR = (uint32_t)addr | DADDR_EF; + STM32_USB->DADDR = (uint32_t)(usbp->address) | DADDR_EF; } /** @@ -270,23 +357,23 @@ void usb_lld_set_address(USBDriver *usbp, uint8_t addr) { void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { uint16_t nblocks; stm32_usb_descriptor_t *dp; - const USBEndpointConfig *epcp = usbp->usb_ep[ep]->uep_config; + const USBEndpointConfig *epcp = usbp->ep[ep]->config; /* EPxR register setup.*/ - EPR_SET(ep, epcp->uepc_epr | ep); - EPR_TOGGLE(ep, epcp->uepc_epr); + EPR_SET(ep, epcp->epr | ep); + EPR_TOGGLE(ep, epcp->epr); /* Endpoint size and address initialization.*/ - if (epcp->uepc_out_maxsize > 62) - nblocks = (((((epcp->uepc_out_maxsize - 1) | 0x1f) + 1) / 32) << 10) | + if (epcp->out_maxsize > 62) + nblocks = (((((epcp->out_maxsize - 1) | 0x1f) + 1) / 32) << 10) | 0x8000; else - nblocks = ((((epcp->uepc_out_maxsize - 1) | 1) + 1) / 2) << 10; + nblocks = ((((epcp->out_maxsize - 1) | 1) + 1) / 2) << 10; dp = USB_GET_DESCRIPTOR(ep); dp->TXCOUNT = 0; dp->RXCOUNT = nblocks; - dp->TXADDR = epcp->uepc_inaddr; - dp->RXADDR = epcp->uepc_outaddr; + dp->TXADDR = epcp->inaddr; + dp->RXADDR = epcp->outaddr; } /** @@ -379,7 +466,7 @@ size_t usb_lld_get_writeable(USBDriver *usbp, usbep_t ep) { if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_NAK) return 0; - return (size_t)usbp->usb_ep[ep]->uep_config->uepc_in_maxsize; + return (size_t)usbp->ep[ep]->config->in_maxsize; } /** @@ -422,20 +509,20 @@ size_t usb_lld_write(USBDriver *usbp, usbep_t ep, } /** - * @brief Returns the status of an IN endpoint. + * @brief Returns the status of an OUT endpoint. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number * * @notapi */ -usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { +usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) { (void)usbp; - switch (STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) { - case EPR_STAT_TX_DIS: + switch (STM32_USB->EPR[ep] & EPR_STAT_RX_MASK) { + case EPR_STAT_RX_DIS: return EP_STATUS_DISABLED; - case EPR_STAT_TX_STALL: + case EPR_STAT_RX_STALL: return EP_STATUS_STALLED; default: return EP_STATUS_ACTIVE; @@ -443,20 +530,20 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { } /** - * @brief Returns the status of an OUT endpoint. + * @brief Returns the status of an IN endpoint. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number * * @notapi */ -usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) { +usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { (void)usbp; - switch (STM32_USB->EPR[ep] & EPR_STAT_RX_MASK) { - case EPR_STAT_RX_DIS: + switch (STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) { + case EPR_STAT_TX_DIS: return EP_STATUS_DISABLED; - case EPR_STAT_RX_STALL: + case EPR_STAT_TX_STALL: return EP_STATUS_STALLED; default: return EP_STATUS_ACTIVE; @@ -464,17 +551,50 @@ usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) { } /** - * @brief Brings an IN endpoint in the stalled state. + * @brief Starts a receive operation on an OUT endpoint. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the endpoint data + * @param[in] n maximum number of bytes to copy in the buffer * * @notapi */ -void usb_lld_stall_in(USBDriver *usbp, usbep_t ep) { +void usb_lld_start_out(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n) { + USBEndpointState *uesp = usbp->ep[ep]; + + uesp->rxbuf = buf; + uesp->rxsize = n; + uesp->rxcnt = 0; + if (uesp->rxsize == 0) /* Special case for zero sized packets.*/ + uesp->rxpkts = 1; + else + uesp->rxpkts = (uint16_t)((n + uesp->config->out_maxsize - 1) / + uesp->config->out_maxsize); + EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); +} - (void)usbp; - EPR_SET_STAT_TX(ep, EPR_STAT_TX_STALL); +/** + * @brief Starts a transmit operation on an IN endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the endpoint data + * @param[in] n maximum number of bytes to copy + * + * @notapi + */ +void usb_lld_start_in(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n) { + USBEndpointState *uesp = usbp->ep[ep]; + + uesp->txbuf = buf; + uesp->txsize = n; + uesp->txcnt = 0; + if (n > (size_t)uesp->config->in_maxsize) + n = (size_t)uesp->config->in_maxsize; + write_packet(ep, buf, n); } /** @@ -492,21 +612,17 @@ void usb_lld_stall_out(USBDriver *usbp, usbep_t ep) { } /** - * @brief Brings an IN endpoint in the active state. + * @brief Brings an IN endpoint in the stalled state. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number * * @notapi */ -void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) { +void usb_lld_stall_in(USBDriver *usbp, usbep_t ep) { (void)usbp; - - /* Makes sure to not put to NAK an endpoint that is already - transferring.*/ - if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_VALID) - EPR_SET_STAT_TX(ep, EPR_STAT_TX_NAK); + EPR_SET_STAT_TX(ep, EPR_STAT_TX_STALL); } /** @@ -527,6 +643,24 @@ void usb_lld_clear_out(USBDriver *usbp, usbep_t ep) { EPR_SET_STAT_TX(ep, EPR_STAT_RX_NAK); } +/** + * @brief Brings an IN endpoint in the active state. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) { + + (void)usbp; + + /* Makes sure to not put to NAK an endpoint that is already + transferring.*/ + if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_VALID) + EPR_SET_STAT_TX(ep, EPR_STAT_TX_NAK); +} + #endif /* HAL_USE_USB */ /** @} */ diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index e21bbecd2..7947e22fc 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -41,6 +41,11 @@ */ #define USB_MAX_ENDPOINTS USB_ENDOPOINTS_NUMBER +/** + * @brief This device requires the address change after the status packet. + */ +#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -89,40 +94,40 @@ /*===========================================================================*/ /** - * @brief Type of an USB Endpoint configuration structure. + * @brief Type of an USB endpoint configuration structure. * @note Platform specific restrictions may apply to endpoints. */ typedef struct { /** * @brief IN endpoint notification callback. */ - usbepcallback_t uepc_in_cb; + usbepcallback_t in_cb; /** * @brief OUT endpoint notification callback. */ - usbepcallback_t uepc_out_cb; + usbepcallback_t out_cb; /** * @brief IN endpoint maximum packet size. */ - uint16_t uepc_in_maxsize; + uint16_t in_maxsize; /** * @brief OUT endpoint maximum packet size. */ - uint16_t uepc_out_maxsize; + uint16_t out_maxsize; /* End of the mandatory fields.*/ /** * @brief EPxR register initialization value. * @note Do not specify the EA field, leave it to zero. */ - uint16_t uepc_epr; + uint16_t epr; /** * @brief Endpoint IN buffer address as offset in the PMA. */ - uint16_t uepc_inaddr; + uint16_t inaddr; /** * @brief Endpoint OUT buffer address as offset in the PMA. */ - uint16_t uepc_outaddr; + uint16_t outaddr; } USBEndpointConfig; @@ -133,39 +138,44 @@ typedef struct { /** * @brief Configuration associated to the endpoint. */ - const USBEndpointConfig *uep_config; + const USBEndpointConfig *config; + /** + * @brief @p TRUE if transmitting else @p FALSE. + */ + uint8_t transmitting; + /** + * @brief @p TRUE if receiving else @p FALSE. + */ + uint8_t receiving; + /* End of the mandatory fields.*/ + /** + * @brief Number of packets to receive. + */ + uint16_t rxpkts; /** * @brief Pointer to the transmission buffer. */ - const uint8_t *uep_txbuf; + const uint8_t *txbuf; /** * @brief Pointer to the receive buffer. */ - uint8_t *uep_rxbuf; + uint8_t *rxbuf; /** * @brief Requested transmit transfer size. */ - size_t uep_txsize; + size_t txsize; /** * @brief Requested receive transfer size. */ - size_t uep_rxsize; + size_t rxsize; /** * @brief Transmitted bytes so far. */ - size_t uep_txcnt; + size_t txcnt; /** * @brief Received bytes so far. */ - size_t uep_rxcnt; - /** - * @brief @p TRUE if transmitting else @p FALSE. - */ - uint8_t uep_transmitting; - /** - * @brief @p TRUE if receiving else @p FALSE. - */ - uint8_t uep_receiving; + size_t rxcnt; } USBEndpointState; /** @@ -176,22 +186,22 @@ typedef struct { * @brief USB events callback. * @details This callback is invoked when an USB driver event is registered. */ - usbeventcb_t uc_event_cb; + usbeventcb_t event_cb; /** * @brief Device GET_DESCRIPTOR request callback. * @note This callback is mandatory and cannot be set to @p NULL. */ - usbgetdescriptor_t uc_get_descriptor_cb; + usbgetdescriptor_t get_descriptor_cb; /** * @brief Requests hook callback. * @details This hook allows to be notified of standard requests or to * handle non standard requests. */ - usbreqhandler_t uc_requests_hook_cb; + usbreqhandler_t requests_hook_cb; /** * @brief Start Of Frame callback. */ - usbcallback_t uc_sof_cb; + usbcallback_t sof_cb; /* End of the mandatory fields.*/ } USBConfig; @@ -202,60 +212,52 @@ struct USBDriver { /** * @brief Driver state. */ - usbstate_t usb_state; + usbstate_t state; /** * @brief Current configuration data. */ - const USBConfig *usb_config; + const USBConfig *config; /** * @brief Field available to user, it can be used to associate an * application-defined handler to the USB driver. */ - void *usb_param; + void *param; /** * @brief Active endpoints configurations. */ - USBEndpointState *usb_ep[USB_MAX_ENDPOINTS + 1]; + USBEndpointState *ep[USB_MAX_ENDPOINTS + 1]; /** * @brief Endpoint 0 state. */ - usbep0state_t usb_ep0state; + usbep0state_t ep0state; /** * @brief Next position in the buffer to be transferred through endpoint 0. */ - uint8_t *usb_ep0next; + uint8_t *ep0next; /** - * @brief Maximum number of bytes to be tranferred through endpoint 0. + * @brief Maximum number of bytes to be transferred through endpoint 0. */ - size_t usb_ep0max; + size_t ep0max; /** - * @brief Number of bytes yet to be tranferred through endpoint 0. + * @brief Number of bytes yet to be transferred through endpoint 0. */ - size_t usb_ep0n; - /** - * @brief Size of the last packet transferred through endpoint 0. - */ - size_t usb_ep0lastsize; - /** - * @brief Endpoint 0 end transaction callback. - */ - usbcallback_t usb_ep0endcb; + size_t ep0n; /** * @brief Setup packet buffer. */ - uint8_t usb_setup[8]; + uint8_t setup[8]; /** * @brief Current USB device status. */ - uint16_t usb_status; + uint16_t status; /** * @brief Assigned USB address. */ - uint8_t usb_address; + uint8_t address; /** * @brief Current USB device configuration. */ - uint8_t usb_configuration; + uint8_t configuration; /* End of the mandatory fields.*/ }; @@ -305,7 +307,7 @@ extern "C" { void usb_lld_start(USBDriver *usbp); void usb_lld_stop(USBDriver *usbp); void usb_lld_reset(USBDriver *usbp); - void usb_lld_set_address(USBDriver *usbp, uint8_t addr); + void usb_lld_set_address(USBDriver *usbp); void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep); void usb_lld_disable_endpoints(USBDriver *usbp); size_t usb_lld_get_readable(USBDriver *usbp, usbep_t ep); @@ -315,10 +317,14 @@ extern "C" { const uint8_t *buf, size_t n); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); + void usb_lld_start_out(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n); + void usb_lld_start_in(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n); void usb_lld_stall_in(USBDriver *usbp, usbep_t ep); void usb_lld_stall_out(USBDriver *usbp, usbep_t ep); - void usb_lld_clear_in(USBDriver *usbp, usbep_t ep); void usb_lld_clear_out(USBDriver *usbp, usbep_t ep); + void usb_lld_clear_in(USBDriver *usbp, usbep_t ep); #ifdef __cplusplus } #endif diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index 3cc076443..d0db0ed5c 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -56,72 +56,18 @@ static const uint8_t halted_status[] = {0x01, 0x00}; */ void set_address(USBDriver *usbp) { - usbp->usb_address = usbp->usb_setup[2]; - usb_lld_set_address(usbp, usbp->usb_address); - if (usbp->usb_config->uc_event_cb) - usbp->usb_config->uc_event_cb(usbp, USB_EVENT_ADDRESS); - usbp->usb_state = USB_SELECTED; -} - -/** - * @brief Starts a receive phase on the endpoint zero. - * - * @param[in] usbp pointer to the @p USBDriver object - */ -static void start_rx_ep0(USBDriver *usbp) { - - if (usbp->usb_ep0n > 0) { - /* The received data cannot exceed the available amount.*/ - if (usbp->usb_ep0n > usbp->usb_ep0max) - usbp->usb_ep0n = usbp->usb_ep0max; - - /* Determines the maximum amount that can be received using a - single packet.*/ - if (usbp->usb_ep0n > usbp->usb_ep[0]->uep_config->uepc_out_maxsize) - usbp->usb_ep0lastsize = usbp->usb_ep[0]->uep_config->uepc_out_maxsize; - else - usbp->usb_ep0lastsize = usbp->usb_ep0n; - usbp->usb_ep0state = USB_EP0_RX; - } - else { - /* Sending zero sized status packet.*/ - usb_lld_write(usbp, 0, NULL, 0); - usbp->usb_ep0state = USB_EP0_SENDING_STS; - } -} - -/** - * @brief Starts a transmission phase on the endpoint zero. - * - * @param[in] usbp pointer to the @p USBDriver object - */ -static void start_tx_ep0(USBDriver *usbp) { - - if (usbp->usb_ep0n > 0) { - /* The transmitted data cannot exceed the requested amount.*/ - if (usbp->usb_ep0n > usbp->usb_ep0max) - usbp->usb_ep0n = usbp->usb_ep0max; - - /* Determines the maximum amount that can be transmitted using a - single packet.*/ - if (usbp->usb_ep0n > usbp->usb_ep[0]->uep_config->uepc_in_maxsize) - usbp->usb_ep0lastsize = usbp->usb_ep[0]->uep_config->uepc_in_maxsize; - else - usbp->usb_ep0lastsize = usbp->usb_ep0n; - - /* Starts transmission.*/ - usb_lld_write(usbp, 0, usbp->usb_ep0next, usbp->usb_ep0lastsize); - usbp->usb_ep0state = USB_EP0_TX; - } - else - usbp->usb_ep0state = USB_EP0_WAITING_STS; + usbp->address = usbp->setup[2]; + usb_lld_set_address(usbp); + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_ADDRESS); + usbp->state = USB_SELECTED; } /** * @brief Standard requests handler. * @details This is the standard requests default handler, most standard * requests are handled here, the user can override the standard - * handling using the @p uc_requests_hook_cb hook in the + * handling using the @p requests_hook_cb hook in the * @p USBConfig structure. * * @param[in] usbp pointer to the @p USBDriver object @@ -133,87 +79,93 @@ static bool_t default_handler(USBDriver *usbp) { const USBDescriptor *dp; /* Decoding the request.*/ - switch (((usbp->usb_setup[0] & (USB_RTYPE_RECIPIENT_MASK | - USB_RTYPE_TYPE_MASK)) | - (usbp->usb_setup[1] << 8))) { + switch (((usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | + USB_RTYPE_TYPE_MASK)) | + (usbp->setup[1] << 8))) { case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_GET_STATUS << 8): /* Just returns the current status word.*/ - usbSetupTransfer(usbp, (uint8_t *)&usbp->usb_status, 2, NULL); + usbSetupTransfer(usbp, (uint8_t *)&usbp->status, 2); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_CLEAR_FEATURE << 8): /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature number is handled as an error.*/ - if (usbp->usb_setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - usbp->usb_status &= ~2; - usbSetupTransfer(usbp, NULL, 0, NULL); + if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { + usbp->status &= ~2; + usbSetupTransfer(usbp, NULL, 0); return TRUE; } return FALSE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_SET_FEATURE << 8): /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature number is handled as an error.*/ - if (usbp->usb_setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - usbp->usb_status |= 2; - usbSetupTransfer(usbp, NULL, 0, NULL); + if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { + usbp->status |= 2; + usbSetupTransfer(usbp, NULL, 0); return TRUE; } return FALSE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_SET_ADDRESS << 8): - /* The handling is posponed to after the status phase in order to allow - the proper completion of the transaction.*/ - usbSetupTransfer(usbp, NULL, 0, set_address); + /* The SET_ADDRESS handling can be performed here or postponed after + the status packed depending on the USB_SET_ADDRESS_MODE low + driver setting.*/ +#if USB_SET_ADDRESS_MODE == USB_EARLY_SET_ADDRESS + if ((usbp->setup[0] == USB_RTYPE_RECIPIENT_DEVICE) && + (usbp->setup[1] == USB_REQ_SET_ADDRESS)) + set_address(usbp); +#endif + usbSetupTransfer(usbp, NULL, 0); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_GET_DESCRIPTOR << 8): /* Handling descriptor requests from the host.*/ - dp = usbp->usb_config->uc_get_descriptor_cb( - usbp, usbp->usb_setup[3], usbp->usb_setup[2], - usb_lld_fetch_word(&usbp->usb_setup[4])); + dp = usbp->config->get_descriptor_cb( + usbp, usbp->setup[3], usbp->setup[2], + usb_lld_fetch_word(&usbp->setup[4])); if (dp == NULL) return FALSE; - usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size, NULL); + usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_GET_CONFIGURATION << 8): /* Returning the last selected configuration.*/ - usbSetupTransfer(usbp, &usbp->usb_configuration, 1, NULL); + usbSetupTransfer(usbp, &usbp->configuration, 1); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_SET_CONFIGURATION << 8): /* Handling configuration selection from the host.*/ - usbp->usb_configuration = usbp->usb_setup[2]; - if (usbp->usb_configuration == 0) - usbp->usb_state = USB_SELECTED; + usbp->configuration = usbp->setup[2]; + if (usbp->configuration == 0) + usbp->state = USB_SELECTED; else - usbp->usb_state = USB_ACTIVE; - if (usbp->usb_config->uc_event_cb) - usbp->usb_config->uc_event_cb(usbp, USB_EVENT_CONFIGURED); - usbSetupTransfer(usbp, NULL, 0, NULL); + usbp->state = USB_ACTIVE; + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_CONFIGURED); + usbSetupTransfer(usbp, NULL, 0); return TRUE; case USB_RTYPE_RECIPIENT_INTERFACE | (USB_REQ_GET_STATUS << 8): case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_SYNCH_FRAME << 8): /* Just sending two zero bytes, the application can change the behavior using a hook..*/ - usbSetupTransfer(usbp, (uint8_t *)zero_status, 2, NULL); + usbSetupTransfer(usbp, (uint8_t *)zero_status, 2); return TRUE; case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_GET_STATUS << 8): /* Sending the EP status.*/ - if (usbp->usb_setup[4] & 0x80) { - switch (usb_lld_get_status_in(usbp, usbp->usb_setup[4] & 0x0F)) { + if (usbp->setup[4] & 0x80) { + switch (usb_lld_get_status_in(usbp, usbp->setup[4] & 0x0F)) { case EP_STATUS_STALLED: - usbSetupTransfer(usbp, (uint8_t *)halted_status, 2, NULL); + usbSetupTransfer(usbp, (uint8_t *)halted_status, 2); return TRUE; case EP_STATUS_ACTIVE: - usbSetupTransfer(usbp, (uint8_t *)active_status, 2, NULL); + usbSetupTransfer(usbp, (uint8_t *)active_status, 2); return TRUE; default: return FALSE; } } else { - switch (usb_lld_get_status_out(usbp, usbp->usb_setup[4] & 0x0F)) { + switch (usb_lld_get_status_out(usbp, usbp->setup[4] & 0x0F)) { case EP_STATUS_STALLED: - usbSetupTransfer(usbp, (uint8_t *)halted_status, 2, NULL); + usbSetupTransfer(usbp, (uint8_t *)halted_status, 2); return TRUE; case EP_STATUS_ACTIVE: - usbSetupTransfer(usbp, (uint8_t *)active_status, 2, NULL); + usbSetupTransfer(usbp, (uint8_t *)active_status, 2); return TRUE; default: return FALSE; @@ -221,29 +173,29 @@ static bool_t default_handler(USBDriver *usbp) { } case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_CLEAR_FEATURE << 8): /* Only ENDPOINT_HALT is handled as feature.*/ - if (usbp->usb_setup[2] != USB_FEATURE_ENDPOINT_HALT) + if (usbp->setup[2] != USB_FEATURE_ENDPOINT_HALT) return FALSE; /* Clearing the EP status, not valid for EP0, it is ignored in that case.*/ - if ((usbp->usb_setup[4] & 0x0F) > 0) { - if (usbp->usb_setup[4] & 0x80) - usb_lld_clear_in(usbp, usbp->usb_setup[4] & 0x0F); + if ((usbp->setup[4] & 0x0F) > 0) { + if (usbp->setup[4] & 0x80) + usb_lld_clear_in(usbp, usbp->setup[4] & 0x0F); else - usb_lld_clear_out(usbp, usbp->usb_setup[4] & 0x0F); + usb_lld_clear_out(usbp, usbp->setup[4] & 0x0F); } - usbSetupTransfer(usbp, NULL, 0, NULL); + usbSetupTransfer(usbp, NULL, 0); return TRUE; case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_SET_FEATURE << 8): /* Only ENDPOINT_HALT is handled as feature.*/ - if (usbp->usb_setup[2] != USB_FEATURE_ENDPOINT_HALT) + if (usbp->setup[2] != USB_FEATURE_ENDPOINT_HALT) return FALSE; /* Stalling the EP, not valid for EP0, it is ignored in that case.*/ - if ((usbp->usb_setup[4] & 0x0F) > 0) { - if (usbp->usb_setup[4] & 0x80) - usb_lld_stall_in(usbp, usbp->usb_setup[4] & 0x0F); + if ((usbp->setup[4] & 0x0F) > 0) { + if (usbp->setup[4] & 0x80) + usb_lld_stall_in(usbp, usbp->setup[4] & 0x0F); else - usb_lld_stall_out(usbp, usbp->usb_setup[4] & 0x0F); + usb_lld_stall_out(usbp, usbp->setup[4] & 0x0F); } - usbSetupTransfer(usbp, NULL, 0, NULL); + usbSetupTransfer(usbp, NULL, 0); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_SET_DESCRIPTOR << 8): case USB_RTYPE_RECIPIENT_INTERFACE | (USB_REQ_CLEAR_FEATURE << 8): @@ -282,9 +234,9 @@ void usbInit(void) { */ void usbObjectInit(USBDriver *usbp) { - usbp->usb_state = USB_STOP; - usbp->usb_config = NULL; - usbp->usb_param = NULL; + usbp->state = USB_STOP; + usbp->config = NULL; + usbp->param = NULL; } /** @@ -301,13 +253,13 @@ void usbStart(USBDriver *usbp, const USBConfig *config) { chDbgCheck((usbp != NULL) && (config != NULL), "usbStart"); chSysLock(); - chDbgAssert((usbp->usb_state == USB_STOP) || (usbp->usb_state == USB_READY), + chDbgAssert((usbp->state == USB_STOP) || (usbp->state == USB_READY), "usbStart(), #1", "invalid state"); - usbp->usb_config = config; + usbp->config = config; for (i = 0; i <= USB_MAX_ENDPOINTS; i++) - usbp->usb_ep[i] = NULL; + usbp->ep[i] = NULL; usb_lld_start(usbp); - usbp->usb_state = USB_READY; + usbp->state = USB_READY; chSysUnlock(); } @@ -323,11 +275,10 @@ void usbStop(USBDriver *usbp) { chDbgCheck(usbp != NULL, "usbStop"); chSysLock(); - chDbgAssert((usbp->usb_state == USB_STOP) || (usbp->usb_state == USB_READY), - "usbStop(), #1", - "invalid state"); + chDbgAssert((usbp->state == USB_STOP) || (usbp->state == USB_READY), + "usbStop(), #1", "invalid state"); usb_lld_stop(usbp); - usbp->usb_state = USB_STOP; + usbp->state = USB_STOP; chSysUnlock(); } @@ -348,15 +299,15 @@ void usbStop(USBDriver *usbp) { void usbInitEndpointI(USBDriver *usbp, usbep_t ep, USBEndpointState *epp, const USBEndpointConfig *epcp) { - chDbgAssert(usbp->usb_state == USB_ACTIVE, + chDbgAssert(usbp->state == USB_ACTIVE, "usbEnableEndpointI(), #1", "invalid state"); - chDbgAssert(usbp->usb_ep[ep] != NULL, + chDbgAssert(usbp->ep[ep] != NULL, "usbEnableEndpointI(), #2", "already initialized"); /* Logically enabling the endpoint in the USBDriver structure.*/ memset(epp, 0, sizeof(USBEndpointState)); - epp->uep_config = epcp; - usbp->usb_ep[ep] = epp; + epp->config = epcp; + usbp->ep[ep] = epp; /* Low level endpoint activation.*/ usb_lld_init_endpoint(usbp, ep); @@ -376,16 +327,100 @@ void usbInitEndpointI(USBDriver *usbp, usbep_t ep, USBEndpointState *epp, void usbDisableEndpointsI(USBDriver *usbp) { unsigned i; - chDbgAssert(usbp->usb_state == USB_SELECTED, + chDbgAssert(usbp->state == USB_SELECTED, "usbDisableEndpointsI(), #1", "invalid state"); for (i = 1; i <= USB_MAX_ENDPOINTS; i++) - usbp->usb_ep[i] = NULL; + usbp->ep[i] = NULL; /* Low level endpoints deactivation.*/ usb_lld_disable_endpoints(usbp); } +/** + * @brief Starts a receive operation on an OUT endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the endpoint data + * @param[in] n maximum number of bytes to copy in the buffer + * @return The operation status. + * @retval FALSE Receive operation started. + * @retval TRUE Endpoint already receiving. + * + * @iclass + */ +bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n) { + + if (usbp->ep[ep]->receiving) + return TRUE; + usbp->ep[ep]->receiving = TRUE; + usb_lld_start_out(usbp, ep, buf, n); + return FALSE; +} + +/** + * @brief Starts a transmit operation on an IN endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the endpoint data + * @param[in] n maximum number of bytes to copy + * @return The operation status. + * @retval FALSE Transmit operation started. + * @retval TRUE Endpoint already transmitting. + * + * @iclass + */ +bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n) { + + if (usbp->ep[ep]->transmitting) + return TRUE; + usbp->ep[ep]->transmitting = TRUE; + usb_lld_start_in(usbp, ep, buf, n); + return FALSE; +} + +/** + * @brief Stalls an OUT endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return The operation status. + * @retval FALSE Endpoint stalled. + * @retval TRUE The endpoint was within a transaction, not stalled. + * + * @iclass + */ +bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep) { + + if (usbp->ep[ep]->receiving) + return TRUE; + usb_lld_stall_out(usbp, ep); + return FALSE; +} + +/** + * @brief Stalls an IN endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return The operation status. + * @retval FALSE Endpoint stalled. + * @retval TRUE The endpoint was within a transaction, not stalled. + * + * @iclass + */ +bool_t usbStallTransmitI(USBDriver *usbp, usbep_t ep) { + + if (usbp->ep[ep]->transmitting) + return TRUE; + usb_lld_stall_in(usbp, ep); + return FALSE; +} + /** * @brief USB reset routine. * @@ -396,24 +431,20 @@ void usbDisableEndpointsI(USBDriver *usbp) { void _usb_reset(USBDriver *usbp) { unsigned i; - usbp->usb_state = USB_READY; - usbp->usb_status = 0; - usbp->usb_address = 0; - usbp->usb_configuration = 0; + usbp->state = USB_READY; + usbp->status = 0; + usbp->address = 0; + usbp->configuration = 0; /* Invalidates all endpoints into the USBDriver structure.*/ for (i = 0; i <= USB_MAX_ENDPOINTS; i++) - usbp->usb_ep[i] = NULL; + usbp->ep[i] = NULL; /* EP0 state machine initialization.*/ - usbp->usb_ep0state = USB_EP0_WAITING_SETUP; + usbp->ep0state = USB_EP0_WAITING_SETUP; /* Low level reset.*/ usb_lld_reset(usbp); - - /* Endpoint zero initialization.*/ -/* usbp->usb_ep[0].uep_config = &usb_lld_ep0config; - usb_lld_init_endpoint(usbp, 0, &usb_lld_ep0config);*/ } /** @@ -427,33 +458,30 @@ void _usb_reset(USBDriver *usbp) { * @notapi */ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { + size_t max; (void)ep; - switch (usbp->usb_ep0state) { + switch (usbp->ep0state) { case USB_EP0_TX: - usbp->usb_ep0next += usbp->usb_ep0lastsize; - usbp->usb_ep0max -= usbp->usb_ep0lastsize; - usbp->usb_ep0n -= usbp->usb_ep0lastsize; - - /* The final condition is when the requested size has been transmitted or - when a packet has been sent with size less than the maximum packet - size.*/ - if ((usbp->usb_ep0max == 0) || - (usbp->usb_ep0lastsize < usbp->usb_ep[0]->uep_config->uepc_in_maxsize)) - usbp->usb_ep0state = USB_EP0_WAITING_STS; - else { - usbp->usb_ep0lastsize = - usbp->usb_ep0n > usbp->usb_ep[0]->uep_config->uepc_in_maxsize ? - usbp->usb_ep[0]->uep_config->uepc_in_maxsize : - usbp->usb_ep0n; - usb_lld_write(usbp, 0, usbp->usb_ep0next, usbp->usb_ep0lastsize); - } + max = usb_lld_fetch_word(&usbp->setup[6]); + /* If the transmitted size is less than the requested size and it is a + multiple of the maximum packet size then a zero size packet must be + transmitted.*/ + if ((usbp->ep0n < max) && + ((usbp->ep0n % usbp->ep[0]->config->in_maxsize) == 0)) { + usb_lld_start_in(usbp, 0, NULL, 0); + return; + } + usbp->ep0state = USB_EP0_WAITING_STS; + usb_lld_start_out(usbp, 0, NULL, 0); return; case USB_EP0_SENDING_STS: - if (usbp->usb_ep0endcb) - usbp->usb_ep0endcb(usbp); - - usbp->usb_ep0state = USB_EP0_WAITING_SETUP; +#if USB_SET_ADDRESS_MODE == USB_LATE_SET_ADDRESS + if ((usbp->setup[0] == USB_RTYPE_RECIPIENT_DEVICE) && + (usbp->setup[1] == USB_REQ_SET_ADDRESS)) + set_address(usbp); +#endif + usbp->ep0state = USB_EP0_WAITING_SETUP; return; default: ; @@ -461,9 +489,9 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { /* Error response.*/ usb_lld_stall_in(usbp, 0); usb_lld_stall_out(usbp, 0); - if (usbp->usb_config->uc_event_cb) - usbp->usb_config->uc_event_cb(usbp, USB_EVENT_STALLED); - usbp->usb_ep0state = USB_EP0_WAITING_SETUP; + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_STALLED); + usbp->ep0state = USB_EP0_WAITING_SETUP; } /** @@ -477,62 +505,67 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { * @notapi */ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { - size_t n, size; - uint8_t buf[1]; + size_t n, max; (void)ep; - switch (usbp->usb_ep0state) { + switch (usbp->ep0state) { case USB_EP0_WAITING_SETUP: - /* SETUP packet handling.*/ - n = usb_lld_read(usbp, 0, usbp->usb_setup, 8); - if (n != 8) - break; - - /* First verify if the application has an handler installed for this + /* SETUP packet handling. + First verify if the application has an handler installed for this request.*/ - if (!(usbp->usb_config->uc_requests_hook_cb) || - !(usbp->usb_config->uc_requests_hook_cb(usbp))) { + if (!(usbp->config->requests_hook_cb) || + !(usbp->config->requests_hook_cb(usbp))) { /* Invoking the default handler, if this fails then stalls the endpoint zero as error.*/ - if (((usbp->usb_setup[0] & USB_RTYPE_TYPE_MASK) != USB_RTYPE_TYPE_STD) || + if (((usbp->setup[0] & USB_RTYPE_TYPE_MASK) != USB_RTYPE_TYPE_STD) || !default_handler(usbp)) break; } /* Transfer preparation. The request handler must have populated - correctly the fields usb_ep0next, usb_ep0n and usb_ep0endcb using + correctly the fields ep0next, ep0n and ep0endcb using the macro usbSetupTransfer().*/ - usbp->usb_ep0max = usb_lld_fetch_word(&usbp->usb_setup[6]); - if ((usbp->usb_setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) - start_tx_ep0(usbp); - else - start_rx_ep0(usbp); + max = usb_lld_fetch_word(&usbp->setup[6]); + /* The transfer size cannot exceed the specified amount.*/ + if (usbp->ep0n > max) + usbp->ep0n = max; + if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { + /* IN phase.*/ + if (usbp->ep0n > 0) { + /* Starts transmission.*/ + usbp->ep0state = USB_EP0_TX; + usb_lld_start_in(usbp, 0, usbp->ep0next, usbp->ep0n); + } + else { + /* Receiving the zero sized status packet.*/ + usbp->ep0state = USB_EP0_WAITING_STS; + usb_lld_start_out(usbp, 0, NULL, 0); + } + } + else { + /* OUT phase.*/ + if (usbp->ep0n > 0) { + /* Starts reception.*/ + usbp->ep0state = USB_EP0_RX; + usb_lld_start_out(usbp, 0, usbp->ep0next, usbp->ep0n); + } + else { + /* Sending zero sized status packet.*/ + usbp->ep0state = USB_EP0_SENDING_STS; + usb_lld_start_in(usbp, 0, NULL, 0); + } + } return; case USB_EP0_RX: - /* Check for buffer overflow.*/ - n = size = usb_lld_get_readable(usbp, 0); - if (n > usbp->usb_ep0n) - n = usbp->usb_ep0n; - /* Fetching received data packet.*/ - n = usb_lld_read(usbp, 0, usbp->usb_ep0next, n); - if (n > usbp->usb_ep0max) - break; - usbp->usb_ep0max -= size; - usbp->usb_ep0n -= n; - usbp->usb_ep0next += n; - if (usbp->usb_ep0max == 0) { - usb_lld_write(usbp, 0, NULL, 0); - usbp->usb_ep0state = USB_EP0_SENDING_STS; - } + usbp->ep0state = USB_EP0_SENDING_STS; + usb_lld_start_in(usbp, 0, NULL, 0); return; case USB_EP0_WAITING_STS: /* STATUS received packet handling, it must be zero sized.*/ - n = usb_lld_read(usbp, 0, buf, 1); + n = usbp->ep[0]->rxsize; if (n != 0) break; - if (usbp->usb_ep0endcb) - usbp->usb_ep0endcb(usbp); - usbp->usb_ep0state = USB_EP0_WAITING_SETUP; + usbp->ep0state = USB_EP0_WAITING_SETUP; return; default: ; @@ -540,9 +573,9 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { /* Error response.*/ usb_lld_stall_in(usbp, 0); usb_lld_stall_out(usbp, 0); - if (usbp->usb_config->uc_event_cb) - usbp->usb_config->uc_event_cb(usbp, USB_EVENT_STALLED); - usbp->usb_ep0state = USB_EP0_WAITING_SETUP; + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_STALLED); + usbp->ep0state = USB_EP0_WAITING_SETUP; } #endif /* HAL_USE_USB */ diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 0a957f0b9..6700bcad5 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -93,7 +93,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE +#define HAL_USE_SERIAL_USB FALSE #endif /** diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 70a27a8f2..697740526 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -32,7 +32,7 @@ /* * USB driver structure. */ -static SerialUSBDriver SDU1; +//static SerialUSBDriver SDU1; /* * USB Device Descriptor. @@ -247,6 +247,24 @@ USBEndpointState ep2state; */ USBEndpointState ep3state; +void sduDataRequest(USBDriver *usbp, usbep_t ep) { + + (void)usbp; + (void)ep; +} + +void sduInterruptRequest(USBDriver *usbp, usbep_t ep) { + + (void)usbp; + (void)ep; +} + +void sduDataAvailable(USBDriver *usbp, usbep_t ep) { + + (void)usbp; + (void)ep; +} + /** * @brief EP1 initialization structure (IN only). */ @@ -317,6 +335,7 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { /* * Serial over USB driver configuration. */ +#if 0 static const SerialUSBConfig serusbcfg = { &USBD1, { @@ -329,6 +348,40 @@ static const SerialUSBConfig serusbcfg = { DATA_AVAILABLE_EP, INTERRUPT_REQUEST_EP }; +#endif + +#include "usb_cdc.h" +static cdc_linecoding_t linecoding = { + {0x00, 0x96, 0x00, 0x00}, /* 38400. */ + LC_STOP_1, LC_PARITY_NONE, 8 +}; +bool_t sduRequestsHook(USBDriver *usbp) { + + if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { + switch (usbp->setup[1]) { + case CDC_GET_LINE_CODING: + usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); + return TRUE; + case CDC_SET_LINE_CODING: + usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); + return TRUE; + case CDC_SET_CONTROL_LINE_STATE: + /* Nothing to do, there are no control lines.*/ + usbSetupTransfer(usbp, NULL, 0); + return TRUE; + default: + return FALSE; + } + } + return FALSE; +} + +USBConfig usbconfig = { + usb_event, + get_descriptor, + sduRequestsHook, + NULL +}; /*===========================================================================*/ /* Generic code. */ @@ -352,6 +405,7 @@ static msg_t Thread1(void *arg) { /* * USB CDC loopback thread. */ +#if 0 static WORKING_AREA(waThread2, 256); static msg_t Thread2(void *arg) { SerialUSBDriver *sdup = arg; @@ -368,6 +422,7 @@ static msg_t Thread2(void *arg) { } } } +#endif /* * Application entry point. @@ -385,11 +440,12 @@ int main(void) { chSysInit(); /* - * Activates the USB bus and then the USB driver. + * Activates the USB driver and then the USB bus pull-up on D+. */ + usbStart(&USBD1, &usbconfig); palClearPad(GPIOC, GPIOC_USB_DISC); - sduObjectInit(&SDU1); - sduStart(&SDU1, &serusbcfg); +// sduObjectInit(&SDU1); +// sduStart(&SDU1, &serusbcfg); /* * Activates the serial driver 2 using the driver default configuration. @@ -404,7 +460,7 @@ int main(void) { /* * Creates the USB CDC loopback thread. */ - chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, &SDU1); +// chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, &SDU1); /* * Normal main() thread activity, in this demo it does nothing except -- cgit v1.2.3 From 18853dba2210eadd2d919da2f17a9b5b553245fd Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Feb 2011 10:02:08 +0000 Subject: Removed some obsolete code from the USB driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2715 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/usb.h | 58 ++++---------------- os/hal/platforms/STM32/usb_lld.c | 116 +-------------------------------------- os/hal/platforms/STM32/usb_lld.h | 5 -- 3 files changed, 13 insertions(+), 166 deletions(-) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index e5f309bd3..26c701f52 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -222,70 +222,35 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @param[in] usbp pointer to the @p USBDriver object * @return The current frame number. * - * @notapi + * @api */ #define usbGetFrameNumber(usbp) usb_lld_get_frame_number(usbp) /** - * @brief Returns the number of bytes readable from the receive packet - * buffer. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * @return The number of bytes that are effectively available. - * @retval 0 Data not yet available. - * - * @iclass - */ -#define usbGetReadableI(usbp, ep) usb_lld_get_readable(usbp, ep) - -/** - * @brief Endpoint read. - * @details The buffered packet is copied into the user buffer and then - * the endpoint is brought to the valid state in order to allow - * reception of more data. + * @brief Returns the status of an IN endpoint. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number - * @param[out] buf buffer where to copy the endpoint data - * @param[in] n maximum number of bytes to copy - * @return The number of bytes that were effectively available. - * @retval 0 Data not yet available. + * @return The operation status. + * @retval FALSE Endpoint ready. + * @retval TRUE Endpoint busy. * * @iclass */ -#define usbReadI(usbp, ep, buf, n) usb_lld_read(usbp, ep, buf, n) +#define usbGetTransmitStatusI(usbp, ep) (usbp)->ep[ep]->transmitting /** - * @brief Returns the number of bytes writeable to the transmit packet - * buffer. + * @brief Returns the status of an OUT endpoint. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number - * @return The number of bytes that can be written. - * @retval 0 Endpoint not ready for transmission. - * - * @iclass - */ -#define usbGetWriteableI(usbp, ep) usb_lld_get_readable(usbp, ep) - -/** - * @brief Endpoint write. - * @details The user data is copied in the packer memory and then - * the endpoint is brought to the valid state in order to allow - * transmission. - * - * @param[in] usbp pointer to the @p USBDriver object triggering the - * callback - * @param[in] ep endpoint number - * @param[in] buf buffer where to copy the endpoint data - * @param[in] n maximum number of bytes to copy - * @return The number of bytes that were effectively written. - * @retval 0 Endpoint not ready for transmission. + * @return The operation status. + * @retval FALSE Endpoint ready. + * @retval TRUE Endpoint busy. * * @iclass */ -#define usbWriteI(usbp, ep, buf, n) usb_lld_write(usbp, ep, buf, n) +#define usbGetReceiveStatusI(usbp, ep) (usbp)->ep[ep]->receiving /** * @brief Request transfer setup. @@ -295,7 +260,6 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @param[in] usbp pointer to the @p USBDriver object * @param[in] buf pointer to a buffer for the transaction data * @param[in] n number of bytes to be transferred - * @param[in] endcb transfer complete callback * * @api */ diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index c55251d9b..e1ba15de5 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -192,6 +192,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { } else { /* Transfer completed, invoking the callback, if defined.*/ + (usbp)->ep[ep]->transmitting = FALSE; if (epcp->in_cb) epcp->in_cb(usbp, ep); } @@ -218,6 +219,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { } else { /* Transfer completed, invoking the callback, if defined.*/ + (usbp)->ep[ep]->receiving = FALSE; if (epcp->out_cb) epcp->out_cb(usbp, ep); } @@ -394,120 +396,6 @@ void usb_lld_disable_endpoints(USBDriver *usbp) { } -/** - * @brief Returns the number of bytes readable from the receive packet - * buffer. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * @return The number of bytes that are effectively available. - * @retval 0 Data not yet available. - * - * @notapi - */ -size_t usb_lld_get_readable(USBDriver *usbp, usbep_t ep) { - - (void)usbp; - if ((STM32_USB->EPR[ep] & EPR_STAT_RX_MASK) != EPR_STAT_RX_NAK) - return 0; - return (size_t)(USB_GET_DESCRIPTOR(ep)->RXCOUNT & RXCOUNT_COUNT_MASK); -} - -/** - * @brief Endpoint read. - * @details The buffered packet is copied into the user buffer and then - * the endpoint is brought to the valid state in order to allow - * reception of more data. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * @param[out] buf buffer where to copy the endpoint data - * @param[in] n maximum number of bytes to copy - * @return The number of bytes that were effectively available. - * @retval 0 Data not yet available. - * - * @notapi - */ -size_t usb_lld_read(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - uint32_t *pmap; - stm32_usb_descriptor_t *udp; - size_t count; - - (void)usbp; - if ((STM32_USB->EPR[ep] & EPR_STAT_RX_MASK) != EPR_STAT_RX_NAK) - return 0; - - udp = USB_GET_DESCRIPTOR(ep); - pmap = USB_ADDR2PTR(udp->RXADDR); - count = udp->RXCOUNT & RXCOUNT_COUNT_MASK; - if (n > count) - n = count; - count = (n + 1) / 2; - while (count) { - *(uint16_t *)buf = (uint16_t)*pmap++; - buf += 2; - count--; - } - EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); - return n; -} -/** - * @brief Returns the number of bytes writeable to the transmit packet - * buffer. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * @return The number of bytes that can be written. - * @retval 0 Endpoint not ready for transmission. - * - * @iclass - */ -size_t usb_lld_get_writeable(USBDriver *usbp, usbep_t ep) { - - if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_NAK) - return 0; - return (size_t)usbp->ep[ep]->config->in_maxsize; -} - -/** - * @brief Endpoint write. - * @details The user data is copied in the packer memory and then - * the endpoint is brought to the valid state in order to allow - * transmission. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * @param[in] buf buffer where to copy the endpoint data - * @param[in] n maximum number of bytes to copy - * @return The number of bytes that were effectively written. - * @retval 0 Endpoint not ready for transmission. - * - * @notapi - */ -size_t usb_lld_write(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, - size_t n) { - uint32_t *pmap; - stm32_usb_descriptor_t *udp; - size_t count; - - (void)usbp; - if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_NAK) - return 0; - - udp = USB_GET_DESCRIPTOR(ep); - pmap = USB_ADDR2PTR(udp->TXADDR); - udp->TXCOUNT = n; - count = (n + 1) / 2; - while (count) { - *pmap++ = *(uint16_t *)buf; - buf += 2; - count--; - } - EPR_SET_STAT_TX(ep, EPR_STAT_TX_VALID); - return n; -} - /** * @brief Returns the status of an OUT endpoint. * diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 7947e22fc..d365521ee 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -310,11 +310,6 @@ extern "C" { void usb_lld_set_address(USBDriver *usbp); void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep); void usb_lld_disable_endpoints(USBDriver *usbp); - size_t usb_lld_get_readable(USBDriver *usbp, usbep_t ep); - size_t usb_lld_read(USBDriver *usbp, usbep_t ep, - uint8_t *buf, size_t n); - size_t usb_lld_write(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); void usb_lld_start_out(USBDriver *usbp, usbep_t ep, -- cgit v1.2.3 From 100573d2c30750a50c3dfd9f3e7a051dcc987724 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Feb 2011 13:51:08 +0000 Subject: Serial over USB changes, work in progress, the USB demo is not buildable. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2717 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/serial_usb.h | 18 +++++++++++------- os/hal/src/serial_usb.c | 26 +++++++++++++------------- testhal/STM32/USB_CDC/halconf.h | 2 +- testhal/STM32/USB_CDC/main.c | 40 ++++++++++------------------------------ 4 files changed, 35 insertions(+), 51 deletions(-) diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index b75f6fe59..9223c82a3 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -114,10 +114,14 @@ typedef struct { InputQueue iqueue; \ /* Output queue.*/ \ OutputQueue oqueue; \ - /* Input circular buffer.*/ \ - uint8_t ib[SERIAL_USB_BUFFERS_SIZE]; \ - /* Output circular buffer.*/ \ - uint8_t ob[SERIAL_USB_BUFFERS_SIZE]; \ + /* Input buffer 1.*/ \ + uint8_t ib1[SERIAL_USB_BUFFERS_SIZE]; \ + /* Input buffer 2.*/ \ + uint8_t ib2[SERIAL_USB_BUFFERS_SIZE]; \ + /* Output buffer 1.*/ \ + uint8_t ob1[SERIAL_USB_BUFFERS_SIZE]; \ + /* Output buffer 2.*/ \ + uint8_t ob2[SERIAL_USB_BUFFERS_SIZE]; \ /* End of the mandatory fields.*/ \ /* Current configuration data.*/ \ const SerialUSBConfig *config; @@ -164,9 +168,9 @@ extern "C" { void sduStart(SerialUSBDriver *sdup, const SerialUSBConfig *config); void sduStop(SerialUSBDriver *sdup); bool_t sduRequestsHook(USBDriver *usbp); - void sduDataRequest(USBDriver *usbp, usbep_t ep); - void sduDataAvailable(USBDriver *usbp, usbep_t ep); - void sduInterruptRequest(USBDriver *usbp, usbep_t ep); + void sduDataTransmitted(USBDriver *usbp, usbep_t ep); + void sduDataReceived(USBDriver *usbp, usbep_t ep); + void sduInterruptTransmitted(USBDriver *usbp, usbep_t ep); #ifdef __cplusplus } #endif diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 62a901162..60976eca2 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -206,7 +206,7 @@ void sduStart(SerialUSBDriver *sdup, const SerialUSBConfig *config) { "invalid state"); sdup->config = config; usbStart(config->usbp, &config->usb_config); - config->usbp->usb_param = sdup; + config->usbp->param = sdup; sdup->state = SDU_READY; chSysUnlock(); } @@ -245,17 +245,17 @@ void sduStop(SerialUSBDriver *sdup) { */ bool_t sduRequestsHook(USBDriver *usbp) { - if ((usbp->usb_setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { - switch (usbp->usb_setup[1]) { + if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { + switch (usbp->setup[1]) { case CDC_GET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL); + usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); return TRUE; case CDC_SET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL); + usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); return TRUE; case CDC_SET_CONTROL_LINE_STATE: /* Nothing to do, there are no control lines.*/ - usbSetupTransfer(usbp, NULL, 0, NULL); + usbSetupTransfer(usbp, NULL, 0); return TRUE; default: return FALSE; @@ -265,12 +265,12 @@ bool_t sduRequestsHook(USBDriver *usbp) { } /** - * @brief Default data request callback. + * @brief Default data transmitted callback. * @details The application must use this function as callback for the IN * data endpoint. */ -void sduDataRequest(USBDriver *usbp, usbep_t ep) { - SerialUSBDriver *sdup = usbp->usb_param; +void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { + SerialUSBDriver *sdup = usbp->param; size_t n; chSysLockFromIsr(); @@ -289,12 +289,12 @@ void sduDataRequest(USBDriver *usbp, usbep_t ep) { } /** - * @brief Default data available callback. + * @brief Default data received callback. * @details The application must use this function as callback for the OUT * data endpoint. */ -void sduDataAvailable(USBDriver *usbp, usbep_t ep) { - SerialUSBDriver *sdup = usbp->usb_param; +void sduDataReceived(USBDriver *usbp, usbep_t ep) { + SerialUSBDriver *sdup = usbp->param; chSysLockFromIsr(); /* Writes to the input queue can only happen when the queue has been @@ -317,7 +317,7 @@ void sduDataAvailable(USBDriver *usbp, usbep_t ep) { * @details The application must use this function as callback for the IN * interrupt endpoint. */ -void sduInterruptRequest(USBDriver *usbp, usbep_t ep) { +void sduInterruptTransmitted(USBDriver *usbp, usbep_t ep) { (void)usbp; (void)ep; diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 6700bcad5..0a957f0b9 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -93,7 +93,7 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 697740526..b55b24892 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -32,7 +32,7 @@ /* * USB driver structure. */ -//static SerialUSBDriver SDU1; +static SerialUSBDriver SDU1; /* * USB Device Descriptor. @@ -247,29 +247,11 @@ USBEndpointState ep2state; */ USBEndpointState ep3state; -void sduDataRequest(USBDriver *usbp, usbep_t ep) { - - (void)usbp; - (void)ep; -} - -void sduInterruptRequest(USBDriver *usbp, usbep_t ep) { - - (void)usbp; - (void)ep; -} - -void sduDataAvailable(USBDriver *usbp, usbep_t ep) { - - (void)usbp; - (void)ep; -} - /** * @brief EP1 initialization structure (IN only). */ static const USBEndpointConfig ep1config = { - sduDataRequest, + sduDataTransmitted, NULL, 0x0040, 0x0000, @@ -282,7 +264,7 @@ static const USBEndpointConfig ep1config = { * @brief EP2 initialization structure (IN only). */ static const USBEndpointConfig ep2config = { - sduInterruptRequest, + sduInterruptTransmitted, NULL, 0x0010, 0x0000, @@ -296,7 +278,7 @@ static const USBEndpointConfig ep2config = { */ static const USBEndpointConfig ep3config = { NULL, - sduDataAvailable, + sduDataReceived, 0x0000, 0x0040, EPR_EP_TYPE_BULK | EPR_STAT_TX_DIS | EPR_STAT_RX_VALID, @@ -335,7 +317,6 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { /* * Serial over USB driver configuration. */ -#if 0 static const SerialUSBConfig serusbcfg = { &USBD1, { @@ -348,8 +329,8 @@ static const SerialUSBConfig serusbcfg = { DATA_AVAILABLE_EP, INTERRUPT_REQUEST_EP }; -#endif +#if 0 #include "usb_cdc.h" static cdc_linecoding_t linecoding = { {0x00, 0x96, 0x00, 0x00}, /* 38400. */ @@ -375,6 +356,7 @@ bool_t sduRequestsHook(USBDriver *usbp) { } return FALSE; } +#endif USBConfig usbconfig = { usb_event, @@ -405,7 +387,6 @@ static msg_t Thread1(void *arg) { /* * USB CDC loopback thread. */ -#if 0 static WORKING_AREA(waThread2, 256); static msg_t Thread2(void *arg) { SerialUSBDriver *sdup = arg; @@ -422,7 +403,6 @@ static msg_t Thread2(void *arg) { } } } -#endif /* * Application entry point. @@ -442,10 +422,10 @@ int main(void) { /* * Activates the USB driver and then the USB bus pull-up on D+. */ - usbStart(&USBD1, &usbconfig); +// usbStart(&USBD1, &usbconfig); + sduObjectInit(&SDU1); + sduStart(&SDU1, &serusbcfg); palClearPad(GPIOC, GPIOC_USB_DISC); -// sduObjectInit(&SDU1); -// sduStart(&SDU1, &serusbcfg); /* * Activates the serial driver 2 using the driver default configuration. @@ -460,7 +440,7 @@ int main(void) { /* * Creates the USB CDC loopback thread. */ -// chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, &SDU1); + chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, &SDU1); /* * Normal main() thread activity, in this demo it does nothing except -- cgit v1.2.3 From 0847ae54f0d4f32f87dc47338a5a9903ce6bc3e0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Feb 2011 15:54:56 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2718 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/serial_usb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index 9223c82a3..03c075f62 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -53,8 +53,9 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -#if !HAL_USE_USB && !CH_USE_EVENTS -#error "Serial over USB Driver requires HAL_USE_USB and CH_USE_EVENTS" +#if !HAL_USE_USB && !CH_USE_QUEUES && !CH_USE_EVENTS +#error "Serial over USB Driver requires HAL_USE_USB, CH_USE_QUEUES, " + "CH_USE_EVENTS" #endif /*===========================================================================*/ -- cgit v1.2.3 From 9ab9d1b44b1dfc11094faf3da939d35061b53bed Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Feb 2011 06:29:27 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2719 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/serial_usb.h | 12 ++--- os/hal/platforms/STM32/usb_lld.c | 112 +++++++++++++++++++++++++++------------ os/hal/platforms/STM32/usb_lld.h | 27 ++++++++-- testhal/STM32/USB_CDC/main.c | 9 ++-- 4 files changed, 112 insertions(+), 48 deletions(-) diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index 03c075f62..3cfa1441b 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -115,14 +115,10 @@ typedef struct { InputQueue iqueue; \ /* Output queue.*/ \ OutputQueue oqueue; \ - /* Input buffer 1.*/ \ - uint8_t ib1[SERIAL_USB_BUFFERS_SIZE]; \ - /* Input buffer 2.*/ \ - uint8_t ib2[SERIAL_USB_BUFFERS_SIZE]; \ - /* Output buffer 1.*/ \ - uint8_t ob1[SERIAL_USB_BUFFERS_SIZE]; \ - /* Output buffer 2.*/ \ - uint8_t ob2[SERIAL_USB_BUFFERS_SIZE]; \ + /* Input buffer.*/ \ + uint8_t ib[SERIAL_USB_BUFFERS_SIZE]; \ + /* Output buffer.*/ \ + uint8_t ob[SERIAL_USB_BUFFERS_SIZE]; \ /* End of the mandatory fields.*/ \ /* Current configuration data.*/ \ const SerialUSBConfig *config; diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index e1ba15de5..a95baf45f 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -58,11 +58,12 @@ static USBEndpointState ep0state; * @brief EP0 initialization structure. */ static const USBEndpointConfig ep0config = { + EP_TYPE_CTRL, _usb_ep0in, _usb_ep0out, 0x40, 0x40, - EPR_EP_TYPE_CONTROL | EPR_STAT_TX_NAK | EPR_STAT_RX_VALID, + 0, 0x40, 0x80 }; @@ -178,50 +179,63 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { if (epr & EPR_CTR_TX) { /* IN endpoint, transmission.*/ EPR_CLEAR_CTR_TX(ep); - n = USB_GET_DESCRIPTOR(ep)->TXCOUNT; - usbp->ep[ep]->txbuf += n; - usbp->ep[ep]->txcnt += n; - usbp->ep[ep]->txsize -= n; - if (usbp->ep[ep]->txsize > 0) { - /* Transfer not completed, there are more packets to send.*/ - if (usbp->ep[ep]->txsize > epcp->in_maxsize) - n = epcp->in_maxsize; - else - n = usbp->ep[ep]->txsize; - write_packet(ep, usbp->ep[ep]->txbuf, n); + if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { + /* Packet mode, just invokes the callback.*/ + (usbp)->ep[ep]->transmitting = FALSE; + epcp->in_cb(usbp, ep); } else { - /* Transfer completed, invoking the callback, if defined.*/ - (usbp)->ep[ep]->transmitting = FALSE; - if (epcp->in_cb) + /* Transaction mode.*/ + n = USB_GET_DESCRIPTOR(ep)->TXCOUNT; + usbp->ep[ep]->txbuf += n; + usbp->ep[ep]->txcnt += n; + usbp->ep[ep]->txsize -= n; + if (usbp->ep[ep]->txsize > 0) { + /* Transfer not completed, there are more packets to send.*/ + if (usbp->ep[ep]->txsize > epcp->in_maxsize) + n = epcp->in_maxsize; + else + n = usbp->ep[ep]->txsize; + write_packet(ep, usbp->ep[ep]->txbuf, n); + } + else { + /* Transfer completed, invokes the callback.*/ + (usbp)->ep[ep]->transmitting = FALSE; epcp->in_cb(usbp, ep); + } } } if (epr & EPR_CTR_RX) { EPR_CLEAR_CTR_RX(ep); /* OUT endpoint, receive.*/ - if ((epr & EPR_SETUP) && (ep == 0)) { - /* Special case, setup packet for EP0, enforcing a reset of the - EP0 state machine for robustness.*/ - usbp->ep0state = USB_EP0_WAITING_SETUP; - read_packet(0, usbp->setup, 8); + if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { + /* Packet mode, just invokes the callback.*/ + (usbp)->ep[ep]->receiving = FALSE; epcp->out_cb(usbp, ep); } else { - n = read_packet(ep, usbp->ep[ep]->rxbuf, usbp->ep[ep]->rxsize); - usbp->ep[ep]->rxbuf += n; - usbp->ep[ep]->rxcnt += n; - usbp->ep[ep]->rxsize -= n; - usbp->ep[ep]->rxpkts -= 1; - if (usbp->ep[ep]->rxpkts > 0) { - /* Transfer not completed, there are more packets to receive.*/ - EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); + if ((epr & EPR_SETUP) && (ep == 0)) { + /* Special case, setup packet for EP0, enforcing a reset of the + EP0 state machine for robustness.*/ + usbp->ep0state = USB_EP0_WAITING_SETUP; + read_packet(0, usbp->setup, 8); + epcp->out_cb(usbp, ep); } else { - /* Transfer completed, invoking the callback, if defined.*/ - (usbp)->ep[ep]->receiving = FALSE; - if (epcp->out_cb) + n = read_packet(ep, usbp->ep[ep]->rxbuf, usbp->ep[ep]->rxsize); + usbp->ep[ep]->rxbuf += n; + usbp->ep[ep]->rxcnt += n; + usbp->ep[ep]->rxsize -= n; + usbp->ep[ep]->rxpkts -= 1; + if (usbp->ep[ep]->rxpkts > 0) { + /* Transfer not completed, there are more packets to receive.*/ + EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); + } + else { + /* Transfer completed, invokes the callback.*/ + (usbp)->ep[ep]->receiving = FALSE; epcp->out_cb(usbp, ep); + } } } } @@ -357,13 +371,43 @@ void usb_lld_set_address(USBDriver *usbp) { * @notapi */ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { - uint16_t nblocks; + uint16_t nblocks, epr; stm32_usb_descriptor_t *dp; const USBEndpointConfig *epcp = usbp->ep[ep]->config; + /* Setting the endpoint type.*/ + switch (epcp->ep_type) { + case EP_TYPE_ISOC: + epr = EPR_EP_TYPE_ISO; + break; + case EP_TYPE_BULK: + epr = EPR_EP_TYPE_BULK; + break; + case EP_TYPE_INTR: + epr = EPR_EP_TYPE_INTERRUPT; + break; + default: + epr = EPR_EP_TYPE_CONTROL; + } + + /* IN endpoint settings, always in NAK mode initially.*/ + if (epcp->in_cb) + epr |= EPR_STAT_TX_NAK; + + /* OUT endpoint settings. If the endpoint is in packet mode then it must + start ready to accept data else it must start in NAK mode.*/ + if (epcp->out_cb) { + if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { + usbp->ep[ep]->receiving = TRUE; + epr |= EPR_STAT_RX_VALID; + } + else + epr |= EPR_STAT_RX_NAK; + } + /* EPxR register setup.*/ - EPR_SET(ep, epcp->epr | ep); - EPR_TOGGLE(ep, epcp->epr); + EPR_SET(ep, epr | ep); + EPR_TOGGLE(ep, epr); /* Endpoint size and address initialization.*/ if (epcp->out_maxsize > 62) diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index d365521ee..d1e3169c2 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -46,6 +46,16 @@ */ #define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS +/** + * @brief Enables the packet mode for an IN endpoint. + */ +#define USB_EP_FLAGS_IN_PACKET_MODE 1 + +/** + * @brief Enables the packet mode for an OUT endpoint. + */ +#define USB_EP_FLAGS_OUT_PACKET_MODE 2 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -98,28 +108,39 @@ * @note Platform specific restrictions may apply to endpoints. */ typedef struct { + /** + * @brief Type of the endpoint. + */ + usbeptype_t ep_type; /** * @brief IN endpoint notification callback. + * @details This field must be set to @p NULL if the IN endpoint is not + * used. */ usbepcallback_t in_cb; /** * @brief OUT endpoint notification callback. + * @details This field must be set to @p NULL if the OUT endpoint is not + * used. */ usbepcallback_t out_cb; /** * @brief IN endpoint maximum packet size. + * @details This field must be set to zero if the IN endpoint is not + * used. */ uint16_t in_maxsize; /** * @brief OUT endpoint maximum packet size. + * @details This field must be set to zero if the OUT endpoint is not + * used. */ uint16_t out_maxsize; /* End of the mandatory fields.*/ /** - * @brief EPxR register initialization value. - * @note Do not specify the EA field, leave it to zero. + * @bief Endpoint mode flags. */ - uint16_t epr; + uint16_t flags; /** * @brief Endpoint IN buffer address as offset in the PMA. */ diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index b55b24892..04fd4d615 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -251,11 +251,12 @@ USBEndpointState ep3state; * @brief EP1 initialization structure (IN only). */ static const USBEndpointConfig ep1config = { + EP_TYPE_BULK, sduDataTransmitted, NULL, 0x0040, 0x0000, - EPR_EP_TYPE_BULK | EPR_STAT_TX_NAK | EPR_STAT_RX_DIS, + USB_EP_FLAGS_IN_PACKET_MODE, 0x00C0, 0x0000 }; @@ -264,11 +265,12 @@ static const USBEndpointConfig ep1config = { * @brief EP2 initialization structure (IN only). */ static const USBEndpointConfig ep2config = { + EP_TYPE_INTR, sduInterruptTransmitted, NULL, 0x0010, 0x0000, - EPR_EP_TYPE_INTERRUPT | EPR_STAT_TX_NAK | EPR_STAT_RX_DIS, + 0, 0x0100, 0x0000 }; @@ -277,11 +279,12 @@ static const USBEndpointConfig ep2config = { * @brief EP3 initialization structure (OUT only). */ static const USBEndpointConfig ep3config = { + EP_TYPE_BULK, NULL, sduDataReceived, 0x0000, 0x0040, - EPR_EP_TYPE_BULK | EPR_STAT_TX_DIS | EPR_STAT_RX_VALID, + USB_EP_FLAGS_OUT_PACKET_MODE, 0x0000, 0x0110 }; -- cgit v1.2.3 From 77934792d53efe99678286bab123c42c546478a7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 9 Feb 2011 16:36:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2722 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/GENERIC_SPC563/board.h | 2 +- os/hal/include/usb.h | 13 +++++-- os/hal/platforms/SPC56x/hal_lld.h | 4 +-- os/hal/platforms/STM32/usb_lld.c | 71 ++++++++++++++++++++++++++++++++++++ os/hal/platforms/STM32/usb_lld.h | 4 +++ os/hal/src/serial_usb.c | 21 +++++------ os/hal/src/usb.c | 76 +++++++++++++++++++++++++++++++++++---- 7 files changed, 169 insertions(+), 22 deletions(-) diff --git a/boards/GENERIC_SPC563/board.h b/boards/GENERIC_SPC563/board.h index 53c1140ce..0c840175f 100644 --- a/boards/GENERIC_SPC563/board.h +++ b/boards/GENERIC_SPC563/board.h @@ -34,7 +34,7 @@ * Board frequencies. */ #if !defined(EXTCLK) -#define EXTCLK 8000000 +#define EXTCLK 12000000 #endif /* diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index 26c701f52..c6c5d57cf 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -76,6 +76,11 @@ #define USB_EARLY_SET_ADDRESS 0 #define USB_LATE_SET_ADDRESS 1 +/** + * @brief Returned by some functions to report a busy endpoint. + */ +#define USB_ENDPOINT_BUSY ((size_t)0xFFFFFFFF) + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -233,7 +238,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @param[in] ep endpoint number * @return The operation status. * @retval FALSE Endpoint ready. - * @retval TRUE Endpoint busy. + * @retval TRUE Endpoint transmitting. * * @iclass */ @@ -246,7 +251,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @param[in] ep endpoint number * @return The operation status. * @retval FALSE Endpoint ready. - * @retval TRUE Endpoint busy. + * @retval TRUE Endpoint receiving. * * @iclass */ @@ -282,6 +287,10 @@ extern "C" { void usbInitEndpointI(USBDriver *usbp, usbep_t ep, USBEndpointState *epp, const USBEndpointConfig *epcp); void usbDisableEndpointsI(USBDriver *usbp); + size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n); + size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n); bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n); bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep, diff --git a/os/hal/platforms/SPC56x/hal_lld.h b/os/hal/platforms/SPC56x/hal_lld.h index c61089a38..13dc9a267 100644 --- a/os/hal/platforms/SPC56x/hal_lld.h +++ b/os/hal/platforms/SPC56x/hal_lld.h @@ -112,7 +112,7 @@ * @note The effective divider factor is this value plus one. */ #if !defined(SPC563_CLK_PREDIV) || defined(__DOXYGEN__) -#define SPC563_CLK_PREDIV 0 +#define SPC563_CLK_PREDIV 2 #endif /** @@ -120,7 +120,7 @@ * @note Must be in range 32...96. */ #if !defined(SPC563_CLK_MFD) || defined(__DOXYGEN__) -#define SPC563_CLK_MFD 40 +#define SPC563_CLK_MFD 80 #endif /** diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index a95baf45f..62e7caa82 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -482,6 +482,77 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { } } +/** + * @brief Reads a packet from the dedicated packet buffer. + * @pre In order to use this function he endpoint must have been + * initialized in packet mode. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * @param[in] n maximum number of bytes to copy. This value must + * not exceed the maximum packet size for this endpoint. + * @return The received packet size regardless the specified + * @p n parameter. + * @retval 0 Zero size packet received. + * + * @notapi + */ +size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n) { + uint32_t *pmap; + stm32_usb_descriptor_t *udp; + size_t count; + + (void)usbp; + udp = USB_GET_DESCRIPTOR(ep); + pmap = USB_ADDR2PTR(udp->RXADDR); + count = udp->RXCOUNT & RXCOUNT_COUNT_MASK; + if (n > count) + n = count; + n = (n + 1) / 2; + while (n > 0) { + *(uint16_t *)buf = (uint16_t)*pmap++; + buf += 2; + n--; + } + EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); + return count; +} + +/** + * @brief Writes a packet to the dedicated packet buffer. + * @pre In order to use this function he endpoint must have been + * initialized in packet mode. + * @post The endpoint is ready to transmit the packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the packet data + * @param[in] n maximum number of bytes to copy. This value must + * not exceed the maximum packet size for this endpoint. + * + * @notapi + */ +void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n) { + uint32_t *pmap; + stm32_usb_descriptor_t *udp; + + (void)usbp; + udp = USB_GET_DESCRIPTOR(ep); + pmap = USB_ADDR2PTR(udp->TXADDR); + udp->TXCOUNT = n; + n = (n + 1) / 2; + while (n > 0) { + *pmap++ = *(uint16_t *)buf; + buf += 2; + n--; + } + EPR_SET_STAT_TX(ep, EPR_STAT_TX_VALID); +} + /** * @brief Starts a receive operation on an OUT endpoint. * diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index d1e3169c2..6d131796e 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -333,6 +333,10 @@ extern "C" { void usb_lld_disable_endpoints(USBDriver *usbp); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); + size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n); + void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n); void usb_lld_start_out(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n); void usb_lld_start_in(USBDriver *usbp, usbep_t ep, diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 60976eca2..29aec2650 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -119,9 +119,9 @@ static void inotify(GenericQueue *qp) { emptied, then a whole packet is loaded in the queue.*/ if (chIQIsEmptyI(&sdup->iqueue)) { - n = usbReadI(sdup->config->usbp, sdup->config->data_available_ep, - sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); - if (n > 0) { + n = usbReadPacketI(sdup->config->usbp, sdup->config->data_available_ep, + sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); + if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; chSemSetCounterI(&sdup->iqueue.q_sem, n); } @@ -137,9 +137,9 @@ static void onotify(GenericQueue *qp) { /* If there is any data in the output queue then it is sent within a single packet and the queue is emptied.*/ - n = usbWriteI(sdup->config->usbp, sdup->config->data_request_ep, - sdup->oqueue.q_buffer, chOQGetFullI(&sdup->oqueue)); - if (n > 0) { + n = usbWritePacketI(sdup->config->usbp, sdup->config->data_request_ep, + sdup->oqueue.q_buffer, chOQGetFullI(&sdup->oqueue)); + if (n != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); } @@ -278,8 +278,8 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { single packet and the queue is emptied.*/ n = chOQGetFullI(&sdup->oqueue); if (n > 0) { - n = usbWriteI(usbp, ep, sdup->oqueue.q_buffer, n); - if (n > 0) { + n = usbWritePacketI(usbp, ep, sdup->oqueue.q_buffer, n); + if (n != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); @@ -302,8 +302,9 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) { if (chIQIsEmptyI(&sdup->iqueue)) { size_t n; - n = usbReadI(usbp, ep, sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); - if (n > 0) { + n = usbReadPacketI(usbp, ep, sdup->iqueue.q_buffer, + SERIAL_USB_BUFFERS_SIZE); + if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; chSemSetCounterI(&sdup->iqueue.q_sem, n); chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index d0db0ed5c..afec3c645 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -337,16 +337,74 @@ void usbDisableEndpointsI(USBDriver *usbp) { usb_lld_disable_endpoints(usbp); } +/** + * @brief Reads a packet from the dedicated packet buffer. + * @pre In order to use this function he endpoint must have been + * initialized in packet mode. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * @param[in] n maximum number of bytes to copy. This value must + * not exceed the maximum packet size for this endpoint. + * @return The received packet size regardless the specified + * @p n parameter. + * @retval USB_ENDPOINT_BUSY Endpoint busy receiving. + * @retval 0 Zero size packet received. + * + * @iclass + */ +size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n) { + + if (usbp->ep[ep]->receiving) + return USB_ENDPOINT_BUSY; + + return usb_lld_read_packet(usbp, ep, buf, n);; +} + +/** + * @brief Writes a packet to the dedicated packet buffer. + * @pre In order to use this function he endpoint must have been + * initialized in packet mode. + * @post The endpoint is ready to transmit the packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the packet data + * @param[in] n maximum number of bytes to copy. This value must + * not exceed the maximum packet size for this endpoint. + * @return The operation status. + * @retval USB_ENDPOINT_BUSY Endpoint busy transmitting. + * @retval 0 Operation complete. + * + * @iclass + */ +size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n) { + + if (usbp->ep[ep]->transmitting) + return USB_ENDPOINT_BUSY; + + usb_lld_write_packet(usbp, ep, buf, n); + return 0; +} + /** * @brief Starts a receive operation on an OUT endpoint. + * @pre In order to use this function he endpoint must have been + * initialized in transaction mode. + * @post The endpoint callback is invoked when the transfer has been + * completed. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number - * @param[out] buf buffer where to copy the endpoint data - * @param[in] n maximum number of bytes to copy in the buffer + * @param[out] buf buffer where to copy the received data + * @param[in] n maximum number of bytes to copy * @return The operation status. - * @retval FALSE Receive operation started. - * @retval TRUE Endpoint already receiving. + * @retval FALSE Operation complete. + * @retval TRUE Endpoint busy receiving. * * @iclass */ @@ -362,14 +420,18 @@ bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, /** * @brief Starts a transmit operation on an IN endpoint. + * @pre In order to use this function he endpoint must have been + * initialized in transaction mode. + * @post The endpoint callback is invoked when the transfer has been + * completed. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number - * @param[in] buf buffer where to fetch the endpoint data + * @param[in] buf buffer where to fetch the data to be transmitted * @param[in] n maximum number of bytes to copy * @return The operation status. - * @retval FALSE Transmit operation started. - * @retval TRUE Endpoint already transmitting. + * @retval FALSE Operation complete. + * @retval TRUE Endpoint busy transmitting. * * @iclass */ -- cgit v1.2.3 From 3c6e54a52eff84bebce23f3d933c1de425a7b428 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 9 Feb 2011 19:56:01 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2724 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/usb_lld.c | 4 ++-- testhal/STM32/USB_CDC/main.c | 36 ------------------------------------ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index 62e7caa82..fa78879c6 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -208,7 +208,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { if (epr & EPR_CTR_RX) { EPR_CLEAR_CTR_RX(ep); /* OUT endpoint, receive.*/ - if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { + if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) { /* Packet mode, just invokes the callback.*/ (usbp)->ep[ep]->receiving = FALSE; epcp->out_cb(usbp, ep); @@ -397,7 +397,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { /* OUT endpoint settings. If the endpoint is in packet mode then it must start ready to accept data else it must start in NAK mode.*/ if (epcp->out_cb) { - if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { + if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) { usbp->ep[ep]->receiving = TRUE; epr |= EPR_STAT_RX_VALID; } diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 04fd4d615..0c2a3ac9d 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -333,41 +333,6 @@ static const SerialUSBConfig serusbcfg = { INTERRUPT_REQUEST_EP }; -#if 0 -#include "usb_cdc.h" -static cdc_linecoding_t linecoding = { - {0x00, 0x96, 0x00, 0x00}, /* 38400. */ - LC_STOP_1, LC_PARITY_NONE, 8 -}; -bool_t sduRequestsHook(USBDriver *usbp) { - - if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { - switch (usbp->setup[1]) { - case CDC_GET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); - return TRUE; - case CDC_SET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); - return TRUE; - case CDC_SET_CONTROL_LINE_STATE: - /* Nothing to do, there are no control lines.*/ - usbSetupTransfer(usbp, NULL, 0); - return TRUE; - default: - return FALSE; - } - } - return FALSE; -} -#endif - -USBConfig usbconfig = { - usb_event, - get_descriptor, - sduRequestsHook, - NULL -}; - /*===========================================================================*/ /* Generic code. */ /*===========================================================================*/ @@ -425,7 +390,6 @@ int main(void) { /* * Activates the USB driver and then the USB bus pull-up on D+. */ -// usbStart(&USBD1, &usbconfig); sduObjectInit(&SDU1); sduStart(&SDU1, &serusbcfg); palClearPad(GPIOC, GPIOC_USB_DISC); -- cgit v1.2.3 From 400bb2ae040d1b78f53bf7eb08f68c8b9d8c56c2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 9 Feb 2011 20:41:39 +0000 Subject: USB CDC demo working. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2725 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index afec3c645..08fa52a3e 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -361,6 +361,7 @@ size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, if (usbp->ep[ep]->receiving) return USB_ENDPOINT_BUSY; + usbp->ep[ep]->receiving = TRUE; return usb_lld_read_packet(usbp, ep, buf, n);; } @@ -387,6 +388,7 @@ size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, if (usbp->ep[ep]->transmitting) return USB_ENDPOINT_BUSY; + usbp->ep[ep]->transmitting = TRUE; usb_lld_write_packet(usbp, ep, buf, n); return 0; } -- cgit v1.2.3 From bbc2b91e9c2b438c97a2412b862f58a914d72394 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 9 Feb 2011 20:51:32 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2726 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/serial_usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 29aec2650..430218edb 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -124,6 +124,7 @@ static void inotify(GenericQueue *qp) { if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; chSemSetCounterI(&sdup->iqueue.q_sem, n); + chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); } } } @@ -142,6 +143,7 @@ static void onotify(GenericQueue *qp) { if (n != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); + chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); } } -- cgit v1.2.3 From 2f003bd7214c54560500b281661281a5c6903cee Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 10 Feb 2011 15:47:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2728 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/serial_usb.dox | 39 +++++++++++++++++++++ os/hal/dox/usb.dox | 86 +++++++++++++++++++++++++++++++++++++++++++++++ os/hal/include/usb_cdc.h | 2 +- readme.txt | 5 ++- todo.txt | 79 +++++++------------------------------------ 5 files changed, 141 insertions(+), 70 deletions(-) create mode 100644 os/hal/dox/serial_usb.dox create mode 100644 os/hal/dox/usb.dox diff --git a/os/hal/dox/serial_usb.dox b/os/hal/dox/serial_usb.dox new file mode 100644 index 000000000..599ee3c16 --- /dev/null +++ b/os/hal/dox/serial_usb.dox @@ -0,0 +1,39 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @defgroup SERIAL_USB Serial over USB Driver + * @brief Serial over USB Driver. + * @details This module implements an USB Communication Device Class + * (CDC) as a normal serial communication port accessible from + * the device application. + * @pre In order to use the USB over Serial driver the + * @p HAL_USE_SERIAL_USB option must be enabled in @p halconf.h. + * + * @section usb_serial_1 Driver State Machine + * The driver implements a state machine internally, not all the driver + * functionalities can be used in any moment, any transition not explicitly + * shown in the following diagram has to be considered an error and shall + * be captured by an assertion (if enabled). + * @if LATEX_PDF + * @else + * @endif + * + * @ingroup IO + */ diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox new file mode 100644 index 000000000..1f843efae --- /dev/null +++ b/os/hal/dox/usb.dox @@ -0,0 +1,86 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @defgroup USB USB Driver + * @brief Generic USB Driver. + * @details This module implements a generic USB driver. + * @pre In order to use the USB driver the @p HAL_USE_USB option + * must be enabled in @p halconf.h. + * + * @section usb_1 Driver State Machine + * The driver implements a state machine internally, not all the driver + * functionalities can be used in any moment, any transition not explicitly + * shown in the following diagram has to be considered an error and shall + * be captured by an assertion (if enabled). + * @if LATEX_PDF + * @else + * @endif + * + * @section usb_2 USB Operations + * The USB driver is quite complex and USB is complex in itself, it is + * recommended to study the USB specification before trying to use the + * driver. + * + * @subsection usb_2_1 USB Implementation + * The USB driver abstracts the inner details of the underlying USB hardware. + * The driver works asynchronously and communicates with the application + * using callbacks. The application is responsible of the descriptors and + * strings required by the USB device class to be implemented and of the + * handling of the specific messages sent over the endpoint zero. Standard + * messages are handled internally to the driver. The application can use + * hooks in order to handle custom messages or override the handling of the + * default handling of standard messages. + * + * @subsection usb_2_2 USB Endpoints + * USB endpoints are the objects that the application uses to exchange + * data with the host. There are two kind of endpoints: + * - IN endpoints are used by the application to transmit data to + * the host. + * - OUT endpoints are used by the application to receive data from + * the host. + * . + * In ChibiOS/RT the endpoints can be configured in two distinct ways: + * - Packet Mode. In this mode the driver invokes a callback each + * time a packet has been received or transmitted. This mode is especially + * suited for those applications handling continuous streams of data. + * - Transaction Mode. In this mode the driver invokes a callback + * only after a large, potentially multi-packet, transfer has been + * completed, a callback is invoked only at the end of the transfer. + * . + * . + * @subsection usb_2_3 USB Callbacks + * The USB driver uses callbacks in order to interact with the application. + * There are several kind of callbacks to be handled: + * - Driver-wide events callback. As example errors, suspend event, reset + * event etc. + * - Messages hook callback. This hook allows the application to implement + * handling of custom messages or to override the default handling of + * standard messages. + * - Descriptor requested callback. When the driver endpoint zero handler + * needs to serve a descriptor to the host it queries the application + * using this callback. + * - Start of Frame callback. This callback is invoked each time a SOF + * packet is received. + * - Endpoint callbacks. Each endpoint informs the application about I/O + * conditions using those callbacks. + * . + * + * @ingroup IO + */ diff --git a/os/hal/include/usb_cdc.h b/os/hal/include/usb_cdc.h index c1d3da3e7..39df4ccf3 100644 --- a/os/hal/include/usb_cdc.h +++ b/os/hal/include/usb_cdc.h @@ -17,7 +17,7 @@ along with this program. If not, see . */ -/** +/*-* * @file usb_cdc.h * @brief USB Communication Device Class support header. * diff --git a/readme.txt b/readme.txt index 5ce5777ad..b61e1d79f 100644 --- a/readme.txt +++ b/readme.txt @@ -70,13 +70,12 @@ *** 2.3.0 *** - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). -- NEW: Added experimental generic USB driver, it will certainly change in next +- NEW: Added experimental generic USB driver, it will evolve in next releases. - NEW: Added an experimental USB driver implementation for STM32. - NEW: Added experimental "serial over USB" driver, it implements a Communication Device Class exposing it as a normal serial driver to - applications, it will certainly change in next - releases. + applications, probably it will evolve in next releases. - NEW: Added USB CDC loopback test application. - NEW: Implemented new event IO_TRANSMISSION_END in the generic serial driver. This event marks the physical transmission end of a data stream. diff --git a/todo.txt b/todo.txt index 259b9f23f..7c92ddac3 100644 --- a/todo.txt +++ b/todo.txt @@ -5,78 +5,25 @@ X = In progress, some work done. ? = Not sure if worth the effort or useful at all. N = Decided against. -Within 2.1.x -* Binary Semaphores on top of Counting Semaphores. -* Direct unbuffered UART driver. - Requirements: low level, callbacks, DMA capable, state machines buildable - on top, support data words greater than 8 bits, callback for - "last byte transmitted (RS485)", simple implementation, - verifiable. -* Rework STM32 drivers to use friendly IRQ names and centralized DMA macros. -* I-class functions for the ADC/PWM drivers. -* All the device driver structures must have a fields extension macro and - initializer hook. -* All the device driver callbacks must have the driver pointer as first - parameter. -* Change the SPI driver to be able to work asynchronously using callbacks, - keep the synchronous APIs available as option. -* Add an optional spiPolledExchange() API to the SPI driver model. -* Update the STM32 SPI driver to the new model. -* Make the ADC driver have the same synchronous/asynchronous API of the - new SPI driver model. -* General HAL improvements. -* Update the AT91SAM7 SPI driver (DMA and/or ISR). - * Verify the FatFs demo on both the AT91SAM7X and AT91SAM7S. -* Update the LPC214x SPI driver (ISR). - * Verify the LPC214x FatFs demo. -* Write a new SPI driver for LPC1xxx (ISR)(it should be very close to the - LPC214x one). -N Evaluate if to add a synchronous API to the UART driver, eventually do so. -* Global documentation reorganization in order to allow both separate documents - and the usual blob document. -* PDF generation from the documentation system (only separate documents, not - the blob). -* Automatic compilation and upload of the various documents on the web site - (doxygen + rsync). -* New STM8S/A SPI driver. -* Reorganization of the STM32 family port-level support. -* Remove preprocessor directives from the assembler files and restore the - RIDE7 build files in the STM32 demo. -* Move dynamic APIs into a separate source file. -* Improved support in the STM32 HAL support for multiple sub-families. Do - not check for the family in the various drivers but simply check for - switch macros like STM32_HAS_USART3, STM32_HAS_SPI3. This what the - drivers will not need changes when adding new sub-families. -* STM8L official HAL support, it will have to be separated from the STM8S/STM8A - HAL because it is very different. - * Shared ISR management. - * STM8L-Discovery demo. -* Add the STM32F100 (Value Line) sub-family to the official STM32 HAL support. - * STM32VL-Discovery demo. -* Remove the PAL default configuration from the various hal_lld.c and move - them into board.c files, this will remove an ugly dependency. -* Realign the STM8 port to the new STM8L one as options, naming conventions - and general solutions. -* Support for more compilers (IAR, Keil, ARMCMx only initially). -X Support for not just Makefiles (Ride7, Crossworks etc). -* IAR port for Cortex-Mx, add demos for all the supported families. -* Keil port for Cortex-Mx, add demos for all the supported families. -* Change the serial drivers to have a single event source instead of three. - Add Rx and Tx to the existing flags mechanism. Move up the flags handling in - the superclass. -X Except for the above, bug fixing only until the 2.2.0 release. - Within 2.3.x (hopefully) -- Resist doing more changes and optimizations to the kernel. -? Make thread functions return void. +- Improvements to the message passing mechanism in order to allow "delayed, + out of order, responses". +- Add a switch to enable/disable the priority inheritance algorithm in mutexes. - Introduce a "THREAD" function prefix in order to hide compiler-specific optimizations for thread functions. -- Add a "transmission end" event to the serial device driver model. +? Make thread functions return void. +- Introduce compiler-info macros to the port layer, improve the test reports + with the info. +* Add a "transmission end" event to the serial device driver model. + X Implement the "transmission end" serial driver event on those platforms + supporting the feature. X Add an USB abstract device driver class. X USB driver implementation for STM32F103/STM32F102. +- USB driver implementation for STM32F105/STM32F107. X Add a Serial over USB generic device driver implementing a USB Communication Device Class and offering a Serial-like interface to the applications. -- Add a switch to enable/disable the priority inheritance algorithm in mutexes. +- Implement USB Mass Storage Class support and demo using the MMC_SPI driver + as back-end. X File System infrastructure. - Official FatFs wrapper using the new infrastructure, dedicated test suite. X Transactional flash file system implementation. @@ -89,7 +36,7 @@ X New device driver models: Clock, Systick, RTC, WDG, DAC, Power Monitor. - Device drivers for STM8/STM8L (ADC, PWM, bring them on par with STM32). - Batch testing of the ARM7/ARMCMx port using OpenOCD, with reports. - Debug-related features and tools. -- Add a *very simple* ADC API for single one shot sampling (implement it as +? Add a *very simple* ADC API for single one shot sampling (implement it as an injected conversion on the STM32). - Update C++ wrapper (Heap, Pools, Mailboxes and any new feature). - Threads Pools manager in the library. -- cgit v1.2.3 From d749ecc10a40b21a22b3e7ab14ff9861fabe4685 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Feb 2011 11:54:15 +0000 Subject: RAM optimization to the USB driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2732 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/usb.h | 4 ++-- os/hal/platforms/STM32/usb_lld.c | 10 +++++----- os/hal/platforms/STM32/usb_lld.h | 17 ++++++++--------- os/hal/src/serial_usb.c | 4 ++-- os/hal/src/usb.c | 32 +++++++++++++++++++------------- 5 files changed, 36 insertions(+), 31 deletions(-) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index c6c5d57cf..7f46e46f5 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -242,7 +242,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * * @iclass */ -#define usbGetTransmitStatusI(usbp, ep) (usbp)->ep[ep]->transmitting +#define usbGetTransmitStatusI(usbp, ep) ((usbp)->transmitting & (1 << (ep))) /** * @brief Returns the status of an OUT endpoint. @@ -255,7 +255,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * * @iclass */ -#define usbGetReceiveStatusI(usbp, ep) (usbp)->ep[ep]->receiving +#define usbGetReceiveStatusI(usbp, ep) ((usbp)->receiving & (1 << (ep))) /** * @brief Request transfer setup. diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index fa78879c6..b0d356bcb 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -181,7 +181,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { EPR_CLEAR_CTR_TX(ep); if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { /* Packet mode, just invokes the callback.*/ - (usbp)->ep[ep]->transmitting = FALSE; + (usbp)->transmitting &= ~((uint16_t)(1 << ep)); epcp->in_cb(usbp, ep); } else { @@ -200,7 +200,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { } else { /* Transfer completed, invokes the callback.*/ - (usbp)->ep[ep]->transmitting = FALSE; + (usbp)->transmitting &= ~((uint16_t)(1 << ep)); epcp->in_cb(usbp, ep); } } @@ -210,7 +210,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { /* OUT endpoint, receive.*/ if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) { /* Packet mode, just invokes the callback.*/ - (usbp)->ep[ep]->receiving = FALSE; + (usbp)->receiving &= ~((uint16_t)(1 << ep)); epcp->out_cb(usbp, ep); } else { @@ -233,7 +233,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { } else { /* Transfer completed, invokes the callback.*/ - (usbp)->ep[ep]->receiving = FALSE; + (usbp)->receiving &= ~((uint16_t)(1 << ep)); epcp->out_cb(usbp, ep); } } @@ -398,7 +398,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { start ready to accept data else it must start in NAK mode.*/ if (epcp->out_cb) { if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) { - usbp->ep[ep]->receiving = TRUE; + usbp->receiving |= ((uint16_t)(1 << ep)); epr |= EPR_STAT_RX_VALID; } else diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 6d131796e..4eebda951 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -160,15 +160,6 @@ typedef struct { * @brief Configuration associated to the endpoint. */ const USBEndpointConfig *config; - /** - * @brief @p TRUE if transmitting else @p FALSE. - */ - uint8_t transmitting; - /** - * @brief @p TRUE if receiving else @p FALSE. - */ - uint8_t receiving; - /* End of the mandatory fields.*/ /** * @brief Number of packets to receive. */ @@ -243,6 +234,14 @@ struct USBDriver { * application-defined handler to the USB driver. */ void *param; + /** + * @brief Bit map of the transmitting IN endpoints. + */ + uint16_t transmitting; + /** + * @brief Bit map of the receiving OUT endpoints. + */ + uint16_t receiving; /** * @brief Active endpoints configurations. */ diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 430218edb..b17669c04 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -124,7 +124,7 @@ static void inotify(GenericQueue *qp) { if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; chSemSetCounterI(&sdup->iqueue.q_sem, n); - chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); +// chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); } } } @@ -143,7 +143,7 @@ static void onotify(GenericQueue *qp) { if (n != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); - chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); +// chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); } } diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index 08fa52a3e..cbbe8f5b3 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -234,9 +234,11 @@ void usbInit(void) { */ void usbObjectInit(USBDriver *usbp) { - usbp->state = USB_STOP; - usbp->config = NULL; - usbp->param = NULL; + usbp->state = USB_STOP; + usbp->config = NULL; + usbp->param = NULL; + usbp->transmitting = 0; + usbp->receiving = 0; } /** @@ -358,10 +360,10 @@ void usbDisableEndpointsI(USBDriver *usbp) { size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - if (usbp->ep[ep]->receiving) + if (usbGetReceiveStatusI(usbp, ep)) return USB_ENDPOINT_BUSY; - usbp->ep[ep]->receiving = TRUE; + usbp->receiving |= (1 << ep); return usb_lld_read_packet(usbp, ep, buf, n);; } @@ -385,10 +387,10 @@ size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, const uint8_t *buf, size_t n) { - if (usbp->ep[ep]->transmitting) + if (usbGetTransmitStatusI(usbp, ep)) return USB_ENDPOINT_BUSY; - usbp->ep[ep]->transmitting = TRUE; + usbp->transmitting |= (1 << ep); usb_lld_write_packet(usbp, ep, buf, n); return 0; } @@ -413,9 +415,10 @@ size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - if (usbp->ep[ep]->receiving) + if (usbGetReceiveStatusI(usbp, ep)) return TRUE; - usbp->ep[ep]->receiving = TRUE; + + usbp->receiving |= (1 << ep); usb_lld_start_out(usbp, ep, buf, n); return FALSE; } @@ -440,9 +443,10 @@ bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep, const uint8_t *buf, size_t n) { - if (usbp->ep[ep]->transmitting) + if (usbGetTransmitStatusI(usbp, ep)) return TRUE; - usbp->ep[ep]->transmitting = TRUE; + + usbp->transmitting |= (1 << ep); usb_lld_start_in(usbp, ep, buf, n); return FALSE; } @@ -460,8 +464,9 @@ bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep, */ bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep) { - if (usbp->ep[ep]->receiving) + if (usbGetReceiveStatusI(usbp, ep)) return TRUE; + usb_lld_stall_out(usbp, ep); return FALSE; } @@ -479,8 +484,9 @@ bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep) { */ bool_t usbStallTransmitI(USBDriver *usbp, usbep_t ep) { - if (usbp->ep[ep]->transmitting) + if (usbGetTransmitStatusI(usbp, ep)) return TRUE; + usb_lld_stall_in(usbp, ep); return FALSE; } -- cgit v1.2.3 From 95d128420a70587ce2845df383ed9b6a165e58dc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Feb 2011 18:59:34 +0000 Subject: Fixed a problem in the USB-CDC demo. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2733 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/serial_usb.c | 4 ++-- testhal/STM32/USB_CDC/main.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index b17669c04..430218edb 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -124,7 +124,7 @@ static void inotify(GenericQueue *qp) { if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; chSemSetCounterI(&sdup->iqueue.q_sem, n); -// chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); + chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); } } } @@ -143,7 +143,7 @@ static void onotify(GenericQueue *qp) { if (n != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); -// chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); + chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); } } diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 0c2a3ac9d..6af497542 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -367,7 +367,8 @@ static msg_t Thread2(void *arg) { uint8_t buffer[0x40]; size_t n = chIQReadTimeout(&sdup->iqueue, buffer, sizeof(buffer), TIME_IMMEDIATE); - chOQWriteTimeout(&sdup->oqueue, buffer, n, TIME_IMMEDIATE); + if (n > 0) + chOQWriteTimeout(&sdup->oqueue, buffer, n, TIME_IMMEDIATE); } } } -- cgit v1.2.3 From eb3355b5589b499e0d36e23f282bf8544cde0bbf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Feb 2011 19:52:43 +0000 Subject: Simplified USB endpoints configuration. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2734 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/usb.h | 20 +++++++++----------- os/hal/platforms/STM32/usb_lld.c | 17 ++++++++--------- os/hal/platforms/STM32/usb_lld.h | 18 ++---------------- testhal/STM32/USB_CDC/main.c | 9 +++------ 4 files changed, 22 insertions(+), 42 deletions(-) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index 7f46e46f5..82ff59d03 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -81,6 +81,14 @@ */ #define USB_ENDPOINT_BUSY ((size_t)0xFFFFFFFF) +#define USB_EP_MODE_TYPE 0x0003 /**< Endpoint type mask. */ +#define USB_EP_MODE_TYPE_CTRL 0x0000 /**< Control endpoint. */ +#define USB_EP_MODE_TYPE_ISOC 0x0001 /**< Isochronous endpoint. */ +#define USB_EP_MODE_TYPE_BULK 0x0002 /**< Bulk endpoint. */ +#define USB_EP_MODE_TYPE_INTR 0x0003 /**< Interrupt endpoint. */ +#define USB_EP_MODE_TRANSACTION 0x0000 /**< Transaction mode. */ +#define USB_EP_MODE_PACKET 0x0010 /**< Packet mode enabled. */ + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -114,21 +122,11 @@ typedef enum { USB_ACTIVE = 4, /**< Active, configuration selected.*/ } usbstate_t; -/** - * @brief Type of an endpoint type. - */ -typedef enum { - EP_TYPE_CTRL = 0, /**< Control endpoint. */ - EP_TYPE_ISOC = 1, /**< Isochronous endpoint. */ - EP_TYPE_BULK = 2, /**< Bulk endpoint. */ - EP_TYPE_INTR = 3 /**< Interrupt endpoint. */ -} usbeptype_t; - /** * @brief Type of an endpoint status. */ typedef enum { - EP_STATUS_DISABLED = 0, /**< Endpoint not opened. */ + EP_STATUS_DISABLED = 0, /**< Endpoint not active. */ EP_STATUS_STALLED = 1, /**< Endpoint opened but stalled. */ EP_STATUS_ACTIVE = 2 /**< Active endpoint. */ } usbepstatus_t; diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index b0d356bcb..f09e6d0ea 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -58,12 +58,11 @@ static USBEndpointState ep0state; * @brief EP0 initialization structure. */ static const USBEndpointConfig ep0config = { - EP_TYPE_CTRL, + USB_EP_MODE_TYPE_CTRL | USB_EP_MODE_TRANSACTION, _usb_ep0in, _usb_ep0out, 0x40, 0x40, - 0, 0x40, 0x80 }; @@ -179,7 +178,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { if (epr & EPR_CTR_TX) { /* IN endpoint, transmission.*/ EPR_CLEAR_CTR_TX(ep); - if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) { + if (epcp->ep_mode & USB_EP_MODE_PACKET) { /* Packet mode, just invokes the callback.*/ (usbp)->transmitting &= ~((uint16_t)(1 << ep)); epcp->in_cb(usbp, ep); @@ -208,7 +207,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { if (epr & EPR_CTR_RX) { EPR_CLEAR_CTR_RX(ep); /* OUT endpoint, receive.*/ - if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) { + if (epcp->ep_mode & USB_EP_MODE_PACKET) { /* Packet mode, just invokes the callback.*/ (usbp)->receiving &= ~((uint16_t)(1 << ep)); epcp->out_cb(usbp, ep); @@ -376,14 +375,14 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { const USBEndpointConfig *epcp = usbp->ep[ep]->config; /* Setting the endpoint type.*/ - switch (epcp->ep_type) { - case EP_TYPE_ISOC: + switch (epcp->ep_mode & USB_EP_MODE_TYPE) { + case USB_EP_MODE_TYPE_ISOC: epr = EPR_EP_TYPE_ISO; break; - case EP_TYPE_BULK: + case USB_EP_MODE_TYPE_BULK: epr = EPR_EP_TYPE_BULK; break; - case EP_TYPE_INTR: + case USB_EP_MODE_TYPE_INTR: epr = EPR_EP_TYPE_INTERRUPT; break; default: @@ -397,7 +396,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { /* OUT endpoint settings. If the endpoint is in packet mode then it must start ready to accept data else it must start in NAK mode.*/ if (epcp->out_cb) { - if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) { + if (epcp->ep_mode & USB_EP_MODE_PACKET) { usbp->receiving |= ((uint16_t)(1 << ep)); epr |= EPR_STAT_RX_VALID; } diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 4eebda951..c1b00de06 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -46,16 +46,6 @@ */ #define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS -/** - * @brief Enables the packet mode for an IN endpoint. - */ -#define USB_EP_FLAGS_IN_PACKET_MODE 1 - -/** - * @brief Enables the packet mode for an OUT endpoint. - */ -#define USB_EP_FLAGS_OUT_PACKET_MODE 2 - /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -109,9 +99,9 @@ */ typedef struct { /** - * @brief Type of the endpoint. + * @brief Type and mode of the endpoint. */ - usbeptype_t ep_type; + uint32_t ep_mode; /** * @brief IN endpoint notification callback. * @details This field must be set to @p NULL if the IN endpoint is not @@ -137,10 +127,6 @@ typedef struct { */ uint16_t out_maxsize; /* End of the mandatory fields.*/ - /** - * @bief Endpoint mode flags. - */ - uint16_t flags; /** * @brief Endpoint IN buffer address as offset in the PMA. */ diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 6af497542..05c8fa11a 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -251,12 +251,11 @@ USBEndpointState ep3state; * @brief EP1 initialization structure (IN only). */ static const USBEndpointConfig ep1config = { - EP_TYPE_BULK, + USB_EP_MODE_TYPE_BULK | USB_EP_MODE_PACKET, sduDataTransmitted, NULL, 0x0040, 0x0000, - USB_EP_FLAGS_IN_PACKET_MODE, 0x00C0, 0x0000 }; @@ -265,12 +264,11 @@ static const USBEndpointConfig ep1config = { * @brief EP2 initialization structure (IN only). */ static const USBEndpointConfig ep2config = { - EP_TYPE_INTR, + USB_EP_MODE_TYPE_INTR | USB_EP_MODE_PACKET, sduInterruptTransmitted, NULL, 0x0010, 0x0000, - 0, 0x0100, 0x0000 }; @@ -279,12 +277,11 @@ static const USBEndpointConfig ep2config = { * @brief EP3 initialization structure (OUT only). */ static const USBEndpointConfig ep3config = { - EP_TYPE_BULK, + USB_EP_MODE_TYPE_BULK | USB_EP_MODE_PACKET, NULL, sduDataReceived, 0x0000, 0x0040, - USB_EP_FLAGS_OUT_PACKET_MODE, 0x0000, 0x0110 }; -- cgit v1.2.3 From f67eb2c108183bc6f037c0cabb95dbd5995207ca Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 13 Feb 2011 15:52:40 +0000 Subject: Fixed bug 3179783. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2735 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/mac.c | 8 ++++++-- readme.txt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c index 48656a8a3..9d033fe33 100644 --- a/os/hal/src/mac.c +++ b/os/hal/src/mac.c @@ -123,8 +123,10 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp, (time > 0)) { chSysLock(); systime_t now = chTimeNow(); - if ((msg = chSemWaitTimeoutS(&macp->md_tdsem, time)) == RDY_TIMEOUT) + if ((msg = chSemWaitTimeoutS(&macp->md_tdsem, time)) == RDY_TIMEOUT) { + chSysUnlock(); break; + } if (time != TIME_INFINITE) time -= (chTimeNow() - now); chSysUnlock(); @@ -173,8 +175,10 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp, (time > 0)) { chSysLock(); systime_t now = chTimeNow(); - if ((msg = chSemWaitTimeoutS(&macp->md_rdsem, time)) == RDY_TIMEOUT) + if ((msg = chSemWaitTimeoutS(&macp->md_rdsem, time)) == RDY_TIMEOUT) { + chSysUnlock(); break; + } if (time != TIME_INFINITE) time -= (chTimeNow() - now); chSysUnlock(); diff --git a/readme.txt b/readme.txt index b61e1d79f..659860a0e 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,7 @@ ***************************************************************************** *** 2.3.0 *** +- FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). - NEW: Added experimental generic USB driver, it will evolve in next releases. -- cgit v1.2.3 From dd6a0b3ccdd62873e1cb874969741e3fb683db4b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 13 Feb 2011 20:55:57 +0000 Subject: Implemented automatic allocation in the packet memory of the STM32 USB driver, no need to specify addresses anymore. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2737 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/usb_lld.c | 33 +++++++++++++++++++++++++++------ os/hal/platforms/STM32/usb_lld.h | 12 ++++-------- testhal/STM32/USB_CDC/main.c | 8 +------- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index f09e6d0ea..cecbc9934 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -44,7 +44,6 @@ USBDriver USBD1; #endif - /*===========================================================================*/ /* Driver local variables. */ /*===========================================================================*/ @@ -62,15 +61,34 @@ static const USBEndpointConfig ep0config = { _usb_ep0in, _usb_ep0out, 0x40, - 0x40, - 0x40, - 0x80 + 0x40 }; /*===========================================================================*/ /* Driver local functions. */ /*===========================================================================*/ +/** + * @brief Resets the packet memory allocator. + * + * @param[in] usbp pointer to the @p USBDriver object + */ +static void pm_reset(USBDriver *usbp) { + usbp->pmnext = 64; +} + +/** + * @brief Resets the packet memory allocator. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] size size of the packet buffer to allocate + */ +static uint32_t pm_alloc(USBDriver *usbp, size_t size) { + uint32_t next = usbp->pmnext; + usbp->pmnext += size; + return next; +} + /** * @brief Copies a packet from memory into a packet buffer. * @@ -342,6 +360,9 @@ void usb_lld_reset(USBDriver *usbp) { cntr |= CNTR_SOFM; STM32_USB->CNTR = cntr; + /* Resets the packet memory allocator.*/ + pm_reset(usbp); + /* EP0 initialization.*/ memset(&ep0state, 0, sizeof ep0state); ep0state.config = &ep0config; @@ -417,8 +438,8 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { dp = USB_GET_DESCRIPTOR(ep); dp->TXCOUNT = 0; dp->RXCOUNT = nblocks; - dp->TXADDR = epcp->inaddr; - dp->RXADDR = epcp->outaddr; + dp->TXADDR = pm_alloc(usbp, epcp->in_maxsize); + dp->RXADDR = pm_alloc(usbp, epcp->out_maxsize); } /** diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index c1b00de06..d82fda644 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -127,14 +127,6 @@ typedef struct { */ uint16_t out_maxsize; /* End of the mandatory fields.*/ - /** - * @brief Endpoint IN buffer address as offset in the PMA. - */ - uint16_t inaddr; - /** - * @brief Endpoint OUT buffer address as offset in the PMA. - */ - uint16_t outaddr; } USBEndpointConfig; @@ -265,6 +257,10 @@ struct USBDriver { */ uint8_t configuration; /* End of the mandatory fields.*/ + /** + * @brief Pointer to the next address in the packet memory. + */ + uint32_t pmnext; }; /*===========================================================================*/ diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 05c8fa11a..00f0d0e66 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -255,8 +255,6 @@ static const USBEndpointConfig ep1config = { sduDataTransmitted, NULL, 0x0040, - 0x0000, - 0x00C0, 0x0000 }; @@ -268,8 +266,6 @@ static const USBEndpointConfig ep2config = { sduInterruptTransmitted, NULL, 0x0010, - 0x0000, - 0x0100, 0x0000 }; @@ -281,9 +277,7 @@ static const USBEndpointConfig ep3config = { NULL, sduDataReceived, 0x0000, - 0x0040, - 0x0000, - 0x0110 + 0x0040 }; /* -- cgit v1.2.3 From 2c15c4864f33c3c71c58e54494561eff1b291a0f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 14 Feb 2011 19:37:40 +0000 Subject: More improvements in the USB driver model. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2738 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/usb.h | 39 ++++++++++- os/hal/platforms/STM32/usb_lld.c | 95 +++++++++++++++------------ os/hal/platforms/STM32/usb_lld.h | 138 +++++++++++++++++++++++++-------------- os/hal/src/serial_usb.c | 6 +- os/hal/src/usb.c | 109 ++++++++++++++++++------------- testhal/STM32/USB_CDC/main.c | 33 ++++------ 6 files changed, 256 insertions(+), 164 deletions(-) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index 82ff59d03..a7b183fe4 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -139,7 +139,8 @@ typedef enum { USB_EP0_TX, /**< Trasmitting. */ USB_EP0_WAITING_STS, /**< Waiting status. */ USB_EP0_RX, /**< Receiving. */ - USB_EP0_SENDING_STS /**< Sending status. */ + USB_EP0_SENDING_STS, /**< Sending status. */ + USB_EP0_ERROR /**< Error, EP0 stalled. */ } usbep0state_t; /** @@ -255,6 +256,37 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, */ #define usbGetReceiveStatusI(usbp, ep) ((usbp)->receiving & (1 << (ep))) +/** + * @brief Returns the exact size of a receive transaction. + * @details The received size can be different from the size specified in + * @p usbStartReceiveI() because the last packet could have a size + * different from the expected one. + * @pre The OUT endpoint must have been configured in transaction mode + * in order to use this function. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return Received data size. + * + * @iclass + */ +#define usbGetReceiveTransactionSizeI(usbp, ep) \ + usb_lld_get_transaction_size(usbp, ep) + +/** + * @brief Returns the exact size of a received packet. + * @pre The OUT endpoint must have been configured in packet mode + * in order to use this function. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return Received data size. + * + * @iclass + */ +#define usbGetReceivePacketSizeI(usbp, ep) \ + usb_lld_get_packet_size(usbp, ep) + /** * @brief Request transfer setup. * @details This macro is used by the request handling callbacks in order to @@ -266,9 +298,10 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * * @api */ -#define usbSetupTransfer(usbp, buf, n) { \ +#define usbSetupTransfer(usbp, buf, n, endcb) { \ (usbp)->ep0next = (buf); \ (usbp)->ep0n = (n); \ + (usbp)->ep0endcb = (endcb); \ } /*===========================================================================*/ @@ -282,7 +315,7 @@ extern "C" { void usbObjectInit(USBDriver *usbp); void usbStart(USBDriver *usbp, const USBConfig *config); void usbStop(USBDriver *usbp); - void usbInitEndpointI(USBDriver *usbp, usbep_t ep, USBEndpointState *epp, + void usbInitEndpointI(USBDriver *usbp, usbep_t ep, const USBEndpointConfig *epcp); void usbDisableEndpointsI(USBDriver *usbp); size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index cecbc9934..5125f1cee 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -50,8 +50,19 @@ USBDriver USBD1; /** * @brief EP0 state. + * @note It is an union because IN and OUT endpoints are never used at the + * same time for EP0. */ -static USBEndpointState ep0state; +static union { + /** + * @brief IN EP0 state. + */ + USBInEndpointState in; + /** + * @brief OUT EP0 state. + */ + USBOutEndpointState out; +} ep0_state; /** * @brief EP0 initialization structure. @@ -61,7 +72,9 @@ static const USBEndpointConfig ep0config = { _usb_ep0in, _usb_ep0out, 0x40, - 0x40 + 0x40, + &ep0_state.in, + &ep0_state.out }; /*===========================================================================*/ @@ -191,33 +204,33 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { while (istr & ISTR_CTR) { uint32_t ep; uint32_t epr = STM32_USB->EPR[ep = istr & ISTR_EP_ID_MASK]; - const USBEndpointConfig *epcp = usbp->ep[ep]->config; + const USBEndpointConfig *epcp = usbp->epc[ep]; if (epr & EPR_CTR_TX) { /* IN endpoint, transmission.*/ EPR_CLEAR_CTR_TX(ep); if (epcp->ep_mode & USB_EP_MODE_PACKET) { /* Packet mode, just invokes the callback.*/ - (usbp)->transmitting &= ~((uint16_t)(1 << ep)); + (usbp)->transmitting &= ~(1 << ep); epcp->in_cb(usbp, ep); } else { /* Transaction mode.*/ n = USB_GET_DESCRIPTOR(ep)->TXCOUNT; - usbp->ep[ep]->txbuf += n; - usbp->ep[ep]->txcnt += n; - usbp->ep[ep]->txsize -= n; - if (usbp->ep[ep]->txsize > 0) { + epcp->in_state->txbuf += n; + epcp->in_state->txcnt += n; + epcp->in_state->txsize -= n; + if (epcp->in_state->txsize > 0) { /* Transfer not completed, there are more packets to send.*/ - if (usbp->ep[ep]->txsize > epcp->in_maxsize) + if (epcp->in_state->txsize > epcp->in_maxsize) n = epcp->in_maxsize; else - n = usbp->ep[ep]->txsize; - write_packet(ep, usbp->ep[ep]->txbuf, n); + n = epcp->in_state->txsize; + write_packet(ep, epcp->in_state->txbuf, n); } else { /* Transfer completed, invokes the callback.*/ - (usbp)->transmitting &= ~((uint16_t)(1 << ep)); + (usbp)->transmitting &= ~(1 << ep); epcp->in_cb(usbp, ep); } } @@ -227,10 +240,11 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { /* OUT endpoint, receive.*/ if (epcp->ep_mode & USB_EP_MODE_PACKET) { /* Packet mode, just invokes the callback.*/ - (usbp)->receiving &= ~((uint16_t)(1 << ep)); + (usbp)->receiving &= ~(1 << ep); epcp->out_cb(usbp, ep); } else { + /* Transaction mode.*/ if ((epr & EPR_SETUP) && (ep == 0)) { /* Special case, setup packet for EP0, enforcing a reset of the EP0 state machine for robustness.*/ @@ -239,18 +253,18 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { epcp->out_cb(usbp, ep); } else { - n = read_packet(ep, usbp->ep[ep]->rxbuf, usbp->ep[ep]->rxsize); - usbp->ep[ep]->rxbuf += n; - usbp->ep[ep]->rxcnt += n; - usbp->ep[ep]->rxsize -= n; - usbp->ep[ep]->rxpkts -= 1; - if (usbp->ep[ep]->rxpkts > 0) { + n = read_packet(ep, epcp->out_state->rxbuf, epcp->out_state->rxsize); + epcp->out_state->rxbuf += n; + epcp->out_state->rxcnt += n; + epcp->out_state->rxsize -= n; + epcp->out_state->rxpkts -= 1; + if (epcp->out_state->rxpkts > 0) { /* Transfer not completed, there are more packets to receive.*/ EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); } else { /* Transfer completed, invokes the callback.*/ - (usbp)->receiving &= ~((uint16_t)(1 << ep)); + (usbp)->receiving &= ~(1 << ep); epcp->out_cb(usbp, ep); } } @@ -306,10 +320,10 @@ void usb_lld_start(USBDriver *usbp) { NVICEnableVector(USB_LP_CAN1_RX0_IRQn, CORTEX_PRIORITY_MASK(STM32_USB_USB1_LP_IRQ_PRIORITY)); - /* Reset procedure enforced on driver start.*/ - _usb_reset(&USBD1); } #endif + /* Reset procedure enforced on driver start.*/ + _usb_reset(usbp); } /* Configuration.*/ } @@ -329,6 +343,7 @@ void usb_lld_stop(USBDriver *usbp) { if (&USBD1 == usbp) { NVICDisableVector(USB_HP_CAN1_TX_IRQn); NVICDisableVector(USB_LP_CAN1_RX0_IRQn); + STM32_USB->CNTR = CNTR_PDWN | CNTR_FRES; RCC->APB1ENR &= ~RCC_APB1ENR_USBEN; } #endif @@ -364,9 +379,7 @@ void usb_lld_reset(USBDriver *usbp) { pm_reset(usbp); /* EP0 initialization.*/ - memset(&ep0state, 0, sizeof ep0state); - ep0state.config = &ep0config; - usbp->ep[0] = &ep0state; + usbp->epc[0] = &ep0config; usb_lld_init_endpoint(usbp, 0); } @@ -393,7 +406,7 @@ void usb_lld_set_address(USBDriver *usbp) { void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { uint16_t nblocks, epr; stm32_usb_descriptor_t *dp; - const USBEndpointConfig *epcp = usbp->ep[ep]->config; + const USBEndpointConfig *epcp = usbp->epc[ep]; /* Setting the endpoint type.*/ switch (epcp->ep_mode & USB_EP_MODE_TYPE) { @@ -418,7 +431,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { start ready to accept data else it must start in NAK mode.*/ if (epcp->out_cb) { if (epcp->ep_mode & USB_EP_MODE_PACKET) { - usbp->receiving |= ((uint16_t)(1 << ep)); + usbp->receiving |= (1 << ep); epr |= EPR_STAT_RX_VALID; } else @@ -585,16 +598,16 @@ void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, */ void usb_lld_start_out(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBEndpointState *uesp = usbp->ep[ep]; + USBOutEndpointState *osp = usbp->epc[ep]->out_state; - uesp->rxbuf = buf; - uesp->rxsize = n; - uesp->rxcnt = 0; - if (uesp->rxsize == 0) /* Special case for zero sized packets.*/ - uesp->rxpkts = 1; + osp->rxbuf = buf; + osp->rxsize = n; + osp->rxcnt = 0; + if (osp->rxsize == 0) /* Special case for zero sized packets.*/ + osp->rxpkts = 1; else - uesp->rxpkts = (uint16_t)((n + uesp->config->out_maxsize - 1) / - uesp->config->out_maxsize); + osp->rxpkts = (uint16_t)((n + usbp->epc[ep]->out_maxsize - 1) / + usbp->epc[ep]->out_maxsize); EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); } @@ -610,13 +623,13 @@ void usb_lld_start_out(USBDriver *usbp, usbep_t ep, */ void usb_lld_start_in(USBDriver *usbp, usbep_t ep, const uint8_t *buf, size_t n) { - USBEndpointState *uesp = usbp->ep[ep]; + USBInEndpointState *isp = usbp->epc[ep]->in_state; - uesp->txbuf = buf; - uesp->txsize = n; - uesp->txcnt = 0; - if (n > (size_t)uesp->config->in_maxsize) - n = (size_t)uesp->config->in_maxsize; + isp->txbuf = buf; + isp->txsize = n; + isp->txcnt = 0; + if (n > (size_t)usbp->epc[ep]->in_maxsize) + n = (size_t)usbp->epc[ep]->in_maxsize; write_packet(ep, buf, n); } diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index d82fda644..42f32560e 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -93,6 +93,46 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief Type of an endpoint state structure. + */ +typedef struct { + /** + * @brief Pointer to the transmission buffer. + */ + const uint8_t *txbuf; + /** + * @brief Requested transmit transfer size. + */ + size_t txsize; + /** + * @brief Transmitted bytes so far. + */ + size_t txcnt; +} USBInEndpointState; + +/** + * @brief Type of an endpoint state structure. + */ +typedef struct { + /** + * @brief Number of packets to receive. + */ + uint16_t rxpkts; + /** + * @brief Pointer to the receive buffer. + */ + uint8_t *rxbuf; + /** + * @brief Requested receive transfer size. + */ + size_t rxsize; + /** + * @brief Received bytes so far. + */ + size_t rxcnt; +} USBOutEndpointState; + /** * @brief Type of an USB endpoint configuration structure. * @note Platform specific restrictions may apply to endpoints. @@ -126,47 +166,22 @@ typedef struct { * used. */ uint16_t out_maxsize; - /* End of the mandatory fields.*/ -} USBEndpointConfig; - - -/** - * @brief Type of an endpoint state structure. - */ -typedef struct { /** - * @brief Configuration associated to the endpoint. + * @brief @p USBEndpointState associated to the IN endpoint. + * @details This structure maintains the state of the IN endpoint when + * the endpoint is not in packet mode. Endpoints configured in + * packet mode must set this field to @p NULL. */ - const USBEndpointConfig *config; + USBInEndpointState *in_state; /** - * @brief Number of packets to receive. - */ - uint16_t rxpkts; - /** - * @brief Pointer to the transmission buffer. - */ - const uint8_t *txbuf; - /** - * @brief Pointer to the receive buffer. - */ - uint8_t *rxbuf; - /** - * @brief Requested transmit transfer size. + * @brief @p USBEndpointState associated to the OUT endpoint. + * @details This structure maintains the state of the OUT endpoint when + * the endpoint is not in packet mode. Endpoints configured in + * packet mode must set this field to @p NULL. */ - size_t txsize; - /** - * @brief Requested receive transfer size. - */ - size_t rxsize; - /** - * @brief Transmitted bytes so far. - */ - size_t txcnt; - /** - * @brief Received bytes so far. - */ - size_t rxcnt; -} USBEndpointState; + USBOutEndpointState *out_state; + /* End of the mandatory fields.*/ +} USBEndpointConfig; /** * @brief Type of an USB driver configuration structure. @@ -223,7 +238,7 @@ struct USBDriver { /** * @brief Active endpoints configurations. */ - USBEndpointState *ep[USB_MAX_ENDPOINTS + 1]; + const USBEndpointConfig *epc[USB_MAX_ENDPOINTS + 1]; /** * @brief Endpoint 0 state. */ @@ -232,14 +247,14 @@ struct USBDriver { * @brief Next position in the buffer to be transferred through endpoint 0. */ uint8_t *ep0next; - /** - * @brief Maximum number of bytes to be transferred through endpoint 0. - */ - size_t ep0max; /** * @brief Number of bytes yet to be transferred through endpoint 0. */ size_t ep0n; + /** + * @brief Endpoint 0 end transaction callback. + */ + usbcallback_t ep0endcb; /** * @brief Setup packet buffer. */ @@ -286,6 +301,37 @@ struct USBDriver { */ #define usb_lld_get_frame_number(usbp) (STM32_USB->FNR & FNR_FN_MASK) +/** + * @brief Returns the exact size of a receive transaction. + * @details The received size can be different from the size specified in + * @p usbStartReceiveI() because the last packet could have a size + * different from the expected one. + * @pre The OUT endpoint must have been configured in transaction mode + * in order to use this function. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return Received data size. + * + * @notapi + */ +#define usb_lld_get_transaction_size(usbp, ep) \ + ((usbp)->epc[ep]->out_state->rxcnt) + +/** + * @brief Returns the exact size of a received packet. + * @pre The OUT endpoint must have been configured in packet mode + * in order to use this function. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return Received data size. + * + * @notapi + */ +#define usb_lld_get_packet_size(usbp, ep) \ + ((size_t)USB_GET_DESCRIPTOR(ep)->RXCOUNT & RXCOUNT_COUNT_MASK) + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -294,14 +340,6 @@ struct USBDriver { extern USBDriver USBD1; #endif -#if !defined(__DOXYGEN__) -extern const USBEndpointConfig usb_lld_ep0config; -#endif - -#if !defined(__DOXYGEN__) -extern USBEndpointState usb_lld_ep0state; -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 430218edb..83f1c93ff 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -250,14 +250,14 @@ bool_t sduRequestsHook(USBDriver *usbp) { if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { switch (usbp->setup[1]) { case CDC_GET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); + usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL); return TRUE; case CDC_SET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding)); + usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL); return TRUE; case CDC_SET_CONTROL_LINE_STATE: /* Nothing to do, there are no control lines.*/ - usbSetupTransfer(usbp, NULL, 0); + usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; default: return FALSE; diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index cbbe8f5b3..34e9a14fd 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -54,7 +54,7 @@ static const uint8_t halted_status[] = {0x01, 0x00}; * * @param[in] usbp pointer to the @p USBDriver object */ -void set_address(USBDriver *usbp) { +static void set_address(USBDriver *usbp) { usbp->address = usbp->setup[2]; usb_lld_set_address(usbp); @@ -84,14 +84,14 @@ static bool_t default_handler(USBDriver *usbp) { (usbp->setup[1] << 8))) { case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_GET_STATUS << 8): /* Just returns the current status word.*/ - usbSetupTransfer(usbp, (uint8_t *)&usbp->status, 2); + usbSetupTransfer(usbp, (uint8_t *)&usbp->status, 2, NULL); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_CLEAR_FEATURE << 8): /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature number is handled as an error.*/ if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { usbp->status &= ~2; - usbSetupTransfer(usbp, NULL, 0); + usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; } return FALSE; @@ -100,7 +100,7 @@ static bool_t default_handler(USBDriver *usbp) { number is handled as an error.*/ if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { usbp->status |= 2; - usbSetupTransfer(usbp, NULL, 0); + usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; } return FALSE; @@ -112,8 +112,10 @@ static bool_t default_handler(USBDriver *usbp) { if ((usbp->setup[0] == USB_RTYPE_RECIPIENT_DEVICE) && (usbp->setup[1] == USB_REQ_SET_ADDRESS)) set_address(usbp); + usbSetupTransfer(usbp, NULL, 0, NULL); +#else + usbSetupTransfer(usbp, NULL, 0, set_address); #endif - usbSetupTransfer(usbp, NULL, 0); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_GET_DESCRIPTOR << 8): /* Handling descriptor requests from the host.*/ @@ -122,11 +124,11 @@ static bool_t default_handler(USBDriver *usbp) { usb_lld_fetch_word(&usbp->setup[4])); if (dp == NULL) return FALSE; - usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size); + usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size, NULL); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_GET_CONFIGURATION << 8): /* Returning the last selected configuration.*/ - usbSetupTransfer(usbp, &usbp->configuration, 1); + usbSetupTransfer(usbp, &usbp->configuration, 1, NULL); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_SET_CONFIGURATION << 8): /* Handling configuration selection from the host.*/ @@ -137,23 +139,23 @@ static bool_t default_handler(USBDriver *usbp) { usbp->state = USB_ACTIVE; if (usbp->config->event_cb) usbp->config->event_cb(usbp, USB_EVENT_CONFIGURED); - usbSetupTransfer(usbp, NULL, 0); + usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; case USB_RTYPE_RECIPIENT_INTERFACE | (USB_REQ_GET_STATUS << 8): case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_SYNCH_FRAME << 8): /* Just sending two zero bytes, the application can change the behavior using a hook..*/ - usbSetupTransfer(usbp, (uint8_t *)zero_status, 2); + usbSetupTransfer(usbp, (uint8_t *)zero_status, 2, NULL); return TRUE; case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_GET_STATUS << 8): /* Sending the EP status.*/ if (usbp->setup[4] & 0x80) { switch (usb_lld_get_status_in(usbp, usbp->setup[4] & 0x0F)) { case EP_STATUS_STALLED: - usbSetupTransfer(usbp, (uint8_t *)halted_status, 2); + usbSetupTransfer(usbp, (uint8_t *)halted_status, 2, NULL); return TRUE; case EP_STATUS_ACTIVE: - usbSetupTransfer(usbp, (uint8_t *)active_status, 2); + usbSetupTransfer(usbp, (uint8_t *)active_status, 2, NULL); return TRUE; default: return FALSE; @@ -162,10 +164,10 @@ static bool_t default_handler(USBDriver *usbp) { else { switch (usb_lld_get_status_out(usbp, usbp->setup[4] & 0x0F)) { case EP_STATUS_STALLED: - usbSetupTransfer(usbp, (uint8_t *)halted_status, 2); + usbSetupTransfer(usbp, (uint8_t *)halted_status, 2, NULL); return TRUE; case EP_STATUS_ACTIVE: - usbSetupTransfer(usbp, (uint8_t *)active_status, 2); + usbSetupTransfer(usbp, (uint8_t *)active_status, 2, NULL); return TRUE; default: return FALSE; @@ -182,7 +184,7 @@ static bool_t default_handler(USBDriver *usbp) { else usb_lld_clear_out(usbp, usbp->setup[4] & 0x0F); } - usbSetupTransfer(usbp, NULL, 0); + usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; case USB_RTYPE_RECIPIENT_ENDPOINT | (USB_REQ_SET_FEATURE << 8): /* Only ENDPOINT_HALT is handled as feature.*/ @@ -195,7 +197,7 @@ static bool_t default_handler(USBDriver *usbp) { else usb_lld_stall_out(usbp, usbp->setup[4] & 0x0F); } - usbSetupTransfer(usbp, NULL, 0); + usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; case USB_RTYPE_RECIPIENT_DEVICE | (USB_REQ_SET_DESCRIPTOR << 8): case USB_RTYPE_RECIPIENT_INTERFACE | (USB_REQ_CLEAR_FEATURE << 8): @@ -259,7 +261,7 @@ void usbStart(USBDriver *usbp, const USBConfig *config) { "usbStart(), #1", "invalid state"); usbp->config = config; for (i = 0; i <= USB_MAX_ENDPOINTS; i++) - usbp->ep[i] = NULL; + usbp->epc[i] = NULL; usb_lld_start(usbp); usbp->state = USB_READY; chSysUnlock(); @@ -293,23 +295,24 @@ void usbStop(USBDriver *usbp) { * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number - * @param[out] epp pointer to an endpoint state descriptor structure * @param[in] epcp the endpoint configuration * * @iclass */ -void usbInitEndpointI(USBDriver *usbp, usbep_t ep, USBEndpointState *epp, +void usbInitEndpointI(USBDriver *usbp, usbep_t ep, const USBEndpointConfig *epcp) { chDbgAssert(usbp->state == USB_ACTIVE, "usbEnableEndpointI(), #1", "invalid state"); - chDbgAssert(usbp->ep[ep] != NULL, + chDbgAssert(usbp->epc[ep] != NULL, "usbEnableEndpointI(), #2", "already initialized"); /* Logically enabling the endpoint in the USBDriver structure.*/ - memset(epp, 0, sizeof(USBEndpointState)); - epp->config = epcp; - usbp->ep[ep] = epp; + if (!(epcp->ep_mode & USB_EP_MODE_PACKET)) { + memset(epcp->in_state, 0, sizeof(USBInEndpointState)); + memset(epcp->out_state, 0, sizeof(USBOutEndpointState)); + } + usbp->epc[ep] = epcp; /* Low level endpoint activation.*/ usb_lld_init_endpoint(usbp, ep); @@ -333,7 +336,7 @@ void usbDisableEndpointsI(USBDriver *usbp) { "usbDisableEndpointsI(), #1", "invalid state"); for (i = 1; i <= USB_MAX_ENDPOINTS; i++) - usbp->ep[i] = NULL; + usbp->epc[i] = NULL; /* Low level endpoints deactivation.*/ usb_lld_disable_endpoints(usbp); @@ -493,6 +496,8 @@ bool_t usbStallTransmitI(USBDriver *usbp, usbep_t ep) { /** * @brief USB reset routine. + * @details This function must be invoked when an USB bus reset condition is + * detected. * * @param[in] usbp pointer to the @p USBDriver object * @@ -508,7 +513,7 @@ void _usb_reset(USBDriver *usbp) { /* Invalidates all endpoints into the USBDriver structure.*/ for (i = 0; i <= USB_MAX_ENDPOINTS; i++) - usbp->ep[i] = NULL; + usbp->epc[i] = NULL; /* EP0 state machine initialization.*/ usbp->ep0state = USB_EP0_WAITING_SETUP; @@ -538,30 +543,32 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { multiple of the maximum packet size then a zero size packet must be transmitted.*/ if ((usbp->ep0n < max) && - ((usbp->ep0n % usbp->ep[0]->config->in_maxsize) == 0)) { + ((usbp->ep0n % usbp->epc[0]->in_maxsize) == 0)) { usb_lld_start_in(usbp, 0, NULL, 0); return; } + + /* Transmit phase over, receiving the zero sized status packet.*/ usbp->ep0state = USB_EP0_WAITING_STS; usb_lld_start_out(usbp, 0, NULL, 0); return; case USB_EP0_SENDING_STS: -#if USB_SET_ADDRESS_MODE == USB_LATE_SET_ADDRESS - if ((usbp->setup[0] == USB_RTYPE_RECIPIENT_DEVICE) && - (usbp->setup[1] == USB_REQ_SET_ADDRESS)) - set_address(usbp); -#endif + /* Status packet sent, invoking the callback if defined.*/ + if (usbp->ep0endcb) + usbp->ep0endcb(usbp); usbp->ep0state = USB_EP0_WAITING_SETUP; return; default: ; } - /* Error response.*/ + /* Error response, the state machine goes into an error state, the low + level layer will have to reset it to USB_EP0_WAITING_SETUP after + receiving a SETUP packet.*/ usb_lld_stall_in(usbp, 0); usb_lld_stall_out(usbp, 0); if (usbp->config->event_cb) usbp->config->event_cb(usbp, USB_EVENT_STALLED); - usbp->ep0state = USB_EP0_WAITING_SETUP; + usbp->ep0state = USB_EP0_ERROR; } /** @@ -575,13 +582,16 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { * @notapi */ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { - size_t n, max; + size_t max; (void)ep; switch (usbp->ep0state) { case USB_EP0_WAITING_SETUP: - /* SETUP packet handling. - First verify if the application has an handler installed for this + /* SETUP packet handling. The setup packet is expected to be already + placed into the setup[8] field of the USBDriver structure, the low + level layer has to take care of this.*/ + + /* First verify if the application has an handler installed for this request.*/ if (!(usbp->config->requests_hook_cb) || !(usbp->config->requests_hook_cb(usbp))) { @@ -593,8 +603,8 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { } /* Transfer preparation. The request handler must have populated - correctly the fields ep0next, ep0n and ep0endcb using - the macro usbSetupTransfer().*/ + correctly the fields ep0next, ep0n and ep0endcb using the macro + usbSetupTransfer().*/ max = usb_lld_fetch_word(&usbp->setup[6]); /* The transfer size cannot exceed the specified amount.*/ if (usbp->ep0n > max) @@ -602,12 +612,13 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { /* IN phase.*/ if (usbp->ep0n > 0) { - /* Starts transmission.*/ + /* Starts the transmit phase.*/ usbp->ep0state = USB_EP0_TX; usb_lld_start_in(usbp, 0, usbp->ep0next, usbp->ep0n); } else { - /* Receiving the zero sized status packet.*/ + /* No transmission phase, directly receiving the zero sized status + packet.*/ usbp->ep0state = USB_EP0_WAITING_STS; usb_lld_start_out(usbp, 0, NULL, 0); } @@ -615,37 +626,43 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { else { /* OUT phase.*/ if (usbp->ep0n > 0) { - /* Starts reception.*/ + /* Starts the receive phase.*/ usbp->ep0state = USB_EP0_RX; usb_lld_start_out(usbp, 0, usbp->ep0next, usbp->ep0n); } else { - /* Sending zero sized status packet.*/ + /* No receive phase, directly sending the zero sized status + packet.*/ usbp->ep0state = USB_EP0_SENDING_STS; usb_lld_start_in(usbp, 0, NULL, 0); } } return; case USB_EP0_RX: + /* Receive phase over, sending the zero sized status packet.*/ usbp->ep0state = USB_EP0_SENDING_STS; usb_lld_start_in(usbp, 0, NULL, 0); return; case USB_EP0_WAITING_STS: - /* STATUS received packet handling, it must be zero sized.*/ - n = usbp->ep[0]->rxsize; - if (n != 0) + /* Status packet received, it must be zero sized, invoking the callback + if defined.*/ + if (usbGetReceiveTransactionSizeI(usbp, 0) != 0) break; + if (usbp->ep0endcb) + usbp->ep0endcb(usbp); usbp->ep0state = USB_EP0_WAITING_SETUP; return; default: ; } - /* Error response.*/ + /* Error response, the state machine goes into an error state, the low + level layer will have to reset it to USB_EP0_WAITING_SETUP after + receiving a SETUP packet.*/ usb_lld_stall_in(usbp, 0); usb_lld_stall_out(usbp, 0); if (usbp->config->event_cb) usbp->config->event_cb(usbp, USB_EVENT_STALLED); - usbp->ep0state = USB_EP0_WAITING_SETUP; + usbp->ep0state = USB_EP0_ERROR; } #endif /* HAL_USE_USB */ diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 00f0d0e66..423a47413 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -232,21 +232,6 @@ static const USBDescriptor *get_descriptor(USBDriver *usbp, return NULL; } -/** - * @brief EP1 state. - */ -USBEndpointState ep1state; - -/** - * @brief EP2 state. - */ -USBEndpointState ep2state; - -/** - * @brief EP3 state. - */ -USBEndpointState ep3state; - /** * @brief EP1 initialization structure (IN only). */ @@ -255,7 +240,9 @@ static const USBEndpointConfig ep1config = { sduDataTransmitted, NULL, 0x0040, - 0x0000 + 0x0000, + NULL, + NULL }; /** @@ -266,7 +253,9 @@ static const USBEndpointConfig ep2config = { sduInterruptTransmitted, NULL, 0x0010, - 0x0000 + 0x0000, + NULL, + NULL }; /** @@ -277,7 +266,9 @@ static const USBEndpointConfig ep3config = { NULL, sduDataReceived, 0x0000, - 0x0040 + 0x0040, + NULL, + NULL }; /* @@ -293,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { case USB_EVENT_CONFIGURED: /* Enables the endpoints specified into the configuration.*/ chSysLock(); - usbInitEndpointI(usbp, DATA_REQUEST_EP, &ep1state, &ep1config); - usbInitEndpointI(usbp, INTERRUPT_REQUEST_EP, &ep2state, &ep2config); - usbInitEndpointI(usbp, DATA_AVAILABLE_EP, &ep3state, &ep3config); + usbInitEndpointI(usbp, DATA_REQUEST_EP, &ep1config); + usbInitEndpointI(usbp, INTERRUPT_REQUEST_EP, &ep2config); + usbInitEndpointI(usbp, DATA_AVAILABLE_EP, &ep3config); chSysUnlock(); return; case USB_EVENT_SUSPEND: -- cgit v1.2.3 From 20a4b38126be234c5f946df9254c7d64502ff855 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 14 Feb 2011 19:45:28 +0000 Subject: STM32 USB reset done right. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2739 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/usb_lld.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index 5125f1cee..0a7bc9315 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -319,7 +319,8 @@ void usb_lld_start(USBDriver *usbp) { CORTEX_PRIORITY_MASK(STM32_USB_USB1_HP_IRQ_PRIORITY)); NVICEnableVector(USB_LP_CAN1_RX0_IRQn, CORTEX_PRIORITY_MASK(STM32_USB_USB1_LP_IRQ_PRIORITY)); - + /* Releases the USB reset.*/ + STM32_USB->CNTR = 0; } #endif /* Reset procedure enforced on driver start.*/ @@ -360,11 +361,8 @@ void usb_lld_stop(USBDriver *usbp) { void usb_lld_reset(USBDriver *usbp) { uint32_t cntr; - /* Powers up the transceiver while holding the USB in reset state.*/ - STM32_USB->CNTR = CNTR_FRES; - - /* Releases the USB reset, BTABLE is reset to zero.*/ - STM32_USB->CNTR = 0; + /* Post reset initialization.*/ + STM32_USB->BTABLE = 0; STM32_USB->ISTR = 0; STM32_USB->DADDR = DADDR_EF; cntr = /*CNTR_ESOFM | */ CNTR_RESETM | /*CNTR_SUSPM |*/ -- cgit v1.2.3 From 35ff7323526f5225d1a00c7812291e9fcdbfafac Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 15 Feb 2011 09:16:17 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2740 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/stm32_usb.h | 7 ++++++- os/hal/platforms/STM32/usb_lld.c | 14 +++++++++++--- os/hal/src/usb.c | 20 ++++++++++++-------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/os/hal/platforms/STM32/stm32_usb.h b/os/hal/platforms/STM32/stm32_usb.h index 8c04ba85f..8bb0d8b95 100644 --- a/os/hal/platforms/STM32/stm32_usb.h +++ b/os/hal/platforms/STM32/stm32_usb.h @@ -108,10 +108,15 @@ typedef struct { #define STM32_USB ((stm32_usb_t *)STM32_USB_BASE) /** - * @brief Pointer to the USB RAM. + * @brief Pointer to the USB RAM. */ #define STM32_USBRAM ((uint32_t *)STM32_USBRAM_BASE) +/** + * @brief Size of the dedicated packet memory. + */ +#define USB_PMA_SIZE 512 + /** * @brief Mask of all the toggling bits in the EPR register. */ diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index 0a7bc9315..f3bfa15f4 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -87,6 +87,9 @@ static const USBEndpointConfig ep0config = { * @param[in] usbp pointer to the @p USBDriver object */ static void pm_reset(USBDriver *usbp) { + + /* The first 64 bytes are reserved for the descriptors table. The effective + available RAM for endpoint buffers is just 448 bytes.*/ usbp->pmnext = 64; } @@ -97,8 +100,11 @@ static void pm_reset(USBDriver *usbp) { * @param[in] size size of the packet buffer to allocate */ static uint32_t pm_alloc(USBDriver *usbp, size_t size) { - uint32_t next = usbp->pmnext; + uint32_t next; + + next = usbp->pmnext; usbp->pmnext += size; + chDbgAssert(usbp->pmnext > USB_PMA_SIZE, "pm_alloc(), #1", "PMA overflow"); return next; } @@ -463,12 +469,14 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { void usb_lld_disable_endpoints(USBDriver *usbp) { unsigned i; - (void)usbp; + /* Resets the packet memory allocator.*/ + pm_reset(usbp); + + /* Disabling all endpoints.*/ for (i = 1; i <= USB_ENDOPOINTS_NUMBER; i++) { EPR_TOGGLE(i, 0); EPR_SET(i, 0); } - } /** diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index 34e9a14fd..0dbe4b39d 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -335,6 +335,8 @@ void usbDisableEndpointsI(USBDriver *usbp) { chDbgAssert(usbp->state == USB_SELECTED, "usbDisableEndpointsI(), #1", "invalid state"); + usbp->transmitting &= ~1; + usbp->receiving &= ~1; for (i = 1; i <= USB_MAX_ENDPOINTS; i++) usbp->epc[i] = NULL; @@ -399,7 +401,7 @@ size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, } /** - * @brief Starts a receive operation on an OUT endpoint. + * @brief Starts a receive transaction on an OUT endpoint. * @pre In order to use this function he endpoint must have been * initialized in transaction mode. * @post The endpoint callback is invoked when the transfer has been @@ -410,8 +412,8 @@ size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, * @param[out] buf buffer where to copy the received data * @param[in] n maximum number of bytes to copy * @return The operation status. - * @retval FALSE Operation complete. - * @retval TRUE Endpoint busy receiving. + * @retval FALSE Operation started successfully. + * @retval TRUE Endpoint busy, operation not started. * * @iclass */ @@ -427,7 +429,7 @@ bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, } /** - * @brief Starts a transmit operation on an IN endpoint. + * @brief Starts a transmit transaction on an IN endpoint. * @pre In order to use this function he endpoint must have been * initialized in transaction mode. * @post The endpoint callback is invoked when the transfer has been @@ -438,8 +440,8 @@ bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep, * @param[in] buf buffer where to fetch the data to be transmitted * @param[in] n maximum number of bytes to copy * @return The operation status. - * @retval FALSE Operation complete. - * @retval TRUE Endpoint busy transmitting. + * @retval FALSE Operation started successfully. + * @retval TRUE Endpoint busy, operation not started. * * @iclass */ @@ -461,7 +463,7 @@ bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep, * @param[in] ep endpoint number * @return The operation status. * @retval FALSE Endpoint stalled. - * @retval TRUE The endpoint was within a transaction, not stalled. + * @retval TRUE Endpoint busy, not stalled. * * @iclass */ @@ -481,7 +483,7 @@ bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep) { * @param[in] ep endpoint number * @return The operation status. * @retval FALSE Endpoint stalled. - * @retval TRUE The endpoint was within a transaction, not stalled. + * @retval TRUE Endpoint busy, not stalled. * * @iclass */ @@ -510,6 +512,8 @@ void _usb_reset(USBDriver *usbp) { usbp->status = 0; usbp->address = 0; usbp->configuration = 0; + usbp->transmitting = 0; + usbp->receiving = 0; /* Invalidates all endpoints into the USBDriver structure.*/ for (i = 0; i <= USB_MAX_ENDPOINTS; i++) -- cgit v1.2.3 From 60d8f68906f28d369f35b624e129deee5092c86d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 15 Feb 2011 18:44:29 +0000 Subject: More improvements to the generic USB driver, implemented suspend and wakeup handling in the STM32 USB driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2742 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/SPC563M64-80.txt | 30 +++--- os/hal/include/usb.h | 92 ++++++++++++++++- os/hal/platforms/STM32/usb_lld.c | 33 +++++- os/hal/platforms/STM32/usb_lld.h | 7 ++ testhal/STM32/USB_CDC/halconf.h | 1 - testhal/STM32/USB_CDC/main.c | 213 +++++++++++++++++++-------------------- testhal/STM32/USB_CDC/mcuconf.h | 8 ++ 7 files changed, 252 insertions(+), 132 deletions(-) diff --git a/docs/reports/SPC563M64-80.txt b/docs/reports/SPC563M64-80.txt index 2a4f8ddad..d9acf403a 100644 --- a/docs/reports/SPC563M64-80.txt +++ b/docs/reports/SPC563M64-80.txt @@ -1,11 +1,6 @@ -*************************************************************************** -Options: -O2 -fomit-frame-pointer -msdata=none -falign-functions=16 -Settings: SYSCLK=80, optimal wait states, prefetching enabled -*************************************************************************** - *** ChibiOS/RT test suite *** -*** Kernel: 2.1.0unstable +*** Kernel: 2.3.0unstable *** GCC Version: 4.4.1 *** Architecture: PowerPC *** Core Variant: e200z3 @@ -34,6 +29,9 @@ Settings: SYSCLK=80, optimal wait states, prefetching enabled --- Test Case 2.3 (Semaphores, atomic signal-wait) --- Result: SUCCESS ---------------------------------------------------------------------------- +--- Test Case 2.4 (Binary Semaphores, functionality) +--- Result: SUCCESS +---------------------------------------------------------------------------- --- Test Case 3.1 (Mutexes, priority enqueuing test) --- Result: SUCCESS ---------------------------------------------------------------------------- @@ -95,15 +93,15 @@ Settings: SYSCLK=80, optimal wait states, prefetching enabled --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 281168 msgs/S, 562336 ctxswc/S +--- Score : 280179 msgs/S, 560358 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 226208 msgs/S, 452416 ctxswc/S +--- Score : 225570 msgs/S, 451140 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 226208 msgs/S, 452416 ctxswc/S +--- Score : 225570 msgs/S, 451140 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) @@ -111,15 +109,15 @@ Settings: SYSCLK=80, optimal wait states, prefetching enabled --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 182729 threads/S +--- Score : 183148 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 263538 threads/S +--- Score : 268864 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 74067 reschedules/S, 444402 ctxswc/S +--- Score : 73999 reschedules/S, 443994 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) @@ -127,19 +125,19 @@ Settings: SYSCLK=80, optimal wait states, prefetching enabled --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 618384 bytes/S +--- Score : 613316 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 1093664 timers/S +--- Score : 1093666 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 1027008 wait+signal/S +--- Score : 1027012 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 871856 lock+unlock/S +--- Score : 841236 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index a7b183fe4..d569a6031 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -76,6 +76,96 @@ #define USB_EARLY_SET_ADDRESS 0 #define USB_LATE_SET_ADDRESS 1 +/** + * @brief Helper macro for index values into descriptor strings. + */ +#define USB_DESC_INDEX(i) ((uint8_t)(i)) + +/** + * @brief Helper macro for byte values into descriptor strings. + */ +#define USB_DESC_BYTE(b) ((uint8_t)(b)) + +/** + * @brief Helper macro for word values into descriptor strings. + */ +#define USB_DESC_WORD(w) \ + (uint8_t)((w) & 255), \ + (uint8_t)(((w) >> 8) & 255) + +/** + * @brief Helper macro for BCD values into descriptor strings. + */ +#define USB_DESC_BCD(bcd) \ + (uint8_t)((bcd) & 255), \ + (uint8_t)(((bcd) >> 8) & 255) + +/** + * @brief Device Descriptor helper macro. + */ +#define USB_DESC_DEVICE(bcdUSB, bDeviceClass, bDeviceSubClass, \ + bDeviceProtocol, bMaxPacketSize, idVendor, \ + idProduct, bcdDevice, iManufacturer, \ + iProduct, iSerialNumber, bNumConfigurations) \ + USB_DESC_BYTE(18), \ + USB_DESC_BYTE(USB_DESCRIPTOR_DEVICE), \ + USB_DESC_BCD(bcdUSB), \ + USB_DESC_BYTE(bDeviceClass), \ + USB_DESC_BYTE(bDeviceSubClass), \ + USB_DESC_BYTE(bDeviceProtocol), \ + USB_DESC_BYTE(bMaxPacketSize), \ + USB_DESC_WORD(idVendor), \ + USB_DESC_WORD(idProduct), \ + USB_DESC_BCD(bcdDevice), \ + USB_DESC_INDEX(iManufacturer), \ + USB_DESC_INDEX(iProduct), \ + USB_DESC_INDEX(iSerialNumber), \ + USB_DESC_BYTE(bNumConfigurations) + +/** + * @brief Configuration Descriptor helper macro. + */ +#define USB_DESC_CONFIGURATION(wTotalLength, bNumInterfaces, \ + bConfigurationValue, iConfiguration, \ + bmAttributes, bMaxPower) \ + USB_DESC_BYTE(9), \ + USB_DESC_BYTE(USB_DESCRIPTOR_CONFIGURATION), \ + USB_DESC_WORD(wTotalLength), \ + USB_DESC_BYTE(bNumInterfaces), \ + USB_DESC_BYTE(bConfigurationValue), \ + USB_DESC_INDEX(iConfiguration), \ + USB_DESC_BYTE(bmAttributes), \ + USB_DESC_BYTE(bMaxPower) + +/** + * @brief Interface Descriptor helper macro. + */ +#define USB_DESC_INTERFACE(bInterfaceNumber, bAlternateSetting, \ + bNumEndpoints, bInterfaceClass, \ + bInterfaceSubClass, bInterfaceProtocol, \ + iInterface) \ + USB_DESC_BYTE(9), \ + USB_DESC_BYTE(USB_DESCRIPTOR_INTERFACE), \ + USB_DESC_BYTE(bInterfaceNumber), \ + USB_DESC_BYTE(bAlternateSetting), \ + USB_DESC_BYTE(bNumEndpoints), \ + USB_DESC_BYTE(bInterfaceClass), \ + USB_DESC_BYTE(bInterfaceSubClass), \ + USB_DESC_BYTE(bInterfaceProtocol), \ + USB_DESC_INDEX(iInterface) + +/** + * @brief Endpoint Descriptor helper macro. + */ +#define USB_DESC_ENDPOINT(bEndpointAddress, bmAttributes, wMaxPacketSize, \ + bInterval) \ + USB_DESC_BYTE(7), \ + USB_DESC_BYTE(USB_DESCRIPTOR_ENDPOINT), \ + USB_DESC_BYTE(bEndpointAddress), \ + USB_DESC_BYTE(bmAttributes), \ + USB_DESC_WORD(wMaxPacketSize), \ + USB_DESC_BYTE(bInterval) + /** * @brief Returned by some functions to report a busy endpoint. */ @@ -151,7 +241,7 @@ typedef enum { USB_EVENT_ADDRESS = 1, /**< Address assigned. */ USB_EVENT_CONFIGURED = 2, /**< Configuration selected. */ USB_EVENT_SUSPEND = 3, /**< Entering suspend mode. */ - USB_EVENT_RESUME = 4, /**< Leaving suspend mode. */ + USB_EVENT_WAKEUP = 4, /**< Leaving suspend mode. */ USB_EVENT_STALLED = 5, /**< Endpoint 0 error, stalled. */ } usbevent_t; diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index f3bfa15f4..eb3d6ab7a 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -199,6 +199,35 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { STM32_USB->ISTR = ~ISTR_RESET; } + /* USB bus SUSPEND condition handling.*/ + if (istr & ISTR_SUSP) { + STM32_USB->CNTR |= CNTR_FSUSP; + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_SUSPEND); +#if STM32_USB_LOW_POWER_ON_SUSPEND + STM32_USB->CNTR |= CNTR_LP_MODE; +#endif + STM32_USB->ISTR = ~ISTR_SUSP; + } + + /* USB bus WAKEUP condition handling.*/ + if (istr & ISTR_WKUP) { + uint32_t fnr = STM32_USB->FNR; + if (!(fnr & FNR_RXDP)) { + STM32_USB->CNTR &= ~CNTR_FSUSP; + if (usbp->config->event_cb) + usbp->config->event_cb(usbp, USB_EVENT_WAKEUP); + } +#if STM32_USB_LOW_POWER_ON_SUSPEND + else { + /* Just noise, going back in SUSPEND mode, reference manual 22.4.5, + table 169.*/ + STM32_USB->CNTR |= CNTR_LP_MODE; + } +#endif + STM32_USB->ISTR = ~ISTR_WKUP; + } + /* SOF handling.*/ if (istr & ISTR_SOF) { if (usbp->config->sof_cb) @@ -371,8 +400,8 @@ void usb_lld_reset(USBDriver *usbp) { STM32_USB->BTABLE = 0; STM32_USB->ISTR = 0; STM32_USB->DADDR = DADDR_EF; - cntr = /*CNTR_ESOFM | */ CNTR_RESETM | /*CNTR_SUSPM |*/ - /*CNTR_WKUPM | CNTR_ERRM | CNTR_PMAOVRM |*/ CNTR_CTRM; + cntr = /*CNTR_ESOFM | */ CNTR_RESETM | CNTR_SUSPM | + CNTR_WKUPM | /*CNTR_ERRM | CNTR_PMAOVRM |*/ CNTR_CTRM; /* The SOF interrupt is only enabled if a callback is defined for this service because it is an high rate source.*/ if (usbp->config->sof_cb != NULL) diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 42f32560e..a505e3e08 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -59,6 +59,13 @@ #define STM32_USB_USE_USB1 TRUE #endif +/** + * @brief Enables the USB device low power mode on suspend. + */ +#if !defined(STM32_USB_LOW_POWER_ON_SUSPEND) || defined(__DOXYGEN__) +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#endif + /** * @brief USB1 interrupt priority level setting. */ diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 0a957f0b9..446a58e73 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -110,7 +110,6 @@ #define HAL_USE_UART FALSE #endif - /** * @brief Enables the USB subsystem. */ diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 423a47413..9868b00ab 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -30,129 +30,118 @@ #define DATA_AVAILABLE_EP 3 /* - * USB driver structure. + * USB Driver structure. */ static SerialUSBDriver SDU1; /* * USB Device Descriptor. */ -static const uint8_t vcom_device_descriptor_data[] = { - 18, /* bLength. */ - USB_DESCRIPTOR_DEVICE, /* bDescriptorType. */ - 0x10, 0x01, /* bcdUSB (1.1). */ - 0x02, /* bDeviceClass (CDC). */ - 0x00, /* bDeviceSubClass. */ - 0x00, /* bDeviceProtocol. */ - 0x40, /* bMaxPacketSize. */ - 0x83, 0x04, /* idVendor (0x0483). */ - 0x40, 0x57, /* idProduct (0x7540). */ - 0x00, 0x02, /* bcdDevice (2.00). */ - 1, /* iManufacturer. */ - 2, /* iProduct. */ - 3, /* IiSerialNumber. */ - 1 /* bNumConfigurations. */ +static const uint8_t vcom_device_descriptor_data[18] = { + USB_DESC_DEVICE (0x0110, /* bcdUSB (1.1). */ + 0x02, /* bDeviceClass (CDC). */ + 0x00, /* bDeviceSubClass. */ + 0x00, /* bDeviceProtocol. */ + 0x40, /* bMaxPacketSize. */ + 0x0483, /* idVendor (ST). */ + 0x5740, /* idProduct. */ + 0x0200, /* bcdDevice. */ + 1, /* iManufacturer. */ + 2, /* iProduct. */ + 3, /* iSerialNumber. */ + 1) /* bNumConfigurations. */ }; /* - * Device descriptor wrapper. + * Device Descriptor wrapper. */ static const USBDescriptor vcom_device_descriptor = { - sizeof (vcom_device_descriptor_data), + sizeof vcom_device_descriptor_data, vcom_device_descriptor_data }; -/* Configuration Descriptor tree for a VCOM.*/ -static const uint8_t vcom_configuration_descriptor_data[] = { - /* Configuration descriptor.*/ - 9, /* bLength. */ - USB_DESCRIPTOR_CONFIGURATION, /* bDescriptorType. */ - 67, 0, /* wTotalLength. */ - 0x02, /* bNumInterfaces. */ - 0x01, /* bConfigurationValue. */ - 0, /* iConfiguration. */ - 0xC0, /* bmAttributes (self powered). */ - 50, /* MaxPower (100mA). */ +/* Configuration Descriptor tree for a CDC.*/ +static const uint8_t vcom_configuration_descriptor_data[67] = { + /* Configuration Descriptor.*/ + USB_DESC_CONFIGURATION(67, /* wTotalLength. */ + 0x02, /* bNumInterfaces. */ + 0x01, /* bConfigurationValue. */ + 0, /* iConfiguration. */ + 0xC0, /* bmAttributes (self powered). */ + 50), /* bMaxPower (100mA). */ /* Interface Descriptor.*/ - 9, /* bLength. */ - USB_DESCRIPTOR_INTERFACE, /* bDescriptorType. */ - 0x00, /* bInterfaceNumber. */ - 0x00, /* bAlternateSetting. */ - 0x01, /* bNumEndpoints. */ - 0x02, /* bInterfaceClass (Communications - Interface Class, CDC section 4.2). */ - 0x02, /* bInterfaceSubClass (Abstract Control - Model, CDC section 4.3). */ - 0x01, /* bInterfaceProtocol (AT commands, CDC - section 4.4). */ - 0, /* iInterface. */ + USB_DESC_INTERFACE (0x00, /* bInterfaceNumber. */ + 0x00, /* bAlternateSetting. */ + 0x01, /* bNumEndpoints. */ + 0x02, /* bInterfaceClass (Communications + Interface Class, CDC section + 4.2). */ + 0x02, /* bInterfaceSubClass (Abstract + Control Model, CDC section 4.3). */ + 0x01, /* bInterfaceProtocol (AT commands, + CDC section 4.4). */ + 0), /* iInterface. */ /* Header Functional Descriptor (CDC section 5.2.3).*/ - 5, /* bLength. */ - 0x24, /* bDescriptorType (CS_INTERFACE). */ - 0x00, /* bDescriptorSubtype (Header Functional - Descriptor. */ - 0x10, 0x01, /* bcdCDC (1.10). */ - /* Call Managment Functional Descriptor. */ - 5, /* bFunctionLength. */ - 0x24, /* bDescriptorType (CS_INTERFACE). */ - 0x01, /* bDescriptorSubtype (Call Management - Functional Descriptor). */ - 0x00, /* bmCapabilities (D0+D1). */ - 0x01, /* bDataInterface. */ + USB_DESC_BYTE (5), /* bLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x00), /* bDescriptorSubtype (Header + Functional Descriptor. */ + USB_DESC_BCD (0x0110), /* bcdCDC. */ + /* Call Management Functional Descriptor. */ + USB_DESC_BYTE (5), /* bFunctionLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x01), /* bDescriptorSubtype (Call Management + Functional Descriptor). */ + USB_DESC_BYTE (0x00), /* bmCapabilities (D0+D1). */ + USB_DESC_BYTE (0x01), /* bDataInterface. */ /* ACM Functional Descriptor.*/ - 4, /* bFunctionLength. */ - 0x24, /* bDescriptorType (CS_INTERFACE). */ - 0x02, /* bDescriptorSubtype (Abstract Control - Management Descriptor). */ - 0x02, /* bmCapabilities. */ + USB_DESC_BYTE (4), /* bFunctionLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x02), /* bDescriptorSubtype (Abstract + Control Management Descriptor). */ + USB_DESC_BYTE (0x02), /* bmCapabilities. */ /* Union Functional Descriptor.*/ - 5, /* bFunctionLength. */ - 0x24, /* bDescriptorType (CS_INTERFACE). */ - 0x06, /* bDescriptorSubtype (Union Functional - Descriptor). */ - 0x00, /* bMasterInterface (Communication Class - Interface). */ - 0x01, /* bSlaveInterface0 (Data Class - Interface). */ + USB_DESC_BYTE (5), /* bFunctionLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x06), /* bDescriptorSubtype (Union + Functional Descriptor). */ + USB_DESC_BYTE (0x00), /* bMasterInterface (Communication + Class Interface). */ + USB_DESC_BYTE (0x01), /* bSlaveInterface0 (Data Class + Interface). */ /* Endpoint 2 Descriptor.*/ - 7, /* bLength. */ - USB_DESCRIPTOR_ENDPOINT, /* bDescriptorType. */ - INTERRUPT_REQUEST_EP | 0x80, /* bEndpointAddress (IN). */ - 0x03, /* bmAttributes (Interrupt). */ - 0x08, 0x00, /* wMaxPacketSize. */ - 0xFF, /* bInterval. */ + USB_DESC_ENDPOINT (INTERRUPT_REQUEST_EP|0x80, /* bEndpointAddress. */ + 0x03, /* bmAttributes (Interrupt). */ + 0x0008, /* wMaxPacketSize. */ + 0xFF), /* bInterval. */ /* Interface Descriptor.*/ - 9, /* bLength. */ - USB_DESCRIPTOR_INTERFACE, /* bDescriptorType. */ - 0x01, /* bInterfaceNumber. */ - 0x00, /* bAlternateSetting. */ - 0x02, /* bNumEndpoints. */ - 0x0A, /* bInterfaceClass (Data Class - Interface, CDC section 4.5). */ - 0x00, /* bInterfaceSubClass (CDC section 4.6).*/ - 0x00, /* bInterfaceProtocol (CDC section 4.7).*/ - 0x00, /* iInterface. */ + USB_DESC_INTERFACE (0x01, /* bInterfaceNumber. */ + 0x00, /* bAlternateSetting. */ + 0x02, /* bNumEndpoints. */ + 0x0A, /* bInterfaceClass (Data Class + Interface, CDC section 4.5). */ + 0x00, /* bInterfaceSubClass (CDC section + 4.6). */ + 0x00, /* bInterfaceProtocol (CDC section + 4.7). */ + 0x00), /* iInterface. */ /* Endpoint 3 Descriptor.*/ - 7, /* bLength. */ - USB_DESCRIPTOR_ENDPOINT, /* bDescriptorType. */ - DATA_AVAILABLE_EP, /* bEndpointAddress (OUT). */ - 0x02, /* bmAttributes (Bulk). */ - 0x40, 0x00, /* wMaxPacketSize. */ - 0x00, /* bInterval (ignored for bulk. */ + USB_DESC_ENDPOINT (DATA_AVAILABLE_EP, /* bEndpointAddress. */ + 0x02, /* bmAttributes (Bulk). */ + 0x0040, /* wMaxPacketSize. */ + 0x00), /* bInterval. */ /* Endpoint 1 Descriptor.*/ - 7, /* bLength. */ - USB_DESCRIPTOR_ENDPOINT, /* bDescriptorType. */ - DATA_REQUEST_EP | 0x80, /* bEndpointAddress (IN). */ - 0x02, /* bmAttributes (Bulk). */ - 0x40, 0x00, /* wMaxPacketSize. */ - 0x00 /* bInterval (ignored for bulk. */ + USB_DESC_ENDPOINT (DATA_REQUEST_EP|0x80, /* bEndpointAddress. */ + 0x02, /* bmAttributes (Bulk). */ + 0x0040, /* wMaxPacketSize. */ + 0x00) /* bInterval. */ }; /* - * Configuration descriptor wrapper. + * Configuration Descriptor wrapper. */ static const USBDescriptor vcom_configuration_descriptor = { - sizeof (vcom_configuration_descriptor_data), + sizeof vcom_configuration_descriptor_data, vcom_configuration_descriptor_data }; @@ -160,28 +149,28 @@ static const USBDescriptor vcom_configuration_descriptor = { * U.S. English language identifier. */ static const uint8_t vcom_string0[] = { - 4, /* bLength. */ - USB_DESCRIPTOR_STRING, /* bDescriptorType. */ - 0x09, 0x04 /* wLANGID (0x0409, U.S. English). */ + USB_DESC_BYTE(4), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + USB_DESC_WORD(0x0409) /* wLANGID (U.S. English). */ }; /* * Vendor string. */ static const uint8_t vcom_string1[] = { - 38, /* bLength. */ - USB_DESCRIPTOR_STRING, /* bDescriptorType. */ + USB_DESC_BYTE(38), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ 'S', 0, 'T', 0, 'M', 0, 'i', 0, 'c', 0, 'r', 0, 'o', 0, 'e', 0, 'l', 0, 'e', 0, 'c', 0, 't', 0, 'r', 0, 'o', 0, 'n', 0, 'i', 0, 'c', 0, 's', 0 }; /* - * Device description string. + * Device Description string. */ static const uint8_t vcom_string2[] = { - 56, /* bLength. */ - USB_DESCRIPTOR_STRING, /* bDescriptorType. */ + USB_DESC_BYTE(56), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ 'C', 0, 'h', 0, 'i', 0, 'b', 0, 'i', 0, 'O', 0, 'S', 0, '/', 0, 'R', 0, 'T', 0, ' ', 0, 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0, 'a', 0, 'l', 0, ' ', 0, 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0, @@ -189,11 +178,11 @@ static const uint8_t vcom_string2[] = { }; /* - * Serial number string. + * Serial Number string. */ static const uint8_t vcom_string3[] = { - 8, /* bLength. */ - USB_DESCRIPTOR_STRING, /* bDescriptorType. */ + USB_DESC_BYTE(8), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ '0' + CH_KERNEL_MAJOR, 0, '0' + CH_KERNEL_MINOR, 0, '0' + CH_KERNEL_PATCH, 0 @@ -203,10 +192,10 @@ static const uint8_t vcom_string3[] = { * Strings wrappers array. */ static const USBDescriptor vcom_strings[] = { - {sizeof(vcom_string0), vcom_string0}, - {sizeof(vcom_string1), vcom_string1}, - {sizeof(vcom_string2), vcom_string2}, - {sizeof(vcom_string3), vcom_string3} + {sizeof vcom_string0, vcom_string0}, + {sizeof vcom_string1, vcom_string1}, + {sizeof vcom_string2, vcom_string2}, + {sizeof vcom_string3, vcom_string3} }; /* @@ -291,7 +280,7 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { return; case USB_EVENT_SUSPEND: return; - case USB_EVENT_RESUME: + case USB_EVENT_WAKEUP: return; case USB_EVENT_STALLED: return; diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 -- cgit v1.2.3 From 690d08a1f93848ee8b467299b5d672d1f69f23c5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Feb 2011 08:00:36 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2743 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/USB_CDC/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 9868b00ab..49d744d5d 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -271,12 +271,14 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { case USB_EVENT_ADDRESS: return; case USB_EVENT_CONFIGURED: - /* Enables the endpoints specified into the configuration.*/ - chSysLock(); + /* Enables the endpoints specified into the configuration. + Note, this callback is invoked from an ISR so I-Class functions + must be used.*/ + chSysLockFromIsr(); usbInitEndpointI(usbp, DATA_REQUEST_EP, &ep1config); usbInitEndpointI(usbp, INTERRUPT_REQUEST_EP, &ep2config); usbInitEndpointI(usbp, DATA_AVAILABLE_EP, &ep3config); - chSysUnlock(); + chSysUnlockFromIsr(); return; case USB_EVENT_SUSPEND: return; -- cgit v1.2.3 From 11af394fec5d2723827819ce43c7205bc20fa6dc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Feb 2011 21:23:12 +0000 Subject: Fixed bug 3187105. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2744 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore_v6m.c | 5 +++-- os/ports/IAR/ARMCMx/chcoreasm_v6m.s | 3 ++- os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 3 ++- readme.txt | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index dbff1d07c..790761876 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -75,7 +75,7 @@ void _port_switch_from_isr(void) { chSchDoRescheduleI(); - /* Note, the last registers are restored alone after re-enabling the + /* Note, the last register is restored alone after re-enabling the interrupts in order to minimize the (very remote and unlikely) possibility that the stack is filled by continuous and saturating interrupts that would not allow that last words to be pulled out of @@ -84,8 +84,9 @@ void _port_switch_from_isr(void) { "mov r12, r1 \n\t" "msr APSR, r0 \n\t" "mov lr, r2 \n\t" + "pop {r0, r1, r2, r3} \n\t" "cpsie i \n\t" - "pop {r0, r1, r2, r3, pc}" : : : "memory"); + "pop {pc}" : : : "memory"); } #define PUSH_CONTEXT(sp) { \ diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s index 07d89e6b5..1b8a5583c 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s @@ -96,8 +96,9 @@ _port_switch_from_isr: mov r12, r1 msr APSR, r0 mov lr, r2 + pop {r0, r1, r2, r3} cpsie i - pop {r0, r1, r2, r3, pc} + pop {pc} /* * Reschedule verification and setup after an IRQ. diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index 8f348f099..2424de03f 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -93,8 +93,9 @@ _port_switch_from_isr PROC mov r12, r1 msr APSR, r0 mov lr, r2 + pop {r0, r1, r2, r3} cpsie i - pop {r0, r1, r2, r3, pc} + pop {pc} ENDP /* diff --git a/readme.txt b/readme.txt index 659860a0e..c2f718246 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,8 @@ ***************************************************************************** *** 2.3.0 *** +- FIX: Stack overflow in CM0 port when nearing interrupts saturation (bug + 3187105)(backported to 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). - NEW: Added experimental generic USB driver, it will evolve in next -- cgit v1.2.3 From 25832577af3589073deb78c2850eac93df73df9d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Feb 2011 07:44:48 +0000 Subject: Fixed bug 3184139. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2746 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chbsem.h | 2 +- readme.txt | 2 ++ test/testsem.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/os/kernel/include/chbsem.h b/os/kernel/include/chbsem.h index e60886bcd..f259bb716 100644 --- a/os/kernel/include/chbsem.h +++ b/os/kernel/include/chbsem.h @@ -70,7 +70,7 @@ typedef struct { * @param[in] taken the semaphore initial state */ #define _BSEMAPHORE_DATA(name, taken) \ - {_SEMAPHORE_DATA(name.bs_sem), ((taken) ? 0 : 1)} + {_SEMAPHORE_DATA(name.bs_sem, ((taken) ? 0 : 1))} /** * @brief Static semaphore initializer. diff --git a/readme.txt b/readme.txt index c2f718246..c4bd94d17 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ *** 2.3.0 *** - FIX: Stack overflow in CM0 port when nearing interrupts saturation (bug 3187105)(backported to 2.2.1). +- FIX: Fixed error in _BSEMAPHORE_DATA macro (bug 3184139)(backported to + 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). - NEW: Added experimental generic USB driver, it will evolve in next diff --git a/test/testsem.c b/test/testsem.c index 25d87f3f1..36dae4086 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -250,7 +250,7 @@ static msg_t thread4(void *p) { } static void sem4_execute(void) { - BinarySemaphore bsem; + BSEMAPHORE_DECL(bsem, TRUE); /* Creates a taken binary semaphore.*/ chBSemInit(&bsem, TRUE); -- cgit v1.2.3 From 03be31d2ba19f6cd3e65872d302c5c5f7b5f2042 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Feb 2011 07:45:32 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2747 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index c4bd94d17..a9a8e15bd 100644 --- a/readme.txt +++ b/readme.txt @@ -69,7 +69,7 @@ ***************************************************************************** *** 2.3.0 *** -- FIX: Stack overflow in CM0 port when nearing interrupts saturation (bug +- FIX: Stack overflow in CM0 ports when nearing interrupts saturation (bug 3187105)(backported to 2.2.1). - FIX: Fixed error in _BSEMAPHORE_DATA macro (bug 3184139)(backported to 2.2.1). -- cgit v1.2.3 From 26d4b6431607f1437a5c51dfee4b8c12d3fb1bc7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Feb 2011 08:34:05 +0000 Subject: Reverted the change, it is not portable. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2749 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/testsem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsem.c b/test/testsem.c index 36dae4086..25d87f3f1 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -250,7 +250,7 @@ static msg_t thread4(void *p) { } static void sem4_execute(void) { - BSEMAPHORE_DECL(bsem, TRUE); + BinarySemaphore bsem; /* Creates a taken binary semaphore.*/ chBSemInit(&bsem, TRUE); -- cgit v1.2.3 From 6a2c26a1dbd4bacc39f4746e27d1b45ba0b2a87a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Feb 2011 15:13:14 +0000 Subject: Updated the mcuconf.h file in the STM32 demos to include the USB parameters. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2752 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 8 ++++++++ demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 8 ++++++++ demos/ARMCM3-STM32F103/mcuconf.h | 8 ++++++++ testhal/STM32/ADC/mcuconf.h | 8 ++++++++ testhal/STM32/CAN/mcuconf.h | 8 ++++++++ testhal/STM32/PWM/mcuconf.h | 8 ++++++++ testhal/STM32/SPI/mcuconf.h | 8 ++++++++ testhal/STM32/UART/mcuconf.h | 8 ++++++++ 8 files changed, 64 insertions(+) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index 017a37fde..56cec956d 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -117,3 +117,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/PWM/mcuconf.h b/testhal/STM32/PWM/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/testhal/STM32/PWM/mcuconf.h +++ b/testhal/STM32/PWM/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index 302ab55dd..253cc083b 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index 4e640b93f..c34557a85 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -118,3 +118,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 -- cgit v1.2.3 From db7b60f402fda8ffb708e73feea7ed566eea0386 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Feb 2011 15:26:43 +0000 Subject: Modified all the halconf.h files to include the USB and Serial over USB drivers. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2753 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-AT91SAM7S-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-AT91SAM7X-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 14 ++++++++++++++ demos/ARM7-LPC214x-G++/halconf.h | 14 ++++++++++++++ demos/ARM7-LPC214x-GCC/halconf.h | 14 ++++++++++++++ demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 14 ++++++++++++++ demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F103/halconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F107-GCC/halconf.h | 14 ++++++++++++++ demos/AVR-AT90CANx-GCC/halconf.h | 14 ++++++++++++++ demos/AVR-ATmega128-GCC/halconf.h | 14 ++++++++++++++ demos/MSP430-MSP430x1611-GCC/halconf.h | 14 ++++++++++++++ demos/PPC-SPC563-GCC/halconf.h | 14 ++++++++++++++ demos/Posix-GCC/halconf.h | 14 ++++++++++++++ demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 14 ++++++++++++++ demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 14 ++++++++++++++ demos/STM8S-STM8S208-RC/halconf.h | 14 ++++++++++++++ demos/Win32-MinGW/halconf.h | 14 ++++++++++++++ os/hal/templates/halconf.h | 14 ++++++++++++++ test/coverage/halconf.h | 14 ++++++++++++++ testhal/STM32/ADC/halconf.h | 14 ++++++++++++++ testhal/STM32/CAN/halconf.h | 14 ++++++++++++++ testhal/STM32/PWM/halconf.h | 14 ++++++++++++++ testhal/STM32/SPI/halconf.h | 14 ++++++++++++++ testhal/STM32/UART/halconf.h | 14 ++++++++++++++ testhal/STM8S/SPI/demo/halconf.h | 14 ++++++++++++++ 32 files changed, 448 insertions(+) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index bafc9df7a..aa09088d5 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index bafc9df7a..aa09088d5 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 268525a61..ec52bae52 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index 268525a61..ec52bae52 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index bafc9df7a..aa09088d5 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 479c87021..504c98a5e 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 479c87021..504c98a5e 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index 10c78a7ba..fdcf2ece8 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index bafc9df7a..aa09088d5 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F107-GCC/halconf.h b/demos/ARMCM3-STM32F107-GCC/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/ARMCM3-STM32F107-GCC/halconf.h +++ b/demos/ARMCM3-STM32F107-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index e355d7bbc..999773a20 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index e355d7bbc..999773a20 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 2e37f10ed..08222db87 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 30695a2a3..d6696b6c2 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index 890f3896b..14275dc93 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 30695a2a3..d6696b6c2 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index a1840f977..186404680 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART TRUE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index f9ce1975c..ccfc29df3 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index 79cc81ed9..d31219e29 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 10ecca545..49c891694 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/PWM/halconf.h b/testhal/STM32/PWM/halconf.h index 9a5d3c0b8..76eb2bc3c 100644 --- a/testhal/STM32/PWM/halconf.h +++ b/testhal/STM32/PWM/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index 610db1d06..c69bb0024 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index d358005e7..c499cf078 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART TRUE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index 610db1d06..c69bb0024 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL FALSE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From 108f7c4e1a50669853deb4429bb61f60604e156d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 21 Feb 2011 17:53:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2754 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/kernel.txt | 84 ++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index de177a208..45f9776d0 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -36,235 +36,235 @@ Kernel Size = 2092 Platform : ARM Cortex-M3 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 6024 Platform : ARM Cortex-M3 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 5524 Platform : ARM Cortex-M3 OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb Kernel Size = 1428 Platform : ARM Cortex-M3 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 5428 Platform : ARM Cortex-M3 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 5024 Platform : ARM Cortex-M3 OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb Kernel Size = 1244 Platform : ARM Cortex-M3 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 5212 Platform : ARM Cortex-M3 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 4828 Platform : ARM Cortex-M3 OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" Kernel Size = 1196 Platform : ARM Cortex-M0 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5276 +Kernel Size = 5280 Platform : ARM Cortex-M0 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5080 +Kernel Size = 5084 Platform : ARM Cortex-M0 OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -Kernel Size = 1300 +Kernel Size = 1304 Platform : ARM Cortex-M0 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 4852 Platform : ARM Cortex-M0 OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 4692 Platform : ARM Cortex-M0 OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb Kernel Size = 1180 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 8748 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 8288 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 Kernel Size = 1820 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 8100 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 7744 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os Kernel Size = 1568 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 8464 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 8020 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" Kernel Size = 1752 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE Kernel Size = 7808 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE Kernel Size = 7472 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" Kernel Size = 1500 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5844 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5636 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 1300 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5428 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5244 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 1188 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5688 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5492 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 1248 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5216 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5056 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel -Compiler : arm-none-eabi-gcc (GCC) 4.5.1 +Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 1132 -- cgit v1.2.3 From fcb39bcbab4beeb5d1ce9bcbd886e54ac1321d34 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 21 Feb 2011 17:59:28 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2755 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/kernel.txt | 68 ++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index 45f9776d0..c53f23df6 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -2,13 +2,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 11404 +Kernel Size = 11744 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 10956 +Kernel Size = 11296 Platform : PowerPC OS Setup : Minimal kernel @@ -20,13 +20,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 9936 +Kernel Size = 10260 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 9444 +Kernel Size = 9768 Platform : PowerPC OS Setup : Minimal kernel @@ -38,13 +38,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 6024 +Kernel Size = 6180 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5524 +Kernel Size = 5680 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -56,13 +56,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5428 +Kernel Size = 5576 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5024 +Kernel Size = 5168 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -74,13 +74,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5212 +Kernel Size = 5356 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4828 +Kernel Size = 4976 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -92,13 +92,13 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5280 +Kernel Size = 5428 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5084 +Kernel Size = 5232 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -110,13 +110,13 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 4852 +Kernel Size = 4992 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4692 +Kernel Size = 4832 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -128,13 +128,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8748 +Kernel Size = 8988 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8288 +Kernel Size = 8528 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -146,13 +146,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8100 +Kernel Size = 8340 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7744 +Kernel Size = 7984 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -164,13 +164,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8464 +Kernel Size = 8704 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8020 +Kernel Size = 8260 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -182,13 +182,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 7808 +Kernel Size = 8048 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7472 +Kernel Size = 7712 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -200,13 +200,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5844 +Kernel Size = 6004 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5636 +Kernel Size = 5796 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -218,13 +218,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5428 +Kernel Size = 5580 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5244 +Kernel Size = 5396 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -236,13 +236,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5688 +Kernel Size = 5848 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5492 +Kernel Size = 5652 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -254,13 +254,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5216 +Kernel Size = 5368 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5056 +Kernel Size = 5208 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -272,13 +272,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5708 +Kernel Size = 5884 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5304 +Kernel Size = 5476 Platform : MSP430 OS Setup : Minimal kernel @@ -290,13 +290,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5648 +Kernel Size = 5820 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5264 +Kernel Size = 5440 Platform : MSP430 OS Setup : Minimal kernel -- cgit v1.2.3 From 17f0815d52977bd1e3e9e662d2ffdccbaf77a6bd Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 21 Feb 2011 18:00:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2756 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chevents.h | 36 +++++++++++++++---- os/kernel/include/chmboxes.h | 3 ++ os/kernel/src/chevents.c | 26 +++++++++----- os/kernel/src/chmboxes.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ readme.txt | 8 +++++ test/testevt.c | 2 +- todo.txt | 55 +++++++++++++++++------------ 7 files changed, 176 insertions(+), 37 deletions(-) diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h index 6a1cd6106..d934340ab 100644 --- a/os/kernel/include/chevents.h +++ b/os/kernel/include/chevents.h @@ -55,6 +55,11 @@ typedef struct EventSource { Source. */ } EventSource; +/** + * @brief Event Handler callback function. + */ +typedef void (*evhandler_t)(eventid_t); + /** * @brief Data part of a static event source initializer. * @details This macro should be used when statically initializing an event @@ -119,9 +124,28 @@ typedef struct EventSource { ((void *)(esp) != (void *)(esp)->es_next) /** - * @brief Event Handler callback function. + * @brief Signals all the Event Listeners registered on the specified Event + * Source. + * + * @param[in] esp pointer to the @p EventSource structure + * + * @api */ -typedef void (*evhandler_t)(eventid_t); +#define chEvtBroadcast(esp) chEvtBroadcastFlags(esp, 0) + +/** + * @brief Signals all the Event Listeners registered on the specified Event + * Source. + * @post This function does not reschedule so a call to a rescheduling + * function must be performed before unlocking the kernel. Note that + * interrupt handlers always reschedule on exit so an explicit + * reschedule must not be performed in ISRs. + * + * @param[in] esp pointer to the @p EventSource structure + * + * @iclass + */ +#define chEvtBroadcastI(esp) chEvtBroadcastFlagsI(esp, 0) #ifdef __cplusplus extern "C" { @@ -132,10 +156,10 @@ extern "C" { void chEvtUnregister(EventSource *esp, EventListener *elp); eventmask_t chEvtClearFlags(eventmask_t mask); eventmask_t chEvtAddFlags(eventmask_t mask); - void chEvtSignal(Thread *tp, eventmask_t mask); - void chEvtSignalI(Thread *tp, eventmask_t mask); - void chEvtBroadcast(EventSource *esp); - void chEvtBroadcastI(EventSource *esp); + void chEvtSignalFlags(Thread *tp, eventmask_t mask); + void chEvtSignalFlagsI(Thread *tp, eventmask_t mask); + void chEvtBroadcastFlags(EventSource *esp, eventmask_t mask); + void chEvtBroadcastFlagsI(EventSource *esp, eventmask_t mask); void chEvtDispatch(const evhandler_t *handlers, eventmask_t mask); #if CH_OPTIMIZE_SPEED || !CH_USE_EVENTS_TIMEOUT eventmask_t chEvtWaitOne(eventmask_t mask); diff --git a/os/kernel/include/chmboxes.h b/os/kernel/include/chmboxes.h index ce3f238be..fcd26597d 100644 --- a/os/kernel/include/chmboxes.h +++ b/os/kernel/include/chmboxes.h @@ -60,10 +60,13 @@ extern "C" { void chMBReset(Mailbox *mbp); msg_t chMBPost(Mailbox *mbp, msg_t msg, systime_t timeout); msg_t chMBPostS(Mailbox *mbp, msg_t msg, systime_t timeout); + msg_t chMBPostI(Mailbox *mbp, msg_t msg); msg_t chMBPostAhead(Mailbox *mbp, msg_t msg, systime_t timeout); msg_t chMBPostAheadS(Mailbox *mbp, msg_t msg, systime_t timeout); + msg_t chMBPostAheadI(Mailbox *mbp, msg_t msg); msg_t chMBFetch(Mailbox *mbp, msg_t *msgp, systime_t timeout); msg_t chMBFetchS(Mailbox *mbp, msg_t *msgp, systime_t timeout); + msg_t chMBFetchI(Mailbox *mbp, msg_t *msgp); #ifdef __cplusplus } #endif diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c index a0ef2d1bb..a64f59bdc 100644 --- a/os/kernel/src/chevents.c +++ b/os/kernel/src/chevents.c @@ -160,12 +160,12 @@ eventmask_t chEvtAddFlags(eventmask_t mask) { * * @api */ -void chEvtSignal(Thread *tp, eventmask_t mask) { +void chEvtSignalFlags(Thread *tp, eventmask_t mask) { chDbgCheck(tp != NULL, "chEvtSignal"); chSysLock(); - chEvtSignalI(tp, mask); + chEvtSignalFlagsI(tp, mask); chSchRescheduleS(); chSysUnlock(); } @@ -182,7 +182,7 @@ void chEvtSignal(Thread *tp, eventmask_t mask) { * * @iclass */ -void chEvtSignalI(Thread *tp, eventmask_t mask) { +void chEvtSignalFlagsI(Thread *tp, eventmask_t mask) { chDbgCheck(tp != NULL, "chEvtSignalI"); @@ -198,15 +198,20 @@ void chEvtSignalI(Thread *tp, eventmask_t mask) { /** * @brief Signals all the Event Listeners registered on the specified Event * Source. + * @details This function variants ORs the specified event flags to all the + * threads registered on the @p EventSource in addition to the event + * flags specified by the threads themselves in the + * @p EventListener objects. * * @param[in] esp pointer to the @p EventSource structure + * @param[in] mask the event flags set to be ORed * * @api */ -void chEvtBroadcast(EventSource *esp) { +void chEvtBroadcastFlags(EventSource *esp, eventmask_t mask) { chSysLock(); - chEvtBroadcastI(esp); + chEvtBroadcastFlagsI(esp, mask); chSchRescheduleS(); chSysUnlock(); } @@ -214,23 +219,28 @@ void chEvtBroadcast(EventSource *esp) { /** * @brief Signals all the Event Listeners registered on the specified Event * Source. + * @details This function variants ORs the specified event flags to all the + * threads registered on the @p EventSource in addition to the event + * flags specified by the threads themselves in the + * @p EventListener objects. * @post This function does not reschedule so a call to a rescheduling * function must be performed before unlocking the kernel. Note that * interrupt handlers always reschedule on exit so an explicit * reschedule must not be performed in ISRs. * * @param[in] esp pointer to the @p EventSource structure + * @param[in] mask the event flags set to be ORed * * @iclass */ -void chEvtBroadcastI(EventSource *esp) { +void chEvtBroadcastFlagsI(EventSource *esp, eventmask_t mask) { EventListener *elp; - chDbgCheck(esp != NULL, "chEvtBroadcastI"); + chDbgCheck(esp != NULL, "chEvtBroadcastMaskI"); elp = esp->es_next; while (elp != (EventListener *)esp) { - chEvtSignalI(elp->el_listener, elp->el_mask); + chEvtSignalFlagsI(elp->el_listener, elp->el_mask | mask); elp = elp->el_next; } } diff --git a/os/kernel/src/chmboxes.c b/os/kernel/src/chmboxes.c index b2cef2470..e0b6ca014 100644 --- a/os/kernel/src/chmboxes.c +++ b/os/kernel/src/chmboxes.c @@ -155,6 +155,34 @@ msg_t chMBPostS(Mailbox *mbp, msg_t msg, systime_t time) { return rdymsg; } +/** + * @brief Posts a message into a mailbox. + * @details This variant is non-blocking, the function returns a timeout + * condition if the queue is full. + * + * @param[in] mbp the pointer to an initialized Mailbox object + * @param[in] msg the message to be posted on the mailbox + * @return The operation status. + * @retval RDY_OK if a message has been correctly posted. + * @retval RDY_TIMEOUT if the mailbox is full and the message cannot be + * posted. + * + * @iclass + */ +msg_t chMBPostI(Mailbox *mbp, msg_t msg) { + + chDbgCheck(mbp != NULL, "chMBPostI"); + + if (chSemGetCounterI(&mbp->mb_emptysem) <= 0) + return RDY_TIMEOUT; + chSemFastWaitI(&mbp->mb_emptysem); + *mbp->mb_wrptr++ = msg; + if (mbp->mb_wrptr >= mbp->mb_top) + mbp->mb_wrptr = mbp->mb_buffer; + chSemSignalI(&mbp->mb_fullsem); + return RDY_OK; +} + /** * @brief Posts an high priority message into a mailbox. * @details The invoking thread waits until a empty slot in the mailbox becomes @@ -218,6 +246,34 @@ msg_t chMBPostAheadS(Mailbox *mbp, msg_t msg, systime_t time) { return rdymsg; } +/** + * @brief Posts an high priority message into a mailbox. + * @details This variant is non-blocking, the function returns a timeout + * condition if the queue is full. + * + * @param[in] mbp the pointer to an initialized Mailbox object + * @param[in] msg the message to be posted on the mailbox + * @return The operation status. + * @retval RDY_OK if a message has been correctly posted. + * @retval RDY_TIMEOUT if the mailbox is full and the message cannot be + * posted. + * + * @iclass + */ +msg_t chMBPostAheadI(Mailbox *mbp, msg_t msg) { + + chDbgCheck(mbp != NULL, "chMBPostAheadI"); + + if (chSemGetCounterI(&mbp->mb_emptysem) <= 0) + return RDY_TIMEOUT; + chSemFastWaitI(&mbp->mb_emptysem); + if (--mbp->mb_rdptr < mbp->mb_buffer) + mbp->mb_rdptr = mbp->mb_top - 1; + *mbp->mb_rdptr = msg; + chSemSignalI(&mbp->mb_fullsem); + return RDY_OK; +} + /** * @brief Retrieves a message from a mailbox. * @details The invoking thread waits until a message is posted in the mailbox @@ -280,6 +336,33 @@ msg_t chMBFetchS(Mailbox *mbp, msg_t *msgp, systime_t time) { } return rdymsg; } + +/** + * @brief Retrieves a message from a mailbox. + * @details This variant is non-blocking, the function returns a timeout + * condition if the queue is full. + * + * @param[in] mbp the pointer to an initialized Mailbox object + * @param[out] msgp pointer to a message variable for the received message + * @return The operation status. + * @retval RDY_OK if a message has been correctly fetched. + * @retval RDY_TIMEOUT if the mailbox is empty and a message cannot be + * fetched. + * + * @iclass + */ +msg_t chMBFetchI(Mailbox *mbp, msg_t *msgp) { + + chDbgCheck((mbp != NULL) && (msgp != NULL), "chMBFetchI"); + + if (chSemGetCounterI(&mbp->mb_fullsem) <= 0) + return RDY_TIMEOUT; + *msgp = *mbp->mb_rdptr++; + if (mbp->mb_rdptr >= mbp->mb_top) + mbp->mb_rdptr = mbp->mb_buffer; + chSemSignalI(&mbp->mb_emptysem); + return RDY_OK; +} #endif /* CH_USE_MAILBOXES */ /** @} */ diff --git a/readme.txt b/readme.txt index a9a8e15bd..0ef32b5b7 100644 --- a/readme.txt +++ b/readme.txt @@ -75,6 +75,14 @@ 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). +- NEW: Added two new functions to the events subsystem: chEvtBroadcastFlags() + and chEvtBroadcastFlagsI(). The old chEvtBroadcast() and chEvtBroadcastI() + become macros. The new functions allow to add the same flags to all the + registered listener threads. +- CHANGE: The functions chEvtSignal() and chEvtSignalI() have been renamed + to chEvtSignalFlags() and chEvtSignalFlagsI() for consistency. +- NEW: Added I-Class functions to the MailBoxes subsystem, now it is + possible to use them as a transport layer between ISRs and Threads. - NEW: Added experimental generic USB driver, it will evolve in next releases. - NEW: Added an experimental USB driver implementation for STM32. diff --git a/test/testevt.c b/test/testevt.c index 656a8430d..ccf0ed576 100644 --- a/test/testevt.c +++ b/test/testevt.c @@ -136,7 +136,7 @@ static void evt2_setup(void) { static msg_t thread1(void *p) { chThdSleepMilliseconds(50); - chEvtSignal((Thread *)p, 1); + chEvtSignalFlags((Thread *)p, 1); return 0; } diff --git a/todo.txt b/todo.txt index 7c92ddac3..92e357ae4 100644 --- a/todo.txt +++ b/todo.txt @@ -6,49 +6,61 @@ X = In progress, some work done. N = Decided against. Within 2.3.x (hopefully) -- Improvements to the message passing mechanism in order to allow "delayed, - out of order, responses". -- Add a switch to enable/disable the priority inheritance algorithm in mutexes. -- Introduce a "THREAD" function prefix in order to hide compiler-specific - optimizations for thread functions. -? Make thread functions return void. -- Introduce compiler-info macros to the port layer, improve the test reports - with the info. +* Add an USB abstract device driver class. +* USB driver implementation for STM32F102/STM32F103. +* Add a Serial over USB generic device driver implementing a USB Communication + Device Class and offering a Serial-like interface to the applications. +* Add I-class APIs for mailboxes. +* Modify chEvtBroadcast() to accept a flags mask as parameter. * Add a "transmission end" event to the serial device driver model. X Implement the "transmission end" serial driver event on those platforms supporting the feature. -X Add an USB abstract device driver class. -X USB driver implementation for STM32F103/STM32F102. -- USB driver implementation for STM32F105/STM32F107. -X Add a Serial over USB generic device driver implementing a USB Communication - Device Class and offering a Serial-like interface to the applications. +- Swap TIME_IMMEDIATE and TIME_INFINITE values. +- Improvements to the message passing mechanism in order to allow "delayed, + out of order, responses". +? Make thread functions return void and add a CH_THREAD macro for threads + declaration in order to hide compiler-specific optimizations for thread + functions. +- Introduce compiler-info macros to the port layer, improve the test reports + with the compiler info. +- Test suite overhaul, the API should be more generic in order to be used + with different subsystems and not just the kernel. +- Long duration "IRQ storm" stress test applications for all supported + architectures. +- Device drivers for STM8/STM8L (ADC, PWM, bring them on par with STM32). +- Device drivers for LPC1xxx (ADC, PWM, bring them on par with STM32). - Implement USB Mass Storage Class support and demo using the MMC_SPI driver as back-end. X File System infrastructure. - Official FatFs wrapper using the new infrastructure, dedicated test suite. X Transactional flash file system implementation. X I2C device driver class support and at least one implementation. -- Serial over UART complex driver driver, evaluate from the performance - results if to make obsolete the current dedicated Serial driver. X Shared DMA channels support in the STM32/STM8L HALs. +X RAM ISR vectors support in the STM32 HAL. X New device driver models: Clock, Systick, RTC, WDG, DAC, Power Monitor. -- MAC driver for STM32F107 (hardware missing). -- Device drivers for STM8/STM8L (ADC, PWM, bring them on par with STM32). + +Later but within 2.x.x - Batch testing of the ARM7/ARMCMx port using OpenOCD, with reports. - Debug-related features and tools. ? Add a *very simple* ADC API for single one shot sampling (implement it as an injected conversion on the STM32). +- Improved Makefile system. +- Serial over UART complex driver driver, evaluate from the performance + results if to make obsolete the current dedicated Serial driver. +- LPC17xx family support. +- Official segmented interrupts support and abstraction in CMx port. +- USB driver implementation for STM32F105/STM32F107. +- MAC driver revision in order to support copy-less operations, this will + require changes to lwIP or a new TCP/IP stack however. +- MAC driver for STM32F107 (hardware missing). - Update C++ wrapper (Heap, Pools, Mailboxes and any new feature). - Threads Pools manager in the library. - -Later but within 2.x.x +- Add a switch to enable/disable the priority inheritance algorithm in mutexes. - Dedicated TCP/IP stack. ? ISO7816 driver over UART driver, both reader and card side (hardware missing). - Merge the Coldfire branch in mainline (hardware missing). - Merge the H8S branch in mainline (hardware missing). -- MAC driver revision in order to support copy-less operations, this will - require changes to lwIP or a new TCP/IP stack however. Ideas for 3.x.x: - MMU/MPU support. @@ -58,5 +70,4 @@ Ideas for 3.x.x: Side projects: X ChibiOS Wizard, UML modeling and ChibiOS applications code and documentation generator. -? File System - Visual debugger/monitor interfaced through OpenOCD. -- cgit v1.2.3 From b3b1028036a2f18327fb97f2126192a2ace62bb2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 21 Feb 2011 19:06:46 +0000 Subject: TIME_IMMEDIATE and TIME_INFINITE values swapped. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2757 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72-GCC.txt | 2 +- docs/reports/kernel.txt | 38 +++++++++++++++++++------------------- os/kernel/include/chschd.h | 4 ++-- os/kernel/include/chthreads.h | 4 +--- os/kernel/src/chcond.c | 22 +++++++++++----------- os/kernel/src/chschd.c | 4 +--- os/kernel/src/chthreads.c | 6 ++---- os/kernel/src/chvt.c | 12 +++++++----- readme.txt | 2 ++ 9 files changed, 46 insertions(+), 48 deletions(-) diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index 8d85ad7ce..e35cb5270 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -130,7 +130,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 465772 bytes/S +--- Score : 474232 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index c53f23df6..d67788fd3 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -38,67 +38,67 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 6180 +Kernel Size = 6172 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5680 +Kernel Size = 5672 Platform : ARM Cortex-M3 OS Setup : Minimal kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -Kernel Size = 1428 +Kernel Size = 1432 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5576 +Kernel Size = 5568 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5168 +Kernel Size = 5156 Platform : ARM Cortex-M3 OS Setup : Minimal kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -Kernel Size = 1244 +Kernel Size = 1248 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5356 +Kernel Size = 5348 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4976 +Kernel Size = 4964 Platform : ARM Cortex-M3 OS Setup : Minimal kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -Kernel Size = 1196 +Kernel Size = 1200 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5428 +Kernel Size = 5432 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5232 +Kernel Size = 5236 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -146,13 +146,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8340 +Kernel Size = 8344 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7984 +Kernel Size = 7988 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -182,13 +182,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8048 +Kernel Size = 8052 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7712 +Kernel Size = 7716 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -200,13 +200,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 6004 +Kernel Size = 6008 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5796 +Kernel Size = 5800 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -236,7 +236,7 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5848 +Kernel Size = 5852 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel @@ -260,7 +260,7 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5208 +Kernel Size = 5212 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h index a9283c290..5d3aee7a0 100644 --- a/os/kernel/include/chschd.h +++ b/os/kernel/include/chschd.h @@ -48,13 +48,13 @@ * @note Not all functions accept @p TIME_IMMEDIATE as timeout parameter, * see the specific function documentation. */ -#define TIME_IMMEDIATE ((systime_t)-1) +#define TIME_IMMEDIATE ((systime_t)0) /** * @brief Infinite time specification for all the syscalls with a timeout * specification. */ -#define TIME_INFINITE ((systime_t)0) +#define TIME_INFINITE ((systime_t)-1) /** * @brief Returns the priority of the first thread on the given ready list. diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index 677f0be58..c22255ad0 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -292,9 +292,7 @@ extern "C" { * handled as follow: * - @a TIME_INFINITE the thread enters an infinite sleep * state. - * - @a TIME_IMMEDIATE this value is accepted but - * interpreted as a normal time specification not as - * an immediate timeout specification. + * - @a TIME_IMMEDIATE this value is not allowed. * . * * @sclass diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c index 0ad9d459d..a6534eabc 100644 --- a/os/kernel/src/chcond.c +++ b/os/kernel/src/chcond.c @@ -203,11 +203,11 @@ msg_t chCondWaitS(CondVar *cp) { * mutex, the mutex ownership is lost. * * @param[in] cp pointer to the @p CondVar structure - * @param[in] time the number of ticks before the operation timeouts, - * the special value @p TIME_INFINITE is allowed. - * It is not possible to specify zero @p TIME_IMMEDIATE - * as timeout specification because it would make no sense - * in this function. + * @param[in] time the number of ticks before the operation timeouts, the + * special values are handled as follow: + * - @a TIME_INFINITE no timeout. + * - @a TIME_IMMEDIATE this value is not allowed. + * . * @return A message specifying how the invoking thread has been * released from the condition variable. * @retval RDY_OK if the condvar has been signaled using @@ -240,11 +240,11 @@ msg_t chCondWaitTimeout(CondVar *cp, systime_t time) { * mutex, the mutex ownership is lost. * * @param[in] cp pointer to the @p CondVar structure - * @param[in] time the number of ticks before the operation timeouts, - * the special value @p TIME_INFINITE is allowed. - * It is not possible to specify zero @p TIME_IMMEDIATE - * as timeout specification because it would make no sense - * in this function. + * @param[in] time the number of ticks before the operation timeouts, the + * special values are handled as follow: + * - @a TIME_INFINITE no timeout. + * - @a TIME_IMMEDIATE this value is not allowed. + * . * @return A message specifying how the invoking thread has been * released from the condition variable. * @retval RDY_OK if the condvar has been signaled using @@ -260,7 +260,7 @@ msg_t chCondWaitTimeoutS(CondVar *cp, systime_t time) { Mutex *mp; msg_t msg; - chDbgCheck(cp != NULL, "chCondWaitTimeoutS"); + chDbgCheck((cp != NULL) && (time != TIME_IMMEDIATE), "chCondWaitTimeoutS"); chDbgAssert(currp->p_mtxlist != NULL, "chCondWaitTimeoutS(), #1", "not owning a mutex"); diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 5b04c1f3d..85e968904 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -160,9 +160,7 @@ static void wakeup(void *p) { * - @a TIME_INFINITE the thread enters an infinite sleep * state, this is equivalent to invoking * @p chSchGoSleepS() but, of course, less efficient. - * - @a TIME_IMMEDIATE this value is accepted but - * interpreted as a normal time specification not as an - * immediate timeout specification. + * - @a TIME_IMMEDIATE this value is not allowed. * . * @return The wakeup message. * @retval RDY_TIMEOUT if a timeout occurs. diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index 51efc20d1..a00b5d3db 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -273,16 +273,14 @@ void chThdTerminate(Thread *tp) { * handled as follow: * - @a TIME_INFINITE the thread enters an infinite sleep * state. - * - @a TIME_IMMEDIATE this value is accepted but - * interpreted as a normal time specification not as an - * immediate timeout specification. + * - @a TIME_IMMEDIATE this value is not allowed. * . * * @api */ void chThdSleep(systime_t time) { - chDbgCheck(time != TIME_INFINITE, "chThdSleep"); + chDbgCheck(time != TIME_IMMEDIATE, "chThdSleep"); chSysLock(); chThdSleepS(time); diff --git a/os/kernel/src/chvt.c b/os/kernel/src/chvt.c index b622bb493..016849186 100644 --- a/os/kernel/src/chvt.c +++ b/os/kernel/src/chvt.c @@ -52,10 +52,12 @@ void vt_init(void) { * the I-Locked state, see @ref system_states. * * @param[out] vtp the @p VirtualTimer structure pointer - * @param[in] time the number of time ticks, the value @p TIME_INFINITE - * is notallowed. The value @p TIME_IMMEDIATE is allowed - * but interpreted as a normal time specification not as - * an immediate timeout specification. + * @param[in] time the number of ticks before the operation timeouts, the + * special values are handled as follow: + * - @a TIME_INFINITE is allowed but interpreted as a + * normal time specification. + * - @a TIME_IMMEDIATE this value is not allowed. + * . * @param[in] vtfunc the timer callback function. After invoking the * callback the timer is disabled and the structure can * be disposed or reused. @@ -67,7 +69,7 @@ void vt_init(void) { void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) { VirtualTimer *p; - chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (time != TIME_INFINITE), + chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (time != TIME_IMMEDIATE), "chVTSetI"); vtp->vt_par = par; diff --git a/readme.txt b/readme.txt index 0ef32b5b7..4ca9da65d 100644 --- a/readme.txt +++ b/readme.txt @@ -94,6 +94,8 @@ driver. This event marks the physical transmission end of a data stream. - NEW: Implemented the new IO_TRANSMISSION_END event in the STM32 serial driver. +- CHANGE: Swapped the numeric values of the TIME_IMMEDIATE and TIME_INFINITE + constants. Fixed the relative documentation in various places. *** 2.1.8 *** - FIX: Fixed error in STM32 ADC driver macro names (bug 3160306)(backported -- cgit v1.2.3 From 6f6e1a6401eda000dce198150937c7919b4c9855 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Feb 2011 18:59:39 +0000 Subject: Improved messages subsystem. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2759 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/Win32-MinGW/main.c | 7 ++-- docs/reports/STM32F103-72-GCC.txt | 6 ++-- docs/reports/kernel.txt | 68 +++++++++++++++++++-------------------- os/kernel/include/chmsg.h | 41 +++++++++++++++++++---- os/kernel/include/chthreads.h | 22 +++++++------ os/kernel/src/chmsg.c | 59 +++++++++++---------------------- os/kernel/src/chmtx.c | 2 +- readme.txt | 2 ++ test/testbmk.c | 5 ++- test/testmsg.c | 30 ++++++----------- 10 files changed, 122 insertions(+), 120 deletions(-) diff --git a/demos/Win32-MinGW/main.c b/demos/Win32-MinGW/main.c index d2effad35..0830ab149 100644 --- a/demos/Win32-MinGW/main.c +++ b/demos/Win32-MinGW/main.c @@ -122,15 +122,16 @@ static const ShellConfig shell_cfg2 = { /* * Console print server done using synchronous messages. This makes the access * to the C printf() thread safe and the print operation atomic among threads. - * In this example the message is the zero termitated string itself. + * In this example the message is the zero terminated string itself. */ static msg_t console_thread(void *arg) { (void)arg; while (!chThdShouldTerminate()) { - puts((char *)chMsgWait()); + Thread *tp = chMsgWait(); + puts((char *)chMsgGet(tp)); fflush(stdout); - chMsgRelease(RDY_OK); + chMsgRelease(tp, RDY_OK); } return 0; } diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index e35cb5270..772e24d45 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -98,15 +98,15 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 248573 msgs/S, 497146 ctxswc/S +--- Score : 248569 msgs/S, 497138 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 201227 msgs/S, 402454 ctxswc/S +--- Score : 198998 msgs/S, 397996 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 201227 msgs/S, 402454 ctxswc/S +--- Score : 198998 msgs/S, 397996 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index d67788fd3..8f9530559 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -2,13 +2,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 11744 +Kernel Size = 11716 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 11296 +Kernel Size = 11244 Platform : PowerPC OS Setup : Minimal kernel @@ -20,13 +20,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 10260 +Kernel Size = 10208 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 9768 +Kernel Size = 9712 Platform : PowerPC OS Setup : Minimal kernel @@ -38,13 +38,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 6172 +Kernel Size = 6124 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5672 +Kernel Size = 5624 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -56,13 +56,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5568 +Kernel Size = 5524 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5156 +Kernel Size = 5112 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -74,13 +74,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5348 +Kernel Size = 5320 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4964 +Kernel Size = 4936 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -92,13 +92,13 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5432 +Kernel Size = 5396 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5236 +Kernel Size = 5196 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -110,13 +110,13 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 4992 +Kernel Size = 4956 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4832 +Kernel Size = 4792 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -128,13 +128,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8988 +Kernel Size = 8940 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8528 +Kernel Size = 8472 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -146,13 +146,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8344 +Kernel Size = 8288 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7988 +Kernel Size = 7928 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -164,13 +164,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8704 +Kernel Size = 8676 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8260 +Kernel Size = 8220 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -182,13 +182,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8052 +Kernel Size = 8016 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7716 +Kernel Size = 7676 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -200,13 +200,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 6008 +Kernel Size = 5964 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5800 +Kernel Size = 5752 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -218,13 +218,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5580 +Kernel Size = 5536 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5396 +Kernel Size = 5348 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -236,13 +236,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5852 +Kernel Size = 5824 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5652 +Kernel Size = 5620 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -254,13 +254,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5368 +Kernel Size = 5340 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5212 +Kernel Size = 5180 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -272,13 +272,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5884 +Kernel Size = 5840 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5476 +Kernel Size = 5428 Platform : MSP430 OS Setup : Minimal kernel @@ -290,13 +290,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5820 +Kernel Size = 5776 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5440 +Kernel Size = 5392 Platform : MSP430 OS Setup : Minimal kernel diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index 438da021f..b2e8ef51e 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -39,20 +39,47 @@ ((tp)->p_msgqueue.p_next != (Thread *)&(tp)->p_msgqueue) /** - * @brief Returns the first message in the queue. + * @brief Returns the message carried by the specified thread. + * @pre This function must be invoked immediately after exiting a call + * to @p chMsgWait(). * - * @iclass + * @param[in] tp pointer to the thread + * @return The message carried by the sender. + * + * @api + */ +#define chMsgGet(tp) ((tp)->p_msg) + +/** + * @brief Returns the message carried by the specified thread. + * @pre This function must be invoked immediately after exiting a call + * to @p chMsgWait(). + * + * @param[in] tp pointer to the thread + * @return The message carried by the sender. + * + * @sclass + */ +#define chMsgGetS(tp) ((tp)->p_msg) + +/** + * @brief Releases the thread waiting on top of the messages queue. + * @pre Invoke this function only after a message has been received + * using @p chMsgWait(). + * + * @param[in] tp pointer to the thread + * @param[in] msg message to be returned to the sender + * + * @sclass */ -#define chMsgGetI(tp) \ - ((tp)->p_msgqueue.p_next->p_msg) +#define chMsgReleaseS(tp, msg) chSchWakeupS(tp, msg) #ifdef __cplusplus extern "C" { #endif msg_t chMsgSend(Thread *tp, msg_t msg); - msg_t chMsgWait(void); - msg_t chMsgGet(void); - void chMsgRelease(msg_t msg); + Thread * chMsgWait(void); + void chMsgRelease(Thread *tp, msg_t msg); #ifdef __cplusplus } #endif diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index c22255ad0..f6ed23d1d 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -176,12 +176,14 @@ struct Thread { #define THD_STATE_WTOREVT 8 /** @brief Thread state: Waiting in @p chEvtWaitAllTimeout().*/ #define THD_STATE_WTANDEVT 9 -/** @brief Thread state: Waiting in @p chMsgSend().*/ -#define THD_STATE_SNDMSG 10 +/** @brief Thread state: Waiting in @p chMsgSend() (queued).*/ +#define THD_STATE_SNDMSGQ 10 +/** @brief Thread state: Waiting in @p chMsgSend() (not queued).*/ +#define THD_STATE_SNDMSG 11 /** @brief Thread state: Waiting in @p chMsgWait().*/ -#define THD_STATE_WTMSG 11 +#define THD_STATE_WTMSG 12 /** @brief Thread state: After termination.*/ -#define THD_STATE_FINAL 12 +#define THD_STATE_FINAL 13 /* * Various flags into the thread p_flags field. @@ -242,7 +244,7 @@ extern "C" { * @note This function is only available when the * @p CH_DBG_THREADS_PROFILING configuration option is enabled. * - * @param[in] tp the pointer to the thread + * @param[in] tp pointer to the thread * * @api */ @@ -258,7 +260,7 @@ extern "C" { /** * @brief Verifies if the specified thread is in the @p THD_STATE_FINAL state. * - * @param[in] tp the pointer to the thread + * @param[in] tp pointer to the thread * @retval TRUE thread terminated. * @retval FALSE thread not terminated. * @@ -279,7 +281,7 @@ extern "C" { /** * @brief Resumes a thread created with @p chThdInit(). * - * @param[in] tp the pointer to the thread + * @param[in] tp pointer to the thread * * @iclass */ @@ -305,7 +307,7 @@ extern "C" { * system clock. * @note The maximum specified value is implementation dependent. * - * @param[in] sec the time in seconds + * @param[in] sec time in seconds * * @api */ @@ -318,7 +320,7 @@ extern "C" { * system clock. * @note The maximum specified value is implementation dependent. * - * @param[in] msec the time in milliseconds + * @param[in] msec time in milliseconds * * @api */ @@ -331,7 +333,7 @@ extern "C" { * system clock. * @note The maximum specified value is implementation dependent. * - * @param[in] usec the time in microseconds + * @param[in] usec time in microseconds * * @api */ diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c index c3b4848b0..d4199bbb0 100644 --- a/os/kernel/src/chmsg.c +++ b/os/kernel/src/chmsg.c @@ -75,7 +75,7 @@ msg_t chMsgSend(Thread *tp, msg_t msg) { msg_insert(ctp, &tp->p_msgqueue); if (tp->p_state == THD_STATE_WTMSG) chSchReadyI(tp); - chSchGoSleepS(THD_STATE_SNDMSG); + chSchGoSleepS(THD_STATE_SNDMSGQ); msg = ctp->p_u.rdymsg; chSysUnlock(); return msg; @@ -83,69 +83,46 @@ msg_t chMsgSend(Thread *tp, msg_t msg) { /** * @brief Suspends the thread and waits for an incoming message. - * @post After receiving a message the function @p chMsgRelease() must be - * invoked in order to acknowledge the reception and send the answer. + * @post After receiving a message the function @p chMsgGet() must be + * called in order to retrieve the message and then @p chMsgRelease() + * must be invoked in order to acknowledge the reception and send + * the answer. * @note If the message is a pointer then you can assume that the data * pointed by the message is stable until you invoke @p chMsgRelease() * because the sending thread is suspended until then. * - * @return The message. + * @return A reference to the thread carrying the message. * * @api */ -msg_t chMsgWait(void) { - msg_t msg; +Thread *chMsgWait(void) { + Thread *tp; chSysLock(); if (!chMsgIsPendingI(currp)) chSchGoSleepS(THD_STATE_WTMSG); -#if defined(CH_ARCHITECTURE_STM8) - msg = chMsgGetI((volatile Thread *)currp); /* Temporary hack.*/ -#else - msg = chMsgGetI(currp); -#endif + tp = fifo_remove(&currp->p_msgqueue); + tp->p_state = THD_STATE_SNDMSG; chSysUnlock(); - return msg; -} - -/** - * @brief Returns the next message in the queue. - * @post After receiving a message the function @p chMsgRelease() must be - * invoked in order to acknowledge the reception and send the answer. - * @note If the message is a pointer then you can assume that the data - * pointed by the message is stable until you invoke @p chMsgRelease() - * because the sending thread is suspended until then. - * - * @return The message. - * @retval 0 if the queue is empty. - * - * @api - */ -msg_t chMsgGet(void) { - msg_t msg; - - chSysLock(); - msg = chMsgIsPendingI(currp) ? chMsgGetI(currp) : (msg_t)NULL; - chSysUnlock(); - return msg; + return tp; } /** * @brief Releases the thread waiting on top of the messages queue. * @pre Invoke this function only after a message has been received - * using @p chMsgWait() or @p chMsgGet(). + * using @p chMsgWait(). * - * @param[in] msg the message returned to the message sender + * @param[in] tp pointer to the thread + * @param[in] msg message to be returned to the sender * * @api */ -void chMsgRelease(msg_t msg) { +void chMsgRelease(Thread *tp, msg_t msg) { chSysLock(); - chDbgAssert(chMsgIsPendingI(currp), - "chMsgRelease(), #1", - "no message pending"); - chSchWakeupS(fifo_remove(&currp->p_msgqueue), msg); + chDbgAssert(tp->p_state == THD_STATE_SNDMSG, + "chMsgRelease(), #1", "invalid state"); + chMsgReleaseS(tp, msg); chSysUnlock(); } diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c index b84c4d57e..826ef27fe 100644 --- a/os/kernel/src/chmtx.c +++ b/os/kernel/src/chmtx.c @@ -141,7 +141,7 @@ void chMtxLockS(Mutex *mp) { case THD_STATE_WTSEM: #endif #if CH_USE_MESSAGES_PRIORITY - case THD_STATE_SNDMSG: + case THD_STATE_SNDMSGQ: #endif /* Re-enqueues tp with its new priority on the queue.*/ prio_insert(dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp); diff --git a/readme.txt b/readme.txt index 4ca9da65d..9f18bdb52 100644 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,8 @@ driver. - CHANGE: Swapped the numeric values of the TIME_IMMEDIATE and TIME_INFINITE constants. Fixed the relative documentation in various places. +- CHANGE: Slightly modified the messages API in order to allow the + processing of multiple messages at the same time. *** 2.1.8 *** - FIX: Fixed error in STM32 ADC driver macro names (bug 3160306)(backported diff --git a/test/testbmk.c b/test/testbmk.c index 0f38eb78b..7e7a714df 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -65,11 +65,14 @@ static Mutex mtx1; #endif static msg_t thread1(void *p) { + Thread *tp; msg_t msg; (void)p; do { - chMsgRelease(msg = chMsgWait()); + tp = chMsgWait(); + msg = chMsgGet(tp); + chMsgRelease(tp, msg); } while (msg); return 0; } diff --git a/test/testmsg.c b/test/testmsg.c index 881db167f..14b6d8186 100644 --- a/test/testmsg.c +++ b/test/testmsg.c @@ -64,11 +64,11 @@ static msg_t thread(void *p) { chMsgSend(p, 'A'); chMsgSend(p, 'B'); chMsgSend(p, 'C'); - chMsgSend(p, 'D'); return 0; } static void msg1_execute(void) { + Thread *tp; msg_t msg; /* @@ -76,29 +76,19 @@ static void msg1_execute(void) { */ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority() + 1, thread, chThdSelf()); - chMsgRelease(msg = chMsgWait()); + tp = chMsgWait(); + msg = chMsgGet(tp); + chMsgRelease(tp, msg); test_emit_token(msg); - chMsgRelease(msg = chMsgWait()); + tp = chMsgWait(); + msg = chMsgGet(tp); + chMsgRelease(tp, msg); test_emit_token(msg); - chMsgRelease(msg = chMsgWait()); + tp = chMsgWait(); + msg = chMsgGet(tp); + chMsgRelease(tp, msg); test_emit_token(msg); test_assert_sequence(1, "ABC"); - - /* - * Testing message fetch using chMsgGet(). - * Note, the following is valid because the sender has higher priority than - * the receiver. - */ - msg = chMsgGet(); - test_assert(1, msg != 0, "no message"); - chMsgRelease(0); - test_assert(2, msg == 'D', "wrong message"); - - /* - * Must not have pending messages. - */ - msg = chMsgGet(); - test_assert(3, msg == 0, "unknown message"); } ROMCONST struct testcase testmsg1 = { -- cgit v1.2.3 From 658872aee02153b2b6c77a2df935f4dbe6590fc9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Feb 2011 19:43:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2760 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 -- todo.txt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/readme.txt b/readme.txt index 9f18bdb52..4ca9da65d 100644 --- a/readme.txt +++ b/readme.txt @@ -96,8 +96,6 @@ driver. - CHANGE: Swapped the numeric values of the TIME_IMMEDIATE and TIME_INFINITE constants. Fixed the relative documentation in various places. -- CHANGE: Slightly modified the messages API in order to allow the - processing of multiple messages at the same time. *** 2.1.8 *** - FIX: Fixed error in STM32 ADC driver macro names (bug 3160306)(backported diff --git a/todo.txt b/todo.txt index 92e357ae4..44c0c464f 100644 --- a/todo.txt +++ b/todo.txt @@ -15,8 +15,8 @@ Within 2.3.x (hopefully) * Add a "transmission end" event to the serial device driver model. X Implement the "transmission end" serial driver event on those platforms supporting the feature. -- Swap TIME_IMMEDIATE and TIME_INFINITE values. -- Improvements to the message passing mechanism in order to allow "delayed, +* Swap TIME_IMMEDIATE and TIME_INFINITE values. +* Improvements to the message passing mechanism in order to allow "delayed, out of order, responses". ? Make thread functions return void and add a CH_THREAD macro for threads declaration in order to hide compiler-specific optimizations for thread -- cgit v1.2.3 From a55d3c6e6b8d14d6310382f149593df231925c17 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Feb 2011 20:24:05 +0000 Subject: Fixed bug 3190512. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2761 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chmempools.c | 2 -- readme.txt | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os/kernel/src/chmempools.c b/os/kernel/src/chmempools.c index 092944b59..054823af0 100644 --- a/os/kernel/src/chmempools.c +++ b/os/kernel/src/chmempools.c @@ -75,10 +75,8 @@ void *chPoolAllocI(MemoryPool *mp) { if ((objp = mp->mp_next) != NULL) mp->mp_next = mp->mp_next->ph_next; -#if CH_USE_MEMCORE else if (mp->mp_provider != NULL) objp = mp->mp_provider(mp->mp_object_size); -#endif return objp; } diff --git a/readme.txt b/readme.txt index 4ca9da65d..3d91239d1 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,8 @@ ***************************************************************************** *** 2.3.0 *** +- FIX: Fixed minor problem with memory pools (bug 3190512)(backported to + 2.2.1). - FIX: Stack overflow in CM0 ports when nearing interrupts saturation (bug 3187105)(backported to 2.2.1). - FIX: Fixed error in _BSEMAPHORE_DATA macro (bug 3184139)(backported to -- cgit v1.2.3 From 24594525990ee1769ee933261b821211b4c299e8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 24 Feb 2011 14:57:38 +0000 Subject: Fixed bugs 3191107 and 3191112. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2762 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 14 ++++++++++++-- os/kernel/include/chmempools.h | 2 +- os/kernel/src/chheap.c | 2 +- os/kernel/src/chmemcore.c | 38 +++++++++++++++++++------------------- os/kernel/src/chmempools.c | 2 +- readme.txt | 7 ++++++- todo.txt | 2 +- 7 files changed, 41 insertions(+), 26 deletions(-) diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index f42478125..58cb318b2 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -35,15 +35,25 @@ */ typedef void *(*memgetfunc_t)(size_t size); +/** + * @brief Alignment size constant. + */ +#define MEM_ALIGN_SIZE sizeof(stkalign_t) + /** * @brief Alignment mask constant. */ -#define MEM_ALIGN_MASK (sizeof(stkalign_t) - 1) +#define MEM_ALIGN_MASK (MEM_ALIGN_SIZE - 1) + +/** + * @brief Alignment helper macro. + */ +#define MEM_ALIGN_PREV(p) ((size_t)(p) & ~MEM_ALIGN_MASK) /** * @brief Alignment helper macro. */ -#define MEM_ALIGN_SIZE(p) (((size_t)(p) + MEM_ALIGN_MASK) & ~MEM_ALIGN_MASK) +#define MEM_ALIGN_NEXT(p) MEM_ALIGN_PREV((size_t)(p) + MEM_ALIGN_MASK) /** * @brief Returns whatever a pointer or memory size is aligned to diff --git a/os/kernel/include/chmempools.h b/os/kernel/include/chmempools.h index 1c2e2aa70..9dbe332c8 100644 --- a/os/kernel/include/chmempools.h +++ b/os/kernel/include/chmempools.h @@ -59,7 +59,7 @@ typedef struct { * @param[in] provider memory provider function for the memory pool */ #define _MEMORYPOOL_DATA(name, size, provider) \ - {NULL, MEM_ALIGN_SIZE(size), provider} + {NULL, MEM_ALIGN_NEXT(size), provider} /** * @brief Static memory pool initializer in hungry mode. diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index 13db7cf6b..c655e3852 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -125,7 +125,7 @@ void *chHeapAlloc(MemoryHeap *heapp, size_t size) { if (heapp == NULL) heapp = &default_heap; - size = MEM_ALIGN_SIZE(size); + size = MEM_ALIGN_NEXT(size); qp = &heapp->h_free; H_LOCK(heapp); diff --git a/os/kernel/src/chmemcore.c b/os/kernel/src/chmemcore.c index 69d3014a5..1fed481c5 100644 --- a/os/kernel/src/chmemcore.c +++ b/os/kernel/src/chmemcore.c @@ -24,18 +24,20 @@ * @addtogroup memcore * @details Core Memory Manager related APIs and services. *

Operation mode

- * The core memory manager is a simplified allocator that only allows - * to allocate memory blocks without the possibility to free them.
- * This allocator is meant as a memory blocks provider for the other - * allocators such as: + * The core memory manager is a simplified allocator that only + * allows to allocate memory blocks without the possibility to + * free them.
+ * This allocator is meant as a memory blocks provider for the + * other allocators such as: * - C-Runtime allocator (through a compiler specific adapter module). * - Heap allocator (see @ref heaps). * - Memory pools allocator (see @ref pools). * . - * By having a centralized memory provider the various allocators can - * coexist and share the main memory.
- * This allocator, alone, is also useful for very simple applications - * that just require a simple way to get memory blocks. + * By having a centralized memory provider the various allocators + * can coexist and share the main memory.
+ * This allocator, alone, is also useful for very simple + * applications that just require a simple way to get memory + * blocks. * @pre In order to use the core memory manager APIs the @p CH_USE_MEMCORE * option must be enabled in @p chconf.h. * @{ @@ -57,22 +59,20 @@ void core_init(void) { #if CH_MEMCORE_SIZE == 0 extern uint8_t __heap_base__; extern uint8_t __heap_end__; - nextmem = &__heap_base__; - endmem = &__heap_end__; + nextmem = (uint8_t *)MEM_ALIGN_NEXT(&__heap_base__); + endmem = (uint8_t *)MEM_ALIGN_PREV(&__heap_end__); #else - static stkalign_t buffer[MEM_ALIGN_SIZE(CH_MEMCORE_SIZE) / - sizeof(stkalign_t)]; + static stkalign_t buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE]; nextmem = (uint8_t *)&buffer[0]; - endmem = (uint8_t *)&buffer[MEM_ALIGN_SIZE(CH_MEMCORE_SIZE) / - sizeof(stkalign_t)]; + endmem = (uint8_t *)&buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE]; #endif } /** * @brief Allocates a memory block. * @details The size of the returned block is aligned to the alignment - * type @p stkalign_t so it is not possible to allocate less - * than sizeof(stkalign_t). + * type so it is not possible to allocate less + * than MEM_ALIGN_SIZE. * * @param[in] size the size of the block to be allocated * @return A pointer to the allocated memory block. @@ -92,8 +92,8 @@ void *chCoreAlloc(size_t size) { /** * @brief Allocates a memory block. * @details The size of the returned block is aligned to the alignment - * type @p align_t so it is not possible to allocate less than - * sizeof(align_t). + * type so it is not possible to allocate less than + * MEM_ALIGN_SIZE. * * @param[in] size the size of the block to be allocated. * @return A pointer to the allocated memory block. @@ -104,7 +104,7 @@ void *chCoreAlloc(size_t size) { void *chCoreAllocI(size_t size) { void *p; - size = MEM_ALIGN_SIZE(size); + size = MEM_ALIGN_NEXT(size); if ((size_t)(endmem - nextmem) < size) return NULL; p = nextmem; diff --git a/os/kernel/src/chmempools.c b/os/kernel/src/chmempools.c index 054823af0..83e6366f4 100644 --- a/os/kernel/src/chmempools.c +++ b/os/kernel/src/chmempools.c @@ -55,7 +55,7 @@ void chPoolInit(MemoryPool *mp, size_t size, memgetfunc_t provider) { chDbgCheck((mp != NULL) && (size >= sizeof(void *)), "chPoolInit"); mp->mp_next = NULL; - mp->mp_object_size = MEM_ALIGN_SIZE(size); + mp->mp_object_size = MEM_ALIGN_NEXT(size); mp->mp_provider = provider; } diff --git a/readme.txt b/readme.txt index 3d91239d1..8516b1c41 100644 --- a/readme.txt +++ b/readme.txt @@ -69,8 +69,13 @@ ***************************************************************************** *** 2.3.0 *** +- FIX: Fixed Cortex-Mx linker scripts alignment of __heap_base__, the + correct alignment is now enforced at runtime into core_init() in order + to make the OS integration easier (bug 3191112)(backported to 2.2.2). +- FIX: Fixed error in function chCoreAllocI() function documentation (bug + 3191107)(backported to 2.2.2). - FIX: Fixed minor problem with memory pools (bug 3190512)(backported to - 2.2.1). + 2.2.2). - FIX: Stack overflow in CM0 ports when nearing interrupts saturation (bug 3187105)(backported to 2.2.1). - FIX: Fixed error in _BSEMAPHORE_DATA macro (bug 3184139)(backported to diff --git a/todo.txt b/todo.txt index 44c0c464f..90d631345 100644 --- a/todo.txt +++ b/todo.txt @@ -37,7 +37,7 @@ X Transactional flash file system implementation. X I2C device driver class support and at least one implementation. X Shared DMA channels support in the STM32/STM8L HALs. X RAM ISR vectors support in the STM32 HAL. -X New device driver models: Clock, Systick, RTC, WDG, DAC, Power Monitor. +X New device driver models: Clock, Systick, PT, RTC, WDG, DAC, Power Monitor. Later but within 2.x.x - Batch testing of the ARM7/ARMCMx port using OpenOCD, with reports. -- cgit v1.2.3 From cd17bfa35ec8b30b490952abeb2177d3498d6bb4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 24 Feb 2011 18:21:36 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2763 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/kernel.txt | 68 ++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index 8f9530559..a998d8484 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -2,13 +2,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 11716 +Kernel Size = 11724 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 11244 +Kernel Size = 11252 Platform : PowerPC OS Setup : Minimal kernel @@ -20,13 +20,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 10208 +Kernel Size = 10216 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 9712 +Kernel Size = 9720 Platform : PowerPC OS Setup : Minimal kernel @@ -38,13 +38,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 6124 +Kernel Size = 6128 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5624 +Kernel Size = 5628 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -56,13 +56,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5524 +Kernel Size = 5532 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5112 +Kernel Size = 5120 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -74,13 +74,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5320 +Kernel Size = 5328 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4936 +Kernel Size = 4944 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -92,13 +92,13 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5396 +Kernel Size = 5404 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5196 +Kernel Size = 5204 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -110,13 +110,13 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 4956 +Kernel Size = 4964 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4792 +Kernel Size = 4800 Platform : ARM Cortex-M0 OS Setup : Minimal kernel @@ -128,13 +128,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8940 +Kernel Size = 8948 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8472 +Kernel Size = 8480 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -146,13 +146,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8288 +Kernel Size = 8296 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7928 +Kernel Size = 7936 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -164,13 +164,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8676 +Kernel Size = 8684 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8220 +Kernel Size = 8228 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -182,13 +182,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8016 +Kernel Size = 8024 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7676 +Kernel Size = 7684 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -200,13 +200,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5964 +Kernel Size = 5972 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5752 +Kernel Size = 5760 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -218,13 +218,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5536 +Kernel Size = 5544 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5348 +Kernel Size = 5356 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -236,13 +236,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5824 +Kernel Size = 5832 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5620 +Kernel Size = 5628 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -254,13 +254,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5340 +Kernel Size = 5348 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5180 +Kernel Size = 5188 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -272,13 +272,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5840 +Kernel Size = 5848 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5428 +Kernel Size = 5436 Platform : MSP430 OS Setup : Minimal kernel @@ -290,13 +290,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5776 +Kernel Size = 5784 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5392 +Kernel Size = 5400 Platform : MSP430 OS Setup : Minimal kernel -- cgit v1.2.3 From a34c2444c227b41a397fa8bde985e5015dc01a1d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 09:36:20 +0000 Subject: Fixed bug 3193062 (GCC only). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2764 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-GCC.txt | 26 +++++++++++++------------- os/ports/GCC/ARMCMx/chcore_v6m.c | 5 ----- os/ports/GCC/ARMCMx/chcore_v6m.h | 12 ++++-------- readme.txt | 1 + 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/docs/reports/LPC1114-48-GCC.txt b/docs/reports/LPC1114-48-GCC.txt index 260d994a4..32ea4154e 100644 --- a/docs/reports/LPC1114-48-GCC.txt +++ b/docs/reports/LPC1114-48-GCC.txt @@ -5,7 +5,7 @@ Settings: CLK=48, (2 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.1.7unstable +*** Kernel: 2.3.0unstable *** GCC Version: 4.3.3 *** Architecture: ARMv6-M *** Core Variant: Cortex-M0 @@ -98,51 +98,51 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 124135 msgs/S, 248270 ctxswc/S +--- Score : 126834 msgs/S, 253668 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 99992 msgs/S, 199984 ctxswc/S +--- Score : 100879 msgs/S, 201758 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 99992 msgs/S, 199984 ctxswc/S +--- Score : 100879 msgs/S, 201758 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 380432 ctxswc/S +--- Score : 380632 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 78349 threads/S +--- Score : 78390 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 110375 threads/S +--- Score : 110433 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 31034 reschedules/S, 186204 ctxswc/S +--- Score : 31050 reschedules/S, 186300 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 253200 ctxswc/S +--- Score : 253332 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 298992 bytes/S +--- Score : 296368 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 350196 timers/S +--- Score : 350378 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 591948 wait+signal/S +--- Score : 592280 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 334860 lock+unlock/S +--- Score : 335036 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index 790761876..4e49e6256 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -32,11 +32,6 @@ */ regarm_t _port_saved_pc; -/** - * @brief IRQ nesting counter. - */ -unsigned _port_irq_nesting; - /** * @brief System Timer vector. * @details This interrupt is used as system tick. diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 1bd2f777e..4b4ef04f6 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -118,11 +118,9 @@ struct intctx { * @details This macro must be inserted at the start of all IRQ handlers * enabled to invoke system APIs. */ -#define PORT_IRQ_PROLOGUE() { \ - port_lock_from_isr(); \ - _port_irq_nesting++; \ - port_unlock_from_isr(); \ -} +#define PORT_IRQ_PROLOGUE() \ + regarm_t _saved_lr; \ + asm volatile ("mov %0, lr" : "=r" (_saved_lr) : : "memory") /** * @brief IRQ epilogue code. @@ -131,7 +129,7 @@ struct intctx { */ #define PORT_IRQ_EPILOGUE() { \ port_lock_from_isr(); \ - if ((--_port_irq_nesting == 0) && chSchIsRescRequiredExI()) { \ + if ((_saved_lr != (regarm_t)0xFFFFFFF1) && chSchIsRescRequiredExI()) { \ register struct cmxctx *ctxp; \ \ asm volatile ("mrs %0, PSP" : "=r" (ctxp) : ); \ @@ -160,7 +158,6 @@ struct intctx { * @brief Port-related initialization code. */ #define port_init() { \ - _port_irq_nesting = 0; \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ @@ -229,7 +226,6 @@ struct intctx { #if !defined(__DOXYGEN__) extern regarm_t _port_saved_pc; -extern unsigned _port_irq_nesting; #endif #ifdef __cplusplus diff --git a/readme.txt b/readme.txt index 8516b1c41..6c5174cfa 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,7 @@ ***************************************************************************** *** 2.3.0 *** +- FIX: Fixed race condition in CM0 ports (bug 3193062)(backported to 2.2.2). - FIX: Fixed Cortex-Mx linker scripts alignment of __heap_base__, the correct alignment is now enforced at runtime into core_init() in order to make the OS integration easier (bug 3191112)(backported to 2.2.2). -- cgit v1.2.3 From a7ce64bb324a4d56808a806070de42adbef9a215 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 12:44:06 +0000 Subject: Fixed bug 3193062 (IAR). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2765 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-GCC.txt | 2 +- os/ports/GCC/ARMCMx/chcore_v6m.h | 18 ++++++++++-------- os/ports/IAR/ARMCMx/chcore_v6m.c | 5 ----- os/ports/IAR/ARMCMx/chcore_v6m.h | 12 +++--------- os/ports/IAR/ARMCMx/chcoreasm_v6m.s | 32 ++++++++++++++------------------ readme.txt | 3 ++- 6 files changed, 30 insertions(+), 42 deletions(-) diff --git a/docs/reports/LPC1114-48-GCC.txt b/docs/reports/LPC1114-48-GCC.txt index 32ea4154e..87dd7dbbe 100644 --- a/docs/reports/LPC1114-48-GCC.txt +++ b/docs/reports/LPC1114-48-GCC.txt @@ -126,7 +126,7 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 253332 ctxswc/S +--- Score : 253328 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 4b4ef04f6..bb20cb4be 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -128,16 +128,18 @@ struct intctx { * enabled to invoke system APIs. */ #define PORT_IRQ_EPILOGUE() { \ - port_lock_from_isr(); \ - if ((_saved_lr != (regarm_t)0xFFFFFFF1) && chSchIsRescRequiredExI()) { \ - register struct cmxctx *ctxp; \ + if (_saved_lr != (regarm_t)0xFFFFFFF1) { \ + port_lock_from_isr(); \ + if (chSchIsRescRequiredExI()) { \ + register struct cmxctx *ctxp; \ \ - asm volatile ("mrs %0, PSP" : "=r" (ctxp) : ); \ - _port_saved_pc = ctxp->pc; \ - ctxp->pc = _port_switch_from_isr; \ - return; \ + asm volatile ("mrs %0, PSP" : "=r" (ctxp) : ); \ + _port_saved_pc = ctxp->pc; \ + ctxp->pc = _port_switch_from_isr; \ + return; \ + } \ + port_unlock_from_isr(); \ } \ - port_unlock_from_isr(); \ } /** diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.c b/os/ports/IAR/ARMCMx/chcore_v6m.c index 25b360809..d8ede674d 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.c +++ b/os/ports/IAR/ARMCMx/chcore_v6m.c @@ -32,11 +32,6 @@ */ regarm_t _port_saved_pc; -/** - * @brief IRQ nesting counter. - */ -unsigned _port_irq_nesting; - /** * @brief System Timer vector. * @details This interrupt is used as system tick. diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index a2d1a40d3..fdbde0641 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -118,18 +118,14 @@ struct intctx { * @details This macro must be inserted at the start of all IRQ handlers * enabled to invoke system APIs. */ -#define PORT_IRQ_PROLOGUE() { \ - port_lock_from_isr(); \ - _port_irq_nesting++; \ - port_unlock_from_isr(); \ -} +#define PORT_IRQ_PROLOGUE() regarm_t _saved_lr = (regarm_t)__get_LR() /** * @brief IRQ epilogue code. * @details This macro must be inserted at the end of all IRQ handlers * enabled to invoke system APIs. */ -#define PORT_IRQ_EPILOGUE() _port_irq_epilogue() +#define PORT_IRQ_EPILOGUE() _port_irq_epilogue(_saved_lr) /** * @brief IRQ handler function declaration. @@ -149,7 +145,6 @@ struct intctx { * @brief Port-related initialization code. */ #define port_init() { \ - _port_irq_nesting = 0; \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ @@ -238,7 +233,6 @@ struct intctx { #if !defined(__DOXYGEN__) extern regarm_t _port_saved_pc; -extern unsigned _port_irq_nesting; #endif #ifdef __cplusplus @@ -246,7 +240,7 @@ extern "C" { #endif void port_halt(void); void _port_switch(Thread *ntp, Thread *otp); - void _port_irq_epilogue(void); + void _port_irq_epilogue(regarm_t lr); void _port_switch_from_isr(void); void _port_thread_start(void); #ifdef __cplusplus diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s index 1b8a5583c..5333d4ab9 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s @@ -105,27 +105,23 @@ _port_switch_from_isr: */ PUBLIC _port_irq_epilogue _port_irq_epilogue: - push {r4, lr} + push {r3, lr} + adds r0, r0, #15 + beq stillnested cpsid i - ldr r2, =_port_irq_nesting - ldr r3, [r2] - subs r3, r3, #1 - str r3, [r2] - cmp r3, #0 - beq skipexit -notrequired - cpsie i - pop {r4, pc} -skipexit bl chSchIsRescRequiredExI cmp r0, #0 - beq notrequired - mrs r1, PSP + bne doresch + cpsie i +stillnested + pop {r3, pc} +doresch + mrs r3, PSP ldr r2, =_port_saved_pc - ldr r3, [r1, #24] - str r3, [r2] - ldr r3, =_port_switch_from_isr - str r3, [r1, #24] - pop {r4, pc} + ldr r1, [r3, #24] + str r1, [r2] + ldr r2, =_port_switch_from_isr + str r2, [r3, #24] + pop {r3, pc} END diff --git a/readme.txt b/readme.txt index 6c5174cfa..6a78aa5d2 100644 --- a/readme.txt +++ b/readme.txt @@ -69,7 +69,8 @@ ***************************************************************************** *** 2.3.0 *** -- FIX: Fixed race condition in CM0 ports (bug 3193062)(backported to 2.2.2). +- FIX: Fixed race condition in CM0 ports, the fix also improves the + ISR latency (bug 3193062)(backported to 2.2.2). - FIX: Fixed Cortex-Mx linker scripts alignment of __heap_base__, the correct alignment is now enforced at runtime into core_init() in order to make the OS integration easier (bug 3191112)(backported to 2.2.2). -- cgit v1.2.3 From 1d00697fe4f8bbe42e0c0d59f76879bd1e575883 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 13:43:07 +0000 Subject: Fixed bug 3193062 (RVCT). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2766 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-RVCT.txt | 26 +++++++++++++------------- os/kernel/src/chmemcore.c | 8 ++++---- os/ports/RVCT/ARMCMx/chcore_v6m.h | 12 +++--------- os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 33 ++++++++++++++------------------- 4 files changed, 34 insertions(+), 45 deletions(-) diff --git a/docs/reports/LPC1114-48-RVCT.txt b/docs/reports/LPC1114-48-RVCT.txt index 17df988de..1b1015d94 100644 --- a/docs/reports/LPC1114-48-RVCT.txt +++ b/docs/reports/LPC1114-48-RVCT.txt @@ -6,7 +6,7 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. *** ChibiOS/RT test suite *** -*** Kernel: 2.1.7unstable +*** Kernel: 2.3.0unstable *** Architecture: ARMv6-M *** Core Variant: Cortex-M0 *** Platform: LPC11xx @@ -98,51 +98,51 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 116826 msgs/S, 233652 ctxswc/S +--- Score : 119522 msgs/S, 239044 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 100172 msgs/S, 200344 ctxswc/S +--- Score : 102156 msgs/S, 204312 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 99754 msgs/S, 199508 ctxswc/S +--- Score : 102595 msgs/S, 205190 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 377360 ctxswc/S +--- Score : 375344 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 79506 threads/S +--- Score : 79025 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 112694 threads/S +--- Score : 111705 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 33626 reschedules/S, 201756 ctxswc/S +--- Score : 33692 reschedules/S, 202152 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 246616 ctxswc/S +--- Score : 249324 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 261068 bytes/S +--- Score : 264832 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 301424 timers/S +--- Score : 303508 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 614472 wait+signal/S +--- Score : 614828 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 382980 lock+unlock/S +--- Score : 381660 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/kernel/src/chmemcore.c b/os/kernel/src/chmemcore.c index 1fed481c5..c28d150fa 100644 --- a/os/kernel/src/chmemcore.c +++ b/os/kernel/src/chmemcore.c @@ -57,10 +57,10 @@ static uint8_t *endmem; */ void core_init(void) { #if CH_MEMCORE_SIZE == 0 - extern uint8_t __heap_base__; - extern uint8_t __heap_end__; - nextmem = (uint8_t *)MEM_ALIGN_NEXT(&__heap_base__); - endmem = (uint8_t *)MEM_ALIGN_PREV(&__heap_end__); + extern uint8_t __heap_base__[]; + extern uint8_t __heap_end__[]; + nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__); + endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__); #else static stkalign_t buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE]; nextmem = (uint8_t *)&buffer[0]; diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 796b7f22e..59d5b6af0 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -118,18 +118,14 @@ struct intctx { * @details This macro must be inserted at the start of all IRQ handlers * enabled to invoke system APIs. */ -#define PORT_IRQ_PROLOGUE() { \ - port_lock_from_isr(); \ - _port_irq_nesting++; \ - port_unlock_from_isr(); \ -} +#define PORT_IRQ_PROLOGUE() regarm_t _saved_lr = (regarm_t)__return_address() /** * @brief IRQ epilogue code. * @details This macro must be inserted at the end of all IRQ handlers * enabled to invoke system APIs. */ -#define PORT_IRQ_EPILOGUE() _port_irq_epilogue() +#define PORT_IRQ_EPILOGUE() _port_irq_epilogue(_saved_lr) /** * @brief IRQ handler function declaration. @@ -149,7 +145,6 @@ struct intctx { * @brief Port-related initialization code. */ #define port_init() { \ - _port_irq_nesting = 0; \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ @@ -230,7 +225,6 @@ struct intctx { #if !defined(__DOXYGEN__) extern regarm_t _port_saved_pc; -extern unsigned _port_irq_nesting; #endif #ifdef __cplusplus @@ -238,7 +232,7 @@ extern "C" { #endif void port_halt(void); void _port_switch(Thread *ntp, Thread *otp); - void _port_irq_epilogue(void); + void _port_irq_epilogue(regarm_t lr); void _port_switch_from_isr(void); void _port_thread_start(void); #ifdef __cplusplus diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index 2424de03f..a789e4a0e 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -103,29 +103,24 @@ _port_switch_from_isr PROC */ EXPORT _port_irq_epilogue _port_irq_epilogue PROC - push {r4, lr} + push {r3, lr} + adds r0, r0, #15 + beq stillnested cpsid i - ldr r2, =_port_irq_nesting - ldr r3, [r2] - subs r3, r3, #1 - str r3, [r2] - cmp r3, #0 - beq skipexit -notrequired - cpsie i - pop {r4, pc} -skipexit bl chSchIsRescRequiredExI cmp r0, #0 - beq notrequired - mrs r1, PSP + bne doresch + cpsie i +stillnested + pop {r3, pc} +doresch + mrs r3, PSP ldr r2, =_port_saved_pc - ldr r3, [r1, #24] - str r3, [r2] - ldr r3, =_port_switch_from_isr - str r3, [r1, #24] - pop {r4, pc} - nop + ldr r1, [r3, #24] + str r1, [r2] + ldr r2, =_port_switch_from_isr + str r2, [r3, #24] + pop {r3, pc} ENDP END -- cgit v1.2.3 From 13441bc22dfeb34faea64bfeebb2a9a479ac3507 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 14:12:37 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2767 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/RVCT/ARMCMx/chcore_v6m.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.c b/os/ports/RVCT/ARMCMx/chcore_v6m.c index 6340df81c..db0cf7bf5 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.c +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.c @@ -32,11 +32,6 @@ */ regarm_t _port_saved_pc; -/** - * @brief IRQ nesting counter. - */ -unsigned _port_irq_nesting; - /** * @brief System Timer vector. * @details This interrupt is used as system tick. -- cgit v1.2.3 From 9ceb5c275037afc4c1eabc7f5422843095acf5f4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 14:14:13 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2768 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 6a78aa5d2..65b7b181b 100644 --- a/readme.txt +++ b/readme.txt @@ -91,7 +91,8 @@ - CHANGE: The functions chEvtSignal() and chEvtSignalI() have been renamed to chEvtSignalFlags() and chEvtSignalFlagsI() for consistency. - NEW: Added I-Class functions to the MailBoxes subsystem, now it is - possible to use them as a transport layer between ISRs and Threads. + possible to use them as a transport layer between ISRs and Threads + (backported to 2.2.2). - NEW: Added experimental generic USB driver, it will evolve in next releases. - NEW: Added an experimental USB driver implementation for STM32. @@ -104,7 +105,8 @@ - NEW: Implemented the new IO_TRANSMISSION_END event in the STM32 serial driver. - CHANGE: Swapped the numeric values of the TIME_IMMEDIATE and TIME_INFINITE - constants. Fixed the relative documentation in various places. + constants. Fixed the relative documentation in various places (backported + to 2.2.2). *** 2.1.8 *** - FIX: Fixed error in STM32 ADC driver macro names (bug 3160306)(backported -- cgit v1.2.3 From 381bddaf5af985848e36ed8abbd4321bbb442538 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 15:18:15 +0000 Subject: Improved mailboxes coverage. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2771 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/coverage.txt | 4 +-- test/testmbox.c | 85 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/docs/reports/coverage.txt b/docs/reports/coverage.txt index dc63a753e..731ba75d5 100644 --- a/docs/reports/coverage.txt +++ b/docs/reports/coverage.txt @@ -49,11 +49,11 @@ Lines executed:100.00% of 111 ../../os/kernel/src/chevents.c:creating `chevents.c.gcov' File `../../os/kernel/src/chmsg.c' -Lines executed:100.00% of 32 +Lines executed:100.00% of 27 ../../os/kernel/src/chmsg.c:creating `chmsg.c.gcov' File `../../os/kernel/src/chmboxes.c' -Lines executed:100.00% of 65 +Lines executed:100.00% of 94 ../../os/kernel/src/chmboxes.c:creating `chmboxes.c.gcov' File `../../os/kernel/src/chqueues.c' diff --git a/test/testmbox.c b/test/testmbox.c index b3ac17e01..eba54a0d0 100644 --- a/test/testmbox.c +++ b/test/testmbox.c @@ -100,46 +100,95 @@ static void mbox1_execute(void) { */ msg1 = chMBPost(&mb1, 'X', 1); test_assert(4, msg1 == RDY_TIMEOUT, "wrong wake-up message"); + msg1 = chMBPostI(&mb1, 'X'); + test_assert(5, msg1 == RDY_TIMEOUT, "wrong wake-up message"); + msg1 = chMBPostAhead(&mb1, 'X', 1); + test_assert(6, msg1 == RDY_TIMEOUT, "wrong wake-up message"); + msg1 = chMBPostAheadI(&mb1, 'X'); + test_assert(7, msg1 == RDY_TIMEOUT, "wrong wake-up message"); /* * Testing final conditions. */ - test_assert(5, chMBGetFreeCountI(&mb1) == 0, "still empty"); - test_assert(6, chMBGetUsedCountI(&mb1) == MB_SIZE, "not full"); - test_assert(7, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); + test_assert(8, chMBGetFreeCountI(&mb1) == 0, "still empty"); + test_assert(9, chMBGetUsedCountI(&mb1) == MB_SIZE, "not full"); + test_assert(10, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); /* * Testing dequeuing. */ for (i = 0; i < MB_SIZE; i++) { - msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE); - test_assert(8, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE); + test_assert(11, msg1 == RDY_OK, "wrong wake-up message"); test_emit_token(msg2); } - test_assert_sequence(9, "ABCDE"); + test_assert_sequence(12, "ABCDE"); /* * Testing buffer circularity. */ msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE); - test_assert(10, msg1 == RDY_OK, "wrong wake-up message"); + test_assert(13, msg1 == RDY_OK, "wrong wake-up message"); msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE); - test_assert(11, msg1 == RDY_OK, "wrong wake-up message"); - test_assert(12, mb1.mb_buffer == mb1.mb_wrptr, "write pointer not aligned to base"); - test_assert(13, mb1.mb_buffer == mb1.mb_rdptr, "read pointer not aligned to base"); + test_assert(14, msg1 == RDY_OK, "wrong wake-up message"); + test_assert(15, mb1.mb_buffer == mb1.mb_wrptr, "write pointer not aligned to base"); + test_assert(16, mb1.mb_buffer == mb1.mb_rdptr, "read pointer not aligned to base"); /* * Testing fetch timeout. */ msg1 = chMBFetch(&mb1, &msg2, 1); - test_assert(14, msg1 == RDY_TIMEOUT, "wrong wake-up message"); + test_assert(17, msg1 == RDY_TIMEOUT, "wrong wake-up message"); + msg1 = chMBFetchI(&mb1, &msg2); + test_assert(18, msg1 == RDY_TIMEOUT, "wrong wake-up message"); /* * Testing final conditions. */ - test_assert(15, chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty"); - test_assert(16, chMBGetUsedCountI(&mb1) == 0, "still full"); - test_assert(17, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); + test_assert(19, chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty"); + test_assert(20, chMBGetUsedCountI(&mb1) == 0, "still full"); + test_assert(21, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); + + /* + * Testing I-Class. + */ + msg1 = chMBPostI(&mb1, 'A'); + test_assert(22, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostI(&mb1, 'B'); + test_assert(23, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostI(&mb1, 'C'); + test_assert(24, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostI(&mb1, 'D'); + test_assert(25, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostI(&mb1, 'E'); + test_assert(26, msg1 == RDY_OK, "wrong wake-up message"); + test_assert(27, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); + for (i = 0; i < MB_SIZE; i++) { + msg1 = chMBFetchI(&mb1, &msg2); + test_assert(28, msg1 == RDY_OK, "wrong wake-up message"); + test_emit_token(msg2); + } + test_assert_sequence(29, "ABCDE"); + test_assert(30, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); + + msg1 = chMBPostAheadI(&mb1, 'E'); + test_assert(31, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostAheadI(&mb1, 'D'); + test_assert(32, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostAheadI(&mb1, 'C'); + test_assert(33, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostAheadI(&mb1, 'B'); + test_assert(34, msg1 == RDY_OK, "wrong wake-up message"); + msg1 = chMBPostAheadI(&mb1, 'A'); + test_assert(35, msg1 == RDY_OK, "wrong wake-up message"); + test_assert(36, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); + for (i = 0; i < MB_SIZE; i++) { + msg1 = chMBFetchI(&mb1, &msg2); + test_assert(37, msg1 == RDY_OK, "wrong wake-up message"); + test_emit_token(msg2); + } + test_assert_sequence(38, "ABCDE"); + test_assert(39, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned"); /* * Testing reset. @@ -149,10 +198,10 @@ static void mbox1_execute(void) { /* * Re-testing final conditions. */ - test_assert(18, chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty"); - test_assert(19, chMBGetUsedCountI(&mb1) == 0, "still full"); - test_assert(20, mb1.mb_buffer == mb1.mb_wrptr, "write pointer not aligned to base"); - test_assert(21, mb1.mb_buffer == mb1.mb_rdptr, "read pointer not aligned to base"); + test_assert(40, chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty"); + test_assert(41, chMBGetUsedCountI(&mb1) == 0, "still full"); + test_assert(42, mb1.mb_buffer == mb1.mb_wrptr, "write pointer not aligned to base"); + test_assert(43, mb1.mb_buffer == mb1.mb_rdptr, "read pointer not aligned to base"); } ROMCONST struct testcase testmbox1 = { -- cgit v1.2.3 From 6b5ddb71fcb396ec826a283427b4771018d193e8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Feb 2011 18:44:46 +0000 Subject: GPT driver model, STM32 GPT driver implementation, not tested, documentation not done yet. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2779 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/hal.mk | 1 + os/hal/include/gpt.h | 107 ++++++++ os/hal/include/hal.h | 1 + os/hal/platforms/STM32/gpt_lld.c | 415 ++++++++++++++++++++++++++++++ os/hal/platforms/STM32/gpt_lld.h | 264 +++++++++++++++++++ os/hal/platforms/STM32/hal_lld.c | 6 + os/hal/platforms/STM32/platform.mk | 1 + os/hal/platforms/STM32/pwm_lld.c | 24 +- os/hal/platforms/STM32/usb_lld.c | 9 +- os/hal/platforms/STM32/usb_lld.h | 2 +- os/hal/src/gpt.c | 228 +++++++++++++++++ os/hal/src/hal.c | 3 + os/hal/templates/adc_lld.c | 4 + os/hal/templates/gpt_lld.c | 134 ++++++++++ os/hal/templates/gpt_lld.h | 130 ++++++++++ os/hal/templates/meta/driver.c | 20 +- os/hal/templates/meta/driver_lld.c | 6 +- os/hal/templates/meta/driver_lld.h | 4 +- os/hal/templates/usb_lld.c | 327 ++++++++++++++++++++++++ os/hal/templates/usb_lld.h | 305 ++++++++++++++++++++++ readme.txt | 20 +- testhal/STM32/GPT/Makefile | 204 +++++++++++++++ testhal/STM32/GPT/ch.ld | 113 +++++++++ testhal/STM32/GPT/chconf.h | 507 +++++++++++++++++++++++++++++++++++++ testhal/STM32/GPT/halconf.h | 280 ++++++++++++++++++++ testhal/STM32/GPT/main.c | 71 ++++++ testhal/STM32/GPT/mcuconf.h | 142 +++++++++++ testhal/STM32/GPT/openocd.bat | 3 + testhal/STM32/GPT/openocd.cfg | 13 + testhal/STM32/GPT/readme.txt | 26 ++ testhal/STM32/GPT/run | 8 + todo.txt | 3 +- 32 files changed, 3336 insertions(+), 45 deletions(-) create mode 100644 os/hal/include/gpt.h create mode 100644 os/hal/platforms/STM32/gpt_lld.c create mode 100644 os/hal/platforms/STM32/gpt_lld.h create mode 100644 os/hal/src/gpt.c create mode 100644 os/hal/templates/gpt_lld.c create mode 100644 os/hal/templates/gpt_lld.h create mode 100644 os/hal/templates/usb_lld.c create mode 100644 os/hal/templates/usb_lld.h create mode 100644 testhal/STM32/GPT/Makefile create mode 100644 testhal/STM32/GPT/ch.ld create mode 100644 testhal/STM32/GPT/chconf.h create mode 100644 testhal/STM32/GPT/halconf.h create mode 100644 testhal/STM32/GPT/main.c create mode 100644 testhal/STM32/GPT/mcuconf.h create mode 100644 testhal/STM32/GPT/openocd.bat create mode 100644 testhal/STM32/GPT/openocd.cfg create mode 100644 testhal/STM32/GPT/readme.txt create mode 100644 testhal/STM32/GPT/run diff --git a/os/hal/hal.mk b/os/hal/hal.mk index 233ac66d1..49561ee8d 100644 --- a/os/hal/hal.mk +++ b/os/hal/hal.mk @@ -3,6 +3,7 @@ HALSRC = ${CHIBIOS}/os/hal/src/hal.c \ ${CHIBIOS}/os/hal/src/adc.c \ ${CHIBIOS}/os/hal/src/can.c \ + ${CHIBIOS}/os/hal/src/gpt.c \ ${CHIBIOS}/os/hal/src/i2c.c \ ${CHIBIOS}/os/hal/src/mac.c \ ${CHIBIOS}/os/hal/src/pal.c \ diff --git a/os/hal/include/gpt.h b/os/hal/include/gpt.h new file mode 100644 index 000000000..d4063cd6c --- /dev/null +++ b/os/hal/include/gpt.h @@ -0,0 +1,107 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file gpt.h + * @brief GPT Driver macros and structures. + * + * @addtogroup GPT + * @{ + */ + +#ifndef _GPT_H_ +#define _GPT_H_ + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(GPT_USE_WAIT) || defined(__DOXYGEN__) +#define GPT_USE_WAIT TRUE +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +#if GPT_USE_WAIT && !CH_USE_SEMAPHORES +#error "GPT driver requires CH_USE_SEMAPHORES when GPT_USE_WAIT is enabled" +#endif + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Driver state machine possible states. + */ +typedef enum { + GPT_UNINIT = 0, /**< Not initialized. */ + GPT_STOP = 1, /**< Stopped. */ + GPT_READY = 2, /**< Ready. */ + GPT_CONTINUOUS = 3, /**< Active in continuous mode. */ + GPT_ONESHOT = 4 /**< Active in one shot mode. */ +} gptstate_t; + +#include "gpt_lld.h" + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void gptInit(void); + void gptObjectInit(GPTDriver *gptp); + void gptStart(GPTDriver *gptp, const GPTConfig *config); + void gptStop(GPTDriver *gptp); + void gptStartContinuous(GPTDriver *gptp, gptcnt_t interval); + void gptStartContinuousI(GPTDriver *gptp, gptcnt_t interval); + void gptStartOneShot(GPTDriver *gptp, gptcnt_t interval); + void gptStartOneShotI(GPTDriver *gptp, gptcnt_t interval); + void gptStopTimer(GPTDriver *gptp); + void gptStopTimerI(GPTDriver *gptp); + void gptPolledDelay(GPTDriver *gptp, gptcnt_t interval); +#if GPT_USE_WAIT + void gptDelay(GPTDriver *gptp, gptcnt_t interval); +#endif +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_GPT */ + +#endif /* _GPT_H_ */ + +/** @} */ diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h index 822dafc35..7cb3a873e 100644 --- a/os/hal/include/hal.h +++ b/os/hal/include/hal.h @@ -36,6 +36,7 @@ #include "pal.h" #include "adc.h" #include "can.h" +#include "gpt.h" #include "i2c.h" #include "mac.h" #include "pwm.h" diff --git a/os/hal/platforms/STM32/gpt_lld.c b/os/hal/platforms/STM32/gpt_lld.c new file mode 100644 index 000000000..1278400a1 --- /dev/null +++ b/os/hal/platforms/STM32/gpt_lld.c @@ -0,0 +1,415 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32/gpt_lld.c + * @brief STM32 GPT subsystem low level driver source. + * + * @addtogroup GPT + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/* There are differences in vector names in the ST header for devices + including TIM15, TIM16, TIM17.*/ +#if STM32_HAS_TIM15 +#define TIM1_BRK_IRQn TIM1_BRK_TIM15_IRQn +#endif +#if STM32_HAS_TIM16 +#define TIM1_UP_IRQn TIM1_UP_TIM16_IRQn +#endif +#if STM32_HAS_TIM17 +#define TIM1_TRG_COM_IRQn TIM1_TRG_COM_TIM17_IRQn +#endif + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/** + * @brief GPT1 driver identifier. + * @note The driver GPT1 allocates the complex timer TIM1 when enabled. + */ +#if STM32_GPT_USE_TIM1 || defined(__DOXYGEN__) +GPTDriver GPTD1; +#endif + +/** + * @brief GPT2 driver identifier. + * @note The driver GPT2 allocates the timer TIM2 when enabled. + */ +#if STM32_GPT_USE_TIM2 || defined(__DOXYGEN__) +GPTDriver GPTD2; +#endif + +/** + * @brief GPT3 driver identifier. + * @note The driver GPT3 allocates the timer TIM3 when enabled. + */ +#if STM32_GPT_USE_TIM3 || defined(__DOXYGEN__) +GPTDriver GPTD3; +#endif + +/** + * @brief GPT4 driver identifier. + * @note The driver GPT4 allocates the timer TIM4 when enabled. + */ +#if STM32_GPT_USE_TIM4 || defined(__DOXYGEN__) +GPTDriver GPTD4; +#endif + +/** + * @brief GPT5 driver identifier. + * @note The driver GPT5 allocates the timer TIM5 when enabled. + */ +#if STM32_GPT_USE_TIM5 || defined(__DOXYGEN__) +GPTDriver GPTD5; +#endif + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/** + * @brief Shared IRQ handler. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +static void gpt_lld_serve_interrupt(GPTDriver *gptp) { + + gptp->tim->SR = 0; + if (gptp->state == GPT_ONESHOT) { + gptp->state = GPT_READY; /* Back in GPT_READY state. */ + gpt_lld_stop_timer(gptp); /* Timer automatically stopped. */ + } + gptp->config->callback(gptp); +} + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +#if STM32_GPT_USE_TIM1 +/** + * @brief TIM2 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM1_UP_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD1); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_GPT_USE_TIM1 */ + +#if STM32_GPT_USE_TIM2 +/** + * @brief TIM2 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM2_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD2); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_GPT_USE_TIM2 */ + +#if STM32_GPT_USE_TIM3 +/** + * @brief TIM3 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM3_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD3); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_GPT_USE_TIM3 */ + +#if STM32_GPT_USE_TIM4 +/** + * @brief TIM4 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM4_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD4); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_GPT_USE_TIM4 */ + +#if STM32_GPT_USE_TIM5 +/** + * @brief TIM5 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM5_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD5); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_GPT_USE_TIM5 */ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level GPT driver initialization. + * + * @notapi + */ +void gpt_lld_init(void) { + +#if STM32_GPT_USE_TIM1 + /* Driver initialization.*/ + GPTD1.tim = TIM1; + gptObjectInit(&GPTD1); +#endif + +#if STM32_GPT_USE_TIM2 + /* Driver initialization.*/ + GPTD2.tim = TIM2; + gptObjectInit(&GPTD2); +#endif + +#if STM32_GPT_USE_TIM3 + /* Driver initialization.*/ + GPTD3.tim = TIM3; + gptObjectInit(&GPTD3); +#endif + +#if STM32_GPT_USE_TIM4 + /* Driver initialization.*/ + GPTD4.tim = TIM4; + gptObjectInit(&GPTD4); +#endif + +#if STM32_GPT_USE_TIM5 + /* Driver initialization.*/ + GPTD5.tim = TIM5; + gptObjectInit(&GPTD5); +#endif +} + +/** + * @brief Configures and activates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_start(GPTDriver *gptp) { + uint16_t psc; + + if (gptp->state == GPT_STOP) { + /* Clock activation.*/ +#if STM32_GPT_USE_TIM1 + if (&GPTD1 == gptp) { + RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; + RCC->APB2RSTR = RCC_APB2RSTR_TIM1RST; + RCC->APB2RSTR = 0; + NVICEnableVector(TIM1_UP_IRQn, + CORTEX_PRIORITY_MASK(STM32_GPT_TIM1_IRQ_PRIORITY)); + gptp->clock = STM32_TIMCLK2; + } +#endif +#if STM32_GPT_USE_TIM2 + if (&GPTD2 == gptp) { + RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM2RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM2_IRQn, + CORTEX_PRIORITY_MASK(STM32_GPT_TIM2_IRQ_PRIORITY)); + gptp->clock = STM32_TIMCLK1; + } +#endif +#if STM32_GPT_USE_TIM3 + if (&GPTD3 == gptp) { + RCC->APB1ENR |= RCC_APB1ENR_TIM3EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM3RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM3_IRQn, + CORTEX_PRIORITY_MASK(STM32_GPT_TIM3_IRQ_PRIORITY)); + gptp->clock = STM32_TIMCLK1; + } +#endif +#if STM32_GPT_USE_TIM4 + if (&GPTD4 == gptp) { + RCC->APB1ENR |= RCC_APB1ENR_TIM4EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM4RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM4_IRQn, + CORTEX_PRIORITY_MASK(STM32_GPT_TIM4_IRQ_PRIORITY)); + gptp->clock = STM32_TIMCLK1; + } +#endif + +#if STM32_GPT_USE_TIM5 + if (&GPTD5 == gptp) { + RCC->APB1ENR |= RCC_APB1ENR_TIM5EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM5RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM5_IRQn, + CORTEX_PRIORITY_MASK(STM32_GPT_TIM5_IRQ_PRIORITY)); + gptp->clock = STM32_TIMCLK1; + } +#endif + } + + /* Prescaler value calculation.*/ + psc = (uint16_t)((gptp->clock / gptp->config->frequency) - 1); + chDbgAssert(((uint32_t)(psc + 1) * gptp->config->frequency) == gptp->clock, + "gpt_lld_start(), #1", "invalid frequency"); + + /* Timer configuration.*/ + gptp->tim->CR1 = 0; /* Initially stopped. */ + gptp->tim->CR2 = TIM_CR2_CCDS; /* DMA on UE (if any). */ + gptp->tim->PSC = psc; /* Prescaler value. */ + gptp->tim->DIER = 0; +} + +/** + * @brief Deactivates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop(GPTDriver *gptp) { + + if (gptp->state == GPT_READY) { + gptp->tim->CR1 = 0; /* Timer disabled. */ + gptp->tim->DIER = 0; /* All IRQs disabled. */ + +#if STM32_GPT_USE_TIM1 + if (&GPTD1 == gptp) { + NVICDisableVector(TIM1_UP_IRQn); + RCC->APB2ENR &= ~RCC_APB2ENR_TIM1EN; + } +#endif +#if STM32_GPT_USE_TIM2 + if (&GPTD2 == gptp) { + NVICDisableVector(TIM2_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM2EN; + } +#endif +#if STM32_GPT_USE_TIM3 + if (&GPTD3 == gptp) { + NVICDisableVector(TIM3_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM3EN; + } +#endif +#if STM32_GPT_USE_TIM4 + if (&GPTD4 == gptp) { + NVICDisableVector(TIM4_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM4EN; + } +#endif +#if STM32_GPT_USE_TIM5 + if (&GPTD5 == gptp) { + NVICDisableVector(TIM5_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM5EN; + } +#endif + } +} + +/** + * @brief Starts the timer in continuous mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval period in ticks + * + * @notapi + */ +void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) { + + gptp->tim->ARR = interval - 1; /* Time constant. */ + gptp->tim->EGR = TIM_EGR_UG; /* Update event. */ + gptp->tim->SR = 0; /* Clear pending IRQs (if any). */ + gptp->tim->DIER = TIM_DIER_UIE; /* Update Event IRQ enabled. */ + gptp->tim->CR1 = TIM_CR1_URS | TIM_CR1_CEN; +} + +/** + * @brief Stops the timer. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop_timer(GPTDriver *gptp) { + + gptp->tim->CR1 = 0; /* Initially stopped. */ + gptp->tim->SR = 0; /* Clear pending IRQs (if any). */ + gptp->tim->DIER = 0; /* Interrupts disabled. */ +} + +/** + * @brief Starts the timer in one shot mode and waits for completion. + * @details This function specifically polls the timer waiting for completion + * in order to not have extra delays caused by interrupt servicing, + * this function is only recommended for short delays. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @notapi + */ +void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) { + + gptp->tim->ARR = interval - 1; /* Time constant. */ + gptp->tim->EGR = TIM_EGR_UG; /* Update event. */ + gptp->tim->SR = 0; /* Clear pending IRQs (if any). */ + gptp->tim->CR1 = TIM_CR1_OPM | TIM_CR1_URS | TIM_CR1_CEN; + while (!(gptp->tim->SR & TIM_SR_UIF)) + ; +} + +#endif /* HAL_USE_GPT */ + +/** @} */ diff --git a/os/hal/platforms/STM32/gpt_lld.h b/os/hal/platforms/STM32/gpt_lld.h new file mode 100644 index 000000000..1eb67318b --- /dev/null +++ b/os/hal/platforms/STM32/gpt_lld.h @@ -0,0 +1,264 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32/gpt_lld.h + * @brief STM32 GPT subsystem low level driver header. + * + * @addtogroup GPT + * @{ + */ + +#ifndef _GPT_LLD_H_ +#define _GPT_LLD_H_ + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief GPT1 driver enable switch. + * @details If set to @p TRUE the support for GPT1 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_GPT_USE_TIM1) || defined(__DOXYGEN__) +#define STM32_GPT_USE_TIM1 TRUE +#endif + +/** + * @brief GPT2 driver enable switch. + * @details If set to @p TRUE the support for GPT2 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_GPT_USE_TIM2) || defined(__DOXYGEN__) +#define STM32_GPT_USE_TIM2 TRUE +#endif + +/** + * @brief GPT3 driver enable switch. + * @details If set to @p TRUE the support for GPT3 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_GPT_USE_TIM3) || defined(__DOXYGEN__) +#define STM32_GPT_USE_TIM3 TRUE +#endif + +/** + * @brief GPT4 driver enable switch. + * @details If set to @p TRUE the support for GPT4 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_GPT_USE_TIM4) || defined(__DOXYGEN__) +#define STM32_GPT_USE_TIM4 TRUE +#endif + +/** + * @brief GPT5 driver enable switch. + * @details If set to @p TRUE the support for GPT5 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_GPT_USE_TIM5) || defined(__DOXYGEN__) +#define STM32_GPT_USE_TIM5 TRUE +#endif + +/** + * @brief GPT1 interrupt priority level setting. + */ +#if !defined(STM32_GPT_TIM1_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#endif + +/** + * @brief GPT2 interrupt priority level setting. + */ +#if !defined(STM32_GPT_TIM2_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#endif + +/** + * @brief GPT3 interrupt priority level setting. + */ +#if !defined(STM32_GPT_TIM3_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#endif + +/** + * @brief GPT4 interrupt priority level setting. + */ +#if !defined(STM32_GPT_TIM4_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#endif + +/** + * @brief GPT5 interrupt priority level setting. + */ +#if !defined(STM32_GPT_TIM5_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +#if STM32_GPT_USE_TIM1 && !STM32_HAS_TIM1 +#error "TIM1 not present in the selected device" +#endif + +#if STM32_GPT_USE_TIM2 && !STM32_HAS_TIM2 +#error "TIM2 not present in the selected device" +#endif + +#if STM32_GPT_USE_TIM3 && !STM32_HAS_TIM3 +#error "TIM3 not present in the selected device" +#endif + +#if STM32_GPT_USE_TIM4 && !STM32_HAS_TIM4 +#error "TIM4 not present in the selected device" +#endif + +#if STM32_GPT_USE_TIM5 && !STM32_HAS_TIM5 +#error "TIM5 not present in the selected device" +#endif + +#if !STM32_GPT_USE_TIM1 && !STM32_GPT_USE_TIM2 && \ + !STM32_GPT_USE_TIM3 && !STM32_GPT_USE_TIM4 && \ + !STM32_GPT_USE_TIM5 +#error "GPT driver activated but no TIM peripheral assigned" +#endif + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief GPT frequency type. + */ +typedef uint32_t gptfreq_t; + +/** + * @brief GPT counter type. + */ +typedef uint16_t gptcnt_t; + +/** + * @brief Type of a structure representing a GPT driver. + */ +typedef struct GPTDriver GPTDriver; + +/** + * @brief GPT notification callback type. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +typedef void (*gptcallback_t)(GPTDriver *gptp); + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + gptfreq_t frequency; + /** + * @brief Timer callback pointer. + * @note This callback is invoked on GPT counter events. + */ + gptcallback_t callback; + /* End of the mandatory fields.*/ +} GPTConfig; + +/** + * @brief Structure representing a GPT driver. + */ +struct GPTDriver { + /** + * @brief Driver state. + */ + gptstate_t state; + /** + * @brief Current configuration data. + */ + const GPTConfig *config; + /* End of the mandatory fields.*/ + /** + * @brief Timer base clock. + */ + uint32_t clock; + /** + * @brief Pointer to the TIMx registers block. + */ + TIM_TypeDef *tim; +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#if STM32_GPT_USE_TIM1 && !defined(__DOXYGEN__) +extern GPTDriver GPTD1; +#endif + +#if STM32_GPT_USE_TIM2 && !defined(__DOXYGEN__) +extern GPTDriver GPTD2; +#endif + +#if STM32_GPT_USE_TIM3 && !defined(__DOXYGEN__) +extern GPTDriver GPTD3; +#endif + +#if STM32_GPT_USE_TIM4 && !defined(__DOXYGEN__) +extern GPTDriver GPTD4; +#endif + +#if STM32_GPT_USE_TIM5 && !defined(__DOXYGEN__) +extern GPTDriver GPTD5; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + void gpt_lld_init(void); + void gpt_lld_start(GPTDriver *gptp); + void gpt_lld_stop(GPTDriver *gptp); + void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t period); + void gpt_lld_stop_timer(GPTDriver *gptp); + void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_GPT */ + +#endif /* _GPT_LLD_H_ */ + +/** @} */ diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 8d8322033..cbbdf1587 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -57,6 +57,12 @@ */ void hal_lld_init(void) { + /* Reset of all the peripherals.*/ + RCC->APB1RSTR = 0xFFFFFFFF; + RCC->APB2RSTR = 0xFFFFFFFF; + RCC->APB1RSTR = 0; + RCC->APB2RSTR = 0; + /* SysTick initialization using the system clock.*/ SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1; SysTick->VAL = 0; diff --git a/os/hal/platforms/STM32/platform.mk b/os/hal/platforms/STM32/platform.mk index ceadcea62..469b85c79 100644 --- a/os/hal/platforms/STM32/platform.mk +++ b/os/hal/platforms/STM32/platform.mk @@ -2,6 +2,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32/hal_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/adc_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/can_lld.c \ + ${CHIBIOS}/os/hal/platforms/STM32/gpt_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/pal_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/pwm_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/serial_lld.c \ diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index f78896e95..a101b284a 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -101,6 +101,8 @@ PWMDriver PWMD5; * @note It is assumed that the various sources are only activated if the * associated callback pointer is not equal to @p NULL in order to not * perform an extra check in a potentially critical interrupt handler. + * + * @param[in] pwmp pointer to a @p PWMDriver object */ static void serve_interrupt(PWMDriver *pwmp) { uint16_t sr; @@ -249,10 +251,6 @@ CH_IRQ_HANDLER(TIM5_IRQHandler) { void pwm_lld_init(void) { #if STM32_PWM_USE_TIM1 - /* TIM1 reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB2RSTR = RCC_APB2RSTR_TIM1RST; - RCC->APB2RSTR = 0; - /* Driver initialization.*/ pwmObjectInit(&PWMD1); PWMD1.pd_enabled_channels = 0; @@ -260,10 +258,6 @@ void pwm_lld_init(void) { #endif #if STM32_PWM_USE_TIM2 - /* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB1RSTR = RCC_APB1RSTR_TIM2RST; - RCC->APB1RSTR = 0; - /* Driver initialization.*/ pwmObjectInit(&PWMD2); PWMD2.pd_enabled_channels = 0; @@ -271,10 +265,6 @@ void pwm_lld_init(void) { #endif #if STM32_PWM_USE_TIM3 - /* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB1RSTR = RCC_APB1RSTR_TIM3RST; - RCC->APB1RSTR = 0; - /* Driver initialization.*/ pwmObjectInit(&PWMD3); PWMD3.pd_enabled_channels = 0; @@ -282,10 +272,6 @@ void pwm_lld_init(void) { #endif #if STM32_PWM_USE_TIM4 - /* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB1RSTR = RCC_APB1RSTR_TIM4RST; - RCC->APB1RSTR = 0; - /* Driver initialization.*/ pwmObjectInit(&PWMD4); PWMD4.pd_enabled_channels = 0; @@ -293,10 +279,6 @@ void pwm_lld_init(void) { #endif #if STM32_PWM_USE_TIM5 - /* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB1RSTR = RCC_APB1RSTR_TIM5RST; - RCC->APB1RSTR = 0; - /* Driver initialization.*/ pwmObjectInit(&PWMD5); PWMD5.pd_enabled_channels = 0; @@ -368,7 +350,6 @@ void pwm_lld_start(PWMDriver *pwmp) { } #endif - /* All channels configured in PWM1 mode with preload enabled and will stay that way until the driver is stopped.*/ pwmp->pd_tim->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 | @@ -448,6 +429,7 @@ void pwm_lld_start(PWMDriver *pwmp) { * @notapi */ void pwm_lld_stop(PWMDriver *pwmp) { + /* If in ready state then disables the PWM clock.*/ if (pwmp->pd_state == PWM_READY) { pwmp->pd_enabled_channels = 0; /* All channels disabled. */ diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index eb3d6ab7a..ecd183171 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -29,7 +29,6 @@ #include "ch.h" #include "hal.h" -#include "usb.h" #if HAL_USE_USB || defined(__DOXYGEN__) @@ -513,6 +512,10 @@ void usb_lld_disable_endpoints(USBDriver *usbp) { * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number + * @return The endpoint status. + * @retval EP_STATUS_DISABLED The endpoint is not active. + * @retval EP_STATUS_STALLED The endpoint is stalled. + * @retval EP_STATUS_ACTIVE The endpoint is active. * * @notapi */ @@ -534,6 +537,10 @@ usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) { * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number + * @return The endpoint status. + * @retval EP_STATUS_DISABLED The endpoint is not active. + * @retval EP_STATUS_STALLED The endpoint is stalled. + * @retval EP_STATUS_ACTIVE The endpoint is active. * * @notapi */ diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index a505e3e08..9c4c899b3 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -296,7 +296,7 @@ struct USBDriver { * * @notapi */ -#define usb_lld_fetch_word(p) (*(uint16_t *)p) +#define usb_lld_fetch_word(p) (*(uint16_t *)(p)) /** * @brief Returns the current frame number. diff --git a/os/hal/src/gpt.c b/os/hal/src/gpt.c new file mode 100644 index 000000000..5027079cf --- /dev/null +++ b/os/hal/src/gpt.c @@ -0,0 +1,228 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file gpt.c + * @brief GPT Driver code. + * + * @addtogroup GPT + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief GPT Driver initialization. + * @note This function is implicitly invoked by @p halInit(), there is + * no need to explicitly initialize the driver. + * + * @init + */ +void gptInit(void) { + + gpt_lld_init(); +} + +/** + * @brief Initializes the standard part of a @p GPTDriver structure. + * + * @param[out] gptp pointer to the @p GPTDriver object + * + * @init + */ +void gptObjectInit(GPTDriver *gptp) { + + gptp->state = GPT_STOP; + gptp->config = NULL; +} + +/** + * @brief Configures and activates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] config pointer to the @p GPTConfig object + * + * @api + */ +void gptStart(GPTDriver *gptp, const GPTConfig *config) { + + chDbgCheck((gptp != NULL) && (config != NULL), "ptStart"); + + chSysLock(); + chDbgAssert((gptp->state == GPT_STOP) || (gptp->state == GPT_READY), + "gptStart(), #1", "invalid state"); + gptp->config = config; + gpt_lld_start(gptp); + gptp->state = GPT_READY; + chSysUnlock(); +} + +/** + * @brief Deactivates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @api + */ +void gptStop(GPTDriver *gptp) { + + chDbgCheck(gptp != NULL, "gptStop"); + + chSysLock(); + chDbgAssert((gptp->state == GPT_STOP) || (gptp->state == GPT_READY), + "gptStop(), #1", "invalid state"); + gpt_lld_stop(gptp); + gptp->state = GPT_STOP; + chSysUnlock(); +} + +/** + * @brief Starts the timer in continuous mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval period in ticks + * + * @api + */ +void gptStartContinuous(GPTDriver *gptp, gptcnt_t interval) { + + chSysLock(); + gptStartContinuousI(gptp, interval); + chSysUnlock(); +} + +/** + * @brief Starts the timer in continuous mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval period in ticks + * + * @iclass + */ +void gptStartContinuousI(GPTDriver *gptp, gptcnt_t interval) { + + chDbgAssert(gptp->state == GPT_READY, + "gptStartContinuousI(), #1", "invalid state"); + gptp->state = GPT_CONTINUOUS; + gpt_lld_start_timer(gptp, interval); +} + +/** + * @brief Starts the timer in one shot mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @api + */ +void gptStartOneShot(GPTDriver *gptp, gptcnt_t interval) { + + chSysLock(); + gptStartOneShotI(gptp, interval); + chSysUnlock(); +} + +/** + * @brief Starts the timer in one shot mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @api + */ +void gptStartOneShotI(GPTDriver *gptp, gptcnt_t interval) { + + chDbgAssert(gptp->state == GPT_READY, + "gptStartOneShotI(), #1", "invalid state"); + gptp->state = GPT_ONESHOT; + gpt_lld_start_timer(gptp, interval); +} + +/** + * @brief Stops the timer. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @api + */ +void gptStopTimer(GPTDriver *gptp) { + + chSysLock(); + gptStopTimerI(gptp); + chSysUnlock(); +} + +/** + * @brief Stops the timer. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @api + */ +void gptStopTimerI(GPTDriver *gptp) { + + chDbgAssert((gptp->state == GPT_READY) || (gptp->state == GPT_CONTINUOUS) || + (gptp->state == GPT_ONESHOT), + "gptStopTimerI(), #1", "invalid state"); + gptp->state = GPT_READY; + gpt_lld_stop_timer(gptp); +} + +/** + * @brief Starts the timer in one shot mode and waits for completion. + * @details This function specifically polls the timer waiting for completion + * in order to not have extra delays caused by interrupt servicing, + * this function is only recommended for short delays. + * @note The configured callback is not invoked when using this function. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @api + */ +void gptPolledDelay(GPTDriver *gptp, gptcnt_t interval) { + + chDbgAssert(gptp->state == GPT_READY, + "gptPolledDelay(), #1", "invalid state"); + gptp->state = GPT_ONESHOT; + gpt_lld_polled_delay(gptp, interval); +} + +#endif /* HAL_USE_GPT */ + +/** @} */ diff --git a/os/hal/src/hal.c b/os/hal/src/hal.c index bfbaa3e84..d33dff30a 100644 --- a/os/hal/src/hal.c +++ b/os/hal/src/hal.c @@ -66,6 +66,9 @@ void halInit(void) { #if HAL_USE_CAN || defined(__DOXYGEN__) canInit(); #endif +#if HAL_USE_GPT || defined(__DOXYGEN__) + gptInit(); +#endif #if HAL_USE_I2C || defined(__DOXYGEN__) i2cInit(); #endif diff --git a/os/hal/templates/adc_lld.c b/os/hal/templates/adc_lld.c index 54622beb7..6c541f557 100644 --- a/os/hal/templates/adc_lld.c +++ b/os/hal/templates/adc_lld.c @@ -83,6 +83,10 @@ void adc_lld_start(ADCDriver *adcp) { */ void adc_lld_stop(ADCDriver *adcp) { + if (adcp->ad_state == ADC_READY) { + /* Clock de-activation.*/ + + } } /** diff --git a/os/hal/templates/gpt_lld.c b/os/hal/templates/gpt_lld.c new file mode 100644 index 000000000..edb6c5ba1 --- /dev/null +++ b/os/hal/templates/gpt_lld.c @@ -0,0 +1,134 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/gpt_lld.c + * @brief GPT Driver subsystem low level driver source template. + * + * @addtogroup GPT + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level GPT driver initialization. + * + * @notapi + */ +void gpt_lld_init(void) { + +} + +/** + * @brief Configures and activates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_start(GPTDriver *gptp) { + uint16_t psc; + + if (gptp->state == GPT_STOP) { + /* Clock activation.*/ + + } + /* Configuration.*/ +} + +/** + * @brief Deactivates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop(GPTDriver *gptp) { + + if (gptp->state == GPT_READY) { + /* Clock de-activation.*/ + + } +} + +/** + * @brief Starts the timer in continuous mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] period period in ticks + * + * @notapi + */ +void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t period) { + +} + +/** + * @brief Stops the timer. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop_timer(GPTDriver *gptp) { + +} + +/** + * @brief Starts the timer in one shot mode and waits for completion. + * @details This function specifically polls the timer waiting for completion + * in order to not have extra delays caused by interrupt servicing, + * this function is only recommended for short delays. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @notapi + */ +void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) { + +} + +#endif /* HAL_USE_GPT */ + +/** @} */ diff --git a/os/hal/templates/gpt_lld.h b/os/hal/templates/gpt_lld.h new file mode 100644 index 000000000..6f8d67d66 --- /dev/null +++ b/os/hal/templates/gpt_lld.h @@ -0,0 +1,130 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/gpt_lld.h + * @brief GPT Driver subsystem low level driver header template. + * + * @addtogroup GPT + * @{ + */ + +#ifndef _GPT_LLD_H_ +#define _GPT_LLD_H_ + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief GPT frequency type. + */ +typedef uint32_t gptfreq_t; + +/** + * @brief GPT counter type. + */ +typedef uint16_t gptcnt_t; + +/** + * @brief Type of a structure representing a GPT driver. + */ +typedef struct GPTDriver GPTDriver; + +/** + * @brief GPT notification callback type. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +typedef void (*gptcallback_t)(GPTDriver *gptp); + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + gptfreq_t frequency; + /** + * @brief Timer callback pointer. + * @note This callback is invoked on GPT counter events. + */ + gptcallback_t callback; + /* End of the mandatory fields.*/ +} GPTConfig; + +/** + * @brief Structure representing a GPT driver. + */ +struct GPTDriver { + /** + * @brief Driver state. + */ + gptstate_t state; + /** + * @brief Current configuration data. + */ + const GPTConfig *config; + /* End of the mandatory fields.*/ +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void gpt_lld_init(void); + void gpt_lld_start(GPTDriver *gptp); + void gpt_lld_stop(GPTDriver *gptp); + void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval); + void gpt_lld_stop_timer(GPTDriver *gptp); + void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_GPT */ + +#endif /* _GPT_LLD_H_ */ + +/** @} */ diff --git a/os/hal/templates/meta/driver.c b/os/hal/templates/meta/driver.c index f75c5d380..52d448126 100644 --- a/os/hal/templates/meta/driver.c +++ b/os/hal/templates/meta/driver.c @@ -67,8 +67,8 @@ void xxxInit(void) { */ void xxxObjectInit(XXXDriver *xxxp) { - xxxp->xxx_state = XXX_STOP; - xxxp->xxx_config = NULL; + xxxp->state = XXX_STOP; + xxxp->config = NULL; } /** @@ -84,12 +84,11 @@ void xxxStart(XXXDriver *xxxp, const XXXConfig *config) { chDbgCheck((xxxp != NULL) && (config != NULL), "xxxStart"); chSysLock(); - chDbgAssert((xxxp->xxx_state == XXX_STOP) || (xxxp->xxx_state == XXX_READY), - "xxxStart(), #1", - "invalid state"); - xxxp->xxx_config = config; + chDbgAssert((xxxp->state == XXX_STOP) || (xxxp->state == XXX_READY), + "xxxStart(), #1", "invalid state"); + xxxp->config = config; xxx_lld_start(xxxp); - xxxp->xxx_state = XXX_READY; + xxxp->state = XXX_READY; chSysUnlock(); } @@ -105,11 +104,10 @@ void xxxStop(XXXDriver *xxxp) { chDbgCheck(xxxp != NULL, "xxxStop"); chSysLock(); - chDbgAssert((xxxp->xxx_state == XXX_STOP) || (xxxp->xxx_state == XXX_READY), - "xxxStop(), #1", - "invalid state"); + chDbgAssert((xxxp->state == XXX_STOP) || (xxxp->state == XXX_READY), + "xxxStop(), #1", "invalid state"); xxx_lld_stop(xxxp); - xxxp->xxx_state = XXX_STOP; + xxxp->state = XXX_STOP; chSysUnlock(); } diff --git a/os/hal/templates/meta/driver_lld.c b/os/hal/templates/meta/driver_lld.c index 051dfac03..c548ccd8a 100644 --- a/os/hal/templates/meta/driver_lld.c +++ b/os/hal/templates/meta/driver_lld.c @@ -68,7 +68,7 @@ void xxx_lld_init(void) { */ void xxx_lld_start(XXXDriver *xxxp) { - if (xxxp->xxx_state == XXX_STOP) { + if (xxxp->state == XXX_STOP) { /* Clock activation.*/ } /* Configuration.*/ @@ -83,6 +83,10 @@ void xxx_lld_start(XXXDriver *xxxp) { */ void xxx_lld_stop(XXXDriver *xxxp) { + if (xxxp->state == XXX_READY) { + /* Clock deactivation.*/ + + } } #endif /* HAL_USE_XXX */ diff --git a/os/hal/templates/meta/driver_lld.h b/os/hal/templates/meta/driver_lld.h index 7d75bbaea..a30b54921 100644 --- a/os/hal/templates/meta/driver_lld.h +++ b/os/hal/templates/meta/driver_lld.h @@ -67,11 +67,11 @@ struct XXXDriver { /** * @brief Driver state. */ - xxxstate_t xxx_state; + xxxstate_t state; /** * @brief Current configuration data. */ - const XXXConfig *xxx_config; + const XXXConfig *config; /* End of the mandatory fields.*/ }; diff --git a/os/hal/templates/usb_lld.c b/os/hal/templates/usb_lld.c new file mode 100644 index 000000000..d2750d2e5 --- /dev/null +++ b/os/hal/templates/usb_lld.c @@ -0,0 +1,327 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/usb_lld.c + * @brief USB Driver subsystem low level driver source template. + * + * @addtogroup USB + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_USB || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/** + * @brief EP0 state. + * @note It is an union because IN and OUT endpoints are never used at the + * same time for EP0. + */ +static union { + /** + * @brief IN EP0 state. + */ + USBInEndpointState in; + /** + * @brief OUT EP0 state. + */ + USBOutEndpointState out; +} ep0_state; + +/** + * @brief EP0 initialization structure. + */ +static const USBEndpointConfig ep0config = { + USB_EP_MODE_TYPE_CTRL | USB_EP_MODE_TRANSACTION, + _usb_ep0in, + _usb_ep0out, + 0x40, + 0x40, + &ep0_state.in, + &ep0_state.out +}; + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level USB driver initialization. + * + * @notapi + */ +void usb_lld_init(void) { + +} + +/** + * @brief Configures and activates the USB peripheral. + * + * @param[in] usbp pointer to the @p USBDriver object + * + * @notapi + */ +void usb_lld_start(USBDriver *usbp) { + + if (usbp->state == USB_STOP) { + /* Clock activation.*/ + + /* Reset procedure enforced on driver start.*/ + _usb_reset(usbp); + } + /* Configuration.*/ +} + +/** + * @brief Deactivates the USB peripheral. + * + * @param[in] usbp pointer to the @p USBDriver object + * + * @notapi + */ +void usb_lld_stop(USBDriver *usbp) { + + /* If in ready state then disables the USB clock.*/ + if (usbp->state == USB_STOP) { + + } +} + +/** + * @brief USB low level reset routine. + * + * @param[in] usbp pointer to the @p USBDriver object + * + * @notapi + */ +void usb_lld_reset(USBDriver *usbp) { + + /* Post reset initialization.*/ + + /* EP0 initialization.*/ + usbp->epc[0] = &ep0config; + usb_lld_init_endpoint(usbp, 0); +} + +/** + * @brief Sets the USB address. + * + * @param[in] usbp pointer to the @p USBDriver object + * + * @notapi + */ +void usb_lld_set_address(USBDriver *usbp) { + +} + +/** + * @brief Enables an endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { + +} + +/** + * @brief Disables all the active endpoints except the endpoint zero. + * + * @param[in] usbp pointer to the @p USBDriver object + * + * @notapi + */ +void usb_lld_disable_endpoints(USBDriver *usbp) { + +} + +/** + * @brief Returns the status of an OUT endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return The endpoint status. + * @retval EP_STATUS_DISABLED The endpoint is not active. + * @retval EP_STATUS_STALLED The endpoint is stalled. + * @retval EP_STATUS_ACTIVE The endpoint is active. + * + * @notapi + */ +usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) { + +} + +/** + * @brief Returns the status of an IN endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return The endpoint status. + * @retval EP_STATUS_DISABLED The endpoint is not active. + * @retval EP_STATUS_STALLED The endpoint is stalled. + * @retval EP_STATUS_ACTIVE The endpoint is active. + * + * @notapi + */ +usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { + +} + +/** + * @brief Reads a packet from the dedicated packet buffer. + * @pre In order to use this function he endpoint must have been + * initialized in packet mode. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * @param[in] n maximum number of bytes to copy. This value must + * not exceed the maximum packet size for this endpoint. + * @return The received packet size regardless the specified + * @p n parameter. + * @retval 0 Zero size packet received. + * + * @notapi + */ +size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n) { + +} + +/** + * @brief Writes a packet to the dedicated packet buffer. + * @pre In order to use this function he endpoint must have been + * initialized in packet mode. + * @post The endpoint is ready to transmit the packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the packet data + * @param[in] n maximum number of bytes to copy. This value must + * not exceed the maximum packet size for this endpoint. + * + * @notapi + */ +void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n) { + +} + +/** + * @brief Starts a receive operation on an OUT endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the endpoint data + * @param[in] n maximum number of bytes to copy in the buffer + * + * @notapi + */ +void usb_lld_start_out(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n) { + +} + +/** + * @brief Starts a transmit operation on an IN endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[in] buf buffer where to fetch the endpoint data + * @param[in] n maximum number of bytes to copy + * + * @notapi + */ +void usb_lld_start_in(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n) { + +} + +/** + * @brief Brings an OUT endpoint in the stalled state. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +void usb_lld_stall_out(USBDriver *usbp, usbep_t ep) { + +} + +/** + * @brief Brings an IN endpoint in the stalled state. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +void usb_lld_stall_in(USBDriver *usbp, usbep_t ep) { + +} + +/** + * @brief Brings an OUT endpoint in the active state. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +void usb_lld_clear_out(USBDriver *usbp, usbep_t ep) { + +} + +/** + * @brief Brings an IN endpoint in the active state. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) { + +} + +#endif /* HAL_USE_USB */ + +/** @} */ diff --git a/os/hal/templates/usb_lld.h b/os/hal/templates/usb_lld.h new file mode 100644 index 000000000..254f6c5da --- /dev/null +++ b/os/hal/templates/usb_lld.h @@ -0,0 +1,305 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/usb_lld.h + * @brief USB Driver subsystem low level driver header template. + * + * @addtogroup USB + * @{ + */ + +#ifndef _USB_LLD_H_ +#define _USB_LLD_H_ + +#if HAL_USE_USB || defined(__DOXYGEN__) + +#include "stm32_usb.h" + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/** + * @brief Maximum endpoint address. + */ +#define USB_MAX_ENDPOINTS 4 + +/** + * @brief This device requires the address change after the status packet. + */ +#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Type of an IN endpoint state structure. + */ +typedef struct { + +} USBInEndpointState; + +/** + * @brief Type of an OUT endpoint state structure. + */ +typedef struct { + +} USBOutEndpointState; + +/** + * @brief Type of an USB endpoint configuration structure. + * @note Platform specific restrictions may apply to endpoints. + */ +typedef struct { + /** + * @brief Type and mode of the endpoint. + */ + uint32_t ep_mode; + /** + * @brief IN endpoint notification callback. + * @details This field must be set to @p NULL if the IN endpoint is not + * used. + */ + usbepcallback_t in_cb; + /** + * @brief OUT endpoint notification callback. + * @details This field must be set to @p NULL if the OUT endpoint is not + * used. + */ + usbepcallback_t out_cb; + /** + * @brief IN endpoint maximum packet size. + * @details This field must be set to zero if the IN endpoint is not + * used. + */ + uint16_t in_maxsize; + /** + * @brief OUT endpoint maximum packet size. + * @details This field must be set to zero if the OUT endpoint is not + * used. + */ + uint16_t out_maxsize; + /** + * @brief @p USBEndpointState associated to the IN endpoint. + * @details This structure maintains the state of the IN endpoint when + * the endpoint is not in packet mode. Endpoints configured in + * packet mode must set this field to @p NULL. + */ + USBInEndpointState *in_state; + /** + * @brief @p USBEndpointState associated to the OUT endpoint. + * @details This structure maintains the state of the OUT endpoint when + * the endpoint is not in packet mode. Endpoints configured in + * packet mode must set this field to @p NULL. + */ + USBOutEndpointState *out_state; + /* End of the mandatory fields.*/ +} USBEndpointConfig; + +/** + * @brief Type of an USB driver configuration structure. + */ +typedef struct { + /** + * @brief USB events callback. + * @details This callback is invoked when an USB driver event is registered. + */ + usbeventcb_t event_cb; + /** + * @brief Device GET_DESCRIPTOR request callback. + * @note This callback is mandatory and cannot be set to @p NULL. + */ + usbgetdescriptor_t get_descriptor_cb; + /** + * @brief Requests hook callback. + * @details This hook allows to be notified of standard requests or to + * handle non standard requests. + */ + usbreqhandler_t requests_hook_cb; + /** + * @brief Start Of Frame callback. + */ + usbcallback_t sof_cb; + /* End of the mandatory fields.*/ +} USBConfig; + +/** + * @brief Structure representing an USB driver. + */ +struct USBDriver { + /** + * @brief Driver state. + */ + usbstate_t state; + /** + * @brief Current configuration data. + */ + const USBConfig *config; + /** + * @brief Field available to user, it can be used to associate an + * application-defined handler to the USB driver. + */ + void *param; + /** + * @brief Bit map of the transmitting IN endpoints. + */ + uint16_t transmitting; + /** + * @brief Bit map of the receiving OUT endpoints. + */ + uint16_t receiving; + /** + * @brief Active endpoints configurations. + */ + const USBEndpointConfig *epc[USB_MAX_ENDPOINTS + 1]; + /** + * @brief Endpoint 0 state. + */ + usbep0state_t ep0state; + /** + * @brief Next position in the buffer to be transferred through endpoint 0. + */ + uint8_t *ep0next; + /** + * @brief Number of bytes yet to be transferred through endpoint 0. + */ + size_t ep0n; + /** + * @brief Endpoint 0 end transaction callback. + */ + usbcallback_t ep0endcb; + /** + * @brief Setup packet buffer. + */ + uint8_t setup[8]; + /** + * @brief Current USB device status. + */ + uint16_t status; + /** + * @brief Assigned USB address. + */ + uint8_t address; + /** + * @brief Current USB device configuration. + */ + uint8_t configuration; + /* End of the mandatory fields.*/ +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/** + * @brief Fetches a 16 bits word value from an USB message. + * + * @param[in] p pointer to the 16 bits word + * + * @notapi + */ +#define usb_lld_fetch_word(p) (*(uint16_t *)(p)) + +/** + * @brief Returns the current frame number. + * + * @param[in] usbp pointer to the @p USBDriver object + * @return The current frame number. + * + * @notapi + */ +#define usb_lld_get_frame_number(usbp) + +/** + * @brief Returns the exact size of a receive transaction. + * @details The received size can be different from the size specified in + * @p usbStartReceiveI() because the last packet could have a size + * different from the expected one. + * @pre The OUT endpoint must have been configured in transaction mode + * in order to use this function. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return Received data size. + * + * @notapi + */ +#define usb_lld_get_transaction_size(usbp, ep) + +/** + * @brief Returns the exact size of a received packet. + * @pre The OUT endpoint must have been configured in packet mode + * in order to use this function. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @return Received data size. + * + * @notapi + */ +#define usb_lld_get_packet_size(usbp, ep) + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void usb_lld_init(void); + void usb_lld_start(USBDriver *usbp); + void usb_lld_stop(USBDriver *usbp); + void usb_lld_reset(USBDriver *usbp); + void usb_lld_set_address(USBDriver *usbp); + void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep); + void usb_lld_disable_endpoints(USBDriver *usbp); + usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); + usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); + size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n); + void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n); + void usb_lld_start_out(USBDriver *usbp, usbep_t ep, + uint8_t *buf, size_t n); + void usb_lld_start_in(USBDriver *usbp, usbep_t ep, + const uint8_t *buf, size_t n); + void usb_lld_stall_in(USBDriver *usbp, usbep_t ep); + void usb_lld_stall_out(USBDriver *usbp, usbep_t ep); + void usb_lld_clear_out(USBDriver *usbp, usbep_t ep); + void usb_lld_clear_in(USBDriver *usbp, usbep_t ep); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_USB */ + +#endif /* _USB_LLD_H_ */ + +/** @} */ diff --git a/readme.txt b/readme.txt index 65b7b181b..3d22895ca 100644 --- a/readme.txt +++ b/readme.txt @@ -88,22 +88,28 @@ and chEvtBroadcastFlagsI(). The old chEvtBroadcast() and chEvtBroadcastI() become macros. The new functions allow to add the same flags to all the registered listener threads. -- CHANGE: The functions chEvtSignal() and chEvtSignalI() have been renamed - to chEvtSignalFlags() and chEvtSignalFlagsI() for consistency. - NEW: Added I-Class functions to the MailBoxes subsystem, now it is possible to use them as a transport layer between ISRs and Threads (backported to 2.2.2). -- NEW: Added experimental generic USB driver, it will evolve in next +- NEW: Added new USB driver model, probably it will evolve in next releases. -- NEW: Added an experimental USB driver implementation for STM32. -- NEW: Added experimental "serial over USB" driver, it implements a - Communication Device Class exposing it as a normal serial driver to - applications, probably it will evolve in next releases. +- NEW: USB driver implementation for STM32. +- NEW: Added "serial over USB" driver, it implements a Communication + Device Class exposing it as a normal serial driver to applications, + probably it will evolve in next releases. - NEW: Added USB CDC loopback test application. +- NEW: Added new GPT driver model, General Purpose Timer. The driver + allows to access the available timers in an abstract way. +- NEW: GTP driver implementation for STM32. - NEW: Implemented new event IO_TRANSMISSION_END in the generic serial driver. This event marks the physical transmission end of a data stream. - NEW: Implemented the new IO_TRANSMISSION_END event in the STM32 serial driver. +- NEW: Added explicit reset of all peripherals inside the STM32 HAL driver. +- OPT: Removed TIMx reset on system startup in the STM32 PWM driver, the + timers are already reset on driver startup. +- CHANGE: The functions chEvtSignal() and chEvtSignalI() have been renamed + to chEvtSignalFlags() and chEvtSignalFlagsI() for consistency. - CHANGE: Swapped the numeric values of the TIME_IMMEDIATE and TIME_INFINITE constants. Fixed the relative documentation in various places (backported to 2.2.2). diff --git a/testhal/STM32/GPT/Makefile b/testhal/STM32/GPT/Makefile new file mode 100644 index 000000000..a5c76f1c8 --- /dev/null +++ b/testhal/STM32/GPT/Makefile @@ -0,0 +1,204 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +#include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARM/rules.mk diff --git a/testhal/STM32/GPT/ch.ld b/testhal/STM32/GPT/ch.ld new file mode 100644 index 000000000..44f494121 --- /dev/null +++ b/testhal/STM32/GPT/ch.ld @@ -0,0 +1,113 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/STM32/GPT/chconf.h b/testhal/STM32/GPT/chconf.h new file mode 100644 index 000000000..3353391ca --- /dev/null +++ b/testhal/STM32/GPT/chconf.h @@ -0,0 +1,507 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h new file mode 100644 index 000000000..ce33dc633 --- /dev/null +++ b/testhal/STM32/GPT/halconf.h @@ -0,0 +1,280 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/GPT/main.c b/testhal/STM32/GPT/main.c new file mode 100644 index 000000000..771434029 --- /dev/null +++ b/testhal/STM32/GPT/main.c @@ -0,0 +1,71 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" + +/* + * Red LEDs blinker thread, times are in milliseconds. + */ +static WORKING_AREA(waThread1, 128); +static msg_t Thread1(void *arg) { + + (void)arg; + while (TRUE) { + palClearPad(IOPORT3, GPIOC_LED); + chThdSleepMilliseconds(500); + palSetPad(IOPORT3, GPIOC_LED); + chThdSleepMilliseconds(500); + } + return 0; +} + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Creates the blinker thread. + */ + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + + /* + * Initializes the GPT driver 1. + */ +// gptStart(&GPTD1, &pwmcfg); + + /* + * Normal main() thread activity, in this demo it does nothing. + */ + while (TRUE) { + chThdSleepMilliseconds(500); + } + return 0; +} diff --git a/testhal/STM32/GPT/mcuconf.h b/testhal/STM32/GPT/mcuconf.h new file mode 100644 index 000000000..6e869607a --- /dev/null +++ b/testhal/STM32/GPT/mcuconf.h @@ -0,0 +1,142 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 TRUE +#define STM32_GPT_USE_TIM2 TRUE +#define STM32_GPT_USE_TIM3 TRUE +#define STM32_GPT_USE_TIM4 TRUE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/GPT/openocd.bat b/testhal/STM32/GPT/openocd.bat new file mode 100644 index 000000000..a8b306318 --- /dev/null +++ b/testhal/STM32/GPT/openocd.bat @@ -0,0 +1,3 @@ +@echo off +start /MIN openocd.exe +start telnet 127.0.0.1 4444 diff --git a/testhal/STM32/GPT/openocd.cfg b/testhal/STM32/GPT/openocd.cfg new file mode 100644 index 000000000..f40febe66 --- /dev/null +++ b/testhal/STM32/GPT/openocd.cfg @@ -0,0 +1,13 @@ +#daemon configuration +telnet_port 4444 +gdb_port 3333 + +# GDB can also flash my flash! +gdb_memory_map enable +gdb_flash_program enable +gdb_breakpoint_override hard + +set WORKAREASIZE 0x5000 + +source [find interface/olimex-arm-usb-ocd.cfg] +source [find target/stm32.cfg] diff --git a/testhal/STM32/GPT/readme.txt b/testhal/STM32/GPT/readme.txt new file mode 100644 index 000000000..4c3fdf2fa --- /dev/null +++ b/testhal/STM32/GPT/readme.txt @@ -0,0 +1,26 @@ +***************************************************************************** +** ChibiOS/RT HAL - PWM driver demo for STM32. ** +***************************************************************************** + +** TARGET ** + +The demo will on an Olimex STM32-P103 board. + +** The Demo ** + +The application demonstrates the use of the STM32 PWM driver. + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com diff --git a/testhal/STM32/GPT/run b/testhal/STM32/GPT/run new file mode 100644 index 000000000..818d0e307 --- /dev/null +++ b/testhal/STM32/GPT/run @@ -0,0 +1,8 @@ +soft_reset_halt +wait_halt +poll +flash probe 0 +stm32x mass_erase 0 +flash write_bank 0 ch.bin 0 +soft_reset_halt +resume diff --git a/todo.txt b/todo.txt index 90d631345..eac79d4ee 100644 --- a/todo.txt +++ b/todo.txt @@ -18,6 +18,7 @@ Within 2.3.x (hopefully) * Swap TIME_IMMEDIATE and TIME_INFINITE values. * Improvements to the message passing mechanism in order to allow "delayed, out of order, responses". +* New device driver models: GPT. ? Make thread functions return void and add a CH_THREAD macro for threads declaration in order to hide compiler-specific optimizations for thread functions. @@ -37,7 +38,7 @@ X Transactional flash file system implementation. X I2C device driver class support and at least one implementation. X Shared DMA channels support in the STM32/STM8L HALs. X RAM ISR vectors support in the STM32 HAL. -X New device driver models: Clock, Systick, PT, RTC, WDG, DAC, Power Monitor. +- New device driver models: Clock, Systick, RTC, WDG, DAC, Power Monitor. Later but within 2.x.x - Batch testing of the ARM7/ARMCMx port using OpenOCD, with reports. -- cgit v1.2.3 From ab3e72edaa76d549f42947f1cfd1479545d9341c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Feb 2011 18:58:07 +0000 Subject: GPT tested. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2780 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/hal_lld.c | 2 +- testhal/STM32/GPT/main.c | 35 +++++++++++++++++------------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index cbbdf1587..7878bb518 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -57,7 +57,7 @@ */ void hal_lld_init(void) { - /* Reset of all the peripherals.*/ + /* Reset of all peripherals.*/ RCC->APB1RSTR = 0xFFFFFFFF; RCC->APB2RSTR = 0xFFFFFFFF; RCC->APB1RSTR = 0; diff --git a/testhal/STM32/GPT/main.c b/testhal/STM32/GPT/main.c index 771434029..6790e5eb0 100644 --- a/testhal/STM32/GPT/main.c +++ b/testhal/STM32/GPT/main.c @@ -21,21 +21,22 @@ #include "hal.h" /* - * Red LEDs blinker thread, times are in milliseconds. + * GPT1 callback. */ -static WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { +static void gpt1cb(GPTDriver *gptp) { - (void)arg; - while (TRUE) { - palClearPad(IOPORT3, GPIOC_LED); - chThdSleepMilliseconds(500); - palSetPad(IOPORT3, GPIOC_LED); - chThdSleepMilliseconds(500); - } - return 0; + (void)gptp; + palTogglePad(IOPORT3, GPIOC_LED); } +/* + * GPT1 configuration. + */ +static const GPTConfig gpt1cfg = { + 10000, /* 10KHz timer clock.*/ + gpt1cb /* Timer callback.*/ +}; + /* * Application entry point. */ @@ -51,21 +52,19 @@ int main(void) { halInit(); chSysInit(); - /* - * Creates the blinker thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - /* * Initializes the GPT driver 1. */ -// gptStart(&GPTD1, &pwmcfg); + gptStart(&GPTD1, &gpt1cfg); /* * Normal main() thread activity, in this demo it does nothing. */ while (TRUE) { - chThdSleepMilliseconds(500); + gptStartContinuous(&GPTD1, 5000); + chThdSleepMilliseconds(5000); + gptStartContinuous(&GPTD1, 2500); + chThdSleepMilliseconds(5000); } return 0; } -- cgit v1.2.3 From 006c13952ffee23f7384b60efa95186333fbf69f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Feb 2011 19:16:52 +0000 Subject: Better GPT test. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2781 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/GPT/main.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/testhal/STM32/GPT/main.c b/testhal/STM32/GPT/main.c index 6790e5eb0..8a07efec4 100644 --- a/testhal/STM32/GPT/main.c +++ b/testhal/STM32/GPT/main.c @@ -26,7 +26,19 @@ static void gpt1cb(GPTDriver *gptp) { (void)gptp; - palTogglePad(IOPORT3, GPIOC_LED); + palClearPad(IOPORT3, GPIOC_LED); + chSysLockFromIsr(); + gptStartOneShotI(&GPTD2, 200); /* 0.02 second pulse.*/ + chSysUnlockFromIsr(); +} + +/* + * GPT2 callback. + */ +static void gpt2cb(GPTDriver *gptp) { + + (void)gptp; + palSetPad(IOPORT3, GPIOC_LED); } /* @@ -37,6 +49,14 @@ static const GPTConfig gpt1cfg = { gpt1cb /* Timer callback.*/ }; +/* + * GPT2 configuration. + */ +static const GPTConfig gpt2cfg = { + 10000, /* 10KHz timer clock.*/ + gpt2cb /* Timer callback.*/ +}; + /* * Application entry point. */ @@ -53,12 +73,14 @@ int main(void) { chSysInit(); /* - * Initializes the GPT driver 1. + * Initializes the GPT drivers 1 and 2. */ gptStart(&GPTD1, &gpt1cfg); + gptStart(&GPTD2, &gpt2cfg); /* - * Normal main() thread activity, in this demo it does nothing. + * Normal main() thread activity, it changes the GPT1 period every + * five seconds. */ while (TRUE) { gptStartContinuous(&GPTD1, 5000); -- cgit v1.2.3 From 761f9f7287db259fe4a280d9ad13e2ed6eaf95a3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Feb 2011 19:28:47 +0000 Subject: Updated the various halconf.h and mcuconf.h with the GPT settings. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2782 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7S-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 7 +++++++ demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-LPC214x-G++/halconf.h | 7 +++++++ demos/ARM7-LPC214x-GCC/halconf.h | 7 +++++++ demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 7 +++++++ demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 7 +++++++ demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 7 +++++++ demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F103/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103/mcuconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F107-GCC/halconf.h | 7 +++++++ demos/ARMCM3-STM32F107-GCC/mcuconf.h | 14 ++++++++++++++ demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ demos/AVR-ATmega128-GCC/halconf.h | 7 +++++++ demos/MSP430-MSP430x1611-GCC/halconf.h | 7 +++++++ demos/PPC-SPC563-GCC/halconf.h | 7 +++++++ demos/Posix-GCC/halconf.h | 7 +++++++ demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 7 +++++++ demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 7 +++++++ demos/STM8S-STM8S208-RC/halconf.h | 7 +++++++ demos/Win32-MinGW/halconf.h | 7 +++++++ os/hal/templates/halconf.h | 7 +++++++ test/coverage/halconf.h | 7 +++++++ testhal/STM32/ADC/halconf.h | 7 +++++++ testhal/STM32/ADC/mcuconf.h | 14 ++++++++++++++ testhal/STM32/CAN/halconf.h | 7 +++++++ testhal/STM32/CAN/mcuconf.h | 14 ++++++++++++++ testhal/STM32/PWM/halconf.h | 7 +++++++ testhal/STM32/PWM/mcuconf.h | 14 ++++++++++++++ testhal/STM32/SPI/halconf.h | 7 +++++++ testhal/STM32/SPI/mcuconf.h | 14 ++++++++++++++ testhal/STM32/UART/halconf.h | 7 +++++++ testhal/STM32/UART/mcuconf.h | 14 ++++++++++++++ testhal/STM32/USB_CDC/halconf.h | 7 +++++++ testhal/STM32/USB_CDC/mcuconf.h | 14 ++++++++++++++ testhal/STM8S/SPI/demo/halconf.h | 7 +++++++ 43 files changed, 371 insertions(+) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index aa09088d5..4aade5bca 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index aa09088d5..4aade5bca 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index ec52bae52..36236ff2c 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index ec52bae52..36236ff2c 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index aa09088d5..4aade5bca 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 504c98a5e..39b6f228d 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 504c98a5e..39b6f228d 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index fdcf2ece8..329ade9c5 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index 56cec956d..73d2ee829 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -58,6 +58,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index aa09088d5..4aade5bca 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/ARMCM3-STM32F107-GCC/halconf.h b/demos/ARMCM3-STM32F107-GCC/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/ARMCM3-STM32F107-GCC/halconf.h +++ b/demos/ARMCM3-STM32F107-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/ARMCM3-STM32F107-GCC/mcuconf.h b/demos/ARMCM3-STM32F107-GCC/mcuconf.h index 853707cc6..f3e7ad40b 100644 --- a/demos/ARMCM3-STM32F107-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F107-GCC/mcuconf.h @@ -62,6 +62,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 999773a20..54ecc3c50 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 999773a20..54ecc3c50 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 08222db87..d567abd9e 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index d6696b6c2..4d73d65cb 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index 14275dc93..b74a05529 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index d6696b6c2..4d73d65cb 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index 186404680..b65e25923 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN TRUE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index ccfc29df3..a1e2190e8 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index d31219e29..b3180dfe8 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 49c891694..2536b39d6 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN TRUE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/PWM/halconf.h b/testhal/STM32/PWM/halconf.h index 76eb2bc3c..35da89b41 100644 --- a/testhal/STM32/PWM/halconf.h +++ b/testhal/STM32/PWM/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/PWM/mcuconf.h b/testhal/STM32/PWM/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/testhal/STM32/PWM/mcuconf.h +++ b/testhal/STM32/PWM/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index c69bb0024..33b2f5242 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index 253cc083b..c6eacdada 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index c499cf078..6b73cf62c 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 446a58e73..1131041f3 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index c34557a85..ea7941a4f 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -59,6 +59,20 @@ #define STM32_CAN_USE_CAN1 TRUE #define STM32_CAN_CAN1_IRQ_PRIORITY 11 +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index c69bb0024..33b2f5242 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ -- cgit v1.2.3 From a5138f8fac4b576c67e70e00453982492055ef15 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Feb 2011 20:30:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2783 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 3 ++- testhal/STM32/GPT/main.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 3d22895ca..6a707264a 100644 --- a/readme.txt +++ b/readme.txt @@ -97,10 +97,11 @@ - NEW: Added "serial over USB" driver, it implements a Communication Device Class exposing it as a normal serial driver to applications, probably it will evolve in next releases. -- NEW: Added USB CDC loopback test application. +- NEW: Added STM32 USB CDC loopback test application. - NEW: Added new GPT driver model, General Purpose Timer. The driver allows to access the available timers in an abstract way. - NEW: GTP driver implementation for STM32. +- NEW: Added STM32 GPT test application. - NEW: Implemented new event IO_TRANSMISSION_END in the generic serial driver. This event marks the physical transmission end of a data stream. - NEW: Implemented the new IO_TRANSMISSION_END event in the STM32 serial diff --git a/testhal/STM32/GPT/main.c b/testhal/STM32/GPT/main.c index 8a07efec4..636940584 100644 --- a/testhal/STM32/GPT/main.c +++ b/testhal/STM32/GPT/main.c @@ -76,7 +76,9 @@ int main(void) { * Initializes the GPT drivers 1 and 2. */ gptStart(&GPTD1, &gpt1cfg); + gptPolledDelay(&GPTD1, 10); /* Small dealy.*/ gptStart(&GPTD2, &gpt2cfg); + gptPolledDelay(&GPTD2, 10); /* Small dealy.*/ /* * Normal main() thread activity, it changes the GPT1 period every -- cgit v1.2.3 From eed6999aaf3a4579121b5e70d3a84ef620f896eb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 1 Mar 2011 13:49:53 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2784 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/rsc/layout.xml | 8 ++-- os/hal/dox/adc.dox | 3 +- os/hal/dox/can.dox | 3 +- os/hal/dox/gpt.dox | 76 +++++++++++++++++++++++++++++++++++++ os/hal/dox/mac.dox | 4 +- os/hal/dox/mmc_spi.dox | 2 +- os/hal/dox/pal.dox | 26 +++++++------ os/hal/dox/pwm.dox | 7 ++-- os/hal/dox/serial.dox | 14 +++---- os/hal/dox/serial_usb.dox | 2 +- os/hal/dox/spi.dox | 6 ++- os/hal/dox/uart.dox | 39 +++++++++---------- os/hal/dox/usb.dox | 5 ++- os/hal/include/usb.h | 1 + os/hal/platforms/STM32/platform.dox | 20 ++++++++++ os/hal/src/serial_usb.c | 20 +++++++--- 16 files changed, 175 insertions(+), 61 deletions(-) create mode 100644 os/hal/dox/gpt.dox diff --git a/docs/rsc/layout.xml b/docs/rsc/layout.xml index eba6d68b3..4dc8961aa 100644 --- a/docs/rsc/layout.xml +++ b/docs/rsc/layout.xml @@ -137,12 +137,12 @@ + + - - @@ -154,12 +154,12 @@ + + - - diff --git a/os/hal/dox/adc.dox b/os/hal/dox/adc.dox index 9ebfca99c..4f1cf963d 100644 --- a/os/hal/dox/adc.dox +++ b/os/hal/dox/adc.dox @@ -20,7 +20,8 @@ /** * @defgroup ADC ADC Driver * @brief Generic ADC Driver. - * @details This module implements a generic ADC driver. + * @details This module implements a generic ADC driver supporting a + * variety of buffer and conversion modes. * @pre In order to use the ADC driver the @p HAL_USE_ADC option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/can.dox b/os/hal/dox/can.dox index 81ee24e8b..550cbc79c 100644 --- a/os/hal/dox/can.dox +++ b/os/hal/dox/can.dox @@ -20,7 +20,8 @@ /** * @defgroup CAN CAN Driver * @brief Generic CAN Driver. - * @details This module implements a generic CAN driver. + * @details This module implements a generic CAN driver allowing the exchange + * of information at frame level. * @pre In order to use the CAN driver the @p HAL_USE_CAN option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/gpt.dox b/os/hal/dox/gpt.dox new file mode 100644 index 000000000..1cca2a689 --- /dev/null +++ b/os/hal/dox/gpt.dox @@ -0,0 +1,76 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @defgroup GPT GPT Driver + * @brief Generic GPT Driver. + * @details This module implements a generic timer driver. The timer can be + * programmed in order to trigger callbacks after a specified time + * period or continuously with a specified interval. + * @pre In order to use the GPT driver the @p HAL_USE_GPT option + * must be enabled in @p halconf.h. + * + * @section gpt_1 Driver State Machine + * The driver implements a state machine internally, not all the driver + * functionalities can be used in any moment, any transition not explicitly + * shown in the following diagram has to be considered an error and shall + * be captured by an assertion (if enabled). + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + stop [label="GPT_STOP\nLow Power"]; + uninit [label="GPT_UNINIT", style="bold"]; + ready [label="GPT_READY\nClock Enabled"]; + continuous [label="GPT_CONT..S\nContinuous\nMode"]; + oneshot [label="GPT_ONESHOT\nOne Shot\nMode"]; + + uninit -> stop [label=" gptInit()", constraint=false]; + stop -> stop [label="\ngptStop()"]; + stop -> ready [label="\ngptStart()"]; + ready -> stop [label="\ngptStop()"]; + ready -> ready [label="\ngptStart()"]; + ready -> continuous [label="\ngptStartContinuous()"]; + continuous -> ready [label="\ngptStopTimer()"]; + continuous -> continuous [label=">callback<"]; + ready -> oneshot [label="\ngptStartOneShot()\ngptPolledDelay()"]; + oneshot -> ready [label="\n>callback<\nor\nDelay Over"]; + } + * @enddot + * + * @section gpt_2 GPT Operations. + * This driver abstracts a generic timer composed of: + * - A clock prescaler. + * - A main up counter. + * - A comparator register that resets the main counter to zero when the limit + * is reached. A callback is invoked when this happens. + * . + * The timer can operate in three different modes: + * - Continuous Mode, a periodic callback is invoked until the driver + * is explicitly stopped. + * - One Shot Mode, a callback is invoked after the programmed period + * and then the timer automatically stops. + * - Delay Mode, the timer is used for inserting a brief delay into + * the execution flow, no callback is invoked in this mode. + * . + * @ingroup IO + */ diff --git a/os/hal/dox/mac.dox b/os/hal/dox/mac.dox index 778795f15..903397749 100644 --- a/os/hal/dox/mac.dox +++ b/os/hal/dox/mac.dox @@ -20,8 +20,8 @@ /** * @defgroup MAC MAC Driver * @brief Generic MAC driver. - * @details This module implements a generic interface for MAC (Media - * Access Control) drivers, as example Ethernet controllers. + * @details This module implements a generic MAC (Media Access Control) + * driver for Ethernet controllers. * @pre In order to use the MAC driver the @p HAL_USE_MAC option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/mmc_spi.dox b/os/hal/dox/mmc_spi.dox index e18ff1a8a..9ccdeb2bc 100644 --- a/os/hal/dox/mmc_spi.dox +++ b/os/hal/dox/mmc_spi.dox @@ -20,7 +20,7 @@ /** * @defgroup MMC_SPI MMC over SPI Driver * @brief Generic MMC driver. - * @details This module implements a portable MMC driver that uses a SPI + * @details This module implements a portable MMC/SD driver that uses a SPI * driver as physical layer. * @pre In order to use the MMC_SPI driver the @p HAL_USE_MMC_SPI option * must be enabled in @p halconf.h. diff --git a/os/hal/dox/pal.dox b/os/hal/dox/pal.dox index 4c7fe685a..63e428377 100644 --- a/os/hal/dox/pal.dox +++ b/os/hal/dox/pal.dox @@ -19,19 +19,21 @@ /** * @defgroup PAL PAL Driver - * @brief I/O Ports Abstraction Layer + * @brief I/O Ports Abstraction Layer * @details This module defines an abstract interface for digital I/O ports. - * Note that most I/O ports functions are just macros. The macros - * have default software implementations that can be redefined in a - * PAL Low Level Driver if the target hardware supports special features like, - * as example, atomic bit set/reset/masking. Please refer to the ports specific - * documentation for details.
- * The @ref PAL has the advantage to make the access to the I/O ports platform - * independent and still be optimized for the specific architectures.
- * Note that the PAL Low Level Driver may also offer non standard macro and - * functions in order to support specific features but, of course, the use of - * such interfaces would not be portable. Such interfaces shall be marked with - * the architecture name inside the function names. + * Note that most I/O ports functions are just macros. The macros + * have default software implementations that can be redefined in a + * PAL Low Level Driver if the target hardware supports special + * features like, for example, atomic bit set/reset/masking. Please + * refer to the ports specific documentation for details.
+ * The @ref PAL has the advantage to make the access to the I/O + * ports platform independent and still be optimized for the specific + * architectures.
+ * Note that the PAL Low Level Driver may also offer non standard + * macro and functions in order to support specific features but, + * of course, the use of such interfaces would not be portable. + * Such interfaces shall be marked with the architecture name inside + * the function names. * @pre In order to use the PAL driver the @p HAL_USE_PAL option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/pwm.dox b/os/hal/dox/pwm.dox index 6fbe2efa1..1cb13056e 100644 --- a/os/hal/dox/pwm.dox +++ b/os/hal/dox/pwm.dox @@ -19,7 +19,7 @@ /** * @defgroup PWM PWM Driver - * @brief Generic PWM Driver. + * @brief Generic PWM Driver. * @details This module implements a generic PWM driver. * @pre In order to use the PWM driver the @p HAL_USE_PWM option * must be enabled in @p halconf.h. @@ -45,8 +45,9 @@ } * @enddot * - * @section pwm_1 PWM Operations. - * This driver abstracts a generic PWM times composed of: + * @section pwm_2 PWM Operations. + * This driver abstracts a generic PWM timer composed of: + * - A clock prescaler. * - A main up counter. * - A comparator register that resets the main counter to zero when the limit * is reached. An optional callback can be generated when this happens. diff --git a/os/hal/dox/serial.dox b/os/hal/dox/serial.dox index 071b2dac5..d4f2cf634 100644 --- a/os/hal/dox/serial.dox +++ b/os/hal/dox/serial.dox @@ -19,14 +19,14 @@ /** * @defgroup SERIAL Serial Driver - * @brief Generic Serial Driver. + * @brief Generic Serial Driver. * @details This module implements a generic full duplex serial driver. The - * driver implements a @p SerialDriver interface and uses I/O Queues for - * communication between the upper and the lower driver. Event flags are used - * to notify the application about incoming data, outgoing data and other I/O - * events.
- * The module also contains functions that make the implementation of the - * interrupt service routines much easier. + * driver implements a @p SerialDriver interface and uses I/O Queues + * for communication between the upper and the lower driver. Event + * flags are used to notify the application about incoming data, + * outgoing data and other I/O events.
+ * The module also contains functions that make the implementation + * of the interrupt service routines much easier. * @pre In order to use the SERIAL driver the @p HAL_USE_SERIAL option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/serial_usb.dox b/os/hal/dox/serial_usb.dox index 599ee3c16..0f857052b 100644 --- a/os/hal/dox/serial_usb.dox +++ b/os/hal/dox/serial_usb.dox @@ -19,7 +19,7 @@ /** * @defgroup SERIAL_USB Serial over USB Driver - * @brief Serial over USB Driver. + * @brief Serial over USB Driver. * @details This module implements an USB Communication Device Class * (CDC) as a normal serial communication port accessible from * the device application. diff --git a/os/hal/dox/spi.dox b/os/hal/dox/spi.dox index 7f68f3c40..7c43fec6e 100644 --- a/os/hal/dox/spi.dox +++ b/os/hal/dox/spi.dox @@ -19,8 +19,10 @@ /** * @defgroup SPI SPI Driver - * @brief Generic SPI Driver. - * @details This module implements a generic SPI driver. + * @brief Generic SPI Driver. + * @details This module implements a generic SPI driver allowing bidirectional + * and monodirectional transfers, complex atomic transactions are + * supported as well. * @pre In order to use the SPI driver the @p HAL_USE_SPI option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/uart.dox b/os/hal/dox/uart.dox index 192ce4d91..53339046d 100644 --- a/os/hal/dox/uart.dox +++ b/os/hal/dox/uart.dox @@ -19,26 +19,27 @@ /** * @defgroup UART UART Driver - * @brief Generic UART Driver. + * @brief Generic UART Driver. * @details This driver abstracts a generic UART peripheral, the API is - * designed to be: - * - Unbuffered and copy-less, transfers are always directly performed - * from/to the application-level buffers without extra copy operations. - * - Asynchronous, the API is always non blocking. - * - Callbacks capable, operations completion and other events are notified - * via callbacks. - * . - * Special hardware features like deep hardware buffers, DMA transfers - * are hidden to the user but fully supportable by the low level - * implementations.
- * This driver model is best used where communication events are meant to - * drive an higher level state machine, as example: - * - RS485 drivers. - * - Multipoint network drivers. - * - Serial protocol decoders. - * . - * If your application requires a synchronoyus buffered driver then the - * @ref SERIAL should be used instead. + * designed to be: + * - Unbuffered and copy-less, transfers are always directly performed + * from/to the application-level buffers without extra copy + * operations. + * - Asynchronous, the API is always non blocking. + * - Callbacks capable, operations completion and other events are + * notified using callbacks. + * . + * Special hardware features like deep hardware buffers, DMA transfers + * are hidden to the user but fully supportable by the low level + * implementations.
+ * This driver model is best used where communication events are + * meant to drive an higher level state machine, as example: + * - RS485 drivers. + * - Multipoint network drivers. + * - Serial protocol decoders. + * . + * If your application requires a synchronoyus buffered driver then + * the @ref SERIAL should be used instead. * @pre In order to use the UART driver the @p HAL_USE_UART option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index 1f843efae..e9c6687ce 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -19,8 +19,9 @@ /** * @defgroup USB USB Driver - * @brief Generic USB Driver. - * @details This module implements a generic USB driver. + * @brief Generic USB Driver. + * @details This module implements a generic USB driver supporting device-mode + * operations. * @pre In order to use the USB driver the @p HAL_USE_USB option * must be enabled in @p halconf.h. * diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index d569a6031..24b492e2f 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -385,6 +385,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @param[in] usbp pointer to the @p USBDriver object * @param[in] buf pointer to a buffer for the transaction data * @param[in] n number of bytes to be transferred + * @param[in] endcb callback to be invoked after the transfer or @p NULL * * @api */ diff --git a/os/hal/platforms/STM32/platform.dox b/os/hal/platforms/STM32/platform.dox index 91f0addca..8edf27161 100644 --- a/os/hal/platforms/STM32/platform.dox +++ b/os/hal/platforms/STM32/platform.dox @@ -99,6 +99,25 @@ * @ingroup STM32_DRIVERS */ +/** + * @defgroup STM32_GPT STM32 GPT Support + * @details The STM32 GPT driver uses the TIMx peripherals. + * + * @section stm32_gpt_1 Supported HW resources + * - TIM1. + * - TIM2. + * - TIM3. + * - TIM4. + * - TIM5. + * . + * @section stm32_gpt_2 STM32 GPT driver implementation features + * - Each timer can be independently enabled and programmed. Unused + * peripherals are left in low power mode. + * - Programmable TIMx interrupts priority level. + * . + * @ingroup STM32_DRIVERS + */ + /** * @defgroup STM32_PAL STM32 GPIO Support * @details The STM32 PAL driver uses the GPIO peripherals. @@ -158,6 +177,7 @@ * - TIM2. * - TIM3. * - TIM4. + * - TIM5. * . * @section stm32_pwm_2 STM32 PWM driver implementation features * - Each timer can be independently enabled and programmed. Unused diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 83f1c93ff..0393ad141 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -167,12 +167,6 @@ void sduInit(void) { * outside, usually in the hardware initialization code. * * @param[out] sdup pointer to a @p SerialUSBDriver structure - * @param[in] inotify pointer to a callback function that is invoked when - * some data is read from the Queue. The value can be - * @p NULL. - * @param[in] onotify pointer to a callback function that is invoked when - * some data is written in the Queue. The value can be - * @p NULL. * * @init */ @@ -244,6 +238,11 @@ void sduStop(SerialUSBDriver *sdup) { * - CDC_SET_LINE_CODING. * - CDC_SET_CONTROL_LINE_STATE. * . + * + * @param[in] usbp pointer to the @p USBDriver object + * @return The hook status. + * @retval TRUE Message handled internally. + * @retval FALSE Message not handled. */ bool_t sduRequestsHook(USBDriver *usbp) { @@ -270,6 +269,9 @@ bool_t sduRequestsHook(USBDriver *usbp) { * @brief Default data transmitted callback. * @details The application must use this function as callback for the IN * data endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number */ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { SerialUSBDriver *sdup = usbp->param; @@ -294,6 +296,9 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { * @brief Default data received callback. * @details The application must use this function as callback for the OUT * data endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number */ void sduDataReceived(USBDriver *usbp, usbep_t ep) { SerialUSBDriver *sdup = usbp->param; @@ -319,6 +324,9 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) { * @brief Default data received callback. * @details The application must use this function as callback for the IN * interrupt endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number */ void sduInterruptTransmitted(USBDriver *usbp, usbep_t ep) { -- cgit v1.2.3 From 3c9d9c9bb57b8bc370bd1d6851b2b9c03fed8b52 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 1 Mar 2011 15:25:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2785 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/serial.dox | 26 +++++++++++++++++++++ os/hal/dox/serial_usb.dox | 22 +++++++++++++++--- os/hal/dox/usb.dox | 57 +++++++++++++++++++++++++++++++++++++++++++++++ readme.txt | 1 + 4 files changed, 103 insertions(+), 3 deletions(-) diff --git a/os/hal/dox/serial.dox b/os/hal/dox/serial.dox index d4f2cf634..c2fae58f5 100644 --- a/os/hal/dox/serial.dox +++ b/os/hal/dox/serial.dox @@ -30,5 +30,31 @@ * @pre In order to use the SERIAL driver the @p HAL_USE_SERIAL option * must be enabled in @p halconf.h. * + * + * @section serial_1 Driver State Machine + * The driver implements a state machine internally, not all the driver + * functionalities can be used in any moment, any transition not explicitly + * shown in the following diagram has to be considered an error and shall + * be captured by an assertion (if enabled). + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + uninit [label="SD_UNINIT", style="bold"]; + stop [label="SD_STOP\nLow Power"]; + ready [label="SD_READY\nClock Enabled"]; + + uninit -> stop [label=" sdInit()"]; + stop -> stop [label="\nsdStop()"]; + stop -> ready [label="\nsdStart()"]; + ready -> stop [label="\nsdStop()"]; + ready -> ready [label="\nsdStart()"]; + ready -> ready [label="\nAny I/O operation"]; + } + * @enddot + * * @ingroup IO */ diff --git a/os/hal/dox/serial_usb.dox b/os/hal/dox/serial_usb.dox index 0f857052b..4384a59f8 100644 --- a/os/hal/dox/serial_usb.dox +++ b/os/hal/dox/serial_usb.dox @@ -31,9 +31,25 @@ * functionalities can be used in any moment, any transition not explicitly * shown in the following diagram has to be considered an error and shall * be captured by an assertion (if enabled). - * @if LATEX_PDF - * @else - * @endif + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + uninit [label="SDU_UNINIT", style="bold"]; + stop [label="SDU_STOP\nLow Power"]; + ready [label="SDU_READY\nClock Enabled"]; + + uninit -> stop [label=" sduInit()"]; + stop -> stop [label="\nsduStop()"]; + stop -> ready [label="\nsduStart()"]; + ready -> stop [label="\nsduStop()"]; + ready -> ready [label="\nsduStart()"]; + ready -> ready [label="\nAny I/O operation"]; + } + * @enddot * * @ingroup IO */ diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index e9c6687ce..e0916f26a 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -31,7 +31,64 @@ * shown in the following diagram has to be considered an error and shall * be captured by an assertion (if enabled). * @if LATEX_PDF + * @dot + digraph example { + size="5, 7"; + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + stop [label="USB_STOP\nLow Power"]; + uninit [label="USB_UNINIT", style="bold"]; + ready [label="USB_READY\nClock Enabled"]; + selected [label="\nUSB_SELECTED\naddress\nassigned"]; + configured [label="\nUSB_ACTIVE\nconfiguration\nselected"]; + + uninit -> stop [label=" usbInit()", constraint=false]; + stop -> stop [label="\nusbStop()"]; + stop -> ready [label="\nusbStart()"]; + ready -> stop [label="\nusbStop()"]; + ready -> ready [label="\n\nusbStart()"]; + ready -> ready [label="\nSUSPEND/WAKEUP\n>event_cb<"]; + ready -> selected [label="\nSET_ADDRESS\n>event_cb<"]; + selected -> ready [label="\nUSB RESET\n>event_cb<"]; + selected -> selected [label="\nSUSPEND/WAKEUP\n>event_cb<\n\nValid EP0 Message\n>requests_hook_cb<\n\nGET DESCRIPTOR\n>get_descriptor_cb<"]; + selected -> configured [label="\nSET_CONF(n)\n>event_cb<"]; + configured -> selected [label="\nSET_CONF(0)\n>event_cb<"]; + configured -> configured [label="\nSUSPEND/WAKEUP\n>event_cb<\n\nValid EP0 Message\n>requests_hook_cb<\n\nGET DESCRIPTOR\n>get_descriptor_cb<\n\nEndpoints Activity\n >in_cb< or >out_cb<"]; + configured -> ready [label="\nUSB RESET\n>event_cb<"]; + } + * @enddot * @else + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + stop [label="USB_STOP\nLow Power"]; + uninit [label="USB_UNINIT", style="bold"]; + ready [label="USB_READY\nClock Enabled"]; + selected [label="\nUSB_SELECTED\naddress\nassigned"]; + configured [label="\nUSB_ACTIVE\nconfiguration\nselected"]; + + uninit -> stop [label=" usbInit()", constraint=false]; + stop -> stop [label="\nusbStop()"]; + stop -> ready [label="\nusbStart()"]; + ready -> stop [label="\nusbStop()"]; + ready -> ready [label="\n\nusbStart()"]; + ready -> ready [label="\nSUSPEND/WAKEUP\n>event_cb<"]; + ready -> selected [label="\nSET_ADDRESS\n>event_cb<"]; + selected -> ready [label="\nUSB RESET\n>event_cb<"]; + selected -> selected [label="\nSUSPEND/WAKEUP\n>event_cb<\n\nValid EP0 Message\n>requests_hook_cb<\n\nGET DESCRIPTOR\n>get_descriptor_cb<"]; + selected -> configured [label="\nSET_CONF(n)\n>event_cb<"]; + configured -> selected [label="\nSET_CONF(0)\n>event_cb<"]; + configured -> configured [label="\nSUSPEND/WAKEUP\n>event_cb<\n\nValid EP0 Message\n>requests_hook_cb<\n\nGET DESCRIPTOR\n>get_descriptor_cb<\n\nEndpoints Activity\n >in_cb< or >out_cb<"]; + configured -> ready [label="\nUSB RESET\n>event_cb<"]; + } + * @enddot * @endif * * @section usb_2 USB Operations diff --git a/readme.txt b/readme.txt index 6a707264a..c49302475 100644 --- a/readme.txt +++ b/readme.txt @@ -114,6 +114,7 @@ - CHANGE: Swapped the numeric values of the TIME_IMMEDIATE and TIME_INFINITE constants. Fixed the relative documentation in various places (backported to 2.2.2). +- Many documentation improvements. *** 2.1.8 *** - FIX: Fixed error in STM32 ADC driver macro names (bug 3160306)(backported -- cgit v1.2.3 From 4844936fde9fc060cd41e15bb354db7a160b4eb4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 1 Mar 2011 19:31:11 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2786 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/usb.dox | 1 - 1 file changed, 1 deletion(-) diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index e0916f26a..119a436eb 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -121,7 +121,6 @@ * - Transaction Mode. In this mode the driver invokes a callback * only after a large, potentially multi-packet, transfer has been * completed, a callback is invoked only at the end of the transfer. - * . * . * @subsection usb_2_3 USB Callbacks * The USB driver uses callbacks in order to interact with the application. -- cgit v1.2.3 From 43bb4bfedb2c8b2ed31adc4d3e262d3c975cbe66 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 2 Mar 2011 15:55:13 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2787 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/usb.dox | 90 ++++++++++++++++++++++++++++++++++++++- os/hal/platforms/STM32/adc_lld.c | 4 -- os/hal/platforms/STM32/can_lld.c | 4 -- os/hal/platforms/STM32/pal_lld.c | 15 +------ os/hal/platforms/STM32/spi_lld.c | 6 --- os/hal/platforms/STM32/uart_lld.c | 6 --- os/hal/platforms/STM32/usb_lld.c | 4 -- readme.txt | 2 + todo.txt | 2 + 9 files changed, 94 insertions(+), 39 deletions(-) diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index 119a436eb..568272e13 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -110,7 +110,7 @@ * USB endpoints are the objects that the application uses to exchange * data with the host. There are two kind of endpoints: * - IN endpoints are used by the application to transmit data to - * the host. + * the host.
* - OUT endpoints are used by the application to receive data from * the host. * . @@ -118,10 +118,98 @@ * - Packet Mode. In this mode the driver invokes a callback each * time a packet has been received or transmitted. This mode is especially * suited for those applications handling continuous streams of data. + *

+ * States diagram for OUT endpoints in packet mode: + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + disabled [label="EP_DISABLED\nDisabled", style="bold"]; + receiving [label="EP_BUSY\nReceiving Packet"]; + idle [label="EP_IDLE\nPacket in Buffer"]; + + disabled -> receiving [label="\usbInitEndpointI()"]; + receiving -> idle [label="\npacket received\n>out_cb<"]; + idle -> receiving [label="\nusbReadPacketI()"]; + receiving -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + } + * @enddot + *

+ * States diagram for IN endpoints in packet mode: + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + disabled [label="EP_DISABLED\nDisabled", style="bold"]; + transmitting [label="EP_BUSY\nSending Packet"]; + idle [label="EP_IDLE\nBuffer Empty"]; + + disabled -> idle [label="\usbInitEndpointI()"]; + idle -> transmitting [label="\nusbWritePacketI()"]; + transmitting -> idle [label="\npacket sent\n>in_cb<"]; + transmitting -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + } + * @enddot + *

* - Transaction Mode. In this mode the driver invokes a callback * only after a large, potentially multi-packet, transfer has been * completed, a callback is invoked only at the end of the transfer. + *

+ * States diagram for OUT endpoints in transaction mode: + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + disabled [label="EP_DISABLED\nDisabled", style="bold"]; + receiving [label="EP_BUSY\nReceiving"]; + idle [label="EP_IDLE\nReady"]; + + disabled -> idle [label="\usbInitEndpointI()"]; + idle -> receiving [label="\usbStartReceiveI()"]; + receiving -> receiving [label="\nmore packets"]; + receiving -> idle [label="\nreception end\n>out_cb<"]; + receiving -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + } + * @enddot + *

+ * States diagram for IN endpoints in transaction mode: + * @dot + digraph example { + rankdir="LR"; + node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", + width="0.9", height="0.9"]; + edge [fontname=Helvetica, fontsize=8]; + + disabled [label="EP_DISABLED\nDisabled", style="bold"]; + transmitting [label="EP_BUSY\nTransmitting"]; + idle [label="EP_IDLE\nReady"]; + + disabled -> idle [label="\usbInitEndpointI()"]; + idle -> transmitting [label="\nusbStartTransmitI()"]; + transmitting -> transmitting [label="\nmore packets"]; + transmitting -> idle [label="\ntransmission end\n>in_cb<"]; + transmitting -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"]; + } + * @enddot + *

* . + * An important difference in the two modes is that there is a dedicated + * endpoint buffer in packet mode while in transaction mode the application + * specifies its own buffer for the whole transfer. + * * @subsection usb_2_3 USB Callbacks * The USB driver uses callbacks in order to interact with the application. * There are several kind of callbacks to be handled: diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index 91fd8a6e8..d8822e0ab 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -93,10 +93,6 @@ CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) { void adc_lld_init(void) { #if STM32_ADC_USE_ADC1 - /* ADC reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB2RSTR = RCC_APB2RSTR_ADC1RST; - RCC->APB2RSTR = 0; - /* Driver initialization.*/ adcObjectInit(&ADCD1); ADCD1.ad_adc = ADC1; diff --git a/os/hal/platforms/STM32/can_lld.c b/os/hal/platforms/STM32/can_lld.c index 24a944c0f..5dc7dc572 100644 --- a/os/hal/platforms/STM32/can_lld.c +++ b/os/hal/platforms/STM32/can_lld.c @@ -165,10 +165,6 @@ CH_IRQ_HANDLER(CAN1_SCE_IRQHandler) { void can_lld_init(void) { #if STM32_CAN_USE_CAN1 - /* CAN reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB1RSTR = RCC_APB1RSTR_CAN1RST; - RCC->APB1RSTR = 0; - /* Driver initialization.*/ canObjectInit(&CAND1); CAND1.cd_can = CAN1; diff --git a/os/hal/platforms/STM32/pal_lld.c b/os/hal/platforms/STM32/pal_lld.c index ac90883f7..f5421fc75 100644 --- a/os/hal/platforms/STM32/pal_lld.c +++ b/os/hal/platforms/STM32/pal_lld.c @@ -31,25 +31,15 @@ #if HAL_USE_PAL || defined(__DOXYGEN__) #if STM32_HAS_GPIOG -#define APB2_RST_MASK (RCC_APB2RSTR_IOPARST | RCC_APB2RSTR_IOPBRST | \ - RCC_APB2RSTR_IOPCRST | RCC_APB2RSTR_IOPDRST | \ - RCC_APB2RSTR_IOPERST | RCC_APB2RSTR_IOPFRST | \ - RCC_APB2RSTR_IOPGRST | RCC_APB2RSTR_AFIORST); #define APB2_EN_MASK (RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | \ RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | \ RCC_APB2ENR_IOPEEN | RCC_APB2ENR_IOPFEN | \ RCC_APB2ENR_IOPGEN | RCC_APB2ENR_AFIOEN) #elif STM32_HAS_GPIOE -#define APB2_RST_MASK (RCC_APB2RSTR_IOPARST | RCC_APB2RSTR_IOPBRST | \ - RCC_APB2RSTR_IOPCRST | RCC_APB2RSTR_IOPDRST | \ - RCC_APB2RSTR_IOPERST | RCC_APB2RSTR_AFIORST); #define APB2_EN_MASK (RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | \ RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | \ RCC_APB2ENR_IOPEEN | RCC_APB2ENR_AFIOEN) #else -#define APB2_RST_MASK (RCC_APB2RSTR_IOPARST | RCC_APB2RSTR_IOPBRST | \ - RCC_APB2RSTR_IOPCRST | RCC_APB2RSTR_IOPDRST | \ - RCC_APB2RSTR_AFIORST) #define APB2_EN_MASK (RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | \ RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | \ RCC_APB2ENR_AFIOEN) @@ -91,11 +81,8 @@ void _pal_lld_init(const PALConfig *config) { RCC->APB2ENR |= APB2_EN_MASK; /* - * Resets the GPIO ports and AFIO. + * Initial GPIO setup. */ - RCC->APB2RSTR = APB2_RST_MASK; - RCC->APB2RSTR = 0; - GPIOA->ODR = config->PAData.odr; GPIOA->CRH = config->PAData.crh; GPIOA->CRL = config->PAData.crl; diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index dfe72822a..1987373ae 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -218,8 +218,6 @@ void spi_lld_init(void) { dummytx = 0xFFFF; #if STM32_SPI_USE_SPI1 - RCC->APB2RSTR = RCC_APB2RSTR_SPI1RST; - RCC->APB2RSTR = 0; spiObjectInit(&SPID1); SPID1.spd_thread = NULL; SPID1.spd_spi = SPI1; @@ -228,8 +226,6 @@ void spi_lld_init(void) { #endif #if STM32_SPI_USE_SPI2 - RCC->APB1RSTR = RCC_APB1RSTR_SPI2RST; - RCC->APB1RSTR = 0; spiObjectInit(&SPID2); SPID2.spd_thread = NULL; SPID2.spd_spi = SPI2; @@ -238,8 +234,6 @@ void spi_lld_init(void) { #endif #if STM32_SPI_USE_SPI3 - RCC->APB1RSTR = RCC_APB1RSTR_SPI3RST; - RCC->APB1RSTR = 0; spiObjectInit(&SPID3); SPID3.spd_thread = NULL; SPID3.spd_spi = SPI3; diff --git a/os/hal/platforms/STM32/uart_lld.c b/os/hal/platforms/STM32/uart_lld.c index 9769aa090..e05051a73 100644 --- a/os/hal/platforms/STM32/uart_lld.c +++ b/os/hal/platforms/STM32/uart_lld.c @@ -438,8 +438,6 @@ CH_IRQ_HANDLER(USART3_IRQHandler) { void uart_lld_init(void) { #if STM32_UART_USE_USART1 - RCC->APB2RSTR = RCC_APB2RSTR_USART1RST; - RCC->APB2RSTR = 0; uartObjectInit(&UARTD1); UARTD1.ud_usart = USART1; UARTD1.ud_dmap = STM32_DMA1; @@ -449,8 +447,6 @@ void uart_lld_init(void) { #endif #if STM32_UART_USE_USART2 - RCC->APB1RSTR = RCC_APB1RSTR_USART2RST; - RCC->APB1RSTR = 0; uartObjectInit(&UARTD2); UARTD2.ud_usart = USART2; UARTD2.ud_dmap = STM32_DMA1; @@ -460,8 +456,6 @@ void uart_lld_init(void) { #endif #if STM32_UART_USE_USART3 - RCC->APB1RSTR = RCC_APB1RSTR_USART3RST; - RCC->APB1RSTR = 0; uartObjectInit(&UARTD3); UARTD3.ud_usart = USART3; UARTD3.ud_dmap = STM32_DMA1; diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index ecd183171..b2198a806 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -322,10 +322,6 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { */ void usb_lld_init(void) { - /* USB reset, ensures reset state in order to avoid trouble with JTAGs.*/ - RCC->APB1RSTR = RCC_APB1RSTR_USBRST; - RCC->APB1RSTR = 0; - /* Driver initialization.*/ usbObjectInit(&USBD1); } diff --git a/readme.txt b/readme.txt index c49302475..bc34b0286 100644 --- a/readme.txt +++ b/readme.txt @@ -107,6 +107,8 @@ - NEW: Implemented the new IO_TRANSMISSION_END event in the STM32 serial driver. - NEW: Added explicit reset of all peripherals inside the STM32 HAL driver. + Removed the separate resets on initialization from the various other + drivers saving significant space. - OPT: Removed TIMx reset on system startup in the STM32 PWM driver, the timers are already reset on driver startup. - CHANGE: The functions chEvtSignal() and chEvtSignalI() have been renamed diff --git a/todo.txt b/todo.txt index eac79d4ee..b5183c7e1 100644 --- a/todo.txt +++ b/todo.txt @@ -19,6 +19,8 @@ Within 2.3.x (hopefully) * Improvements to the message passing mechanism in order to allow "delayed, out of order, responses". * New device driver models: GPT. +- Add UART4 support to the STM32 UART driver. +- Add ADC3 support to the STM32 ADC driver. ? Make thread functions return void and add a CH_THREAD macro for threads declaration in order to hide compiler-specific optimizations for thread functions. -- cgit v1.2.3 From f95fc666de8186937f7101c74386af0c85968ec3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 2 Mar 2011 18:56:02 +0000 Subject: Various documentation improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2788 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/usb.dox | 31 ++++++++++------ os/hal/platforms/AT91SAM7/platform.dox | 44 +++++++++++----------- os/hal/platforms/AVR/platform.dox | 2 +- os/hal/platforms/LPC11xx/platform.dox | 42 ++++++++++----------- os/hal/platforms/LPC13xx/platform.dox | 42 ++++++++++----------- os/hal/platforms/LPC214x/platform.dox | 42 ++++++++++----------- os/hal/platforms/MSP430/platform.dox | 4 +- os/hal/platforms/SPC56x/platform.dox | 2 +- os/hal/platforms/STM32/platform.dox | 67 +++++++++++++++++++++------------- os/hal/platforms/STM8L/platform.dox | 4 +- os/hal/platforms/STM8S/platform.dox | 42 ++++++++++----------- 11 files changed, 173 insertions(+), 149 deletions(-) diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index 568272e13..af34e1abd 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -206,21 +206,28 @@ * @enddot *

* . - * An important difference in the two modes is that there is a dedicated - * endpoint buffer in packet mode while in transaction mode the application - * specifies its own buffer for the whole transfer. + * @subsection usb_2_3 USB Packet Buffers + * An important difference between packet and transaction modes is that there + * is a dedicated endpoint buffer in packet mode while in transaction mode + * the application has to specify its own buffer for duration of the whole + * transfer.
+ * Packet buffers cannot be accessed directly by the application because those + * could not be necessarily memory mapped, a buffer could be a FIFO or some + * other kind of memory accessible in a special way depending on the + * underlying hardware architecture, the functions @p usbReadPacketI() and + * @p usbWritePacketI() allow to access packet buffers in an abstract way. * - * @subsection usb_2_3 USB Callbacks + * @subsection usb_2_4 USB Callbacks * The USB driver uses callbacks in order to interact with the application. - * There are several kind of callbacks to be handled: - * - Driver-wide events callback. As example errors, suspend event, reset - * event etc. - * - Messages hook callback. This hook allows the application to implement + * There are several kinds of callbacks to be handled: + * - Driver events callback. As example errors, suspend event, reset event + * etc. + * - Messages Hook callback. This hook allows the application to implement * handling of custom messages or to override the default handling of - * standard messages. - * - Descriptor requested callback. When the driver endpoint zero handler - * needs to serve a descriptor to the host it queries the application - * using this callback. + * standard messages on endpoint zero. + * - Descriptor Requested callback. When the driver endpoint zero handler + * receives a GET DESCRIPTOR message and needs to send a descriptor to + * the host it queries the application using this callback. * - Start of Frame callback. This callback is invoked each time a SOF * packet is received. * - Endpoint callbacks. Each endpoint informs the application about I/O diff --git a/os/hal/platforms/AT91SAM7/platform.dox b/os/hal/platforms/AT91SAM7/platform.dox index af4816486..4c87192f0 100644 --- a/os/hal/platforms/AT91SAM7/platform.dox +++ b/os/hal/platforms/AT91SAM7/platform.dox @@ -42,7 +42,7 @@ */ /** - * @defgroup AT91SAM7_MAC AT91SAM7 EMAC Support + * @defgroup AT91SAM7_MAC AT91SAM7 MAC Support * @details The AT91SAM7 MAC driver supports the EMAC peripheral. * * @section at91sam7_mac_1 Supported HW resources @@ -62,7 +62,7 @@ */ /** - * @defgroup AT91SAM7_PAL AT91SAM7 PIO Support + * @defgroup AT91SAM7_PAL AT91SAM7 PAL Support * @details The AT91SAM7 PAL driver supports the PIO peripherals. * * @section at91sam7_pal_1 Supported HW resources @@ -99,26 +99,7 @@ */ /** - * @defgroup AT91SAM7_SPI AT91SAM7 SPI Support - * @details The SPI driver supports the AT91SAM7 SPI peripherals using DMA - * channels for maximum performance. - * - * @section at91sam7_spi_1 Supported HW resources - * - SPI1. - * - SPI2. - * . - * @section at91sam7_spi_2 AT91SAM7 SPI driver implementation features - * - Clock stop for reduced power usage when the driver is in stop state. - * - Each SPI can be independently enabled and programmed. Unused - * peripherals are left in low power mode. - * - Programmable interrupt priority levels for each SPI. - * - DMA is used for receiving and transmitting. - * . - * @ingroup AT91SAM7 - */ - -/** - * @defgroup AT91SAM7_SERIAL AT91SAM7 USART Support (buffered) + * @defgroup AT91SAM7_SERIAL AT91SAM7 Serial Support * @details The AT91SAM7 Serial driver uses the USART/UART peripherals in a * buffered, interrupt driven, implementation. * @@ -137,3 +118,22 @@ * . * @ingroup AT91SAM7 */ + +/** + * @defgroup AT91SAM7_SPI AT91SAM7 SPI Support + * @details The SPI driver supports the AT91SAM7 SPI peripherals using DMA + * channels for maximum performance. + * + * @section at91sam7_spi_1 Supported HW resources + * - SPI1. + * - SPI2. + * . + * @section at91sam7_spi_2 AT91SAM7 SPI driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Each SPI can be independently enabled and programmed. Unused + * peripherals are left in low power mode. + * - Programmable interrupt priority levels for each SPI. + * - DMA is used for receiving and transmitting. + * . + * @ingroup AT91SAM7 + */ diff --git a/os/hal/platforms/AVR/platform.dox b/os/hal/platforms/AVR/platform.dox index 9b8cf3e6b..9b497b724 100644 --- a/os/hal/platforms/AVR/platform.dox +++ b/os/hal/platforms/AVR/platform.dox @@ -35,7 +35,7 @@ */ /** - * @defgroup AVR_SERIAL AVR USART Support (buffered) + * @defgroup AVR_SERIAL AVR Serial Support * @details The AVR Serial driver uses the USART peripherals in a * buffered, interrupt driven, implementation. * diff --git a/os/hal/platforms/LPC11xx/platform.dox b/os/hal/platforms/LPC11xx/platform.dox index 19dd542ae..ec9ac59af 100644 --- a/os/hal/platforms/LPC11xx/platform.dox +++ b/os/hal/platforms/LPC11xx/platform.dox @@ -43,7 +43,7 @@ */ /** - * @defgroup LPC11xx_PAL LPC11xx GPIO Support + * @defgroup LPC11xx_PAL LPC11xx PAL Support * @details The LPC11xx PAL driver uses the GPIO peripherals. * * @section lpc11xx_pal_1 Supported HW resources @@ -79,7 +79,26 @@ */ /** - * @defgroup LPC11xx_SPI LPC11xx SSP Support + * @defgroup LPC11xx_SERIAL LPC11xx Serial Support + * @details The LPC11xx Serial driver uses the UART peripheral in a + * buffered, interrupt driven, implementation. The serial driver + * also takes advantage of the LPC11xx UARTs deep hardware buffers. + * + * @section lpc11xx_serial_1 Supported HW resources + * The serial driver can support any of the following hardware resources: + * - UART. + * . + * @section lpc11xx_serial_2 LPC11xx Serial driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Fully interrupt driven. + * - Programmable priority level. + * - Takes advantage of the input and output FIFOs. + * . + * @ingroup LPC11xx + */ + +/** + * @defgroup LPC11xx_SPI LPC11xx SPI Support * @details The SPI driver supports the LPC11xx SSP peripherals in an interrupt * driven implementation. * @note Being the SPI a fast peripheral, much care must be taken to @@ -100,22 +119,3 @@ * . * @ingroup LPC11xx */ - -/** - * @defgroup LPC11xx_SERIAL LPC11xx UART Support (buffered) - * @details The LPC11xx Serial driver uses the UART peripheral in a - * buffered, interrupt driven, implementation. The serial driver - * also takes advantage of the LPC11xx UARTs deep hardware buffers. - * - * @section lpc11xx_serial_1 Supported HW resources - * The serial driver can support any of the following hardware resources: - * - UART. - * . - * @section lpc11xx_serial_2 LPC11xx Serial driver implementation features - * - Clock stop for reduced power usage when the driver is in stop state. - * - Fully interrupt driven. - * - Programmable priority level. - * - Takes advantage of the input and output FIFOs. - * . - * @ingroup LPC11xx - */ diff --git a/os/hal/platforms/LPC13xx/platform.dox b/os/hal/platforms/LPC13xx/platform.dox index 7b1e09a60..54b90b6dd 100644 --- a/os/hal/platforms/LPC13xx/platform.dox +++ b/os/hal/platforms/LPC13xx/platform.dox @@ -43,7 +43,7 @@ */ /** - * @defgroup LPC13xx_PAL LPC13xx GPIO Support + * @defgroup LPC13xx_PAL LPC13xx PAL Support * @details The LPC13xx PAL driver uses the GPIO peripherals. * * @section lpc13xx_pal_1 Supported HW resources @@ -79,7 +79,26 @@ */ /** - * @defgroup LPC13xx_SPI LPC13xx SSP Support + * @defgroup LPC13xx_SERIAL LPC13xx Serial Support + * @details The LPC13xx Serial driver uses the UART peripheral in a + * buffered, interrupt driven, implementation. The serial driver + * also takes advantage of the LPC13xx UARTs deep hardware buffers. + * + * @section lpc13xx_serial_1 Supported HW resources + * The serial driver can support any of the following hardware resources: + * - UART. + * . + * @section lpc13xx_serial_2 LPC13xx Serial driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Fully interrupt driven. + * - Programmable priority level. + * - Takes advantage of the input and output FIFOs. + * . + * @ingroup LPC13xx + */ + +/** + * @defgroup LPC13xx_SPI LPC13xx SPI Support * @details The SPI driver supports the LPC13xx SSP peripherals in an interrupt * driven implementation. * @note Being the SPI a fast peripheral, much care must be taken to @@ -100,22 +119,3 @@ * . * @ingroup LPC13xx */ - -/** - * @defgroup LPC13xx_SERIAL LPC13xx UART Support (buffered) - * @details The LPC13xx Serial driver uses the UART peripheral in a - * buffered, interrupt driven, implementation. The serial driver - * also takes advantage of the LPC13xx UARTs deep hardware buffers. - * - * @section lpc13xx_serial_1 Supported HW resources - * The serial driver can support any of the following hardware resources: - * - UART. - * . - * @section lpc13xx_serial_2 LPC13xx Serial driver implementation features - * - Clock stop for reduced power usage when the driver is in stop state. - * - Fully interrupt driven. - * - Programmable priority level. - * - Takes advantage of the input and output FIFOs. - * . - * @ingroup LPC13xx - */ diff --git a/os/hal/platforms/LPC214x/platform.dox b/os/hal/platforms/LPC214x/platform.dox index b07cce8c6..0c1835ba7 100644 --- a/os/hal/platforms/LPC214x/platform.dox +++ b/os/hal/platforms/LPC214x/platform.dox @@ -43,7 +43,7 @@ */ /** - * @defgroup LPC214x_PAL LPC214x FIO Support + * @defgroup LPC214x_PAL LPC214x PAL Support * @details The LPC214x PAL driver uses the FIO peripherals. * * @section lpc214x_pal_1 Supported HW resources @@ -74,26 +74,7 @@ */ /** - * @defgroup LPC214x_SPI LPC214x SSP Support - * @details The SPI driver supports the LPC214x SSP peripheral in an interrupt - * driven implementation. - * @note Being the SPI a fast peripheral, much care must be taken to - * not saturate the CPU bandwidth with an excessive IRQ rate. The - * maximum transfer bit rate is likely limited by the IRQ - * handling. - * - * @section lpc214x_spi_1 Supported HW resources - * - SSP (SPI0). - * . - * @section lpc214x_spi_2 LPC214x SPI driver implementation features - * - Clock stop for reduced power usage when the driver is in stop state. - * - Programmable interrupt priority level. - * . - * @ingroup LPC214x - */ - -/** - * @defgroup LPC214x_SERIAL LPC214x UART Support (buffered) + * @defgroup LPC214x_SERIAL LPC214x Serial Support * @details The LPC214x Serial driver uses the UART peripherals in a * buffered, interrupt driven, implementation. The serial driver * also takes advantage of the LPC214x UARTs deep hardware buffers. @@ -112,6 +93,25 @@ * @ingroup LPC214x */ +/** + * @defgroup LPC214x_SPI LPC214x SPI Support + * @details The SPI driver supports the LPC214x SSP peripheral in an interrupt + * driven implementation. + * @note Being the SPI a fast peripheral, much care must be taken to + * not saturate the CPU bandwidth with an excessive IRQ rate. The + * maximum transfer bit rate is likely limited by the IRQ + * handling. + * + * @section lpc214x_spi_1 Supported HW resources + * - SSP (SPI0). + * . + * @section lpc214x_spi_2 LPC214x SPI driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Programmable interrupt priority level. + * . + * @ingroup LPC214x + */ + /** * @defgroup LPC214x_VIC LPC214x VIC Support * @details This VIC helper driver is used by the other drivers in order to diff --git a/os/hal/platforms/MSP430/platform.dox b/os/hal/platforms/MSP430/platform.dox index ec6bbd535..25d263fa7 100644 --- a/os/hal/platforms/MSP430/platform.dox +++ b/os/hal/platforms/MSP430/platform.dox @@ -41,7 +41,7 @@ */ /** - * @defgroup MSP430_PAL MSP430 PORT Support + * @defgroup MSP430_PAL MSP430 PAL Support * @details The MSP430 PAL driver uses the PORT peripherals. * * @section msp430_pal_1 Supported HW resources @@ -79,7 +79,7 @@ */ /** - * @defgroup MSP430_SERIAL MSP430 USART Support (buffered) + * @defgroup MSP430_SERIAL MSP430 Serial Support * @details The MSP430 Serial driver uses the USART peripherals in a * buffered, interrupt driven, implementation. * diff --git a/os/hal/platforms/SPC56x/platform.dox b/os/hal/platforms/SPC56x/platform.dox index 3308731e9..397e92ad0 100644 --- a/os/hal/platforms/SPC56x/platform.dox +++ b/os/hal/platforms/SPC56x/platform.dox @@ -49,7 +49,7 @@ */ /** - * @defgroup SPC563_SERIAL SPC563Mx ESCI Support (buffered) + * @defgroup SPC563_SERIAL SPC563Mx Serial Support * @details The SPC563Mx/MPC563xM Serial driver uses the ESCI peripherals * in a buffered, interrupt driven, implementation. * diff --git a/os/hal/platforms/STM32/platform.dox b/os/hal/platforms/STM32/platform.dox index 8edf27161..cce82c6a2 100644 --- a/os/hal/platforms/STM32/platform.dox +++ b/os/hal/platforms/STM32/platform.dox @@ -119,7 +119,7 @@ */ /** - * @defgroup STM32_PAL STM32 GPIO Support + * @defgroup STM32_PAL STM32 PAL Support * @details The STM32 PAL driver uses the GPIO peripherals. * * @section stm32_pal_1 Supported HW resources @@ -188,6 +188,29 @@ * @ingroup STM32_DRIVERS */ +/** + * @defgroup STM32_SERIAL STM32 Serial Support + * @details The STM32 Serial driver uses the USART/UART peripherals in a + * buffered, interrupt driven, implementation. + * + * @section stm32_serial_1 Supported HW resources + * The serial driver can support any of the following hardware resources: + * - USART1. + * - USART2. + * - USART3 (where present). + * - UART4 (where present). + * - UART5 (where present). + * . + * @section stm32_serial_2 STM32 Serial driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Each UART/USART can be independently enabled and programmed. Unused + * peripherals are left in low power mode. + * - Fully interrupt driven. + * - Programmable priority levels for each UART/USART. + * . + * @ingroup STM32_DRIVERS + */ + /** * @defgroup STM32_SPI STM32 SPI Support * @details The SPI driver supports the STM32 SPI peripherals using DMA @@ -214,30 +237,7 @@ */ /** - * @defgroup STM32_SERIAL STM32 USART Support (buffered) - * @details The STM32 Serial driver uses the USART/UART peripherals in a - * buffered, interrupt driven, implementation. - * - * @section stm32_serial_1 Supported HW resources - * The serial driver can support any of the following hardware resources: - * - USART1. - * - USART2. - * - USART3 (where present). - * - UART4 (where present). - * - UART5 (where present). - * . - * @section stm32_serial_2 STM32 Serial driver implementation features - * - Clock stop for reduced power usage when the driver is in stop state. - * - Each UART/USART can be independently enabled and programmed. Unused - * peripherals are left in low power mode. - * - Fully interrupt driven. - * - Programmable priority levels for each UART/USART. - * . - * @ingroup STM32_DRIVERS - */ - -/** - * @defgroup STM32_UART STM32 USART Support (unbuffered) + * @defgroup STM32_UART STM32 UART Support * @details The UART driver supports the STM32 USART peripherals using DMA * channels for maximum performance. * @@ -246,6 +246,7 @@ * - USART1. * - USART2. * - USART3 (where present). + * - UART4 (where present). * - DMA1. * - DMA2 (where present). * . @@ -261,3 +262,19 @@ * . * @ingroup STM32_DRIVERS */ + +/** + * @defgroup STM32_USB STM32 USB Support + * @details The USB driver supports the STM32 USB peripheral. + * + * @section stm32_usb_1 Supported HW resources + * The USB driver can support any of the following hardware resources: + * - USB. + * . + * @section stm32_usb_2 STM32 USB driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Programmable interrupt priority levels. + * - Each endpoint programmable in Control, Bulk and Interrupt modes. + * . + * @ingroup STM32_DRIVERS + */ diff --git a/os/hal/platforms/STM8L/platform.dox b/os/hal/platforms/STM8L/platform.dox index b1b74251e..ec0bf1cf7 100644 --- a/os/hal/platforms/STM8L/platform.dox +++ b/os/hal/platforms/STM8L/platform.dox @@ -41,7 +41,7 @@ */ /** - * @defgroup STM8L_PAL STM8L GPIO Support + * @defgroup STM8L_PAL STM8L PAL Support * @details The STM8L PAL driver uses the GPIO peripherals. * * @section stm8l_pal_1 Supported HW resources @@ -84,7 +84,7 @@ */ /** - * @defgroup STM8L_SERIAL STM8L USART Support (buffered) + * @defgroup STM8L_SERIAL STM8L Serial Support * @details The STM8L Serial driver uses the USART1 peripheral in a * buffered, interrupt driven, implementation. * diff --git a/os/hal/platforms/STM8S/platform.dox b/os/hal/platforms/STM8S/platform.dox index d05bb4af6..a8e356c6e 100644 --- a/os/hal/platforms/STM8S/platform.dox +++ b/os/hal/platforms/STM8S/platform.dox @@ -40,7 +40,7 @@ */ /** - * @defgroup STM8S_PAL STM8S GPIO Support + * @defgroup STM8S_PAL STM8S PAL Support * @details The STM8S PAL driver uses the GPIO peripherals. * * @section stm8s_pal_1 Supported HW resources @@ -83,26 +83,7 @@ */ /** - * @defgroup STM8S_SPI STM8S SPI Support - * @details The SPI driver supports the STM8S SPI peripheral in an interrupt - * driven implementation. - * @note Being the SPI a fast peripheral, much care must be taken to - * not saturate the CPU bandwidth with an excessive IRQ rate. The - * maximum transfer bit rate is likely limited by the IRQ - * handling. - * - * @section stm8s_spi_1 Supported HW resources - * - SPI. - * . - * @section stm8s_spi_2 STM8S SPI driver implementation features - * - Clock stop for reduced power usage when the driver is in stop state. - * - Fully interrupt driven. - * . - * @ingroup STM8S - */ - -/** - * @defgroup STM8S_SERIAL STM8S UART Support (buffered) + * @defgroup STM8S_SERIAL STM8S Serial Support * @details The STM8S Serial driver uses the UART peripherals in a * buffered, interrupt driven, implementation. * @@ -120,3 +101,22 @@ * . * @ingroup STM8S */ + +/** + * @defgroup STM8S_SPI STM8S SPI Support + * @details The SPI driver supports the STM8S SPI peripheral in an interrupt + * driven implementation. + * @note Being the SPI a fast peripheral, much care must be taken to + * not saturate the CPU bandwidth with an excessive IRQ rate. The + * maximum transfer bit rate is likely limited by the IRQ + * handling. + * + * @section stm8s_spi_1 Supported HW resources + * - SPI. + * . + * @section stm8s_spi_2 STM8S SPI driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Fully interrupt driven. + * . + * @ingroup STM8S + */ -- cgit v1.2.3 From e0c20340f0b9664d5e5d15c840db97fc119be757 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 3 Mar 2011 13:32:21 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2789 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/uart_lld.h | 6 +----- todo.txt | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h index 589a274fa..f09fe7cd4 100644 --- a/os/hal/platforms/STM32/uart_lld.h +++ b/os/hal/platforms/STM32/uart_lld.h @@ -158,12 +158,8 @@ #error "USART3 not present in the selected device" #endif -#if STM32_UART_USE_UART4 && !STM32_HAS_UART4 -#error "UART4 not present in the selected device" -#endif - #if !STM32_UART_USE_USART1 && !STM32_UART_USE_USART2 && \ - !STM32_UART_USE_USART3 && !STM32_UART_USE_UART4 + !STM32_UART_USE_USART3 #error "UART driver activated but no USART/UART peripheral assigned" #endif diff --git a/todo.txt b/todo.txt index b5183c7e1..7e16194b9 100644 --- a/todo.txt +++ b/todo.txt @@ -19,7 +19,8 @@ Within 2.3.x (hopefully) * Improvements to the message passing mechanism in order to allow "delayed, out of order, responses". * New device driver models: GPT. -- Add UART4 support to the STM32 UART driver. +- Add UART4 support to the STM32 UART driver (CL line only, HD has a nasty + shared interrupt). - Add ADC3 support to the STM32 ADC driver. ? Make thread functions return void and add a CH_THREAD macro for threads declaration in order to hide compiler-specific optimizations for thread -- cgit v1.2.3 From 2de96c4c5776fe2c029b6b6ee543f13a07585107 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 4 Mar 2011 16:56:01 +0000 Subject: Better a KISS approach. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2790 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/gpt.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/os/hal/include/gpt.h b/os/hal/include/gpt.h index d4063cd6c..c1ce72edf 100644 --- a/os/hal/include/gpt.h +++ b/os/hal/include/gpt.h @@ -38,22 +38,10 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(GPT_USE_WAIT) || defined(__DOXYGEN__) -#define GPT_USE_WAIT TRUE -#endif - /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ -#if GPT_USE_WAIT && !CH_USE_SEMAPHORES -#error "GPT driver requires CH_USE_SEMAPHORES when GPT_USE_WAIT is enabled" -#endif - /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ @@ -93,9 +81,6 @@ extern "C" { void gptStopTimer(GPTDriver *gptp); void gptStopTimerI(GPTDriver *gptp); void gptPolledDelay(GPTDriver *gptp, gptcnt_t interval); -#if GPT_USE_WAIT - void gptDelay(GPTDriver *gptp, gptcnt_t interval); -#endif #ifdef __cplusplus } #endif -- cgit v1.2.3 From b122874af2de2ed2243c274b363caf789eeed157 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Mar 2011 09:02:15 +0000 Subject: IRQ STORM test for the STM32 added. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2791 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 3 + testhal/STM32/GPT/readme.txt | 4 +- testhal/STM32/IRQ_STORM/Makefile | 204 +++++++++++++++ testhal/STM32/IRQ_STORM/ch.ld | 113 +++++++++ testhal/STM32/IRQ_STORM/chconf.h | 507 +++++++++++++++++++++++++++++++++++++ testhal/STM32/IRQ_STORM/halconf.h | 280 ++++++++++++++++++++ testhal/STM32/IRQ_STORM/main.c | 267 +++++++++++++++++++ testhal/STM32/IRQ_STORM/mcuconf.h | 142 +++++++++++ testhal/STM32/IRQ_STORM/readme.txt | 27 ++ 9 files changed, 1545 insertions(+), 2 deletions(-) create mode 100644 testhal/STM32/IRQ_STORM/Makefile create mode 100644 testhal/STM32/IRQ_STORM/ch.ld create mode 100644 testhal/STM32/IRQ_STORM/chconf.h create mode 100644 testhal/STM32/IRQ_STORM/halconf.h create mode 100644 testhal/STM32/IRQ_STORM/main.c create mode 100644 testhal/STM32/IRQ_STORM/mcuconf.h create mode 100644 testhal/STM32/IRQ_STORM/readme.txt diff --git a/readme.txt b/readme.txt index bc34b0286..ff67c98bc 100644 --- a/readme.txt +++ b/readme.txt @@ -84,6 +84,9 @@ 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). +- NEW: Added an "IRQ STORM" long duration test for the STM32. The test + demonstrates the system stability in a thread-intensive, progressively + CPU saturating, IRQ intensive long duration test. - NEW: Added two new functions to the events subsystem: chEvtBroadcastFlags() and chEvtBroadcastFlagsI(). The old chEvtBroadcast() and chEvtBroadcastI() become macros. The new functions allow to add the same flags to all the diff --git a/testhal/STM32/GPT/readme.txt b/testhal/STM32/GPT/readme.txt index 4c3fdf2fa..3f3164120 100644 --- a/testhal/STM32/GPT/readme.txt +++ b/testhal/STM32/GPT/readme.txt @@ -1,5 +1,5 @@ ***************************************************************************** -** ChibiOS/RT HAL - PWM driver demo for STM32. ** +** ChibiOS/RT HAL - GPT driver demo for STM32. ** ***************************************************************************** ** TARGET ** @@ -8,7 +8,7 @@ The demo will on an Olimex STM32-P103 board. ** The Demo ** -The application demonstrates the use of the STM32 PWM driver. +The application demonstrates the use of the STM32 GPT driver. ** Build Procedure ** diff --git a/testhal/STM32/IRQ_STORM/Makefile b/testhal/STM32/IRQ_STORM/Makefile new file mode 100644 index 000000000..a5c76f1c8 --- /dev/null +++ b/testhal/STM32/IRQ_STORM/Makefile @@ -0,0 +1,204 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +#include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARM/rules.mk diff --git a/testhal/STM32/IRQ_STORM/ch.ld b/testhal/STM32/IRQ_STORM/ch.ld new file mode 100644 index 000000000..44f494121 --- /dev/null +++ b/testhal/STM32/IRQ_STORM/ch.ld @@ -0,0 +1,113 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/STM32/IRQ_STORM/chconf.h b/testhal/STM32/IRQ_STORM/chconf.h new file mode 100644 index 000000000..3353391ca --- /dev/null +++ b/testhal/STM32/IRQ_STORM/chconf.h @@ -0,0 +1,507 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h new file mode 100644 index 000000000..70c240431 --- /dev/null +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -0,0 +1,280 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/IRQ_STORM/main.c b/testhal/STM32/IRQ_STORM/main.c new file mode 100644 index 000000000..35ec498c9 --- /dev/null +++ b/testhal/STM32/IRQ_STORM/main.c @@ -0,0 +1,267 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" + +/*===========================================================================*/ +/* Test related code. */ +/*===========================================================================*/ + +#define NUM_THREADS 4 +#define MAILBOX_SIZE 2 + +#define MSG_SEND_LEFT 0 +#define MSG_SEND_RIGHT 1 + +static bool_t saturated; + +/* + * Mailboxes and buffers. + */ +static Mailbox mb[NUM_THREADS]; +static msg_t b[NUM_THREADS][MAILBOX_SIZE]; + +/* + * Test worker threads. + */ +static WORKING_AREA(waWorkerThread[NUM_THREADS], 128); +static msg_t WorkerThread(void *arg) { + static volatile uint32_t x = 0; + static uint32_t cnt = 0; + uint32_t me = (uint32_t)arg; + uint32_t target; + uint32_t i; + msg_t msg; + + /* Work loop.*/ + while (TRUE) { + /* Waiting for a message.*/ + chMBFetch(&mb[me], &msg, TIME_INFINITE); + + /* Pseudo-random delay.*/ + for (i = 0; i < (me >> 4); i++) + x++; + + /* Deciding in which direction to re-send the message.*/ + if (msg == MSG_SEND_LEFT) + target = me - 1; + else + target = me + 1; + + if (target < NUM_THREADS) { + /* If this thread is not at the end of a chain re-sending the message, + note this check works because the variable target is unsigned.*/ + msg = chMBPost(&mb[target], msg, TIME_IMMEDIATE); + if (msg != RDY_OK) + saturated = TRUE; + } + else { + /* Provides a visual feedback about the system.*/ + if (++cnt >= 500) { + cnt = 0; + palTogglePad(GPIOC, GPIOC_LED); + } + } + } +} + +/* + * GPT1 callback. + */ +static void gpt1cb(GPTDriver *gptp) { + msg_t msg; + + (void)gptp; + chSysLockFromIsr(); + msg = chMBPostI(&mb[0], MSG_SEND_RIGHT); + if (msg != RDY_OK) + saturated = TRUE; + chSysUnlockFromIsr(); +} + +/* + * GPT2 callback. + */ +static void gpt2cb(GPTDriver *gptp) { + msg_t msg; + + (void)gptp; + chSysLockFromIsr(); + msg = chMBPostI(&mb[NUM_THREADS - 1], MSG_SEND_LEFT); + if (msg != RDY_OK) + saturated = TRUE; + chSysUnlockFromIsr(); +} + +/* + * GPT1 configuration. + */ +static const GPTConfig gpt1cfg = { + 1000000, /* 1MHz timer clock.*/ + gpt1cb /* Timer callback.*/ +}; + +/* + * GPT2 configuration. + */ +static const GPTConfig gpt2cfg = { + 1000000, /* 1MHz timer clock.*/ + gpt2cb /* Timer callback.*/ +}; + + +/*===========================================================================*/ +/* Generic demo code. */ +/*===========================================================================*/ + +static void print(char *p) { + + while (*p) { + chIOPut(&SD2, *p++); + } +} + +static void println(char *p) { + + while (*p) { + chIOPut(&SD2, *p++); + } + chIOWriteTimeout(&SD2, (uint8_t *)"\r\n", 2, TIME_INFINITE); +} + +static void printn(uint32_t n) { + char buf[16], *p; + + if (!n) + chIOPut(&SD2, '0'); + else { + p = buf; + while (n) + *p++ = (n % 10) + '0', n /= 10; + while (p > buf) + chIOPut(&SD2, *--p); + } +} + +/* + * Application entry point. + */ +int main(void) { + unsigned i; + gptcnt_t interval; + gptcnt_t threshold; + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Prepares the Serial driver 2 and GPT drivers 1 and 2. + */ + sdStart(&SD2, NULL); /* Default is 38400-8-N-1.*/ + gptStart(&GPTD1, &gpt1cfg); + gptStart(&GPTD2, &gpt2cfg); + + /* + * Initializes the mailboxes and creates the worker threads. + */ + for (i = 0; i < NUM_THREADS; i++) { + chMBInit(&mb[i], b[i], MAILBOX_SIZE); + chThdCreateStatic(waWorkerThread[i], sizeof waWorkerThread[i], + NORMALPRIO - 20, WorkerThread, (void *)i); + } + + /* + * Test procedure. + */ + println(""); + println("*** ChibiOS/RT IRQ-STORM long duration test"); + println("***"); + print("*** Kernel: "); + println(CH_KERNEL_VERSION); +#ifdef __GNUC__ + print("*** GCC Version: "); + println(__VERSION__); +#endif + print("*** Architecture: "); + println(CH_ARCHITECTURE_NAME); +#ifdef CH_CORE_VARIANT_NAME + print("*** Core Variant: "); + println(CH_CORE_VARIANT_NAME); +#endif +#ifdef PLATFORM_NAME + print("*** Platform: "); + println(PLATFORM_NAME); +#endif +#ifdef BOARD_NAME + print("*** Test Board: "); + println(BOARD_NAME); +#endif + print("*** SYSCLK: "); + printn(STM32_SYSCLK); + println(""); + + println(""); + for (i = 1; i <= 100; i++){ + print("Iteration "); + printn(i); + println(""); + saturated = FALSE; + threshold = 0; + for (interval = 2000; interval >= 20; interval -= interval / 10) { + gptStartContinuous(&GPTD1, interval - 1); /* Slightly out of phase.*/ + gptStartContinuous(&GPTD2, interval + 1); /* Slightly out of phase.*/ + chThdSleepMilliseconds(1000); + gptStopTimer(&GPTD1); + gptStopTimer(&GPTD2); + if (!saturated) + print("."); + else { + print("#"); + if (threshold == 0) + threshold = interval; + } + } + /* Gives the worker threads a chance to empty the mailboxes before next + cycle.*/ + chThdSleepMilliseconds(20); + print("\r\nSaturated at "); + printn(threshold); + print(" uS\r\n\n"); + } + gptStopTimer(&GPTD1); + gptStopTimer(&GPTD2); + + println("\r\nTest Complete"); + + /* + * Normal main() thread activity, nothing in this test. + */ + while (TRUE) { + chThdSleepMilliseconds(5000); + } + return 0; +} diff --git a/testhal/STM32/IRQ_STORM/mcuconf.h b/testhal/STM32/IRQ_STORM/mcuconf.h new file mode 100644 index 000000000..643a5f2a5 --- /dev/null +++ b/testhal/STM32/IRQ_STORM/mcuconf.h @@ -0,0 +1,142 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 TRUE +#define STM32_GPT_USE_TIM2 TRUE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 6 +#define STM32_GPT_TIM2_IRQ_PRIORITY 10 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/IRQ_STORM/readme.txt b/testhal/STM32/IRQ_STORM/readme.txt new file mode 100644 index 000000000..32aad05b5 --- /dev/null +++ b/testhal/STM32/IRQ_STORM/readme.txt @@ -0,0 +1,27 @@ +***************************************************************************** +** ChibiOS/RT HAL - IRQ-STORM demo for STM32. ** +***************************************************************************** + +** TARGET ** + +The demo will on an Olimex STM32-P103 board. + +** The Demo ** + +The application demonstrates the use of the STM32 GPT, PAL and Serial drivers +in order to implement a system stress demo. + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com -- cgit v1.2.3 From 2de7c9ddf99e11564b045ffc92c73d2e423ae665 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Mar 2011 12:21:45 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2792 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/IRQ_STORM/main.c | 88 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 17 deletions(-) diff --git a/testhal/STM32/IRQ_STORM/main.c b/testhal/STM32/IRQ_STORM/main.c index 35ec498c9..b20369b47 100644 --- a/testhal/STM32/IRQ_STORM/main.c +++ b/testhal/STM32/IRQ_STORM/main.c @@ -17,15 +17,34 @@ along with this program. If not, see . */ +#include + #include "ch.h" #include "hal.h" /*===========================================================================*/ -/* Test related code. */ +/* Configurable settings. */ /*===========================================================================*/ +#ifndef RANDOMIZE +#define RANDOMIZE FALSE +#endif + +#ifndef ITERATIONS +#define ITERATIONS 100 +#endif + +#ifndef NUM_THREADS #define NUM_THREADS 4 +#endif + +#ifndef MAILBOX_SIZE #define MAILBOX_SIZE 2 +#endif + +/*===========================================================================*/ +/* Test related code. */ +/*===========================================================================*/ #define MSG_SEND_LEFT 0 #define MSG_SEND_RIGHT 1 @@ -43,11 +62,11 @@ static msg_t b[NUM_THREADS][MAILBOX_SIZE]; */ static WORKING_AREA(waWorkerThread[NUM_THREADS], 128); static msg_t WorkerThread(void *arg) { - static volatile uint32_t x = 0; - static uint32_t cnt = 0; - uint32_t me = (uint32_t)arg; - uint32_t target; - uint32_t i; + static volatile unsigned x = 0; + static unsigned cnt = 0; + unsigned me = (unsigned)arg; + unsigned target; + unsigned r; msg_t msg; /* Work loop.*/ @@ -55,9 +74,23 @@ static msg_t WorkerThread(void *arg) { /* Waiting for a message.*/ chMBFetch(&mb[me], &msg, TIME_INFINITE); - /* Pseudo-random delay.*/ - for (i = 0; i < (me >> 4); i++) - x++; +#if RANDOMIZE + /* Pseudo-random delay.*/ + { + chSysLock(); + r = rand() & 15; + chSysUnlock(); + while (r--) + x++; + } +#else + /* Fixed delay.*/ + { + r = me >> 4; + while (r--) + x++; + } +#endif /* Deciding in which direction to re-send the message.*/ if (msg == MSG_SEND_LEFT) @@ -165,8 +198,7 @@ static void printn(uint32_t n) { */ int main(void) { unsigned i; - gptcnt_t interval; - gptcnt_t threshold; + gptcnt_t interval, threshold, worst; /* * System initializations. @@ -201,7 +233,7 @@ int main(void) { println("*** ChibiOS/RT IRQ-STORM long duration test"); println("***"); print("*** Kernel: "); - println(CH_KERNEL_VERSION); + println(CH_KERNEL_VERSION); #ifdef __GNUC__ print("*** GCC Version: "); println(__VERSION__); @@ -220,12 +252,26 @@ int main(void) { print("*** Test Board: "); println(BOARD_NAME); #endif - print("*** SYSCLK: "); + println("***"); + print("*** System Clock: "); printn(STM32_SYSCLK); println(""); + print("*** Iterations: "); + printn(ITERATIONS); + println(""); + print("*** Randomize: "); + printn(RANDOMIZE); + println(""); + print("*** Threads: "); + printn(NUM_THREADS); + println(""); + print("*** Mailbox size: "); + printn(MAILBOX_SIZE); + println(""); println(""); - for (i = 1; i <= 100; i++){ + worst = 0; + for (i = 1; i <= ITERATIONS; i++){ print("Iteration "); printn(i); println(""); @@ -248,14 +294,22 @@ int main(void) { /* Gives the worker threads a chance to empty the mailboxes before next cycle.*/ chThdSleepMilliseconds(20); - print("\r\nSaturated at "); + println(""); + print("Saturated at "); printn(threshold); - print(" uS\r\n\n"); + println(" uS"); + println(""); + if (threshold > worst) + worst = threshold; } gptStopTimer(&GPTD1); gptStopTimer(&GPTD2); - println("\r\nTest Complete"); + print("Worst case at "); + printn(worst); + println(" uS"); + println(""); + println("Test Complete"); /* * Normal main() thread activity, nothing in this test. -- cgit v1.2.3 From 654bed7b7122c1231a02e790d1af3c55ec7a981c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Mar 2011 16:05:17 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2793 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/IRQ_STORM/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testhal/STM32/IRQ_STORM/main.c b/testhal/STM32/IRQ_STORM/main.c index b20369b47..71ff38440 100644 --- a/testhal/STM32/IRQ_STORM/main.c +++ b/testhal/STM32/IRQ_STORM/main.c @@ -39,7 +39,7 @@ #endif #ifndef MAILBOX_SIZE -#define MAILBOX_SIZE 2 +#define MAILBOX_SIZE 4 #endif /*===========================================================================*/ -- cgit v1.2.3 From d17660452ee51c773e8cbb3c4104ec946ba86458 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Mar 2011 18:35:10 +0000 Subject: GPT driver for LPC11xx (not tested yet). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2794 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h | 12 ++ os/hal/platforms/LPC11xx/gpt_lld.c | 341 ++++++++++++++++++++++++++++++ os/hal/platforms/LPC11xx/gpt_lld.h | 223 +++++++++++++++++++ os/hal/platforms/LPC11xx/platform.dox | 18 ++ os/hal/platforms/LPC11xx/platform.mk | 1 + readme.txt | 2 +- 6 files changed, 596 insertions(+), 1 deletion(-) create mode 100644 os/hal/platforms/LPC11xx/gpt_lld.c create mode 100644 os/hal/platforms/LPC11xx/gpt_lld.h diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h index aafb2901d..b78d966e1 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h @@ -45,6 +45,18 @@ * CAN driver system settings. */ +/* + * GPT driver system settings. + */ +#define LPC11xx_GPT_USE_CT16B0 TRUE +#define LPC11xx_GPT_USE_CT16B1 TRUE +#define LPC11xx_GPT_USE_CT32B0 TRUE +#define LPC11xx_GPT_USE_CT32B1 TRUE +#define LPC11xx_GPT_CT16B0_IRQ_PRIORITY 2 +#define LPC11xx_GPT_CT16B1_IRQ_PRIORITY 2 +#define LPC11xx_GPT_CT32B0_IRQ_PRIORITY 2 +#define LPC11xx_GPT_CT32B1_IRQ_PRIORITY 2 + /* * PWM driver system settings. */ diff --git a/os/hal/platforms/LPC11xx/gpt_lld.c b/os/hal/platforms/LPC11xx/gpt_lld.c new file mode 100644 index 000000000..fa64db94c --- /dev/null +++ b/os/hal/platforms/LPC11xx/gpt_lld.c @@ -0,0 +1,341 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file LPC11xx/gpt_lld.c + * @brief LPC11xx GPT subsystem low level driver source. + * + * @addtogroup GPT + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/** + * @brief GPT1 driver identifier. + * @note The driver GPT1 allocates the complex timer CT16B0 when enabled. + */ +#if LPC11xx_GPT_USE_CT16B0 || defined(__DOXYGEN__) +GPTDriver GPTD1; +#endif + +/** + * @brief GPT2 driver identifier. + * @note The driver GPT2 allocates the timer CT16B1 when enabled. + */ +#if LPC11xx_GPT_USE_CT16B1 || defined(__DOXYGEN__) +GPTDriver GPTD2; +#endif + +/** + * @brief GPT3 driver identifier. + * @note The driver GPT3 allocates the timer CT32B0 when enabled. + */ +#if LPC11xx_GPT_USE_CT32B0 || defined(__DOXYGEN__) +GPTDriver GPTD3; +#endif + +/** + * @brief GPT4 driver identifier. + * @note The driver GPT4 allocates the timer CT32B1 when enabled. + */ +#if LPC11xx_GPT_USE_CT32B1 || defined(__DOXYGEN__) +GPTDriver GPTD4; +#endif + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/** + * @brief Shared IRQ handler. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +static void gpt_lld_serve_interrupt(GPTDriver *gptp) { + + gptp->tmr->IR = 1; /* Clear interrupt on match MR0.*/ + if (gptp->state == GPT_ONESHOT) { + gptp->state = GPT_READY; /* Back in GPT_READY state. */ + gpt_lld_stop_timer(gptp); /* Timer automatically stopped. */ + } + gptp->config->callback(gptp); +} + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +#if LPC11xx_GPT_USE_CT16B0 +/** + * @brief CT16B0 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(Vector80) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD1); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC11xx_GPT_USE_CT16B0 */ + +#if LPC11xx_GPT_USE_CT16B1 +/** + * @brief CT16B1 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(Vector84) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD2); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC11xx_GPT_USE_CT16B0 */ + +#if LPC11xx_GPT_USE_CT32B0 +/** + * @brief CT32B0 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(Vector88) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD3); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC11xx_GPT_USE_CT32B0 */ + +#if LPC11xx_GPT_USE_CT32B1 +/** + * @brief CT32B1 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(Vector8C) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD4); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC11xx_GPT_USE_CT32B1 */ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level GPT driver initialization. + * + * @notapi + */ +void gpt_lld_init(void) { + +#if LPC11xx_GPT_USE_CT16B0 + /* Driver initialization.*/ + GPTD1.tmr = LPC_TMR16B0; + gptObjectInit(&GPTD1); +#endif + +#if LPC11xx_GPT_USE_CT16B1 + /* Driver initialization.*/ + GPTD2.tmr = LPC_TMR16B1; + gptObjectInit(&GPTD2); +#endif + +#if LPC11xx_GPT_USE_CT32B0 + /* Driver initialization.*/ + GPTD3.tmr = LPC_TMR32B0; + gptObjectInit(&GPTD3); +#endif + +#if LPC11xx_GPT_USE_CT32B1 + /* Driver initialization.*/ + GPTD4.tmr = LPC_TMR32B1; + gptObjectInit(&GPTD4); +#endif +} + +/** + * @brief Configures and activates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_start(GPTDriver *gptp) { + uint32_t pr; + + if (gptp->state == GPT_STOP) { + /* Clock activation.*/ +#if LPC11xx_GPT_USE_CT16B0 + if (&GPTD1 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 7); + NVICEnableVector(TIMER_16_0_IRQn, CORTEX_PRIORITY_MASK(2)); + } +#endif +#if LPC11xx_GPT_USE_CT16B1 + if (&GPTD2 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 8); + NVICEnableVector(TIMER_16_1_IRQn, CORTEX_PRIORITY_MASK(3)); + } +#endif +#if LPC11xx_GPT_USE_CT32B0 + if (&GPTD3 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 9); + NVICEnableVector(TIMER_32_0_IRQn, CORTEX_PRIORITY_MASK(2)); + } +#endif +#if LPC11xx_GPT_USE_CT32B1 + if (&GPTD4 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 10); + NVICEnableVector(TIMER_32_1_IRQn, CORTEX_PRIORITY_MASK(2)); + } +#endif + } + + /* Prescaler value calculation.*/ + pr = (uint16_t)((LPC11xx_SYSCLK / gptp->config->frequency) - 1); + chDbgAssert(((uint32_t)(pr + 1) * gptp->config->frequency) == LPC11xx_SYSCLK, + "gpt_lld_start(), #1", "invalid frequency"); + + /* Timer configuration.*/ + gptp->tmr->PR = pr; + gptp->tmr->IR = 1; + gptp->tmr->MCR = 0; + gptp->tmr->TCR = 0; +} + +/** + * @brief Deactivates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop(GPTDriver *gptp) { + + if (gptp->state == GPT_READY) { + gptp->tmr->MCR = 0; + gptp->tmr->TCR = 0; + +#if LPC11xx_GPT_USE_CT16B0 + if (&GPTD1 == gptp) { + NVICDisableVector(TIMER_16_0_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 7); + } +#endif +#if LPC11xx_GPT_USE_CT16B1 + if (&GPTD2 == gptp) { + NVICDisableVector(TIMER_16_1_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 8); + } +#endif +#if LPC11xx_GPT_USE_CT32B0 + if (&GPTD3 == gptp) { + NVICDisableVector(TIMER_32_0_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 9); + } +#endif +#if LPC11xx_GPT_USE_CT32B1 + if (&GPTD4 == gptp) { + NVICDisableVector(TIMER_32_1_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 10); + } +#endif + } +} + +/** + * @brief Starts the timer in continuous mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval period in ticks + * + * @notapi + */ +void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) { + + gptp->tmr->MR0 = interval - 1; + gptp->tmr->IR = 1; + gptp->tmr->MCR = 3; /* IRQ and clr TC on match MR0. */ + gptp->tmr->TCR = 2; /* Reset counter and prescaler. */ + gptp->tmr->TCR = 1; /* Timer enabled. */ +} + +/** + * @brief Stops the timer. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop_timer(GPTDriver *gptp) { + + gptp->tmr->IR = 1; + gptp->tmr->MCR = 0; + gptp->tmr->TCR = 0; +} + +/** + * @brief Starts the timer in one shot mode and waits for completion. + * @details This function specifically polls the timer waiting for completion + * in order to not have extra delays caused by interrupt servicing, + * this function is only recommended for short delays. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @notapi + */ +void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) { + + gptp->tmr->MR0 = interval - 1; + gptp->tmr->IR = 1; + gptp->tmr->MCR = 4; /* Stop TC on match MR0. */ + gptp->tmr->TCR = 2; /* Reset counter and prescaler. */ + gptp->tmr->TCR = 1; /* Timer enabled. */ + while (gptp->tmr->TCR & 1) + ; +} + +#endif /* HAL_USE_GPT */ + +/** @} */ diff --git a/os/hal/platforms/LPC11xx/gpt_lld.h b/os/hal/platforms/LPC11xx/gpt_lld.h new file mode 100644 index 000000000..1abc1572e --- /dev/null +++ b/os/hal/platforms/LPC11xx/gpt_lld.h @@ -0,0 +1,223 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file LPC11xx/gpt_lld.h + * @brief LPC11xx GPT subsystem low level driver header. + * + * @addtogroup GPT + * @{ + */ + +#ifndef _GPT_LLD_H_ +#define _GPT_LLD_H_ + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief GPT1 driver enable switch. + * @details If set to @p TRUE the support for GPT1 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC11xx_GPT_USE_CT16B0) || defined(__DOXYGEN__) +#define LPC11xx_GPT_USE_CT16B0 TRUE +#endif + +/** + * @brief GPT2 driver enable switch. + * @details If set to @p TRUE the support for GPT2 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC11xx_GPT_USE_CT16B1) || defined(__DOXYGEN__) +#define LPC11xx_GPT_USE_CT16B1 TRUE +#endif + +/** + * @brief GPT3 driver enable switch. + * @details If set to @p TRUE the support for GPT3 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC11xx_GPT_USE_CT32B0) || defined(__DOXYGEN__) +#define LPC11xx_GPT_USE_CT32B0 TRUE +#endif + +/** + * @brief GPT4 driver enable switch. + * @details If set to @p TRUE the support for GPT4 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC11xx_GPT_USE_CT32B1) || defined(__DOXYGEN__) +#define LPC11xx_GPT_USE_CT32B1 TRUE +#endif + +/** + * @brief GPT1 interrupt priority level setting. + */ +#if !defined(LPC11xx_GPT_CT16B0_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC11xx_GPT_CT16B0_IRQ_PRIORITY 2 +#endif + +/** + * @brief GPT2 interrupt priority level setting. + */ +#if !defined(LPC11xx_GPT_CT16B1_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC11xx_GPT_CT16B1_IRQ_PRIORITY 2 +#endif + +/** + * @brief GPT3 interrupt priority level setting. + */ +#if !defined(LPC11xx_GPT_CT32B0_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC11xx_GPT_CT32B0_IRQ_PRIORITY 2 +#endif + +/** + * @brief GPT4 interrupt priority level setting. + */ +#if !defined(LPC11xx_GPT_CT32B1_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC11xx_GPT_CT32B1_IRQ_PRIORITY 2 +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +#if !LPC11xx_GPT_USE_CT16B0 && !LPC11xx_GPT_USE_CT16B1 && \ + !LPC11xx_GPT_USE_CT32B0 && !LPC11xx_GPT_USE_CT32B1 +#error "GPT driver activated but no CT peripheral assigned" +#endif + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief GPT frequency type. + */ +typedef uint32_t gptfreq_t; + +/** + * @brief GPT counter type. + */ +typedef uint32_t gptcnt_t; + +/** + * @brief Type of a structure representing a GPT driver. + */ +typedef struct GPTDriver GPTDriver; + +/** + * @brief GPT notification callback type. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +typedef void (*gptcallback_t)(GPTDriver *gptp); + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + gptfreq_t frequency; + /** + * @brief Timer callback pointer. + * @note This callback is invoked on GPT counter events. + */ + gptcallback_t callback; + /* End of the mandatory fields.*/ +} GPTConfig; + +/** + * @brief Structure representing a GPT driver. + */ +struct GPTDriver { + /** + * @brief Driver state. + */ + gptstate_t state; + /** + * @brief Current configuration data. + */ + const GPTConfig *config; + /* End of the mandatory fields.*/ + /** + * @brief Timer base clock. + */ + uint32_t clock; + /** + * @brief Pointer to the CTxxBy registers block. + */ + LPC_TMR_TypeDef *tmr; +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#if LPC11xx_GPT_USE_CT16B0 && !defined(__DOXYGEN__) +extern GPTDriver GPTD1; +#endif + +#if LPC11xx_GPT_USE_CT16B1 && !defined(__DOXYGEN__) +extern GPTDriver GPTD2; +#endif + +#if LPC11xx_GPT_USE_CT32B0 && !defined(__DOXYGEN__) +extern GPTDriver GPTD3; +#endif + +#if LPC11xx_GPT_USE_CT32B1 && !defined(__DOXYGEN__) +extern GPTDriver GPTD4; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + void gpt_lld_init(void); + void gpt_lld_start(GPTDriver *gptp); + void gpt_lld_stop(GPTDriver *gptp); + void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t period); + void gpt_lld_stop_timer(GPTDriver *gptp); + void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_GPT */ + +#endif /* _GPT_LLD_H_ */ + +/** @} */ diff --git a/os/hal/platforms/LPC11xx/platform.dox b/os/hal/platforms/LPC11xx/platform.dox index ec9ac59af..47b9273e9 100644 --- a/os/hal/platforms/LPC11xx/platform.dox +++ b/os/hal/platforms/LPC11xx/platform.dox @@ -42,6 +42,24 @@ * @ingroup LPC11xx */ +/** + * @defgroup LPC11xx_GPT LPC11xx GPT Support + * @details The LPC11xx GPT driver uses the CTxxBy peripherals. + * + * @section lpc11xx_gpt_1 Supported HW resources + * - CT16B0. + * - CT16B1. + * - CT32B0. + * - CT32B1. + * . + * @section lpc11xx_gpt_2 LPC11xx GPT driver implementation features + * - Each timer can be independently enabled and programmed. Unused + * peripherals are left in low power mode. + * - Programmable TIMx interrupts priority level. + * . + * @ingroup LPC11xx + */ + /** * @defgroup LPC11xx_PAL LPC11xx PAL Support * @details The LPC11xx PAL driver uses the GPIO peripherals. diff --git a/os/hal/platforms/LPC11xx/platform.mk b/os/hal/platforms/LPC11xx/platform.mk index ade33695f..4f0d19547 100644 --- a/os/hal/platforms/LPC11xx/platform.mk +++ b/os/hal/platforms/LPC11xx/platform.mk @@ -1,5 +1,6 @@ # List of all the LPC11xx platform files. PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/LPC11xx/hal_lld.c \ + ${CHIBIOS}/os/hal/platforms/LPC11xx/gpt_lld.c \ ${CHIBIOS}/os/hal/platforms/LPC11xx/pal_lld.c \ ${CHIBIOS}/os/hal/platforms/LPC11xx/serial_lld.c \ ${CHIBIOS}/os/hal/platforms/LPC11xx/spi_lld.c diff --git a/readme.txt b/readme.txt index ff67c98bc..1369f73d1 100644 --- a/readme.txt +++ b/readme.txt @@ -103,7 +103,7 @@ - NEW: Added STM32 USB CDC loopback test application. - NEW: Added new GPT driver model, General Purpose Timer. The driver allows to access the available timers in an abstract way. -- NEW: GTP driver implementation for STM32. +- NEW: GTP driver implementation for STM32 and LPC11xx. - NEW: Added STM32 GPT test application. - NEW: Implemented new event IO_TRANSMISSION_END in the generic serial driver. This event marks the physical transmission end of a data stream. -- cgit v1.2.3 From d0354e88078731263e433634997a9ff0f91dee34 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Mar 2011 19:28:54 +0000 Subject: IRQ STORM test demo for LPC11xx. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2795 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 6 +- testhal/LPC11xx/IRQ_STORM/Makefile | 191 +++++++++++++ testhal/LPC11xx/IRQ_STORM/ch.ld | 113 ++++++++ testhal/LPC11xx/IRQ_STORM/chconf.h | 507 +++++++++++++++++++++++++++++++++++ testhal/LPC11xx/IRQ_STORM/halconf.h | 280 +++++++++++++++++++ testhal/LPC11xx/IRQ_STORM/main.c | 321 ++++++++++++++++++++++ testhal/LPC11xx/IRQ_STORM/mcuconf.h | 82 ++++++ testhal/LPC11xx/IRQ_STORM/readme.txt | 25 ++ 8 files changed, 1522 insertions(+), 3 deletions(-) create mode 100644 testhal/LPC11xx/IRQ_STORM/Makefile create mode 100644 testhal/LPC11xx/IRQ_STORM/ch.ld create mode 100644 testhal/LPC11xx/IRQ_STORM/chconf.h create mode 100644 testhal/LPC11xx/IRQ_STORM/halconf.h create mode 100644 testhal/LPC11xx/IRQ_STORM/main.c create mode 100644 testhal/LPC11xx/IRQ_STORM/mcuconf.h create mode 100644 testhal/LPC11xx/IRQ_STORM/readme.txt diff --git a/readme.txt b/readme.txt index 1369f73d1..a8486d91b 100644 --- a/readme.txt +++ b/readme.txt @@ -84,9 +84,9 @@ 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). -- NEW: Added an "IRQ STORM" long duration test for the STM32. The test - demonstrates the system stability in a thread-intensive, progressively - CPU saturating, IRQ intensive long duration test. +- NEW: Added "IRQ STORM" long duration tests for the STM32 and LPC11xx. The + test demonstrates the system stability in a thread-intensive, progressively + CPU-saturating, IRQ-intensive long duration test. - NEW: Added two new functions to the events subsystem: chEvtBroadcastFlags() and chEvtBroadcastFlagsI(). The old chEvtBroadcast() and chEvtBroadcastI() become macros. The new functions allow to add the same flags to all the diff --git a/testhal/LPC11xx/IRQ_STORM/Makefile b/testhal/LPC11xx/IRQ_STORM/Makefile new file mode 100644 index 000000000..2f65b9fe4 --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/Makefile @@ -0,0 +1,191 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/EA_LPCXPRESSO_BB_1114/board.mk +include $(CHIBIOS)/os/hal/platforms/LPC11xx/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC11xx/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m0 + +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = -DLPC1114 -D__NEWLIB__ + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/testhal/LPC11xx/IRQ_STORM/ch.ld b/testhal/LPC11xx/IRQ_STORM/ch.ld new file mode 100644 index 000000000..44f494121 --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/ch.ld @@ -0,0 +1,113 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/LPC11xx/IRQ_STORM/chconf.h b/testhal/LPC11xx/IRQ_STORM/chconf.h new file mode 100644 index 000000000..3353391ca --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/chconf.h @@ -0,0 +1,507 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h new file mode 100644 index 000000000..70c240431 --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -0,0 +1,280 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/LPC11xx/IRQ_STORM/main.c b/testhal/LPC11xx/IRQ_STORM/main.c new file mode 100644 index 000000000..1fcec7268 --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/main.c @@ -0,0 +1,321 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +#include "ch.h" +#include "hal.h" + +/*===========================================================================*/ +/* Configurable settings. */ +/*===========================================================================*/ + +#ifndef RANDOMIZE +#define RANDOMIZE FALSE +#endif + +#ifndef ITERATIONS +#define ITERATIONS 100 +#endif + +#ifndef NUM_THREADS +#define NUM_THREADS 4 +#endif + +#ifndef MAILBOX_SIZE +#define MAILBOX_SIZE 4 +#endif + +/*===========================================================================*/ +/* Test related code. */ +/*===========================================================================*/ + +#define MSG_SEND_LEFT 0 +#define MSG_SEND_RIGHT 1 + +static bool_t saturated; + +/* + * Mailboxes and buffers. + */ +static Mailbox mb[NUM_THREADS]; +static msg_t b[NUM_THREADS][MAILBOX_SIZE]; + +/* + * Test worker threads. + */ +static WORKING_AREA(waWorkerThread[NUM_THREADS], 128); +static msg_t WorkerThread(void *arg) { + static volatile unsigned x = 0; + static unsigned cnt = 0; + unsigned me = (unsigned)arg; + unsigned target; + unsigned r; + msg_t msg; + + /* Work loop.*/ + while (TRUE) { + /* Waiting for a message.*/ + chMBFetch(&mb[me], &msg, TIME_INFINITE); + +#if RANDOMIZE + /* Pseudo-random delay.*/ + { + chSysLock(); + r = rand() & 15; + chSysUnlock(); + while (r--) + x++; + } +#else + /* Fixed delay.*/ + { + r = me >> 4; + while (r--) + x++; + } +#endif + + /* Deciding in which direction to re-send the message.*/ + if (msg == MSG_SEND_LEFT) + target = me - 1; + else + target = me + 1; + + if (target < NUM_THREADS) { + /* If this thread is not at the end of a chain re-sending the message, + note this check works because the variable target is unsigned.*/ + msg = chMBPost(&mb[target], msg, TIME_IMMEDIATE); + if (msg != RDY_OK) + saturated = TRUE; + } + else { + /* Provides a visual feedback about the system.*/ + if (++cnt >= 500) { + cnt = 0; + palTogglePad(GPIO0, GPIO0_LED2); + } + } + } +} + +/* + * GPT1 callback. + */ +static void gpt1cb(GPTDriver *gptp) { + msg_t msg; + + (void)gptp; + chSysLockFromIsr(); + msg = chMBPostI(&mb[0], MSG_SEND_RIGHT); + if (msg != RDY_OK) + saturated = TRUE; + chSysUnlockFromIsr(); +} + +/* + * GPT2 callback. + */ +static void gpt2cb(GPTDriver *gptp) { + msg_t msg; + + (void)gptp; + chSysLockFromIsr(); + msg = chMBPostI(&mb[NUM_THREADS - 1], MSG_SEND_LEFT); + if (msg != RDY_OK) + saturated = TRUE; + chSysUnlockFromIsr(); +} + +/* + * GPT1 configuration. + */ +static const GPTConfig gpt1cfg = { + 1000000, /* 1MHz timer clock.*/ + gpt1cb /* Timer callback.*/ +}; + +/* + * GPT2 configuration. + */ +static const GPTConfig gpt2cfg = { + 1000000, /* 1MHz timer clock.*/ + gpt2cb /* Timer callback.*/ +}; + + +/*===========================================================================*/ +/* Generic demo code. */ +/*===========================================================================*/ + +static void print(char *p) { + + while (*p) { + chIOPut(&SD1, *p++); + } +} + +static void println(char *p) { + + while (*p) { + chIOPut(&SD1, *p++); + } + chIOWriteTimeout(&SD1, (uint8_t *)"\r\n", 2, TIME_INFINITE); +} + +static void printn(uint32_t n) { + char buf[16], *p; + + if (!n) + chIOPut(&SD1, '0'); + else { + p = buf; + while (n) + *p++ = (n % 10) + '0', n /= 10; + while (p > buf) + chIOPut(&SD1, *--p); + } +} + +/* + * Application entry point. + */ +int main(void) { + unsigned i; + gptcnt_t interval, threshold, worst; + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Prepares the Serial driver 2 and GPT drivers 1 and 2. + */ + sdStart(&SD1, NULL); /* Default is 38400-8-N-1.*/ + gptStart(&GPTD1, &gpt1cfg); + gptStart(&GPTD2, &gpt2cfg); + + /* + * Initializes the mailboxes and creates the worker threads. + */ + for (i = 0; i < NUM_THREADS; i++) { + chMBInit(&mb[i], b[i], MAILBOX_SIZE); + chThdCreateStatic(waWorkerThread[i], sizeof waWorkerThread[i], + NORMALPRIO - 20, WorkerThread, (void *)i); + } + + /* + * Test procedure. + */ + println(""); + println("*** ChibiOS/RT IRQ-STORM long duration test"); + println("***"); + print("*** Kernel: "); + println(CH_KERNEL_VERSION); +#ifdef __GNUC__ + print("*** GCC Version: "); + println(__VERSION__); +#endif + print("*** Architecture: "); + println(CH_ARCHITECTURE_NAME); +#ifdef CH_CORE_VARIANT_NAME + print("*** Core Variant: "); + println(CH_CORE_VARIANT_NAME); +#endif +#ifdef PLATFORM_NAME + print("*** Platform: "); + println(PLATFORM_NAME); +#endif +#ifdef BOARD_NAME + print("*** Test Board: "); + println(BOARD_NAME); +#endif + println("***"); + print("*** System Clock: "); + printn(LPC11xx_SYSCLK); + println(""); + print("*** Iterations: "); + printn(ITERATIONS); + println(""); + print("*** Randomize: "); + printn(RANDOMIZE); + println(""); + print("*** Threads: "); + printn(NUM_THREADS); + println(""); + print("*** Mailbox size: "); + printn(MAILBOX_SIZE); + println(""); + + println(""); + worst = 0; + for (i = 1; i <= ITERATIONS; i++){ + print("Iteration "); + printn(i); + println(""); + saturated = FALSE; + threshold = 0; + for (interval = 2000; interval >= 20; interval -= interval / 10) { + gptStartContinuous(&GPTD1, interval - 1); /* Slightly out of phase.*/ + gptStartContinuous(&GPTD2, interval + 1); /* Slightly out of phase.*/ + chThdSleepMilliseconds(1000); + gptStopTimer(&GPTD1); + gptStopTimer(&GPTD2); + if (!saturated) + print("."); + else { + print("#"); + if (threshold == 0) + threshold = interval; + } + } + /* Gives the worker threads a chance to empty the mailboxes before next + cycle.*/ + chThdSleepMilliseconds(20); + println(""); + print("Saturated at "); + printn(threshold); + println(" uS"); + println(""); + if (threshold > worst) + worst = threshold; + } + gptStopTimer(&GPTD1); + gptStopTimer(&GPTD2); + + print("Worst case at "); + printn(worst); + println(" uS"); + println(""); + println("Test Complete"); + + /* + * Normal main() thread activity, nothing in this test. + */ + while (TRUE) { + chThdSleepMilliseconds(5000); + } + return 0; +} diff --git a/testhal/LPC11xx/IRQ_STORM/mcuconf.h b/testhal/LPC11xx/IRQ_STORM/mcuconf.h new file mode 100644 index 000000000..189e5f6b7 --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/mcuconf.h @@ -0,0 +1,82 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * LPC1114 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the driver + * is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...highest. + */ + +/* + * HAL driver system settings. + */ +#define LPC11xx_PLLCLK_SOURCE SYSPLLCLKSEL_SYSOSC +#define LPC11xx_SYSPLL_MUL 4 +#define LPC11xx_SYSPLL_DIV 4 +#define LPC11xx_MAINCLK_SOURCE SYSMAINCLKSEL_PLLOUT +#define LPC11xx_SYSABHCLK_DIV 1 + +/* + * ADC driver system settings. + */ + +/* + * CAN driver system settings. + */ + +/* + * GPT driver system settings. + */ +#define LPC11xx_GPT_USE_CT16B0 TRUE +#define LPC11xx_GPT_USE_CT16B1 TRUE +#define LPC11xx_GPT_USE_CT32B0 TRUE +#define LPC11xx_GPT_USE_CT32B1 TRUE +#define LPC11xx_GPT_CT16B0_IRQ_PRIORITY 0 +#define LPC11xx_GPT_CT16B1_IRQ_PRIORITY 1 +#define LPC11xx_GPT_CT32B0_IRQ_PRIORITY 2 +#define LPC11xx_GPT_CT32B1_IRQ_PRIORITY 2 + +/* + * PWM driver system settings. + */ + +/* + * SERIAL driver system settings. + */ +#define LPC11xx_SERIAL_USE_UART0 TRUE +#define LPC11xx_SERIAL_FIFO_PRELOAD 16 +#define LPC11xx_SERIAL_UART0CLKDIV 1 +#define LPC11xx_SERIAL_UART0_IRQ_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define LPC11xx_SPI_USE_SSP0 TRUE +#define LPC11xx_SPI_USE_SSP1 FALSE +#define LPC11xx_SPI_SSP0CLKDIV 1 +#define LPC11xx_SPI_SSP1CLKDIV 1 +#define LPC11xx_SPI_SSP0_IRQ_PRIORITY 1 +#define LPC11xx_SPI_SSP1_IRQ_PRIORITY 1 +#define LPC11xx_SPI_SSP_ERROR_HOOK(spip) chSysHalt() +#define LPC11xx_SPI_SCK0_SELECTOR SCK0_IS_PIO2_11 diff --git a/testhal/LPC11xx/IRQ_STORM/readme.txt b/testhal/LPC11xx/IRQ_STORM/readme.txt new file mode 100644 index 000000000..cf0e9246b --- /dev/null +++ b/testhal/LPC11xx/IRQ_STORM/readme.txt @@ -0,0 +1,25 @@ +***************************************************************************** +** ChibiOS/RT HAL - IRQ-STORM demo for LPC11xx. ** +***************************************************************************** + +** TARGET ** + +The demo will on an LPCXpresso LPC1114 board. + +** The Demo ** + +The application demonstrates the use of the LPC11xx GPT, PAL and Serial drivers +in order to implement a system stress demo. + +** Build Procedure ** + +The demo has been tested by using the free LPCXpresso toolchain but also with +Codesourcery and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +NXP and are licensed under a different license. + + http://www.nxp.com -- cgit v1.2.3 From 645fce5f28b5d62b682657ec8d6c3fcf775b9f08 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Mar 2011 21:50:36 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2796 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/LPC11xx/IRQ_STORM/ch.ld | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testhal/LPC11xx/IRQ_STORM/ch.ld b/testhal/LPC11xx/IRQ_STORM/ch.ld index 44f494121..0eff7df98 100644 --- a/testhal/LPC11xx/IRQ_STORM/ch.ld +++ b/testhal/LPC11xx/IRQ_STORM/ch.ld @@ -18,16 +18,16 @@ */ /* - * ST32F103 memory setup. + * LPC1114 memory setup. */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; +__main_stack_size__ = 0x0100; +__process_stack_size__ = 0x0100; __stacks_total_size__ = __main_stack_size__ + __process_stack_size__; MEMORY { - flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 20k + flash : org = 0x00000000, len = 32k + ram : org = 0x10000000, len = 8k } __ram_start__ = ORIGIN(ram); -- cgit v1.2.3 From 3cc5ac6d9a6555ba70ea83c9eb9cae1bb1f44fd9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 08:02:26 +0000 Subject: Improved preemption for Cortex-M0 port. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2797 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-GCC.txt | 2 +- os/ports/GCC/ARMCMx/chcore_v6m.c | 54 ++++++++++++++++++---------------------- os/ports/GCC/ARMCMx/chcore_v6m.h | 30 ++++++++-------------- readme.txt | 3 +++ 4 files changed, 39 insertions(+), 50 deletions(-) diff --git a/docs/reports/LPC1114-48-GCC.txt b/docs/reports/LPC1114-48-GCC.txt index 87dd7dbbe..32ea4154e 100644 --- a/docs/reports/LPC1114-48-GCC.txt +++ b/docs/reports/LPC1114-48-GCC.txt @@ -126,7 +126,7 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 253328 ctxswc/S +--- Score : 253332 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index 4e49e6256..5004b2256 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -27,11 +27,6 @@ #include "ch.h" -/** - * @brief PC register temporary storage. - */ -regarm_t _port_saved_pc; - /** * @brief System Timer vector. * @details This interrupt is used as system tick. @@ -48,40 +43,39 @@ CH_IRQ_HANDLER(SysTickVector) { CH_IRQ_EPILOGUE(); } +/** + * @brief NMI vector. + * @details The NMI vector is used for exception mode re-entering after a + * context switch. + */ +void NMIVector(void) { + register struct extctx *ctxp; + + /* Discarding the current exception context and positioning the stack to + point to the real one.*/ + asm volatile ("mrs %0, PSP" : "=r" (ctxp) : : "memory"); + ctxp++; + asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); + port_unlock_from_isr(); +} + /** * @brief Post-IRQ switch code. - * @details On entry the stack and the registers are restored by the exception - * return, the PC value is stored in @p _port_saved_pc, the interrupts - * are disabled. + * @details The switch is performed in thread context then an NMI exception + * is enforced in order to return to the exact point before the + * preemption. */ #if !defined(__DOXYGEN__) __attribute__((naked)) #endif void _port_switch_from_isr(void) { - /* Note, saves r4 to make space for the PC.*/ - asm volatile ("push {r0, r1, r2, r3, r4} \n\t" - "mrs r0, APSR \n\t" - "mov r1, r12 \n\t" - "push {r0, r1, lr} \n\t" - "ldr r0, =_port_saved_pc \n\t" - "ldr r0, [r0] \n\t" - "add r0, r0, #1 \n\t" - "str r0, [sp, #28]" : : : "memory"); chSchDoRescheduleI(); - - /* Note, the last register is restored alone after re-enabling the - interrupts in order to minimize the (very remote and unlikely) - possibility that the stack is filled by continuous and saturating - interrupts that would not allow that last words to be pulled out of - the stack.*/ - asm volatile ("pop {r0, r1, r2} \n\t" - "mov r12, r1 \n\t" - "msr APSR, r0 \n\t" - "mov lr, r2 \n\t" - "pop {r0, r1, r2, r3} \n\t" - "cpsie i \n\t" - "pop {pc}" : : : "memory"); + SCB_ICSR = ICSR_NMIPENDSET; + /* The following loop should never be executed, the NMI will kick in + immediately.*/ + while (TRUE) + ; } #define PUSH_CONTEXT(sp) { \ diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index bb20cb4be..89fbdbec6 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -32,10 +32,8 @@ /* Port implementation part. */ /*===========================================================================*/ -/** - * @brief Cortex-Mx exception context. - */ -struct cmxctx { +#if !defined(__DOXYGEN__) +struct extctx { regarm_t r0; regarm_t r1; regarm_t r2; @@ -46,18 +44,6 @@ struct cmxctx { regarm_t xpsr; }; -#if !defined(__DOXYGEN__) -struct extctx { - regarm_t xpsr; - regarm_t r12; - regarm_t lr; - regarm_t r0; - regarm_t r1; - regarm_t r2; - regarm_t r3; - regarm_t pc; -}; - struct intctx { regarm_t r8; regarm_t r9; @@ -131,11 +117,17 @@ struct intctx { if (_saved_lr != (regarm_t)0xFFFFFFF1) { \ port_lock_from_isr(); \ if (chSchIsRescRequiredExI()) { \ - register struct cmxctx *ctxp; \ + register struct extctx *ctxp; \ \ - asm volatile ("mrs %0, PSP" : "=r" (ctxp) : ); \ - _port_saved_pc = ctxp->pc; \ + /* Adding an artificial exception return context, there is no need to \ + populate it fully.*/ \ + asm volatile ("mrs %0, PSP" : "=r" (ctxp) : : "memory"); \ + ctxp--; \ + asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); \ ctxp->pc = _port_switch_from_isr; \ + ctxp->xpsr = (regarm_t)0x01000000; \ + /* Note, returning without unlocking is intentional, this is done in \ + order to keep the rest of the context switching atomic.*/ \ return; \ } \ port_unlock_from_isr(); \ diff --git a/readme.txt b/readme.txt index a8486d91b..c0754c136 100644 --- a/readme.txt +++ b/readme.txt @@ -84,6 +84,9 @@ 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). +- NEW: Inproved preemption implementation for the Cortex-M0, now it uses + the NMI vector in order to restore the original context. The change makes + IRQ handling faster and also saves some RAM/ROM space (backported to 2.2.3). - NEW: Added "IRQ STORM" long duration tests for the STM32 and LPC11xx. The test demonstrates the system stability in a thread-intensive, progressively CPU-saturating, IRQ-intensive long duration test. -- cgit v1.2.3 From 9f8702a2a0bb074eb79a5804db2ff935849307df Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 08:05:01 +0000 Subject: Removed an obsolete extern declaration. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2798 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore_v6m.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 89fbdbec6..4e156f4c4 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -218,10 +218,6 @@ struct intctx { #define port_wait_for_interrupt() #endif -#if !defined(__DOXYGEN__) -extern regarm_t _port_saved_pc; -#endif - #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3 From 5ab1f418c84cb003a2bf65bd66758bd0abacb08b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 08:46:51 +0000 Subject: LPC13xx GPT driver added (not tested yet). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2799 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h | 12 ++ os/hal/platforms/LPC11xx/platform.dox | 2 +- os/hal/platforms/LPC13xx/gpt_lld.c | 341 ++++++++++++++++++++++++++++++ os/hal/platforms/LPC13xx/gpt_lld.h | 223 +++++++++++++++++++ os/hal/platforms/LPC13xx/platform.dox | 18 ++ os/hal/platforms/LPC13xx/platform.mk | 1 + 6 files changed, 596 insertions(+), 1 deletion(-) create mode 100644 os/hal/platforms/LPC13xx/gpt_lld.c create mode 100644 os/hal/platforms/LPC13xx/gpt_lld.h diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h index f5d119449..195eb6c6a 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h @@ -45,6 +45,18 @@ * CAN driver system settings. */ +/* + * GPT driver system settings. + */ +#define LPC13xx_GPT_USE_CT16B0 TRUE +#define LPC13xx_GPT_USE_CT16B1 TRUE +#define LPC13xx_GPT_USE_CT32B0 TRUE +#define LPC13xx_GPT_USE_CT32B1 TRUE +#define LPC13xx_GPT_CT16B0_IRQ_PRIORITY 2 +#define LPC13xx_GPT_CT16B1_IRQ_PRIORITY 2 +#define LPC13xx_GPT_CT32B0_IRQ_PRIORITY 2 +#define LPC13xx_GPT_CT32B1_IRQ_PRIORITY 2 + /* * PWM driver system settings. */ diff --git a/os/hal/platforms/LPC11xx/platform.dox b/os/hal/platforms/LPC11xx/platform.dox index 47b9273e9..405ed8ee3 100644 --- a/os/hal/platforms/LPC11xx/platform.dox +++ b/os/hal/platforms/LPC11xx/platform.dox @@ -55,7 +55,7 @@ * @section lpc11xx_gpt_2 LPC11xx GPT driver implementation features * - Each timer can be independently enabled and programmed. Unused * peripherals are left in low power mode. - * - Programmable TIMx interrupts priority level. + * - Programmable CTxxBy interrupts priority level. * . * @ingroup LPC11xx */ diff --git a/os/hal/platforms/LPC13xx/gpt_lld.c b/os/hal/platforms/LPC13xx/gpt_lld.c new file mode 100644 index 000000000..e6a112d61 --- /dev/null +++ b/os/hal/platforms/LPC13xx/gpt_lld.c @@ -0,0 +1,341 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file LPC13xx/gpt_lld.c + * @brief LPC13xx GPT subsystem low level driver source. + * + * @addtogroup GPT + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/** + * @brief GPT1 driver identifier. + * @note The driver GPT1 allocates the complex timer CT16B0 when enabled. + */ +#if LPC13xx_GPT_USE_CT16B0 || defined(__DOXYGEN__) +GPTDriver GPTD1; +#endif + +/** + * @brief GPT2 driver identifier. + * @note The driver GPT2 allocates the timer CT16B1 when enabled. + */ +#if LPC13xx_GPT_USE_CT16B1 || defined(__DOXYGEN__) +GPTDriver GPTD2; +#endif + +/** + * @brief GPT3 driver identifier. + * @note The driver GPT3 allocates the timer CT32B0 when enabled. + */ +#if LPC13xx_GPT_USE_CT32B0 || defined(__DOXYGEN__) +GPTDriver GPTD3; +#endif + +/** + * @brief GPT4 driver identifier. + * @note The driver GPT4 allocates the timer CT32B1 when enabled. + */ +#if LPC13xx_GPT_USE_CT32B1 || defined(__DOXYGEN__) +GPTDriver GPTD4; +#endif + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/** + * @brief Shared IRQ handler. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +static void gpt_lld_serve_interrupt(GPTDriver *gptp) { + + gptp->tmr->IR = 1; /* Clear interrupt on match MR0.*/ + if (gptp->state == GPT_ONESHOT) { + gptp->state = GPT_READY; /* Back in GPT_READY state. */ + gpt_lld_stop_timer(gptp); /* Timer automatically stopped. */ + } + gptp->config->callback(gptp); +} + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +#if LPC13xx_GPT_USE_CT16B0 +/** + * @brief CT16B0 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(VectorE4) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD1); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC13xx_GPT_USE_CT16B0 */ + +#if LPC13xx_GPT_USE_CT16B1 +/** + * @brief CT16B1 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(VectorE8) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD2); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC13xx_GPT_USE_CT16B0 */ + +#if LPC13xx_GPT_USE_CT32B0 +/** + * @brief CT32B0 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(VectorEC) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD3); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC13xx_GPT_USE_CT32B0 */ + +#if LPC13xx_GPT_USE_CT32B1 +/** + * @brief CT32B1 interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(VectorF0) { + + CH_IRQ_PROLOGUE(); + + gpt_lld_serve_interrupt(&GPTD4); + + CH_IRQ_EPILOGUE(); +} +#endif /* LPC13xx_GPT_USE_CT32B1 */ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level GPT driver initialization. + * + * @notapi + */ +void gpt_lld_init(void) { + +#if LPC13xx_GPT_USE_CT16B0 + /* Driver initialization.*/ + GPTD1.tmr = LPC_TMR16B0; + gptObjectInit(&GPTD1); +#endif + +#if LPC13xx_GPT_USE_CT16B1 + /* Driver initialization.*/ + GPTD2.tmr = LPC_TMR16B1; + gptObjectInit(&GPTD2); +#endif + +#if LPC13xx_GPT_USE_CT32B0 + /* Driver initialization.*/ + GPTD3.tmr = LPC_TMR32B0; + gptObjectInit(&GPTD3); +#endif + +#if LPC13xx_GPT_USE_CT32B1 + /* Driver initialization.*/ + GPTD4.tmr = LPC_TMR32B1; + gptObjectInit(&GPTD4); +#endif +} + +/** + * @brief Configures and activates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_start(GPTDriver *gptp) { + uint32_t pr; + + if (gptp->state == GPT_STOP) { + /* Clock activation.*/ +#if LPC13xx_GPT_USE_CT16B0 + if (&GPTD1 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 7); + NVICEnableVector(TIMER_16_0_IRQn, CORTEX_PRIORITY_MASK(2)); + } +#endif +#if LPC13xx_GPT_USE_CT16B1 + if (&GPTD2 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 8); + NVICEnableVector(TIMER_16_1_IRQn, CORTEX_PRIORITY_MASK(3)); + } +#endif +#if LPC13xx_GPT_USE_CT32B0 + if (&GPTD3 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 9); + NVICEnableVector(TIMER_32_0_IRQn, CORTEX_PRIORITY_MASK(2)); + } +#endif +#if LPC13xx_GPT_USE_CT32B1 + if (&GPTD4 == gptp) { + LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 10); + NVICEnableVector(TIMER_32_1_IRQn, CORTEX_PRIORITY_MASK(2)); + } +#endif + } + + /* Prescaler value calculation.*/ + pr = (uint16_t)((LPC13xx_SYSCLK / gptp->config->frequency) - 1); + chDbgAssert(((uint32_t)(pr + 1) * gptp->config->frequency) == LPC13xx_SYSCLK, + "gpt_lld_start(), #1", "invalid frequency"); + + /* Timer configuration.*/ + gptp->tmr->PR = pr; + gptp->tmr->IR = 1; + gptp->tmr->MCR = 0; + gptp->tmr->TCR = 0; +} + +/** + * @brief Deactivates the GPT peripheral. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop(GPTDriver *gptp) { + + if (gptp->state == GPT_READY) { + gptp->tmr->MCR = 0; + gptp->tmr->TCR = 0; + +#if LPC13xx_GPT_USE_CT16B0 + if (&GPTD1 == gptp) { + NVICDisableVector(TIMER_16_0_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 7); + } +#endif +#if LPC13xx_GPT_USE_CT16B1 + if (&GPTD2 == gptp) { + NVICDisableVector(TIMER_16_1_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 8); + } +#endif +#if LPC13xx_GPT_USE_CT32B0 + if (&GPTD3 == gptp) { + NVICDisableVector(TIMER_32_0_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 9); + } +#endif +#if LPC13xx_GPT_USE_CT32B1 + if (&GPTD4 == gptp) { + NVICDisableVector(TIMER_32_1_IRQn); + LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 10); + } +#endif + } +} + +/** + * @brief Starts the timer in continuous mode. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval period in ticks + * + * @notapi + */ +void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) { + + gptp->tmr->MR0 = interval - 1; + gptp->tmr->IR = 1; + gptp->tmr->MCR = 3; /* IRQ and clr TC on match MR0. */ + gptp->tmr->TCR = 2; /* Reset counter and prescaler. */ + gptp->tmr->TCR = 1; /* Timer enabled. */ +} + +/** + * @brief Stops the timer. + * + * @param[in] gptp pointer to the @p GPTDriver object + * + * @notapi + */ +void gpt_lld_stop_timer(GPTDriver *gptp) { + + gptp->tmr->IR = 1; + gptp->tmr->MCR = 0; + gptp->tmr->TCR = 0; +} + +/** + * @brief Starts the timer in one shot mode and waits for completion. + * @details This function specifically polls the timer waiting for completion + * in order to not have extra delays caused by interrupt servicing, + * this function is only recommended for short delays. + * + * @param[in] gptp pointer to the @p GPTDriver object + * @param[in] interval time interval in ticks + * + * @notapi + */ +void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) { + + gptp->tmr->MR0 = interval - 1; + gptp->tmr->IR = 1; + gptp->tmr->MCR = 4; /* Stop TC on match MR0. */ + gptp->tmr->TCR = 2; /* Reset counter and prescaler. */ + gptp->tmr->TCR = 1; /* Timer enabled. */ + while (gptp->tmr->TCR & 1) + ; +} + +#endif /* HAL_USE_GPT */ + +/** @} */ diff --git a/os/hal/platforms/LPC13xx/gpt_lld.h b/os/hal/platforms/LPC13xx/gpt_lld.h new file mode 100644 index 000000000..9be8179c3 --- /dev/null +++ b/os/hal/platforms/LPC13xx/gpt_lld.h @@ -0,0 +1,223 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file LPC13xx/gpt_lld.h + * @brief LPC13xx GPT subsystem low level driver header. + * + * @addtogroup GPT + * @{ + */ + +#ifndef _GPT_LLD_H_ +#define _GPT_LLD_H_ + +#if HAL_USE_GPT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief GPT1 driver enable switch. + * @details If set to @p TRUE the support for GPT1 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC13xx_GPT_USE_CT16B0) || defined(__DOXYGEN__) +#define LPC13xx_GPT_USE_CT16B0 TRUE +#endif + +/** + * @brief GPT2 driver enable switch. + * @details If set to @p TRUE the support for GPT2 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC13xx_GPT_USE_CT16B1) || defined(__DOXYGEN__) +#define LPC13xx_GPT_USE_CT16B1 TRUE +#endif + +/** + * @brief GPT3 driver enable switch. + * @details If set to @p TRUE the support for GPT3 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC13xx_GPT_USE_CT32B0) || defined(__DOXYGEN__) +#define LPC13xx_GPT_USE_CT32B0 TRUE +#endif + +/** + * @brief GPT4 driver enable switch. + * @details If set to @p TRUE the support for GPT4 is included. + * @note The default is @p TRUE. + */ +#if !defined(LPC13xx_GPT_USE_CT32B1) || defined(__DOXYGEN__) +#define LPC13xx_GPT_USE_CT32B1 TRUE +#endif + +/** + * @brief GPT1 interrupt priority level setting. + */ +#if !defined(LPC13xx_GPT_CT16B0_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC13xx_GPT_CT16B0_IRQ_PRIORITY 2 +#endif + +/** + * @brief GPT2 interrupt priority level setting. + */ +#if !defined(LPC13xx_GPT_CT16B1_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC13xx_GPT_CT16B1_IRQ_PRIORITY 2 +#endif + +/** + * @brief GPT3 interrupt priority level setting. + */ +#if !defined(LPC13xx_GPT_CT32B0_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC13xx_GPT_CT32B0_IRQ_PRIORITY 2 +#endif + +/** + * @brief GPT4 interrupt priority level setting. + */ +#if !defined(LPC13xx_GPT_CT32B1_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define LPC13xx_GPT_CT32B1_IRQ_PRIORITY 2 +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +#if !LPC13xx_GPT_USE_CT16B0 && !LPC13xx_GPT_USE_CT16B1 && \ + !LPC13xx_GPT_USE_CT32B0 && !LPC13xx_GPT_USE_CT32B1 +#error "GPT driver activated but no CT peripheral assigned" +#endif + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief GPT frequency type. + */ +typedef uint32_t gptfreq_t; + +/** + * @brief GPT counter type. + */ +typedef uint32_t gptcnt_t; + +/** + * @brief Type of a structure representing a GPT driver. + */ +typedef struct GPTDriver GPTDriver; + +/** + * @brief GPT notification callback type. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +typedef void (*gptcallback_t)(GPTDriver *gptp); + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + gptfreq_t frequency; + /** + * @brief Timer callback pointer. + * @note This callback is invoked on GPT counter events. + */ + gptcallback_t callback; + /* End of the mandatory fields.*/ +} GPTConfig; + +/** + * @brief Structure representing a GPT driver. + */ +struct GPTDriver { + /** + * @brief Driver state. + */ + gptstate_t state; + /** + * @brief Current configuration data. + */ + const GPTConfig *config; + /* End of the mandatory fields.*/ + /** + * @brief Timer base clock. + */ + uint32_t clock; + /** + * @brief Pointer to the CTxxBy registers block. + */ + LPC_TMR_TypeDef *tmr; +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#if LPC13xx_GPT_USE_CT16B0 && !defined(__DOXYGEN__) +extern GPTDriver GPTD1; +#endif + +#if LPC13xx_GPT_USE_CT16B1 && !defined(__DOXYGEN__) +extern GPTDriver GPTD2; +#endif + +#if LPC13xx_GPT_USE_CT32B0 && !defined(__DOXYGEN__) +extern GPTDriver GPTD3; +#endif + +#if LPC13xx_GPT_USE_CT32B1 && !defined(__DOXYGEN__) +extern GPTDriver GPTD4; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + void gpt_lld_init(void); + void gpt_lld_start(GPTDriver *gptp); + void gpt_lld_stop(GPTDriver *gptp); + void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t period); + void gpt_lld_stop_timer(GPTDriver *gptp); + void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_GPT */ + +#endif /* _GPT_LLD_H_ */ + +/** @} */ diff --git a/os/hal/platforms/LPC13xx/platform.dox b/os/hal/platforms/LPC13xx/platform.dox index 54b90b6dd..00715dd9f 100644 --- a/os/hal/platforms/LPC13xx/platform.dox +++ b/os/hal/platforms/LPC13xx/platform.dox @@ -42,6 +42,24 @@ * @ingroup LPC13xx */ +/** + * @defgroup LPC13xx_GPT LPC13xx GPT Support + * @details The LPC13xx GPT driver uses the CTxxBy peripherals. + * + * @section lpc13xx_gpt_1 Supported HW resources + * - CT16B0. + * - CT16B1. + * - CT32B0. + * - CT32B1. + * . + * @section lpc13xx_gpt_2 LPC13xx GPT driver implementation features + * - Each timer can be independently enabled and programmed. Unused + * peripherals are left in low power mode. + * - Programmable CTxxBy interrupts priority level. + * . + * @ingroup LPC13xx + */ + /** * @defgroup LPC13xx_PAL LPC13xx PAL Support * @details The LPC13xx PAL driver uses the GPIO peripherals. diff --git a/os/hal/platforms/LPC13xx/platform.mk b/os/hal/platforms/LPC13xx/platform.mk index 66c39058e..1171af7d7 100644 --- a/os/hal/platforms/LPC13xx/platform.mk +++ b/os/hal/platforms/LPC13xx/platform.mk @@ -1,5 +1,6 @@ # List of all the LPC13xx platform files. PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/LPC13xx/hal_lld.c \ + ${CHIBIOS}/os/hal/platforms/LPC13xx/gpt_lld.c \ ${CHIBIOS}/os/hal/platforms/LPC13xx/pal_lld.c \ ${CHIBIOS}/os/hal/platforms/LPC13xx/serial_lld.c \ ${CHIBIOS}/os/hal/platforms/LPC13xx/spi_lld.c -- cgit v1.2.3 From 18f25c97363ae944c918e2edf134ea990e3183db Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 09:07:41 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2800 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index c0754c136..d5526d2f6 100644 --- a/readme.txt +++ b/readme.txt @@ -106,7 +106,7 @@ - NEW: Added STM32 USB CDC loopback test application. - NEW: Added new GPT driver model, General Purpose Timer. The driver allows to access the available timers in an abstract way. -- NEW: GTP driver implementation for STM32 and LPC11xx. +- NEW: GTP driver implementation for STM32, LPC13xx and LPC11xx. - NEW: Added STM32 GPT test application. - NEW: Implemented new event IO_TRANSMISSION_END in the generic serial driver. This event marks the physical transmission end of a data stream. -- cgit v1.2.3 From 30c73db82fbd034b89094dd58f069be43c1734d2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 09:43:12 +0000 Subject: More Cortex-M0 GCC port improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2801 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-GCC.txt | 24 ++++++++++++------------ os/ports/GCC/ARMCMx/chcore_v6m.c | 27 +++++++++++++++++++++++++++ os/ports/GCC/ARMCMx/chcore_v6m.h | 22 ++-------------------- readme.txt | 4 +++- 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/docs/reports/LPC1114-48-GCC.txt b/docs/reports/LPC1114-48-GCC.txt index 32ea4154e..e5f0a3f3b 100644 --- a/docs/reports/LPC1114-48-GCC.txt +++ b/docs/reports/LPC1114-48-GCC.txt @@ -98,51 +98,51 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 126834 msgs/S, 253668 ctxswc/S +--- Score : 126786 msgs/S, 253572 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 100879 msgs/S, 201758 ctxswc/S +--- Score : 100841 msgs/S, 201682 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 100879 msgs/S, 201758 ctxswc/S +--- Score : 100841 msgs/S, 201682 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 380632 ctxswc/S +--- Score : 380488 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 78390 threads/S +--- Score : 78359 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 110433 threads/S +--- Score : 110391 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 31050 reschedules/S, 186300 ctxswc/S +--- Score : 31038 reschedules/S, 186228 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 253332 ctxswc/S +--- Score : 253236 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 296368 bytes/S +--- Score : 296256 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 350378 timers/S +--- Score : 350246 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 592280 wait+signal/S +--- Score : 592052 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 335036 lock+unlock/S +--- Score : 334912 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index 5004b2256..f132697d5 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -127,6 +127,33 @@ void port_switch(Thread *ntp, Thread *otp) { POP_CONTEXT(r13); } +/** + * @brief IRQ epilogue code. + * + * @param[in] lr value of the @p LR register on ISR entry + */ +void _port_irq_epilogue(regarm_t lr) { + + if (lr != (regarm_t)0xFFFFFFF1) { + port_lock_from_isr(); + if (chSchIsRescRequiredExI()) { + register struct extctx *ctxp; + + /* Adding an artificial exception return context, there is no need to + populate it fully.*/ + asm volatile ("mrs %0, PSP" : "=r" (ctxp) : : "memory"); + ctxp--; + asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); + ctxp->pc = _port_switch_from_isr; + ctxp->xpsr = (regarm_t)0x01000000; + /* Note, returning without unlocking is intentional, this is done in + order to keep the rest of the context switching atomic.*/ + return; + } + port_unlock_from_isr(); + } +} + /** * @brief Start a thread by invoking its work function. * @details If the work function returns @p chThdExit() is automatically diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 4e156f4c4..4cfd7de8a 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -113,26 +113,7 @@ struct intctx { * @details This macro must be inserted at the end of all IRQ handlers * enabled to invoke system APIs. */ -#define PORT_IRQ_EPILOGUE() { \ - if (_saved_lr != (regarm_t)0xFFFFFFF1) { \ - port_lock_from_isr(); \ - if (chSchIsRescRequiredExI()) { \ - register struct extctx *ctxp; \ - \ - /* Adding an artificial exception return context, there is no need to \ - populate it fully.*/ \ - asm volatile ("mrs %0, PSP" : "=r" (ctxp) : : "memory"); \ - ctxp--; \ - asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); \ - ctxp->pc = _port_switch_from_isr; \ - ctxp->xpsr = (regarm_t)0x01000000; \ - /* Note, returning without unlocking is intentional, this is done in \ - order to keep the rest of the context switching atomic.*/ \ - return; \ - } \ - port_unlock_from_isr(); \ - } \ -} +#define PORT_IRQ_EPILOGUE() _port_irq_epilogue(_saved_lr) /** * @brief IRQ handler function declaration. @@ -223,6 +204,7 @@ extern "C" { #endif void port_halt(void); void port_switch(Thread *ntp, Thread *otp); + void _port_irq_epilogue(regarm_t lr); void _port_switch_from_isr(void); void _port_thread_start(void); #ifdef __cplusplus diff --git a/readme.txt b/readme.txt index d5526d2f6..5b0f0865a 100644 --- a/readme.txt +++ b/readme.txt @@ -86,7 +86,9 @@ - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). - NEW: Inproved preemption implementation for the Cortex-M0, now it uses the NMI vector in order to restore the original context. The change makes - IRQ handling faster and also saves some RAM/ROM space (backported to 2.2.3). + IRQ handling faster and also saves some RAM/ROM space. The GCC port code + now does not inline the epilogue code in each ISR saving significan ROM + space for each interrupt handler in the system (backported to 2.2.3). - NEW: Added "IRQ STORM" long duration tests for the STM32 and LPC11xx. The test demonstrates the system stability in a thread-intensive, progressively CPU-saturating, IRQ-intensive long duration test. -- cgit v1.2.3 From 3964ec0195af626e59e6ce9dae1ed003576765ae Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 10:32:00 +0000 Subject: Cortex-M0 improvements for RVCT. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2802 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-RVCT.txt | 26 ++++++++++---------- os/ports/RVCT/ARMCMx/chcore_v6m.c | 5 ---- os/ports/RVCT/ARMCMx/chcore_v6m.h | 22 ++--------------- os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 46 ++++++++++++++++++++---------------- 4 files changed, 40 insertions(+), 59 deletions(-) diff --git a/docs/reports/LPC1114-48-RVCT.txt b/docs/reports/LPC1114-48-RVCT.txt index 1b1015d94..53953ee84 100644 --- a/docs/reports/LPC1114-48-RVCT.txt +++ b/docs/reports/LPC1114-48-RVCT.txt @@ -90,7 +90,7 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. ---------------------------------------------------------------------------- --- Test Case 9.3 (Dynamic APIs, registry and references) --- Result: SUCCESS ----------------------------------------------------------------------------- +--------------------------------------------------------------------------- --- Test Case 10.1 (Queues, input queues) --- Result: SUCCESS ---------------------------------------------------------------------------- @@ -98,51 +98,51 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 119522 msgs/S, 239044 ctxswc/S +--- Score : 121347 msgs/S, 242694 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 102156 msgs/S, 204312 ctxswc/S +--- Score : 102162 msgs/S, 204324 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 102595 msgs/S, 205190 ctxswc/S +--- Score : 102162 msgs/S, 204324 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 375344 ctxswc/S +--- Score : 377584 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 79025 threads/S +--- Score : 78768 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 111705 threads/S +--- Score : 112764 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 33692 reschedules/S, 202152 ctxswc/S +--- Score : 33088 reschedules/S, 198528 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 249324 ctxswc/S +--- Score : 249336 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 264832 bytes/S +--- Score : 270084 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 303508 timers/S +--- Score : 303522 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 614828 wait+signal/S +--- Score : 603212 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 381660 lock+unlock/S +--- Score : 372744 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.c b/os/ports/RVCT/ARMCMx/chcore_v6m.c index db0cf7bf5..94b348140 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.c +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.c @@ -27,11 +27,6 @@ #include "ch.h" -/** - * @brief PC register temporary storage. - */ -regarm_t _port_saved_pc; - /** * @brief System Timer vector. * @details This interrupt is used as system tick. diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 59d5b6af0..df2646c22 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -32,10 +32,8 @@ /* Port implementation part. */ /*===========================================================================*/ -/** - * @brief Cortex-Mx exception context. - */ -struct cmxctx { +#if !defined(__DOXYGEN__) +struct extctx { regarm_t r0; regarm_t r1; regarm_t r2; @@ -46,18 +44,6 @@ struct cmxctx { regarm_t xpsr; }; -#if !defined(__DOXYGEN__) -struct extctx { - regarm_t xpsr; - regarm_t r12; - regarm_t lr; - regarm_t r0; - regarm_t r1; - regarm_t r2; - regarm_t r3; - regarm_t pc; -}; - struct intctx { regarm_t r8; regarm_t r9; @@ -223,10 +209,6 @@ struct intctx { */ #define port_switch(ntp, otp) _port_switch(ntp, otp) -#if !defined(__DOXYGEN__) -extern regarm_t _port_saved_pc; -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index a789e4a0e..44691cd99 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -27,6 +27,7 @@ EXTCTX_SIZE EQU 32 CONTEXT_OFFSET EQU 12 +SCB_ICSR EQU 0xE000ED04 PRESERVE8 THUMB @@ -35,8 +36,6 @@ CONTEXT_OFFSET EQU 12 IMPORT chThdExit IMPORT chSchIsRescRequiredExI IMPORT chSchDoRescheduleI - IMPORT _port_saved_pc - IMPORT _port_irq_nesting /* * Performs a context switch between two threads. @@ -73,29 +72,32 @@ _port_thread_start PROC bl chThdExit ENDP +/* + * NMI vector. + * The NMI vector is used for exception mode re-entering after a context + * switch. + */ + EXPORT NMIVector +NMIVector PROC + mrs r3, PSP + adds r3, r3, #32 + msr PSP, r3 + cpsie i + bx lr + ENDP + /* * Post-IRQ switch code. * Exception handlers return here for context switching. */ EXPORT _port_switch_from_isr _port_switch_from_isr PROC - /* Note, saves r4 to make space for the PC.*/ - push {r0, r1, r2, r3, r4} - mrs r0, APSR - mov r1, r12 - push {r0, r1, lr} - ldr r0, =_port_saved_pc - ldr r0, [r0] - adds r0, r0, #1 - str r0, [sp, #28] bl chSchDoRescheduleI - pop {r0, r1, r2} - mov r12, r1 - msr APSR, r0 - mov lr, r2 - pop {r0, r1, r2, r3} - cpsie i - pop {pc} + movs r3, #128 + lsls r3, r3, #24 + ldr r2, =SCB_ICSR + str r3, [r2, #0] +_waitnmi b _waitnmi ENDP /* @@ -115,11 +117,13 @@ stillnested pop {r3, pc} doresch mrs r3, PSP - ldr r2, =_port_saved_pc - ldr r1, [r3, #24] - str r1, [r2] + subs r3, r3, #32 + msr PSP, r3 ldr r2, =_port_switch_from_isr str r2, [r3, #24] + movs r2, #128 + lsls r2, r2, #17 + str r2, [r3, #28] pop {r3, pc} ENDP -- cgit v1.2.3 From f26704f6eed57f17cb0eb8c1048dc5cfd7ee11a4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 10:39:17 +0000 Subject: Cortex-M0 improvements for IAR port. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2803 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/IAR/ARMCMx/chcore_v6m.c | 5 ---- os/ports/IAR/ARMCMx/chcore_v6m.h | 22 ++-------------- os/ports/IAR/ARMCMx/chcoreasm_v6m.s | 50 ++++++++++++++++++++----------------- 3 files changed, 29 insertions(+), 48 deletions(-) diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.c b/os/ports/IAR/ARMCMx/chcore_v6m.c index d8ede674d..8549393e1 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.c +++ b/os/ports/IAR/ARMCMx/chcore_v6m.c @@ -27,11 +27,6 @@ #include "ch.h" -/** - * @brief PC register temporary storage. - */ -regarm_t _port_saved_pc; - /** * @brief System Timer vector. * @details This interrupt is used as system tick. diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index fdbde0641..e39d6c299 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -32,10 +32,8 @@ /* Port implementation part. */ /*===========================================================================*/ -/** - * @brief Cortex-Mx exception context. - */ -struct cmxctx { +#if !defined(__DOXYGEN__) +struct extctx { regarm_t r0; regarm_t r1; regarm_t r2; @@ -46,18 +44,6 @@ struct cmxctx { regarm_t xpsr; }; -#if !defined(__DOXYGEN__) -struct extctx { - regarm_t xpsr; - regarm_t r12; - regarm_t lr; - regarm_t r0; - regarm_t r1; - regarm_t r2; - regarm_t r3; - regarm_t pc; -}; - struct intctx { regarm_t r8; regarm_t r9; @@ -231,10 +217,6 @@ struct intctx { } #endif -#if !defined(__DOXYGEN__) -extern regarm_t _port_saved_pc; -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s index 5333d4ab9..a0ddb42bc 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s @@ -30,16 +30,15 @@ #define CORTEX_PRIORITY_MASK(n) ((n) << (8 - CORTEX_PRIORITY_BITS)) -EXTCTX_SIZE SET 32 -CONTEXT_OFFSET SET 12 +EXTCTX_SIZE SET 32 +CONTEXT_OFFSET SET 12 +SCB_ICSR SET 0xE000ED04 SECTION .text:CODE:NOROOT(2) EXTERN chThdExit EXTERN chSchIsRescRequiredExI EXTERN chSchDoRescheduleI - EXTERN _port_saved_pc - EXTERN _port_irq_nesting THUMB @@ -76,29 +75,32 @@ _port_thread_start: blx r4 bl chThdExit +/* + * NMI vector. + * The NMI vector is used for exception mode re-entering after a context + * switch. + */ + PUBLIC NMIVector +NMIVector: + mrs r3, PSP + adds r3, r3, #32 + msr PSP, r3 + cpsie i + bx lr + /* * Post-IRQ switch code. * Exception handlers return here for context switching. */ PUBLIC _port_switch_from_isr _port_switch_from_isr: - /* Note, saves r4 to make space for the PC.*/ - push {r0, r1, r2, r3, r4} - mrs r0, APSR - mov r1, r12 - push {r0, r1, lr} - ldr r0, =_port_saved_pc - ldr r0, [r0] - adds r0, r0, #1 - str r0, [sp, #28] bl chSchDoRescheduleI - pop {r0, r1, r2} - mov r12, r1 - msr APSR, r0 - mov lr, r2 - pop {r0, r1, r2, r3} - cpsie i - pop {pc} + movs r3, #128 + lsls r3, r3, #24 + ldr r2, =SCB_ICSR + str r3, [r2, #0] +_waitnmi: + b _waitnmi /* * Reschedule verification and setup after an IRQ. @@ -117,11 +119,13 @@ stillnested pop {r3, pc} doresch mrs r3, PSP - ldr r2, =_port_saved_pc - ldr r1, [r3, #24] - str r1, [r2] + subs r3, r3, #32 + msr PSP, r3 ldr r2, =_port_switch_from_isr str r2, [r3, #24] + movs r2, #128 + lsls r2, r2, #17 + str r2, [r3, #28] pop {r3, pc} END -- cgit v1.2.3 From 734288440851424f50664a6a1495446570c84b32 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 10:54:06 +0000 Subject: IRQ STORM test demo for LPC13xx (GPT tested). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2804 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/LPC13xx/IRQ_STORM/Makefile | 192 +++ testhal/LPC13xx/IRQ_STORM/ch.ld | 113 ++ testhal/LPC13xx/IRQ_STORM/ch.map | 2983 ++++++++++++++++++++++++++++++++++ testhal/LPC13xx/IRQ_STORM/chconf.h | 507 ++++++ testhal/LPC13xx/IRQ_STORM/halconf.h | 280 ++++ testhal/LPC13xx/IRQ_STORM/main.c | 321 ++++ testhal/LPC13xx/IRQ_STORM/mcuconf.h | 79 + testhal/LPC13xx/IRQ_STORM/readme.txt | 25 + 8 files changed, 4500 insertions(+) create mode 100644 testhal/LPC13xx/IRQ_STORM/Makefile create mode 100644 testhal/LPC13xx/IRQ_STORM/ch.ld create mode 100644 testhal/LPC13xx/IRQ_STORM/ch.map create mode 100644 testhal/LPC13xx/IRQ_STORM/chconf.h create mode 100644 testhal/LPC13xx/IRQ_STORM/halconf.h create mode 100644 testhal/LPC13xx/IRQ_STORM/main.c create mode 100644 testhal/LPC13xx/IRQ_STORM/mcuconf.h create mode 100644 testhal/LPC13xx/IRQ_STORM/readme.txt diff --git a/testhal/LPC13xx/IRQ_STORM/Makefile b/testhal/LPC13xx/IRQ_STORM/Makefile new file mode 100644 index 000000000..6d904e8a8 --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/Makefile @@ -0,0 +1,192 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/EA_LPCXPRESSO_BB_1343/board.mk +include $(CHIBIOS)/os/hal/platforms/LPC13xx/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC13xx/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = -DLPC1348 -D__NEWLIB__ + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/testhal/LPC13xx/IRQ_STORM/ch.ld b/testhal/LPC13xx/IRQ_STORM/ch.ld new file mode 100644 index 000000000..83028c619 --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/ch.ld @@ -0,0 +1,113 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * LPC1343 memory setup. + */ +__main_stack_size__ = 0x0100; +__process_stack_size__ = 0x0100; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x00000000, len = 32k + ram : org = 0x10000000, len = 8k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/LPC13xx/IRQ_STORM/ch.map b/testhal/LPC13xx/IRQ_STORM/ch.map new file mode 100644 index 000000000..95c41185f --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/ch.map @@ -0,0 +1,2983 @@ +Archive member included because of file (symbol) + +c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + ../../../os/various/syscalls.o (memset) + +Allocating common symbols +Common symbol size file + +GPTD2 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o +test_timer_done 0x4 ../../../test/test.o +GPTD4 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o +GPTD1 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o +threads 0x14 ../../../test/test.o +test 0x578 ../../../test/test.o +GPTD3 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o +vtlist 0x10 ../../../os/kernel/src/chvt.o +rlist 0x20 ../../../os/kernel/src/chschd.o +_idle_thread_wa 0xa0 ../../../os/kernel/src/chsys.o +SD1 0x74 ../../../os/hal/platforms/LPC13xx/serial_lld.o + +Discarded input sections + + .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o + .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o + .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore.o + .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore.o + .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore.o + .text.port_halt + 0x00000000 0x4 ../../../os/ports/GCC/ARMCMx/chcore.o + .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/nvic.o + .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/nvic.o + .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/nvic.o + .text.NVICDisableVector + 0x00000000 0x3c ../../../os/ports/GCC/ARMCMx/nvic.o + .text 0x00000000 0x0 ../../../os/kernel/src/chsys.o + .data 0x00000000 0x0 ../../../os/kernel/src/chsys.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chsys.o + .text 0x00000000 0x0 ../../../os/kernel/src/chdebug.o + .data 0x00000000 0x0 ../../../os/kernel/src/chdebug.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chdebug.o + .text 0x00000000 0x0 ../../../os/kernel/src/chlists.o + .data 0x00000000 0x0 ../../../os/kernel/src/chlists.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chlists.o + .text 0x00000000 0x0 ../../../os/kernel/src/chvt.o + .data 0x00000000 0x0 ../../../os/kernel/src/chvt.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chvt.o + .text.chTimeIsWithin + 0x00000000 0x34 ../../../os/kernel/src/chvt.o + .text 0x00000000 0x0 ../../../os/kernel/src/chschd.o + .data 0x00000000 0x0 ../../../os/kernel/src/chschd.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chschd.o + .text 0x00000000 0x0 ../../../os/kernel/src/chthreads.o + .data 0x00000000 0x0 ../../../os/kernel/src/chthreads.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chthreads.o + .text.chThdSetPriority + 0x00000000 0x30 ../../../os/kernel/src/chthreads.o + .text.chThdResume + 0x00000000 0x1c ../../../os/kernel/src/chthreads.o + .text.chThdTerminate + 0x00000000 0x18 ../../../os/kernel/src/chthreads.o + .text.chThdSleepUntil + 0x00000000 0x24 ../../../os/kernel/src/chthreads.o + .text.chThdYield + 0x00000000 0x28 ../../../os/kernel/src/chthreads.o + .text.chThdWait + 0x00000000 0x38 ../../../os/kernel/src/chthreads.o + .text 0x00000000 0x0 ../../../os/kernel/src/chdynamic.o + .data 0x00000000 0x0 ../../../os/kernel/src/chdynamic.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chdynamic.o + .text.chThdAddRef + 0x00000000 0x14 ../../../os/kernel/src/chdynamic.o + .text.chThdRelease + 0x00000000 0x54 ../../../os/kernel/src/chdynamic.o + .text.chThdCreateFromHeap + 0x00000000 0x44 ../../../os/kernel/src/chdynamic.o + .text.chThdCreateFromMemoryPool + 0x00000000 0x44 ../../../os/kernel/src/chdynamic.o + .text 0x00000000 0x0 ../../../os/kernel/src/chregistry.o + .data 0x00000000 0x0 ../../../os/kernel/src/chregistry.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chregistry.o + .text.chRegFirstThread + 0x00000000 0x20 ../../../os/kernel/src/chregistry.o + .text.chRegNextThread + 0x00000000 0x2c ../../../os/kernel/src/chregistry.o + .text 0x00000000 0x0 ../../../os/kernel/src/chsem.o + .data 0x00000000 0x0 ../../../os/kernel/src/chsem.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chsem.o + .text.chSemResetI + 0x00000000 0x28 ../../../os/kernel/src/chsem.o + .text.chSemReset + 0x00000000 0x18 ../../../os/kernel/src/chsem.o + .text.chSemWaitS + 0x00000000 0x34 ../../../os/kernel/src/chsem.o + .text.chSemWait + 0x00000000 0x14 ../../../os/kernel/src/chsem.o + .text.chSemWaitTimeout + 0x00000000 0x14 ../../../os/kernel/src/chsem.o + .text.chSemSignal + 0x00000000 0x2c ../../../os/kernel/src/chsem.o + .text.chSemSetCounterI + 0x00000000 0x28 ../../../os/kernel/src/chsem.o + .text.chSemSignalWait + 0x00000000 0x64 ../../../os/kernel/src/chsem.o + .text 0x00000000 0x0 ../../../os/kernel/src/chmtx.o + .data 0x00000000 0x0 ../../../os/kernel/src/chmtx.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chmtx.o + .text.chMtxLockS + 0x00000000 0xcc ../../../os/kernel/src/chmtx.o + .text.chMtxLock + 0x00000000 0x14 ../../../os/kernel/src/chmtx.o + .text.chMtxTryLock + 0x00000000 0x2c ../../../os/kernel/src/chmtx.o + .text.chMtxTryLockS + 0x00000000 0x20 ../../../os/kernel/src/chmtx.o + .text.chMtxUnlock + 0x00000000 0x60 ../../../os/kernel/src/chmtx.o + .text.chMtxUnlockS + 0x00000000 0x50 ../../../os/kernel/src/chmtx.o + .text.chMtxUnlockAll + 0x00000000 0x54 ../../../os/kernel/src/chmtx.o + .text 0x00000000 0x0 ../../../os/kernel/src/chcond.o + .data 0x00000000 0x0 ../../../os/kernel/src/chcond.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chcond.o + .text.chCondInit + 0x00000000 0x8 ../../../os/kernel/src/chcond.o + .text.chCondSignal + 0x00000000 0x24 ../../../os/kernel/src/chcond.o + .text.chCondSignalI + 0x00000000 0x1c ../../../os/kernel/src/chcond.o + .text.chCondBroadcastI + 0x00000000 0x24 ../../../os/kernel/src/chcond.o + .text.chCondBroadcast + 0x00000000 0x18 ../../../os/kernel/src/chcond.o + .text.chCondWaitS + 0x00000000 0x48 ../../../os/kernel/src/chcond.o + .text.chCondWait + 0x00000000 0x14 ../../../os/kernel/src/chcond.o + .text.chCondWaitTimeoutS + 0x00000000 0x58 ../../../os/kernel/src/chcond.o + .text.chCondWaitTimeout + 0x00000000 0x14 ../../../os/kernel/src/chcond.o + .text 0x00000000 0x0 ../../../os/kernel/src/chevents.o + .data 0x00000000 0x0 ../../../os/kernel/src/chevents.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chevents.o + .text.chEvtRegisterMask + 0x00000000 0x2c ../../../os/kernel/src/chevents.o + .text.chEvtUnregister + 0x00000000 0x24 ../../../os/kernel/src/chevents.o + .text.chEvtClearFlags + 0x00000000 0x24 ../../../os/kernel/src/chevents.o + .text.chEvtAddFlags + 0x00000000 0x20 ../../../os/kernel/src/chevents.o + .text.chEvtSignalFlags + 0x00000000 0x18 ../../../os/kernel/src/chevents.o + .text.chEvtBroadcastFlags + 0x00000000 0x18 ../../../os/kernel/src/chevents.o + .text.chEvtDispatch + 0x00000000 0x34 ../../../os/kernel/src/chevents.o + .text.chEvtWaitOne + 0x00000000 0x3c ../../../os/kernel/src/chevents.o + .text.chEvtWaitAny + 0x00000000 0x34 ../../../os/kernel/src/chevents.o + .text.chEvtWaitAll + 0x00000000 0x38 ../../../os/kernel/src/chevents.o + .text.chEvtWaitOneTimeout + 0x00000000 0x54 ../../../os/kernel/src/chevents.o + .text.chEvtWaitAnyTimeout + 0x00000000 0x50 ../../../os/kernel/src/chevents.o + .text.chEvtWaitAllTimeout + 0x00000000 0x54 ../../../os/kernel/src/chevents.o + .text 0x00000000 0x0 ../../../os/kernel/src/chmsg.o + .data 0x00000000 0x0 ../../../os/kernel/src/chmsg.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chmsg.o + .text.chMsgSend + 0x00000000 0x44 ../../../os/kernel/src/chmsg.o + .text.chMsgWait + 0x00000000 0x3c ../../../os/kernel/src/chmsg.o + .text.chMsgRelease + 0x00000000 0x14 ../../../os/kernel/src/chmsg.o + .text 0x00000000 0x0 ../../../os/kernel/src/chmboxes.o + .data 0x00000000 0x0 ../../../os/kernel/src/chmboxes.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chmboxes.o + .text.chMBReset + 0x00000000 0x34 ../../../os/kernel/src/chmboxes.o + .text.chMBPostAheadS + 0x00000000 0x3c ../../../os/kernel/src/chmboxes.o + .text.chMBPostAhead + 0x00000000 0x14 ../../../os/kernel/src/chmboxes.o + .text.chMBPostAheadI + 0x00000000 0x34 ../../../os/kernel/src/chmboxes.o + .text.chMBFetchI + 0x00000000 0x30 ../../../os/kernel/src/chmboxes.o + .text 0x00000000 0x0 ../../../os/kernel/src/chqueues.o + .data 0x00000000 0x0 ../../../os/kernel/src/chqueues.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chqueues.o + .text.chIQGetFullI + 0x00000000 0x8 ../../../os/kernel/src/chqueues.o + .text.chIQResetI + 0x00000000 0x18 ../../../os/kernel/src/chqueues.o + .text.chOQGetFullI + 0x00000000 0x18 ../../../os/kernel/src/chqueues.o + .text.chOQResetI + 0x00000000 0x18 ../../../os/kernel/src/chqueues.o + .text 0x00000000 0x0 ../../../os/kernel/src/chmemcore.o + .data 0x00000000 0x0 ../../../os/kernel/src/chmemcore.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chmemcore.o + .text.chCoreAllocI + 0x00000000 0x28 ../../../os/kernel/src/chmemcore.o + .text.chCoreStatus + 0x00000000 0x18 ../../../os/kernel/src/chmemcore.o + .text 0x00000000 0x0 ../../../os/kernel/src/chheap.o + .data 0x00000000 0x0 ../../../os/kernel/src/chheap.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chheap.o + .text.chHeapInit + 0x00000000 0x24 ../../../os/kernel/src/chheap.o + .text.chHeapAlloc + 0x00000000 0x90 ../../../os/kernel/src/chheap.o + .text.chHeapFree + 0x00000000 0xa0 ../../../os/kernel/src/chheap.o + .text.chHeapStatus + 0x00000000 0x40 ../../../os/kernel/src/chheap.o + .text 0x00000000 0x0 ../../../os/kernel/src/chmempools.o + .data 0x00000000 0x0 ../../../os/kernel/src/chmempools.o + .bss 0x00000000 0x0 ../../../os/kernel/src/chmempools.o + .text.chPoolInit + 0x00000000 0x10 ../../../os/kernel/src/chmempools.o + .text.chPoolAllocI + 0x00000000 0x1c ../../../os/kernel/src/chmempools.o + .text.chPoolAlloc + 0x00000000 0x28 ../../../os/kernel/src/chmempools.o + .text.chPoolFreeI + 0x00000000 0x8 ../../../os/kernel/src/chmempools.o + .text.chPoolFree + 0x00000000 0x14 ../../../os/kernel/src/chmempools.o + .text 0x00000000 0x0 ../../../test/test.o + .data 0x00000000 0x0 ../../../test/test.o + .bss 0x00000000 0x0 ../../../test/test.o + .text.tmr 0x00000000 0x10 ../../../test/test.o + .text.print_line + 0x00000000 0x40 ../../../test/test.o + .text.test_printn + 0x00000000 0x64 ../../../test/test.o + .text.test_print + 0x00000000 0x24 ../../../test/test.o + .text.test_println + 0x00000000 0x2c ../../../test/test.o + .text.test_emit_token + 0x00000000 0x20 ../../../test/test.o + .text._test_fail + 0x00000000 0x28 ../../../test/test.o + .text._test_assert + 0x00000000 0x24 ../../../test/test.o + .text._test_assert_sequence + 0x00000000 0x50 ../../../test/test.o + .text._test_assert_time_window + 0x00000000 0x30 ../../../test/test.o + .text.test_terminate_threads + 0x00000000 0x1c ../../../test/test.o + .text.test_wait_threads + 0x00000000 0x24 ../../../test/test.o + .text.test_cpu_pulse + 0x00000000 0x64 ../../../test/test.o + .text.test_wait_tick + 0x00000000 0x14 ../../../test/test.o + .text.test_start_timer + 0x00000000 0x50 ../../../test/test.o + .text.TestThread + 0x00000000 0x240 ../../../test/test.o + .bss.failpoint + 0x00000000 0x4 ../../../test/test.o + .bss.local_fail + 0x00000000 0x4 ../../../test/test.o + .rodata.wa 0x00000000 0x14 ../../../test/test.o + .bss.tokp 0x00000000 0x4 ../../../test/test.o + .bss.global_fail + 0x00000000 0x4 ../../../test/test.o + .rodata.str1.4 + 0x00000000 0x174 ../../../test/test.o + .rodata.patterns + 0x00000000 0x30 ../../../test/test.o + .bss.vt 0x00000000 0x14 ../../../test/test.o + .bss.chp 0x00000000 0x4 ../../../test/test.o + .bss.tokens_buffer + 0x00000000 0x10 ../../../test/test.o + COMMON 0x00000000 0x590 ../../../test/test.o + .text 0x00000000 0x0 ../../../test/testthd.o + .data 0x00000000 0x0 ../../../test/testthd.o + .bss 0x00000000 0x0 ../../../test/testthd.o + .text.thd4_execute + 0x00000000 0x74 ../../../test/testthd.o + .text.thd3_execute + 0x00000000 0x138 ../../../test/testthd.o + .text.thd2_execute + 0x00000000 0xf8 ../../../test/testthd.o + .text.thd1_execute + 0x00000000 0xec ../../../test/testthd.o + .text.thread 0x00000000 0xc ../../../test/testthd.o + .rodata.testthd1 + 0x00000000 0x10 ../../../test/testthd.o + .rodata.testthd2 + 0x00000000 0x10 ../../../test/testthd.o + .rodata.testthd3 + 0x00000000 0x10 ../../../test/testthd.o + .rodata.testthd4 + 0x00000000 0x10 ../../../test/testthd.o + .rodata.patternthd + 0x00000000 0x14 ../../../test/testthd.o + .rodata.str1.4 + 0x00000000 0x80 ../../../test/testthd.o + .text 0x00000000 0x0 ../../../test/testsem.o + .data 0x00000000 0x0 ../../../test/testsem.o + .bss 0x00000000 0x0 ../../../test/testsem.o + .text.sem3_setup + 0x00000000 0x14 ../../../test/testsem.o + .text.sem2_setup + 0x00000000 0x14 ../../../test/testsem.o + .text.sem1_setup + 0x00000000 0x14 ../../../test/testsem.o + .text.sem4_execute + 0x00000000 0x100 ../../../test/testsem.o + .text.thread4 0x00000000 0x24 ../../../test/testsem.o + .text.sem3_execute + 0x00000000 0xa0 ../../../test/testsem.o + .text.thread3 0x00000000 0x1c ../../../test/testsem.o + .text.thread1 0x00000000 0x1c ../../../test/testsem.o + .text.sem2_execute + 0x00000000 0x154 ../../../test/testsem.o + .text.thread2 0x00000000 0x28 ../../../test/testsem.o + .text.sem1_execute + 0x00000000 0x140 ../../../test/testsem.o + .rodata.testsem1 + 0x00000000 0x10 ../../../test/testsem.o + .rodata.testsem2 + 0x00000000 0x10 ../../../test/testsem.o + .rodata.testsem3 + 0x00000000 0x10 ../../../test/testsem.o + .rodata.testsem4 + 0x00000000 0x10 ../../../test/testsem.o + .data.sem1 0x00000000 0xc ../../../test/testsem.o + .rodata.patternsem + 0x00000000 0x14 ../../../test/testsem.o + .rodata.str1.4 + 0x00000000 0x8c ../../../test/testsem.o + .text 0x00000000 0x0 ../../../test/testmtx.o + .data 0x00000000 0x0 ../../../test/testmtx.o + .bss 0x00000000 0x0 ../../../test/testmtx.o + .text.mtx8_execute + 0x00000000 0xb4 ../../../test/testmtx.o + .text.thread12 + 0x00000000 0x20 ../../../test/testmtx.o + .text.thread1 0x00000000 0x20 ../../../test/testmtx.o + .text.thread10 + 0x00000000 0x2c ../../../test/testmtx.o + .text.thread11 + 0x00000000 0x40 ../../../test/testmtx.o + .text.mtx8_setup + 0x00000000 0x28 ../../../test/testmtx.o + .text.mtx7_setup + 0x00000000 0x1c ../../../test/testmtx.o + .text.mtx6_setup + 0x00000000 0x1c ../../../test/testmtx.o + .text.mtx5_setup + 0x00000000 0x10 ../../../test/testmtx.o + .text.mtx4_setup + 0x00000000 0x1c ../../../test/testmtx.o + .text.mtx3_setup + 0x00000000 0x1c ../../../test/testmtx.o + .text.mtx2_setup + 0x00000000 0x10 ../../../test/testmtx.o + .text.mtx1_setup + 0x00000000 0x10 ../../../test/testmtx.o + .text.mtx7_execute + 0x00000000 0xe8 ../../../test/testmtx.o + .text.mtx6_execute + 0x00000000 0x110 ../../../test/testmtx.o + .text.mtx1_execute + 0x00000000 0xf0 ../../../test/testmtx.o + .text.mtx5_execute + 0x00000000 0xbc ../../../test/testmtx.o + .text.mtx4_execute + 0x00000000 0x260 ../../../test/testmtx.o + .text.thread4b + 0x00000000 0x1c ../../../test/testmtx.o + .text.thread4a + 0x00000000 0x1c ../../../test/testmtx.o + .text.mtx3_execute + 0x00000000 0xe4 ../../../test/testmtx.o + .text.mtx2_execute + 0x00000000 0xa8 ../../../test/testmtx.o + .text.thread3HH + 0x00000000 0x28 ../../../test/testmtx.o + .text.thread3H + 0x00000000 0x18 ../../../test/testmtx.o + .text.thread3M + 0x00000000 0x28 ../../../test/testmtx.o + .text.thread3L + 0x00000000 0x44 ../../../test/testmtx.o + .text.thread3LL + 0x00000000 0x24 ../../../test/testmtx.o + .text.thread2L + 0x00000000 0x28 ../../../test/testmtx.o + .text.thread2M + 0x00000000 0x18 ../../../test/testmtx.o + .text.thread2H + 0x00000000 0x28 ../../../test/testmtx.o + .rodata.testmtx5 + 0x00000000 0x10 ../../../test/testmtx.o + .rodata.testmtx6 + 0x00000000 0x10 ../../../test/testmtx.o + .rodata.testmtx7 + 0x00000000 0x10 ../../../test/testmtx.o + .rodata.testmtx8 + 0x00000000 0x10 ../../../test/testmtx.o + .data.m1 0x00000000 0x10 ../../../test/testmtx.o + .data.m2 0x00000000 0x10 ../../../test/testmtx.o + .rodata.str1.4 + 0x00000000 0x10c ../../../test/testmtx.o + .rodata.patternmtx + 0x00000000 0x24 ../../../test/testmtx.o + .data.c1 0x00000000 0x8 ../../../test/testmtx.o + .rodata.testmtx1 + 0x00000000 0x10 ../../../test/testmtx.o + .rodata.testmtx2 + 0x00000000 0x10 ../../../test/testmtx.o + .rodata.testmtx3 + 0x00000000 0x10 ../../../test/testmtx.o + .rodata.testmtx4 + 0x00000000 0x10 ../../../test/testmtx.o + .text 0x00000000 0x0 ../../../test/testmsg.o + .data 0x00000000 0x0 ../../../test/testmsg.o + .bss 0x00000000 0x0 ../../../test/testmsg.o + .text.msg1_execute + 0x00000000 0x80 ../../../test/testmsg.o + .text.thread 0x00000000 0x20 ../../../test/testmsg.o + .rodata.testmsg1 + 0x00000000 0x10 ../../../test/testmsg.o + .rodata.str1.4 + 0x00000000 0x14 ../../../test/testmsg.o + .rodata.patternmsg + 0x00000000 0x8 ../../../test/testmsg.o + .text 0x00000000 0x0 ../../../test/testmbox.o + .data 0x00000000 0x0 ../../../test/testmbox.o + .bss 0x00000000 0x0 ../../../test/testmbox.o + .text.mbox1_execute + 0x00000000 0x49c ../../../test/testmbox.o + .text.mbox1_setup + 0x00000000 0x1c ../../../test/testmbox.o + .data.mb1 0x00000000 0x28 ../../../test/testmbox.o + .rodata.patternmbox + 0x00000000 0x8 ../../../test/testmbox.o + .rodata.str1.4 + 0x00000000 0x28 ../../../test/testmbox.o + .rodata.testmbox1 + 0x00000000 0x10 ../../../test/testmbox.o + .text 0x00000000 0x0 ../../../test/testevt.o + .data 0x00000000 0x0 ../../../test/testevt.o + .bss 0x00000000 0x0 ../../../test/testevt.o + .text.evt3_execute + 0x00000000 0xa8 ../../../test/testevt.o + .text.evt3_setup + 0x00000000 0xc ../../../test/testevt.o + .text.evt2_setup + 0x00000000 0xc ../../../test/testevt.o + .text.evt1_setup + 0x00000000 0xc ../../../test/testevt.o + .text.evt2_execute + 0x00000000 0x274 ../../../test/testevt.o + .text.thread2 0x00000000 0x28 ../../../test/testevt.o + .text.thread1 0x00000000 0x18 ../../../test/testevt.o + .text.evt1_execute + 0x00000000 0x88 ../../../test/testevt.o + .text.h3 0x00000000 0xc ../../../test/testevt.o + .text.h2 0x00000000 0xc ../../../test/testevt.o + .text.h1 0x00000000 0xc ../../../test/testevt.o + .rodata.patternevt + 0x00000000 0x10 ../../../test/testevt.o + .rodata.testevt2 + 0x00000000 0x10 ../../../test/testevt.o + .rodata.str1.4 + 0x00000000 0x5c ../../../test/testevt.o + .rodata.testevt1 + 0x00000000 0x10 ../../../test/testevt.o + .rodata.evhndl + 0x00000000 0xc ../../../test/testevt.o + .rodata.testevt3 + 0x00000000 0x10 ../../../test/testevt.o + .data.es1 0x00000000 0x4 ../../../test/testevt.o + .data.es2 0x00000000 0x4 ../../../test/testevt.o + .text 0x00000000 0x0 ../../../test/testheap.o + .data 0x00000000 0x0 ../../../test/testheap.o + .bss 0x00000000 0x0 ../../../test/testheap.o + .text.heap1_execute + 0x00000000 0x24c ../../../test/testheap.o + .text.heap1_setup + 0x00000000 0x1c ../../../test/testheap.o + .rodata.patternheap + 0x00000000 0x8 ../../../test/testheap.o + .rodata.str1.4 + 0x00000000 0x28 ../../../test/testheap.o + .rodata.testheap1 + 0x00000000 0x10 ../../../test/testheap.o + .bss.test_heap + 0x00000000 0x20 ../../../test/testheap.o + .text 0x00000000 0x0 ../../../test/testpools.o + .data 0x00000000 0x0 ../../../test/testpools.o + .bss 0x00000000 0x0 ../../../test/testpools.o + .text.null_provider + 0x00000000 0x4 ../../../test/testpools.o + .text.pools1_execute + 0x00000000 0x78 ../../../test/testpools.o + .text.pools1_setup + 0x00000000 0x18 ../../../test/testpools.o + .rodata.str1.4 + 0x00000000 0x1c ../../../test/testpools.o + .rodata.patternpools + 0x00000000 0x8 ../../../test/testpools.o + .data.mp1 0x00000000 0xc ../../../test/testpools.o + .rodata.testpools1 + 0x00000000 0x10 ../../../test/testpools.o + .text 0x00000000 0x0 ../../../test/testdyn.o + .data 0x00000000 0x0 ../../../test/testdyn.o + .bss 0x00000000 0x0 ../../../test/testdyn.o + .text.regfind 0x00000000 0x24 ../../../test/testdyn.o + .text.dyn3_execute + 0x00000000 0x134 ../../../test/testdyn.o + .text.thread 0x00000000 0xc ../../../test/testdyn.o + .text.dyn3_setup + 0x00000000 0x1c ../../../test/testdyn.o + .text.dyn1_setup + 0x00000000 0x1c ../../../test/testdyn.o + .text.dyn2_execute + 0x00000000 0x108 ../../../test/testdyn.o + .text.dyn2_setup + 0x00000000 0x18 ../../../test/testdyn.o + .text.dyn1_execute + 0x00000000 0x10c ../../../test/testdyn.o + .rodata.testdyn1 + 0x00000000 0x10 ../../../test/testdyn.o + .rodata.testdyn2 + 0x00000000 0x10 ../../../test/testdyn.o + .rodata.testdyn3 + 0x00000000 0x10 ../../../test/testdyn.o + .bss.mp1 0x00000000 0xc ../../../test/testdyn.o + .rodata.str1.4 + 0x00000000 0xa4 ../../../test/testdyn.o + .rodata.patterndyn + 0x00000000 0x10 ../../../test/testdyn.o + .bss.heap1 0x00000000 0x20 ../../../test/testdyn.o + .text 0x00000000 0x0 ../../../test/testqueues.o + .data 0x00000000 0x0 ../../../test/testqueues.o + .bss 0x00000000 0x0 ../../../test/testqueues.o + .text.notify 0x00000000 0x4 ../../../test/testqueues.o + .text.thread2 0x00000000 0x18 ../../../test/testqueues.o + .text.queues2_execute + 0x00000000 0x1b8 ../../../test/testqueues.o + .text.queues2_setup + 0x00000000 0x24 ../../../test/testqueues.o + .text.thread1 0x00000000 0x14 ../../../test/testqueues.o + .text.queues1_execute + 0x00000000 0x1e4 ../../../test/testqueues.o + .text.queues1_setup + 0x00000000 0x24 ../../../test/testqueues.o + .rodata.testqueues1 + 0x00000000 0x10 ../../../test/testqueues.o + .rodata.testqueues2 + 0x00000000 0x10 ../../../test/testqueues.o + .rodata.str1.4 + 0x00000000 0x38 ../../../test/testqueues.o + .rodata.patternqueues + 0x00000000 0xc ../../../test/testqueues.o + .data.oq 0x00000000 0x20 ../../../test/testqueues.o + .data.iq 0x00000000 0x20 ../../../test/testqueues.o + .text 0x00000000 0x0 ../../../test/testbmk.o + .data 0x00000000 0x0 ../../../test/testbmk.o + .bss 0x00000000 0x0 ../../../test/testbmk.o + .text.thread2 0x00000000 0x4 ../../../test/testbmk.o + .text.tmo 0x00000000 0x4 ../../../test/testbmk.o + .text.bmk13_execute + 0x00000000 0x100 ../../../test/testbmk.o + .text.bmk12_execute + 0x00000000 0x68 ../../../test/testbmk.o + .text.bmk12_setup + 0x00000000 0x10 ../../../test/testbmk.o + .text.thread3 0x00000000 0x2c ../../../test/testbmk.o + .text.bmk11_execute + 0x00000000 0x70 ../../../test/testbmk.o + .text.bmk11_setup + 0x00000000 0x14 ../../../test/testbmk.o + .text.bmk7_setup + 0x00000000 0x14 ../../../test/testbmk.o + .text.bmk10_execute + 0x00000000 0x78 ../../../test/testbmk.o + .text.bmk9_execute + 0x00000000 0x98 ../../../test/testbmk.o + .text.bmk6_execute + 0x00000000 0x70 ../../../test/testbmk.o + .text.bmk8_execute + 0x00000000 0xe8 ../../../test/testbmk.o + .text.thread8 0x00000000 0x30 ../../../test/testbmk.o + .text.bmk7_execute + 0x00000000 0x104 ../../../test/testbmk.o + .text.bmk5_execute + 0x00000000 0x74 ../../../test/testbmk.o + .text.bmk4_execute + 0x00000000 0xb4 ../../../test/testbmk.o + .text.msg_loop_test + 0x00000000 0x34 ../../../test/testbmk.o + .text.bmk3_execute + 0x00000000 0xfc ../../../test/testbmk.o + .text.bmk2_execute + 0x00000000 0x80 ../../../test/testbmk.o + .text.bmk1_execute + 0x00000000 0x80 ../../../test/testbmk.o + .text.thread1 0x00000000 0x18 ../../../test/testbmk.o + .text.thread4 0x00000000 0x28 ../../../test/testbmk.o + .rodata.testbmk8 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk9 + 0x00000000 0x10 ../../../test/testbmk.o + .bss.vt2.2131 0x00000000 0x14 ../../../test/testbmk.o + .rodata.testbmk10 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk11 + 0x00000000 0x10 ../../../test/testbmk.o + .bss.vt1.2130 0x00000000 0x14 ../../../test/testbmk.o + .bss.mtx1 0x00000000 0x10 ../../../test/testbmk.o + .bss.ib.2119 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk12 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk13 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.str1.4 + 0x00000000 0x2c8 ../../../test/testbmk.o + .bss.iq.2120 0x00000000 0x20 ../../../test/testbmk.o + .bss.sem1 0x00000000 0xc ../../../test/testbmk.o + .rodata.patternbmk + 0x00000000 0x38 ../../../test/testbmk.o + .rodata.testbmk1 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk2 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk3 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk4 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk5 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk6 + 0x00000000 0x10 ../../../test/testbmk.o + .rodata.testbmk7 + 0x00000000 0x10 ../../../test/testbmk.o + .text 0x00000000 0x0 ../../../os/hal/src/hal.o + .data 0x00000000 0x0 ../../../os/hal/src/hal.o + .bss 0x00000000 0x0 ../../../os/hal/src/hal.o + .text 0x00000000 0x0 ../../../os/hal/src/adc.o + .data 0x00000000 0x0 ../../../os/hal/src/adc.o + .bss 0x00000000 0x0 ../../../os/hal/src/adc.o + .text 0x00000000 0x0 ../../../os/hal/src/can.o + .data 0x00000000 0x0 ../../../os/hal/src/can.o + .bss 0x00000000 0x0 ../../../os/hal/src/can.o + .text 0x00000000 0x0 ../../../os/hal/src/gpt.o + .data 0x00000000 0x0 ../../../os/hal/src/gpt.o + .bss 0x00000000 0x0 ../../../os/hal/src/gpt.o + .text.gptStop 0x00000000 0x1c ../../../os/hal/src/gpt.o + .text.gptStartContinuousI + 0x00000000 0xc ../../../os/hal/src/gpt.o + .text.gptStartOneShot + 0x00000000 0x18 ../../../os/hal/src/gpt.o + .text.gptStartOneShotI + 0x00000000 0xc ../../../os/hal/src/gpt.o + .text.gptStopTimerI + 0x00000000 0xc ../../../os/hal/src/gpt.o + .text.gptPolledDelay + 0x00000000 0xc ../../../os/hal/src/gpt.o + .text 0x00000000 0x0 ../../../os/hal/src/i2c.o + .data 0x00000000 0x0 ../../../os/hal/src/i2c.o + .bss 0x00000000 0x0 ../../../os/hal/src/i2c.o + .text 0x00000000 0x0 ../../../os/hal/src/mac.o + .data 0x00000000 0x0 ../../../os/hal/src/mac.o + .bss 0x00000000 0x0 ../../../os/hal/src/mac.o + .text 0x00000000 0x0 ../../../os/hal/src/pal.o + .data 0x00000000 0x0 ../../../os/hal/src/pal.o + .bss 0x00000000 0x0 ../../../os/hal/src/pal.o + .text.palReadBus + 0x00000000 0x10 ../../../os/hal/src/pal.o + .text.palWriteBus + 0x00000000 0x14 ../../../os/hal/src/pal.o + .text.palSetBusMode + 0x00000000 0x10 ../../../os/hal/src/pal.o + .text 0x00000000 0x0 ../../../os/hal/src/pwm.o + .data 0x00000000 0x0 ../../../os/hal/src/pwm.o + .bss 0x00000000 0x0 ../../../os/hal/src/pwm.o + .text 0x00000000 0x0 ../../../os/hal/src/serial.o + .data 0x00000000 0x0 ../../../os/hal/src/serial.o + .bss 0x00000000 0x0 ../../../os/hal/src/serial.o + .text.sdStop 0x00000000 0x30 ../../../os/hal/src/serial.o + .text.sdIncomingDataI + 0x00000000 0x40 ../../../os/hal/src/serial.o + .text.sdRequestDataI + 0x00000000 0x28 ../../../os/hal/src/serial.o + .text 0x00000000 0x0 ../../../os/hal/src/spi.o + .data 0x00000000 0x0 ../../../os/hal/src/spi.o + .bss 0x00000000 0x0 ../../../os/hal/src/spi.o + .text 0x00000000 0x0 ../../../os/hal/src/uart.o + .data 0x00000000 0x0 ../../../os/hal/src/uart.o + .bss 0x00000000 0x0 ../../../os/hal/src/uart.o + .text 0x00000000 0x0 ../../../os/hal/src/usb.o + .data 0x00000000 0x0 ../../../os/hal/src/usb.o + .bss 0x00000000 0x0 ../../../os/hal/src/usb.o + .text 0x00000000 0x0 ../../../os/hal/src/mmc_spi.o + .data 0x00000000 0x0 ../../../os/hal/src/mmc_spi.o + .bss 0x00000000 0x0 ../../../os/hal/src/mmc_spi.o + .text 0x00000000 0x0 ../../../os/hal/src/serial_usb.o + .data 0x00000000 0x0 ../../../os/hal/src/serial_usb.o + .bss 0x00000000 0x0 ../../../os/hal/src/serial_usb.o + .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .text.gpt_lld_stop + 0x00000000 0xac ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .text.gpt_lld_polled_delay + 0x00000000 0x20 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .text._pal_lld_setgroupmode + 0x00000000 0x38 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .text.sd_lld_stop + 0x00000000 0x60 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .text 0x00000000 0x0 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .data 0x00000000 0x0 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .bss 0x00000000 0x0 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .text 0x00000000 0x0 ../../../os/various/evtimer.o + .data 0x00000000 0x0 ../../../os/various/evtimer.o + .bss 0x00000000 0x0 ../../../os/various/evtimer.o + .text.tmrcb 0x00000000 0x24 ../../../os/various/evtimer.o + .text.evtStart + 0x00000000 0x24 ../../../os/various/evtimer.o + .text.evtStop 0x00000000 0x18 ../../../os/various/evtimer.o + .text 0x00000000 0x0 ../../../os/various/syscalls.o + .data 0x00000000 0x0 ../../../os/various/syscalls.o + .bss 0x00000000 0x0 ../../../os/various/syscalls.o + .text._read_r 0x00000000 0xc ../../../os/various/syscalls.o + .text._lseek_r + 0x00000000 0x4 ../../../os/various/syscalls.o + .text._write_r + 0x00000000 0x4 ../../../os/various/syscalls.o + .text._close_r + 0x00000000 0x4 ../../../os/various/syscalls.o + .text._sbrk_r 0x00000000 0x18 ../../../os/various/syscalls.o + .text._fstat_r + 0x00000000 0x18 ../../../os/various/syscalls.o + .text._isatty_r + 0x00000000 0x4 ../../../os/various/syscalls.o + .text 0x00000000 0x0 main.o + .data 0x00000000 0x0 main.o + .bss 0x00000000 0x0 main.o + .text 0x00000000 0x9c c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + .data 0x00000000 0x0 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + .bss 0x00000000 0x0 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +Memory Configuration + +Name Origin Length Attributes +flash 0x00000000 0x00008000 +ram 0x10000000 0x00002000 +*default* 0x00000000 0xffffffff + +Linker script and memory map + +LOAD ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +LOAD ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +LOAD ../../../os/ports/GCC/ARMCMx/chcore.o +LOAD ../../../os/ports/GCC/ARMCMx/chcore_v7m.o +LOAD ../../../os/ports/GCC/ARMCMx/nvic.o +LOAD ../../../os/kernel/src/chsys.o +LOAD ../../../os/kernel/src/chdebug.o +LOAD ../../../os/kernel/src/chlists.o +LOAD ../../../os/kernel/src/chvt.o +LOAD ../../../os/kernel/src/chschd.o +LOAD ../../../os/kernel/src/chthreads.o +LOAD ../../../os/kernel/src/chdynamic.o +LOAD ../../../os/kernel/src/chregistry.o +LOAD ../../../os/kernel/src/chsem.o +LOAD ../../../os/kernel/src/chmtx.o +LOAD ../../../os/kernel/src/chcond.o +LOAD ../../../os/kernel/src/chevents.o +LOAD ../../../os/kernel/src/chmsg.o +LOAD ../../../os/kernel/src/chmboxes.o +LOAD ../../../os/kernel/src/chqueues.o +LOAD ../../../os/kernel/src/chmemcore.o +LOAD ../../../os/kernel/src/chheap.o +LOAD ../../../os/kernel/src/chmempools.o +LOAD ../../../test/test.o +LOAD ../../../test/testthd.o +LOAD ../../../test/testsem.o +LOAD ../../../test/testmtx.o +LOAD ../../../test/testmsg.o +LOAD ../../../test/testmbox.o +LOAD ../../../test/testevt.o +LOAD ../../../test/testheap.o +LOAD ../../../test/testpools.o +LOAD ../../../test/testdyn.o +LOAD ../../../test/testqueues.o +LOAD ../../../test/testbmk.o +LOAD ../../../os/hal/src/hal.o +LOAD ../../../os/hal/src/adc.o +LOAD ../../../os/hal/src/can.o +LOAD ../../../os/hal/src/gpt.o +LOAD ../../../os/hal/src/i2c.o +LOAD ../../../os/hal/src/mac.o +LOAD ../../../os/hal/src/pal.o +LOAD ../../../os/hal/src/pwm.o +LOAD ../../../os/hal/src/serial.o +LOAD ../../../os/hal/src/spi.o +LOAD ../../../os/hal/src/uart.o +LOAD ../../../os/hal/src/usb.o +LOAD ../../../os/hal/src/mmc_spi.o +LOAD ../../../os/hal/src/serial_usb.o +LOAD ../../../os/hal/platforms/LPC13xx/hal_lld.o +LOAD ../../../os/hal/platforms/LPC13xx/gpt_lld.o +LOAD ../../../os/hal/platforms/LPC13xx/pal_lld.o +LOAD ../../../os/hal/platforms/LPC13xx/serial_lld.o +LOAD ../../../os/hal/platforms/LPC13xx/spi_lld.o +LOAD ../../../boards/EA_LPCXPRESSO_BB_1343/board.o +LOAD ../../../os/various/evtimer.o +LOAD ../../../os/various/syscalls.o +LOAD main.o +START GROUP +LOAD c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/thumb/v7m\libgcc.a +LOAD c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a +END GROUP + 0x00000100 __main_stack_size__ = 0x100 + 0x00000100 __process_stack_size__ = 0x100 + 0x00000200 __stacks_total_size__ = (__main_stack_size__ + __process_stack_size__) + 0x10000000 __ram_start__ = ORIGIN (ram) + 0x00002000 __ram_size__ = 0x2000 + 0x10002000 __ram_end__ = (__ram_start__ + __ram_size__) + 0x00000000 . = 0x0 + +.text 0x00000000 0x1bb8 + 0x00000000 _text = . + *(vectors) + vectors 0x00000000 0x120 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + 0x00000000 _vectors + *(.text) + .text 0x00000120 0x64 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o + 0x00000120 ResetHandler + 0x00000164 _main_exit_handler + *(.text.*) + *fill* 0x00000184 0xc 00 + .text._unhandled_exception + 0x00000190 0x4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + 0x00000190 Vector58 + 0x00000190 Vector9C + 0x00000190 VectorAC + 0x00000190 Vector5C + 0x00000190 NMIVector + 0x00000190 Vector11C + 0x00000190 Vector8C + 0x00000190 VectorDC + 0x00000190 Vector110 + 0x00000190 VectorC8 + 0x00000190 Vector94 + 0x00000190 VectorA8 + 0x00000190 VectorB4 + 0x00000190 Vector74 + 0x00000190 UsageFaultVector + 0x00000190 DebugMonitorVector + 0x00000190 Vector40 + 0x00000190 Vector108 + 0x00000190 VectorBC + 0x00000190 PendSVVector + 0x00000190 Vector118 + 0x00000190 Vector64 + 0x00000190 VectorCC + 0x00000190 Vector54 + 0x00000190 Vector98 + 0x00000190 VectorD8 + 0x00000190 Vector24 + 0x00000190 Vector84 + 0x00000190 BusFaultVector + 0x00000190 VectorD0 + 0x00000190 VectorC0 + 0x00000190 HardFaultVector + 0x00000190 Vector100 + 0x00000190 VectorE0 + 0x00000190 VectorF4 + 0x00000190 MemManageVector + 0x00000190 Vector6C + 0x00000190 VectorA0 + 0x00000190 VectorC4 + 0x00000190 Vector7C + 0x00000190 VectorB0 + 0x00000190 Vector90 + 0x00000190 Vector114 + 0x00000190 Vector60 + 0x00000190 Vector1C + 0x00000190 Vector48 + 0x00000190 Vector70 + 0x00000190 VectorD4 + 0x00000190 Vector4C + 0x00000190 Vector80 + 0x00000190 Vector68 + 0x00000190 Vector78 + 0x00000190 _unhandled_exception + 0x00000190 Vector88 + 0x00000190 Vector104 + 0x00000190 Vector10C + 0x00000190 Vector50 + 0x00000190 Vector44 + 0x00000190 Vector28 + 0x00000190 VectorB8 + 0x00000190 VectorFC + 0x00000190 Vector34 + 0x00000190 VectorA4 + 0x00000190 Vector20 + *fill* 0x00000194 0xc 00 + .text._port_switch_from_isr + 0x000001a0 0x8 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x000001a0 _port_switch_from_isr + *fill* 0x000001a8 0x8 00 + .text.SVCallVector + 0x000001b0 0x14 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x000001b0 SVCallVector + *fill* 0x000001c4 0xc 00 + .text._port_irq_epilogue + 0x000001d0 0x44 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x000001d0 _port_irq_epilogue + *fill* 0x00000214 0xc 00 + .text.SysTickVector + 0x00000220 0x18 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x00000220 SysTickVector + *fill* 0x00000238 0x8 00 + .text.port_switch + 0x00000240 0x10 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x00000240 port_switch + .text._port_thread_start + 0x00000250 0x10 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x00000250 _port_thread_start + .text.NVICEnableVector + 0x00000260 0x4c ../../../os/ports/GCC/ARMCMx/nvic.o + 0x00000260 NVICEnableVector + *fill* 0x000002ac 0x4 00 + .text.NVICSetSystemHandlerPriority + 0x000002b0 0x30 ../../../os/ports/GCC/ARMCMx/nvic.o + 0x000002b0 NVICSetSystemHandlerPriority + .text._idle_thread + 0x000002e0 0x4 ../../../os/kernel/src/chsys.o + 0x000002e0 _idle_thread + *fill* 0x000002e4 0xc 00 + .text.chSysInit + 0x000002f0 0x78 ../../../os/kernel/src/chsys.o + 0x000002f0 chSysInit + *fill* 0x00000368 0x8 00 + .text.chSysTimerHandlerI + 0x00000370 0x50 ../../../os/kernel/src/chsys.o + 0x00000370 chSysTimerHandlerI + .text.vt_init 0x000003c0 0x18 ../../../os/kernel/src/chvt.o + 0x000003c0 vt_init + *fill* 0x000003d8 0x8 00 + .text.chVTSetI + 0x000003e0 0x3c ../../../os/kernel/src/chvt.o + 0x000003e0 chVTSetI + *fill* 0x0000041c 0x4 00 + .text.chVTResetI + 0x00000420 0x24 ../../../os/kernel/src/chvt.o + 0x00000420 chVTResetI + *fill* 0x00000444 0xc 00 + .text.wakeup 0x00000450 0x48 ../../../os/kernel/src/chschd.o + *fill* 0x00000498 0x8 00 + .text.scheduler_init + 0x000004a0 0x1c ../../../os/kernel/src/chschd.o + 0x000004a0 scheduler_init + *fill* 0x000004bc 0x4 00 + .text.chSchReadyI + 0x000004c0 0x20 ../../../os/kernel/src/chschd.o + 0x000004c0 chSchReadyI + .text.chSchGoSleepS + 0x000004e0 0x2c ../../../os/kernel/src/chschd.o + 0x000004e0 chSchGoSleepS + *fill* 0x0000050c 0x4 00 + .text.chSchGoSleepTimeoutS + 0x00000510 0x44 ../../../os/kernel/src/chschd.o + 0x00000510 chSchGoSleepTimeoutS + *fill* 0x00000554 0xc 00 + .text.chSchWakeupS + 0x00000560 0x60 ../../../os/kernel/src/chschd.o + 0x00000560 chSchWakeupS + .text.chSchDoRescheduleI + 0x000005c0 0x44 ../../../os/kernel/src/chschd.o + 0x000005c0 chSchDoRescheduleI + *fill* 0x00000604 0xc 00 + .text.chSchRescheduleS + 0x00000610 0x1c ../../../os/kernel/src/chschd.o + 0x00000610 chSchRescheduleS + *fill* 0x0000062c 0x4 00 + .text.chSchIsRescRequiredExI + 0x00000630 0x28 ../../../os/kernel/src/chschd.o + 0x00000630 chSchIsRescRequiredExI + *fill* 0x00000658 0x8 00 + .text._thread_init + 0x00000660 0x4c ../../../os/kernel/src/chthreads.o + 0x00000660 _thread_init + *fill* 0x000006ac 0x4 00 + .text.chThdCreateI + 0x000006b0 0x5c ../../../os/kernel/src/chthreads.o + 0x000006b0 chThdCreateI + *fill* 0x0000070c 0x4 00 + .text.chThdCreateStatic + 0x00000710 0x30 ../../../os/kernel/src/chthreads.o + 0x00000710 chThdCreateStatic + .text.chThdSleep + 0x00000740 0x18 ../../../os/kernel/src/chthreads.o + 0x00000740 chThdSleep + *fill* 0x00000758 0x8 00 + .text.chThdExit + 0x00000760 0x48 ../../../os/kernel/src/chthreads.o + 0x00000760 chThdExit + *fill* 0x000007a8 0x8 00 + .text.chSemInit + 0x000007b0 0x8 ../../../os/kernel/src/chsem.o + 0x000007b0 chSemInit + *fill* 0x000007b8 0x8 00 + .text.chSemWaitTimeoutS + 0x000007c0 0x40 ../../../os/kernel/src/chsem.o + 0x000007c0 chSemWaitTimeoutS + .text.chSemSignalI + 0x00000800 0x24 ../../../os/kernel/src/chsem.o + 0x00000800 chSemSignalI + *fill* 0x00000824 0xc 00 + .text.chMtxInit + 0x00000830 0xc ../../../os/kernel/src/chmtx.o + 0x00000830 chMtxInit + *fill* 0x0000083c 0x4 00 + .text.chEvtSignalFlagsI + 0x00000840 0x38 ../../../os/kernel/src/chevents.o + 0x00000840 chEvtSignalFlagsI + *fill* 0x00000878 0x8 00 + .text.chEvtBroadcastFlagsI + 0x00000880 0x20 ../../../os/kernel/src/chevents.o + 0x00000880 chEvtBroadcastFlagsI + .text.chMBInit + 0x000008a0 0x2c ../../../os/kernel/src/chmboxes.o + 0x000008a0 chMBInit + *fill* 0x000008cc 0x4 00 + .text.chMBPostS + 0x000008d0 0x38 ../../../os/kernel/src/chmboxes.o + 0x000008d0 chMBPostS + *fill* 0x00000908 0x8 00 + .text.chMBPost + 0x00000910 0x14 ../../../os/kernel/src/chmboxes.o + 0x00000910 chMBPost + *fill* 0x00000924 0xc 00 + .text.chMBPostI + 0x00000930 0x34 ../../../os/kernel/src/chmboxes.o + 0x00000930 chMBPostI + *fill* 0x00000964 0xc 00 + .text.chMBFetchS + 0x00000970 0x38 ../../../os/kernel/src/chmboxes.o + 0x00000970 chMBFetchS + *fill* 0x000009a8 0x8 00 + .text.chMBFetch + 0x000009b0 0x14 ../../../os/kernel/src/chmboxes.o + 0x000009b0 chMBFetch + *fill* 0x000009c4 0xc 00 + .text.chIQInit + 0x000009d0 0x1c ../../../os/kernel/src/chqueues.o + 0x000009d0 chIQInit + *fill* 0x000009ec 0x4 00 + .text.chIQPutI + 0x000009f0 0x34 ../../../os/kernel/src/chqueues.o + 0x000009f0 chIQPutI + *fill* 0x00000a24 0xc 00 + .text.chIQGetTimeout + 0x00000a30 0x44 ../../../os/kernel/src/chqueues.o + 0x00000a30 chIQGetTimeout + *fill* 0x00000a74 0xc 00 + .text.chIQReadTimeout + 0x00000a80 0x88 ../../../os/kernel/src/chqueues.o + 0x00000a80 chIQReadTimeout + *fill* 0x00000b08 0x8 00 + .text.chOQInit + 0x00000b10 0x20 ../../../os/kernel/src/chqueues.o + 0x00000b10 chOQInit + .text.chOQPutTimeout + 0x00000b30 0x48 ../../../os/kernel/src/chqueues.o + 0x00000b30 chOQPutTimeout + *fill* 0x00000b78 0x8 00 + .text.chOQGetI + 0x00000b80 0x38 ../../../os/kernel/src/chqueues.o + 0x00000b80 chOQGetI + *fill* 0x00000bb8 0x8 00 + .text.chOQWriteTimeout + 0x00000bc0 0x88 ../../../os/kernel/src/chqueues.o + 0x00000bc0 chOQWriteTimeout + *fill* 0x00000c48 0x8 00 + .text.core_init + 0x00000c50 0x2c ../../../os/kernel/src/chmemcore.o + 0x00000c50 core_init + *fill* 0x00000c7c 0x4 00 + .text.chCoreAlloc + 0x00000c80 0x34 ../../../os/kernel/src/chmemcore.o + 0x00000c80 chCoreAlloc + *fill* 0x00000cb4 0xc 00 + .text.heap_init + 0x00000cc0 0x24 ../../../os/kernel/src/chheap.o + 0x00000cc0 heap_init + *fill* 0x00000ce4 0xc 00 + .text.halInit 0x00000cf0 0x20 ../../../os/hal/src/hal.o + 0x00000cf0 halInit + .text.gptInit 0x00000d10 0x8 ../../../os/hal/src/gpt.o + 0x00000d10 gptInit + *fill* 0x00000d18 0x8 00 + .text.gptObjectInit + 0x00000d20 0xc ../../../os/hal/src/gpt.o + 0x00000d20 gptObjectInit + *fill* 0x00000d2c 0x4 00 + .text.gptStart + 0x00000d30 0x1c ../../../os/hal/src/gpt.o + 0x00000d30 gptStart + *fill* 0x00000d4c 0x4 00 + .text.gptStartContinuous + 0x00000d50 0x18 ../../../os/hal/src/gpt.o + 0x00000d50 gptStartContinuous + *fill* 0x00000d68 0x8 00 + .text.gptStopTimer + 0x00000d70 0x18 ../../../os/hal/src/gpt.o + 0x00000d70 gptStopTimer + *fill* 0x00000d88 0x8 00 + .text.putwouldblock + 0x00000d90 0xc ../../../os/hal/src/serial.o + *fill* 0x00000d9c 0x4 00 + .text.getwouldblock + 0x00000da0 0xc ../../../os/hal/src/serial.o + *fill* 0x00000dac 0x4 00 + .text.getflags + 0x00000db0 0x18 ../../../os/hal/src/serial.o + *fill* 0x00000dc8 0x8 00 + .text.readt 0x00000dd0 0xc ../../../os/hal/src/serial.o + *fill* 0x00000ddc 0x4 00 + .text.reads 0x00000de0 0x10 ../../../os/hal/src/serial.o + .text.writet 0x00000df0 0xc ../../../os/hal/src/serial.o + *fill* 0x00000dfc 0x4 00 + .text.writes 0x00000e00 0x10 ../../../os/hal/src/serial.o + .text.gett 0x00000e10 0xc ../../../os/hal/src/serial.o + *fill* 0x00000e1c 0x4 00 + .text.putt 0x00000e20 0xc ../../../os/hal/src/serial.o + *fill* 0x00000e2c 0x4 00 + .text.sdInit 0x00000e30 0x8 ../../../os/hal/src/serial.o + 0x00000e30 sdInit + *fill* 0x00000e38 0x8 00 + .text.sdObjectInit + 0x00000e40 0x4c ../../../os/hal/src/serial.o + 0x00000e40 sdObjectInit + *fill* 0x00000e8c 0x4 00 + .text.sdStart 0x00000e90 0x1c ../../../os/hal/src/serial.o + 0x00000e90 sdStart + *fill* 0x00000eac 0x4 00 + .text.hal_lld_init + 0x00000eb0 0x28 ../../../os/hal/platforms/LPC13xx/hal_lld.o + 0x00000eb0 hal_lld_init + *fill* 0x00000ed8 0x8 00 + .text.LPC13xx_clock_init + 0x00000ee0 0xa0 ../../../os/hal/platforms/LPC13xx/hal_lld.o + 0x00000ee0 LPC13xx_clock_init + .text.VectorE4 + 0x00000f80 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x00000f80 VectorE4 + *fill* 0x00000fb4 0xc 00 + .text.VectorE8 + 0x00000fc0 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x00000fc0 VectorE8 + *fill* 0x00000ff4 0xc 00 + .text.VectorEC + 0x00001000 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x00001000 VectorEC + *fill* 0x00001034 0xc 00 + .text.VectorF0 + 0x00001040 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x00001040 VectorF0 + *fill* 0x00001074 0xc 00 + .text.gpt_lld_init + 0x00001080 0x60 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x00001080 gpt_lld_init + .text.gpt_lld_start + 0x000010e0 0xd0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x000010e0 gpt_lld_start + .text.gpt_lld_start_timer + 0x000011b0 0x18 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x000011b0 gpt_lld_start_timer + *fill* 0x000011c8 0x8 00 + .text.gpt_lld_stop_timer + 0x000011d0 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x000011d0 gpt_lld_stop_timer + .text._pal_lld_init + 0x000011e0 0x64 ../../../os/hal/platforms/LPC13xx/pal_lld.o + 0x000011e0 _pal_lld_init + *fill* 0x00001244 0xc 00 + .text.notify1 0x00001250 0x4c ../../../os/hal/platforms/LPC13xx/serial_lld.o + *fill* 0x0000129c 0x4 00 + .text.VectorF8 + 0x000012a0 0x130 ../../../os/hal/platforms/LPC13xx/serial_lld.o + 0x000012a0 VectorF8 + .text.sd_lld_init + 0x000013d0 0x38 ../../../os/hal/platforms/LPC13xx/serial_lld.o + 0x000013d0 sd_lld_init + *fill* 0x00001408 0x8 00 + .text.sd_lld_start + 0x00001410 0x84 ../../../os/hal/platforms/LPC13xx/serial_lld.o + 0x00001410 sd_lld_start + *fill* 0x00001494 0xc 00 + .text.__early_init + 0x000014a0 0x8 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + 0x000014a0 __early_init + *fill* 0x000014a8 0x8 00 + .text.boardInit + 0x000014b0 0x18 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + 0x000014b0 boardInit + *fill* 0x000014c8 0x8 00 + .text.print 0x000014d0 0x24 main.o + *fill* 0x000014f4 0xc 00 + .text.println 0x00001500 0x3c main.o + *fill* 0x0000153c 0x4 00 + .text.printn 0x00001540 0x64 main.o + *fill* 0x000015a4 0xc 00 + .text.gpt2cb 0x000015b0 0x28 main.o + *fill* 0x000015d8 0x8 00 + .text.gpt1cb 0x000015e0 0x28 main.o + *fill* 0x00001608 0x8 00 + .text.WorkerThread + 0x00001610 0xb4 main.o + *fill* 0x000016c4 0xc 00 + .text.main 0x000016d0 0x2a4 main.o + 0x000016d0 main + *(.rodata) + *(.rodata.*) + *fill* 0x00001974 0xc 00 + .rodata.vmt 0x00001980 0x24 ../../../os/hal/src/serial.o + *fill* 0x000019a4 0xc 00 + .rodata.default_config + 0x000019b0 0xc ../../../os/hal/platforms/LPC13xx/serial_lld.o + *fill* 0x000019bc 0x4 00 + .rodata.pal_default_config + 0x000019c0 0x20 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + 0x000019c0 pal_default_config + .rodata.gpt2cfg + 0x000019e0 0x8 main.o + *fill* 0x000019e8 0x8 00 + .rodata.str1.4 + 0x000019f0 0x1c0 main.o + 0x1c4 (size before relaxing) + .rodata.gpt1cfg + 0x00001bb0 0x8 main.o + *(.glue_7t) + .glue_7t 0x00000000 0x0 linker stubs + *(.glue_7) + .glue_7 0x00000000 0x0 linker stubs + *(.gcc*) + +.vfp11_veneer 0x00001bb8 0x0 + .vfp11_veneer 0x00000000 0x0 linker stubs + +.v4_bx 0x00001bb8 0x0 + .v4_bx 0x00000000 0x0 linker stubs + +.ctors 0x00001bb8 0x0 + 0x00001bb8 PROVIDE (_ctors_start_, .) + *(SORT(.ctors.*)) + *(.ctors) + 0x00001bb8 PROVIDE (_ctors_end_, .) + +.dtors 0x00001bb8 0x0 + 0x00001bb8 PROVIDE (_dtors_start_, .) + *(SORT(.dtors.*)) + *(.dtors) + 0x00001bb8 PROVIDE (_dtors_end_, .) + +.ARM.extab + *(.ARM.extab* .gnu.linkonce.armextab.*) + 0x00001bb8 __exidx_start = . + +.ARM.exidx + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + 0x00001bb8 __exidx_end = . + +.eh_frame_hdr + *(.eh_frame_hdr) + +.eh_frame + *(.eh_frame) + 0x00001bb8 . = ALIGN (0x4) + 0x00001bb8 _etext = . + 0x00001bb8 _textdata = _etext + +.data 0x10000000 0x0 load address 0x00001bb8 + 0x10000000 _data = . + *(.data) + 0x10000000 . = ALIGN (0x4) + *(.data.*) + 0x10000000 . = ALIGN (0x4) + *(.ramtext) + 0x10000000 . = ALIGN (0x4) + 0x10000000 _edata = . + +.bss 0x10000000 0x744 load address 0x00001bb8 + 0x10000000 _bss_start = . + *(.bss) + 0x10000000 . = ALIGN (0x4) + *(.bss.*) + .bss.mainthread.1972 + 0x10000000 0x44 ../../../os/kernel/src/chsys.o + .bss.endmem 0x10000044 0x4 ../../../os/kernel/src/chmemcore.o + .bss.nextmem 0x10000048 0x4 ../../../os/kernel/src/chmemcore.o + *fill* 0x1000004c 0x4 00 + .bss.default_heap + 0x10000050 0x20 ../../../os/kernel/src/chheap.o + .bss.x.3296 0x10000070 0x4 main.o + .bss.cnt.3297 0x10000074 0x4 main.o + .bss.saturated + 0x10000078 0x4 main.o + .bss.mb 0x1000007c 0xa0 main.o + .bss.b 0x1000011c 0x40 main.o + *fill* 0x1000015c 0x4 00 + .bss.waWorkerThread + 0x10000160 0x460 main.o + 0x100005c0 . = ALIGN (0x4) + *(COMMON) + COMMON 0x100005c0 0xa0 ../../../os/kernel/src/chsys.o + 0x100005c0 _idle_thread_wa + COMMON 0x10000660 0x10 ../../../os/kernel/src/chvt.o + 0x10000660 vtlist + COMMON 0x10000670 0x20 ../../../os/kernel/src/chschd.o + 0x10000670 rlist + COMMON 0x10000690 0x40 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x10000690 GPTD2 + 0x100006a0 GPTD4 + 0x100006b0 GPTD1 + 0x100006c0 GPTD3 + COMMON 0x100006d0 0x74 ../../../os/hal/platforms/LPC13xx/serial_lld.o + 0x100006d0 SD1 + 0x10000744 . = ALIGN (0x4) + 0x10000744 _bss_end = . + 0x10000744 PROVIDE (end, .) + 0x10000744 _end = . + 0x10000744 __heap_base__ = _end + 0x10001e00 __heap_end__ = (__ram_end__ - __stacks_total_size__) +OUTPUT(ch.elf elf32-littlearm) + +.ARM.attributes + 0x00000000 0x2d + .ARM.attributes + 0x00000000 0x21 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o + .ARM.attributes + 0x00000021 0x31 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .ARM.attributes + 0x00000052 0x31 ../../../os/ports/GCC/ARMCMx/chcore.o + .ARM.attributes + 0x00000083 0x31 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .ARM.attributes + 0x000000b4 0x31 ../../../os/ports/GCC/ARMCMx/nvic.o + .ARM.attributes + 0x000000e5 0x31 ../../../os/kernel/src/chsys.o + .ARM.attributes + 0x00000116 0x31 ../../../os/kernel/src/chdebug.o + .ARM.attributes + 0x00000147 0x31 ../../../os/kernel/src/chlists.o + .ARM.attributes + 0x00000178 0x31 ../../../os/kernel/src/chvt.o + .ARM.attributes + 0x000001a9 0x31 ../../../os/kernel/src/chschd.o + .ARM.attributes + 0x000001da 0x31 ../../../os/kernel/src/chthreads.o + .ARM.attributes + 0x0000020b 0x31 ../../../os/kernel/src/chdynamic.o + .ARM.attributes + 0x0000023c 0x31 ../../../os/kernel/src/chregistry.o + .ARM.attributes + 0x0000026d 0x31 ../../../os/kernel/src/chsem.o + .ARM.attributes + 0x0000029e 0x31 ../../../os/kernel/src/chmtx.o + .ARM.attributes + 0x000002cf 0x31 ../../../os/kernel/src/chcond.o + .ARM.attributes + 0x00000300 0x31 ../../../os/kernel/src/chevents.o + .ARM.attributes + 0x00000331 0x31 ../../../os/kernel/src/chmsg.o + .ARM.attributes + 0x00000362 0x31 ../../../os/kernel/src/chmboxes.o + .ARM.attributes + 0x00000393 0x31 ../../../os/kernel/src/chqueues.o + .ARM.attributes + 0x000003c4 0x31 ../../../os/kernel/src/chmemcore.o + .ARM.attributes + 0x000003f5 0x31 ../../../os/kernel/src/chheap.o + .ARM.attributes + 0x00000426 0x31 ../../../os/kernel/src/chmempools.o + .ARM.attributes + 0x00000457 0x31 ../../../test/test.o + .ARM.attributes + 0x00000488 0x31 ../../../test/testthd.o + .ARM.attributes + 0x000004b9 0x31 ../../../test/testsem.o + .ARM.attributes + 0x000004ea 0x31 ../../../test/testmtx.o + .ARM.attributes + 0x0000051b 0x31 ../../../test/testmsg.o + .ARM.attributes + 0x0000054c 0x31 ../../../test/testmbox.o + .ARM.attributes + 0x0000057d 0x31 ../../../test/testevt.o + .ARM.attributes + 0x000005ae 0x31 ../../../test/testheap.o + .ARM.attributes + 0x000005df 0x31 ../../../test/testpools.o + .ARM.attributes + 0x00000610 0x31 ../../../test/testdyn.o + .ARM.attributes + 0x00000641 0x31 ../../../test/testqueues.o + .ARM.attributes + 0x00000672 0x31 ../../../test/testbmk.o + .ARM.attributes + 0x000006a3 0x31 ../../../os/hal/src/hal.o + .ARM.attributes + 0x000006d4 0x31 ../../../os/hal/src/adc.o + .ARM.attributes + 0x00000705 0x31 ../../../os/hal/src/can.o + .ARM.attributes + 0x00000736 0x31 ../../../os/hal/src/gpt.o + .ARM.attributes + 0x00000767 0x31 ../../../os/hal/src/i2c.o + .ARM.attributes + 0x00000798 0x31 ../../../os/hal/src/mac.o + .ARM.attributes + 0x000007c9 0x31 ../../../os/hal/src/pal.o + .ARM.attributes + 0x000007fa 0x31 ../../../os/hal/src/pwm.o + .ARM.attributes + 0x0000082b 0x31 ../../../os/hal/src/serial.o + .ARM.attributes + 0x0000085c 0x31 ../../../os/hal/src/spi.o + .ARM.attributes + 0x0000088d 0x31 ../../../os/hal/src/uart.o + .ARM.attributes + 0x000008be 0x31 ../../../os/hal/src/usb.o + .ARM.attributes + 0x000008ef 0x31 ../../../os/hal/src/mmc_spi.o + .ARM.attributes + 0x00000920 0x31 ../../../os/hal/src/serial_usb.o + .ARM.attributes + 0x00000951 0x31 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .ARM.attributes + 0x00000982 0x31 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .ARM.attributes + 0x000009b3 0x31 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .ARM.attributes + 0x000009e4 0x31 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .ARM.attributes + 0x00000a15 0x31 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .ARM.attributes + 0x00000a46 0x31 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .ARM.attributes + 0x00000a77 0x31 ../../../os/various/evtimer.o + .ARM.attributes + 0x00000aa8 0x31 ../../../os/various/syscalls.o + .ARM.attributes + 0x00000ad9 0x31 main.o + .ARM.attributes + 0x00000b0a 0x29 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.comment 0x00000000 0x11 + .comment 0x00000000 0x11 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + 0x12 (size before relaxing) + .comment 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/chcore.o + .comment 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .comment 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/nvic.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chsys.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chdebug.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chlists.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chvt.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chschd.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chthreads.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chdynamic.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chregistry.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chsem.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chmtx.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chcond.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chevents.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chmsg.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chmboxes.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chqueues.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chmemcore.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chheap.o + .comment 0x00000000 0x12 ../../../os/kernel/src/chmempools.o + .comment 0x00000000 0x12 ../../../test/test.o + .comment 0x00000000 0x12 ../../../test/testthd.o + .comment 0x00000000 0x12 ../../../test/testsem.o + .comment 0x00000000 0x12 ../../../test/testmtx.o + .comment 0x00000000 0x12 ../../../test/testmsg.o + .comment 0x00000000 0x12 ../../../test/testmbox.o + .comment 0x00000000 0x12 ../../../test/testevt.o + .comment 0x00000000 0x12 ../../../test/testheap.o + .comment 0x00000000 0x12 ../../../test/testpools.o + .comment 0x00000000 0x12 ../../../test/testdyn.o + .comment 0x00000000 0x12 ../../../test/testqueues.o + .comment 0x00000000 0x12 ../../../test/testbmk.o + .comment 0x00000000 0x12 ../../../os/hal/src/hal.o + .comment 0x00000000 0x12 ../../../os/hal/src/adc.o + .comment 0x00000000 0x12 ../../../os/hal/src/can.o + .comment 0x00000000 0x12 ../../../os/hal/src/gpt.o + .comment 0x00000000 0x12 ../../../os/hal/src/i2c.o + .comment 0x00000000 0x12 ../../../os/hal/src/mac.o + .comment 0x00000000 0x12 ../../../os/hal/src/pal.o + .comment 0x00000000 0x12 ../../../os/hal/src/pwm.o + .comment 0x00000000 0x12 ../../../os/hal/src/serial.o + .comment 0x00000000 0x12 ../../../os/hal/src/spi.o + .comment 0x00000000 0x12 ../../../os/hal/src/uart.o + .comment 0x00000000 0x12 ../../../os/hal/src/usb.o + .comment 0x00000000 0x12 ../../../os/hal/src/mmc_spi.o + .comment 0x00000000 0x12 ../../../os/hal/src/serial_usb.o + .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .comment 0x00000000 0x12 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .comment 0x00000000 0x12 ../../../os/various/evtimer.o + .comment 0x00000000 0x12 ../../../os/various/syscalls.o + .comment 0x00000000 0x12 main.o + .comment 0x00000000 0x12 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_abbrev 0x00000000 0x5409 + .debug_abbrev 0x00000000 0x74 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_abbrev 0x00000074 0x41 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_abbrev 0x000000b5 0x17a ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_abbrev 0x0000022f 0xfa ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_abbrev 0x00000329 0x182 ../../../os/kernel/src/chsys.o + .debug_abbrev 0x000004ab 0x2a ../../../os/kernel/src/chdebug.o + .debug_abbrev 0x000004d5 0x2a ../../../os/kernel/src/chlists.o + .debug_abbrev 0x000004ff 0x163 ../../../os/kernel/src/chvt.o + .debug_abbrev 0x00000662 0x29f ../../../os/kernel/src/chschd.o + .debug_abbrev 0x00000901 0x2e4 ../../../os/kernel/src/chthreads.o + .debug_abbrev 0x00000be5 0x1ac ../../../os/kernel/src/chdynamic.o + .debug_abbrev 0x00000d91 0x14b ../../../os/kernel/src/chregistry.o + .debug_abbrev 0x00000edc 0x27d ../../../os/kernel/src/chsem.o + .debug_abbrev 0x00001159 0x2c5 ../../../os/kernel/src/chmtx.o + .debug_abbrev 0x0000141e 0x26a ../../../os/kernel/src/chcond.o + .debug_abbrev 0x00001688 0x201 ../../../os/kernel/src/chevents.o + .debug_abbrev 0x00001889 0x1b1 ../../../os/kernel/src/chmsg.o + .debug_abbrev 0x00001a3a 0x1e2 ../../../os/kernel/src/chmboxes.o + .debug_abbrev 0x00001c1c 0x206 ../../../os/kernel/src/chqueues.o + .debug_abbrev 0x00001e22 0x167 ../../../os/kernel/src/chmemcore.o + .debug_abbrev 0x00001f89 0x18d ../../../os/kernel/src/chheap.o + .debug_abbrev 0x00002116 0x1ef ../../../os/kernel/src/chmempools.o + .debug_abbrev 0x00002305 0x40c ../../../test/test.o + .debug_abbrev 0x00002711 0x1c7 ../../../test/testthd.o + .debug_abbrev 0x000028d8 0x1e8 ../../../test/testsem.o + .debug_abbrev 0x00002ac0 0x27b ../../../test/testmtx.o + .debug_abbrev 0x00002d3b 0x171 ../../../test/testmsg.o + .debug_abbrev 0x00002eac 0x1a5 ../../../test/testmbox.o + .debug_abbrev 0x00003051 0x207 ../../../test/testevt.o + .debug_abbrev 0x00003258 0x1aa ../../../test/testheap.o + .debug_abbrev 0x00003402 0x14a ../../../test/testpools.o + .debug_abbrev 0x0000354c 0x211 ../../../test/testdyn.o + .debug_abbrev 0x0000375d 0x206 ../../../test/testqueues.o + .debug_abbrev 0x00003963 0x2cb ../../../test/testbmk.o + .debug_abbrev 0x00003c2e 0x98 ../../../os/hal/src/hal.o + .debug_abbrev 0x00003cc6 0x42 ../../../os/hal/src/adc.o + .debug_abbrev 0x00003d08 0x42 ../../../os/hal/src/can.o + .debug_abbrev 0x00003d4a 0x1e1 ../../../os/hal/src/gpt.o + .debug_abbrev 0x00003f2b 0x42 ../../../os/hal/src/i2c.o + .debug_abbrev 0x00003f6d 0x42 ../../../os/hal/src/mac.o + .debug_abbrev 0x00003faf 0x16d ../../../os/hal/src/pal.o + .debug_abbrev 0x0000411c 0x42 ../../../os/hal/src/pwm.o + .debug_abbrev 0x0000415e 0x24b ../../../os/hal/src/serial.o + .debug_abbrev 0x000043a9 0x42 ../../../os/hal/src/spi.o + .debug_abbrev 0x000043eb 0x42 ../../../os/hal/src/uart.o + .debug_abbrev 0x0000442d 0x42 ../../../os/hal/src/usb.o + .debug_abbrev 0x0000446f 0x42 ../../../os/hal/src/mmc_spi.o + .debug_abbrev 0x000044b1 0x42 ../../../os/hal/src/serial_usb.o + .debug_abbrev 0x000044f3 0x117 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_abbrev 0x0000460a 0x245 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_abbrev 0x0000484f 0x14c ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_abbrev 0x0000499b 0x301 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_abbrev 0x00004c9c 0x42 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .debug_abbrev 0x00004cde 0xec ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_abbrev 0x00004dca 0x152 ../../../os/various/evtimer.o + .debug_abbrev 0x00004f1c 0x1dc ../../../os/various/syscalls.o + .debug_abbrev 0x000050f8 0x275 main.o + .debug_abbrev 0x0000536d 0x9c c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_info 0x00000000 0x15945 + .debug_info 0x00000000 0xae ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_info 0x000000ae 0x84 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_info 0x00000132 0x66a ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_info 0x0000079c 0x356 ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_info 0x00000af2 0x714 ../../../os/kernel/src/chsys.o + .debug_info 0x00001206 0x6c ../../../os/kernel/src/chdebug.o + .debug_info 0x00001272 0x6c ../../../os/kernel/src/chlists.o + .debug_info 0x000012de 0x272 ../../../os/kernel/src/chvt.o + .debug_info 0x00001550 0x83a ../../../os/kernel/src/chschd.o + .debug_info 0x00001d8a 0xa69 ../../../os/kernel/src/chthreads.o + .debug_info 0x000027f3 0x729 ../../../os/kernel/src/chdynamic.o + .debug_info 0x00002f1c 0x4f0 ../../../os/kernel/src/chregistry.o + .debug_info 0x0000340c 0x9d6 ../../../os/kernel/src/chsem.o + .debug_info 0x00003de2 0x945 ../../../os/kernel/src/chmtx.o + .debug_info 0x00004727 0x860 ../../../os/kernel/src/chcond.o + .debug_info 0x00004f87 0xc03 ../../../os/kernel/src/chevents.o + .debug_info 0x00005b8a 0x60b ../../../os/kernel/src/chmsg.o + .debug_info 0x00006195 0x854 ../../../os/kernel/src/chmboxes.o + .debug_info 0x000069e9 0xa25 ../../../os/kernel/src/chqueues.o + .debug_info 0x0000740e 0x212 ../../../os/kernel/src/chmemcore.o + .debug_info 0x00007620 0x618 ../../../os/kernel/src/chheap.o + .debug_info 0x00007c38 0x322 ../../../os/kernel/src/chmempools.o + .debug_info 0x00007f5a 0xfc0 ../../../test/test.o + .debug_info 0x00008f1a 0x7bc ../../../test/testthd.o + .debug_info 0x000096d6 0x92f ../../../test/testsem.o + .debug_info 0x0000a005 0xc6c ../../../test/testmtx.o + .debug_info 0x0000ac71 0x589 ../../../test/testmsg.o + .debug_info 0x0000b1fa 0x60c ../../../test/testmbox.o + .debug_info 0x0000b806 0x8de ../../../test/testevt.o + .debug_info 0x0000c0e4 0x65a ../../../test/testheap.o + .debug_info 0x0000c73e 0x250 ../../../test/testpools.o + .debug_info 0x0000c98e 0x8f5 ../../../test/testdyn.o + .debug_info 0x0000d283 0x81e ../../../test/testqueues.o + .debug_info 0x0000daa1 0xd5e ../../../test/testbmk.o + .debug_info 0x0000e7ff 0x14a ../../../os/hal/src/hal.o + .debug_info 0x0000e949 0x8d ../../../os/hal/src/adc.o + .debug_info 0x0000e9d6 0x8d ../../../os/hal/src/can.o + .debug_info 0x0000ea63 0x682 ../../../os/hal/src/gpt.o + .debug_info 0x0000f0e5 0x8d ../../../os/hal/src/i2c.o + .debug_info 0x0000f172 0x8d ../../../os/hal/src/mac.o + .debug_info 0x0000f1ff 0x2c5 ../../../os/hal/src/pal.o + .debug_info 0x0000f4c4 0x8d ../../../os/hal/src/pwm.o + .debug_info 0x0000f551 0xe72 ../../../os/hal/src/serial.o + .debug_info 0x000103c3 0x8d ../../../os/hal/src/spi.o + .debug_info 0x00010450 0x8d ../../../os/hal/src/uart.o + .debug_info 0x000104dd 0x94 ../../../os/hal/src/usb.o + .debug_info 0x00010571 0x8d ../../../os/hal/src/mmc_spi.o + .debug_info 0x000105fe 0x8d ../../../os/hal/src/serial_usb.o + .debug_info 0x0001068b 0x58c ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_info 0x00010c17 0xb89 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_info 0x000117a0 0x2da ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_info 0x00011a7a 0x1654 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_info 0x000130ce 0x8d ../../../os/hal/platforms/LPC13xx/spi_lld.o + .debug_info 0x0001315b 0x411 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_info 0x0001356c 0x5a9 ../../../os/various/evtimer.o + .debug_info 0x00013b15 0xcc6 ../../../os/various/syscalls.o + .debug_info 0x000147db 0x1056 main.o + .debug_info 0x00015831 0x114 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_line 0x00000000 0x61f5 + .debug_line 0x00000000 0x60 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_line 0x00000060 0x56 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_line 0x000000b6 0x193 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_line 0x00000249 0xe6 ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_line 0x0000032f 0x18e ../../../os/kernel/src/chsys.o + .debug_line 0x000004bd 0x1d ../../../os/kernel/src/chdebug.o + .debug_line 0x000004da 0x1d ../../../os/kernel/src/chlists.o + .debug_line 0x000004f7 0x150 ../../../os/kernel/src/chvt.o + .debug_line 0x00000647 0x2c0 ../../../os/kernel/src/chschd.o + .debug_line 0x00000907 0x312 ../../../os/kernel/src/chthreads.o + .debug_line 0x00000c19 0x210 ../../../os/kernel/src/chdynamic.o + .debug_line 0x00000e29 0x151 ../../../os/kernel/src/chregistry.o + .debug_line 0x00000f7a 0x2f6 ../../../os/kernel/src/chsem.o + .debug_line 0x00001270 0x2fb ../../../os/kernel/src/chmtx.o + .debug_line 0x0000156b 0x260 ../../../os/kernel/src/chcond.o + .debug_line 0x000017cb 0x2d9 ../../../os/kernel/src/chevents.o + .debug_line 0x00001aa4 0x19f ../../../os/kernel/src/chmsg.o + .debug_line 0x00001c43 0x24c ../../../os/kernel/src/chmboxes.o + .debug_line 0x00001e8f 0x2de ../../../os/kernel/src/chqueues.o + .debug_line 0x0000216d 0x137 ../../../os/kernel/src/chmemcore.o + .debug_line 0x000022a4 0x269 ../../../os/kernel/src/chheap.o + .debug_line 0x0000250d 0x18e ../../../os/kernel/src/chmempools.o + .debug_line 0x0000269b 0x491 ../../../test/test.o + .debug_line 0x00002b2c 0x1e2 ../../../test/testthd.o + .debug_line 0x00002d0e 0x2b5 ../../../test/testsem.o + .debug_line 0x00002fc3 0x471 ../../../test/testmtx.o + .debug_line 0x00003434 0x157 ../../../test/testmsg.o + .debug_line 0x0000358b 0x1a8 ../../../test/testmbox.o + .debug_line 0x00003733 0x275 ../../../test/testevt.o + .debug_line 0x000039a8 0x1f2 ../../../test/testheap.o + .debug_line 0x00003b9a 0x113 ../../../test/testpools.o + .debug_line 0x00003cad 0x2df ../../../test/testdyn.o + .debug_line 0x00003f8c 0x29e ../../../test/testqueues.o + .debug_line 0x0000422a 0x562 ../../../test/testbmk.o + .debug_line 0x0000478c 0xdb ../../../os/hal/src/hal.o + .debug_line 0x00004867 0x4d ../../../os/hal/src/adc.o + .debug_line 0x000048b4 0x4d ../../../os/hal/src/can.o + .debug_line 0x00004901 0x1d8 ../../../os/hal/src/gpt.o + .debug_line 0x00004ad9 0x4d ../../../os/hal/src/i2c.o + .debug_line 0x00004b26 0x4d ../../../os/hal/src/mac.o + .debug_line 0x00004b73 0x125 ../../../os/hal/src/pal.o + .debug_line 0x00004c98 0x4d ../../../os/hal/src/pwm.o + .debug_line 0x00004ce5 0x331 ../../../os/hal/src/serial.o + .debug_line 0x00005016 0x4d ../../../os/hal/src/spi.o + .debug_line 0x00005063 0x4d ../../../os/hal/src/uart.o + .debug_line 0x000050b0 0x4d ../../../os/hal/src/usb.o + .debug_line 0x000050fd 0x4d ../../../os/hal/src/mmc_spi.o + .debug_line 0x0000514a 0x4d ../../../os/hal/src/serial_usb.o + .debug_line 0x00005197 0x109 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_line 0x000052a0 0x264 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_line 0x00005504 0xf0 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_line 0x000055f4 0x2e7 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_line 0x000058db 0x4d ../../../os/hal/platforms/LPC13xx/spi_lld.o + .debug_line 0x00005928 0x108 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_line 0x00005a30 0x170 ../../../os/various/evtimer.o + .debug_line 0x00005ba0 0x187 ../../../os/various/syscalls.o + .debug_line 0x00005d27 0x35f main.o + .debug_line 0x00006086 0x16f c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_pubnames + 0x00000000 0x13e4 + .debug_pubnames + 0x00000000 0x38 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_pubnames + 0x00000038 0x20 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_pubnames + 0x00000058 0x8d ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_pubnames + 0x000000e5 0x5e ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_pubnames + 0x00000143 0x5c ../../../os/kernel/src/chsys.o + .debug_pubnames + 0x0000019f 0x58 ../../../os/kernel/src/chvt.o + .debug_pubnames + 0x000001f7 0xc2 ../../../os/kernel/src/chschd.o + .debug_pubnames + 0x000002b9 0xd0 ../../../os/kernel/src/chthreads.o + .debug_pubnames + 0x00000389 0x69 ../../../os/kernel/src/chdynamic.o + .debug_pubnames + 0x000003f2 0x3b ../../../os/kernel/src/chregistry.o + .debug_pubnames + 0x0000042d 0xd1 ../../../os/kernel/src/chsem.o + .debug_pubnames + 0x000004fe 0x94 ../../../os/kernel/src/chmtx.o + .debug_pubnames + 0x00000592 0xb9 ../../../os/kernel/src/chcond.o + .debug_pubnames + 0x0000064b 0x14b ../../../os/kernel/src/chevents.o + .debug_pubnames + 0x00000796 0x3f ../../../os/kernel/src/chmsg.o + .debug_pubnames + 0x000007d5 0xba ../../../os/kernel/src/chmboxes.o + .debug_pubnames + 0x0000088f 0xd5 ../../../os/kernel/src/chqueues.o + .debug_pubnames + 0x00000964 0x52 ../../../os/kernel/src/chmemcore.o + .debug_pubnames + 0x000009b6 0x5f ../../../os/kernel/src/chheap.o + .debug_pubnames + 0x00000a15 0x61 ../../../os/kernel/src/chmempools.o + .debug_pubnames + 0x00000a76 0x158 ../../../test/test.o + .debug_pubnames + 0x00000bce 0x55 ../../../test/testthd.o + .debug_pubnames + 0x00000c23 0x55 ../../../test/testsem.o + .debug_pubnames + 0x00000c78 0x89 ../../../test/testmtx.o + .debug_pubnames + 0x00000d01 0x2e ../../../test/testmsg.o + .debug_pubnames + 0x00000d2f 0x30 ../../../test/testmbox.o + .debug_pubnames + 0x00000d5f 0x48 ../../../test/testevt.o + .debug_pubnames + 0x00000da7 0x30 ../../../test/testheap.o + .debug_pubnames + 0x00000dd7 0x32 ../../../test/testpools.o + .debug_pubnames + 0x00000e09 0x48 ../../../test/testdyn.o + .debug_pubnames + 0x00000e51 0x44 ../../../test/testqueues.o + .debug_pubnames + 0x00000e95 0xda ../../../test/testbmk.o + .debug_pubnames + 0x00000f6f 0x1e ../../../os/hal/src/hal.o + .debug_pubnames + 0x00000f8d 0xd7 ../../../os/hal/src/gpt.o + .debug_pubnames + 0x00001064 0x43 ../../../os/hal/src/pal.o + .debug_pubnames + 0x000010a7 0x6c ../../../os/hal/src/serial.o + .debug_pubnames + 0x00001113 0x3a ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_pubnames + 0x0000114d 0xea ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_pubnames + 0x00001237 0x3e ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_pubnames + 0x00001275 0x58 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_pubnames + 0x000012cd 0x48 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_pubnames + 0x00001315 0x2b ../../../os/various/evtimer.o + .debug_pubnames + 0x00001340 0x6c ../../../os/various/syscalls.o + .debug_pubnames + 0x000013ac 0x1b main.o + .debug_pubnames + 0x000013c7 0x1d c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_pubtypes + 0x00000000 0x34ef + .debug_pubtypes + 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_pubtypes + 0x00000012 0x12 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_pubtypes + 0x00000024 0x116 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_pubtypes + 0x0000013a 0x38 ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_pubtypes + 0x00000172 0x185 ../../../os/kernel/src/chsys.o + .debug_pubtypes + 0x000002f7 0x12 ../../../os/kernel/src/chdebug.o + .debug_pubtypes + 0x00000309 0x12 ../../../os/kernel/src/chlists.o + .debug_pubtypes + 0x0000031b 0x7e ../../../os/kernel/src/chvt.o + .debug_pubtypes + 0x00000399 0x16d ../../../os/kernel/src/chschd.o + .debug_pubtypes + 0x00000506 0x168 ../../../os/kernel/src/chthreads.o + .debug_pubtypes + 0x0000066e 0x191 ../../../os/kernel/src/chdynamic.o + .debug_pubtypes + 0x000007ff 0x117 ../../../os/kernel/src/chregistry.o + .debug_pubtypes + 0x00000916 0x133 ../../../os/kernel/src/chsem.o + .debug_pubtypes + 0x00000a49 0x122 ../../../os/kernel/src/chmtx.o + .debug_pubtypes + 0x00000b6b 0x12f ../../../os/kernel/src/chcond.o + .debug_pubtypes + 0x00000c9a 0x179 ../../../os/kernel/src/chevents.o + .debug_pubtypes + 0x00000e13 0x117 ../../../os/kernel/src/chmsg.o + .debug_pubtypes + 0x00000f2a 0x131 ../../../os/kernel/src/chmboxes.o + .debug_pubtypes + 0x0000105b 0x18a ../../../os/kernel/src/chqueues.o + .debug_pubtypes + 0x000011e5 0x36 ../../../os/kernel/src/chmemcore.o + .debug_pubtypes + 0x0000121b 0x166 ../../../os/kernel/src/chheap.o + .debug_pubtypes + 0x00001381 0x5a ../../../os/kernel/src/chmempools.o + .debug_pubtypes + 0x000013db 0x1c4 ../../../test/test.o + .debug_pubtypes + 0x0000159f 0x15e ../../../test/testthd.o + .debug_pubtypes + 0x000016fd 0x18e ../../../test/testsem.o + .debug_pubtypes + 0x0000188b 0x181 ../../../test/testmtx.o + .debug_pubtypes + 0x00001a0c 0x124 ../../../test/testmsg.o + .debug_pubtypes + 0x00001b30 0x16b ../../../test/testmbox.o + .debug_pubtypes + 0x00001c9b 0x1c0 ../../../test/testevt.o + .debug_pubtypes + 0x00001e5b 0x184 ../../../test/testheap.o + .debug_pubtypes + 0x00001fdf 0x5a ../../../test/testpools.o + .debug_pubtypes + 0x00002039 0x1c6 ../../../test/testdyn.o + .debug_pubtypes + 0x000021ff 0x1d2 ../../../test/testqueues.o + .debug_pubtypes + 0x000023d1 0x1b9 ../../../test/testbmk.o + .debug_pubtypes + 0x0000258a 0x46 ../../../os/hal/src/hal.o + .debug_pubtypes + 0x000025d0 0x12 ../../../os/hal/src/adc.o + .debug_pubtypes + 0x000025e2 0x12 ../../../os/hal/src/can.o + .debug_pubtypes + 0x000025f4 0x99 ../../../os/hal/src/gpt.o + .debug_pubtypes + 0x0000268d 0x12 ../../../os/hal/src/i2c.o + .debug_pubtypes + 0x0000269f 0x12 ../../../os/hal/src/mac.o + .debug_pubtypes + 0x000026b1 0x6f ../../../os/hal/src/pal.o + .debug_pubtypes + 0x00002720 0x12 ../../../os/hal/src/pwm.o + .debug_pubtypes + 0x00002732 0x293 ../../../os/hal/src/serial.o + .debug_pubtypes + 0x000029c5 0x12 ../../../os/hal/src/spi.o + .debug_pubtypes + 0x000029d7 0x12 ../../../os/hal/src/uart.o + .debug_pubtypes + 0x000029e9 0x12 ../../../os/hal/src/usb.o + .debug_pubtypes + 0x000029fb 0x12 ../../../os/hal/src/mmc_spi.o + .debug_pubtypes + 0x00002a0d 0x12 ../../../os/hal/src/serial_usb.o + .debug_pubtypes + 0x00002a1f 0x47 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_pubtypes + 0x00002a66 0xc6 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_pubtypes + 0x00002b2c 0x8c ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_pubtypes + 0x00002bb8 0x28e ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_pubtypes + 0x00002e46 0x12 ../../../os/hal/platforms/LPC13xx/spi_lld.o + .debug_pubtypes + 0x00002e58 0x6d ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_pubtypes + 0x00002ec5 0x17e ../../../os/various/evtimer.o + .debug_pubtypes + 0x00003043 0x180 ../../../os/various/syscalls.o + .debug_pubtypes + 0x000031c3 0x30f main.o + .debug_pubtypes + 0x000034d2 0x1d c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_aranges 0x00000000 0xe18 + .debug_aranges + 0x00000000 0x20 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_aranges + 0x00000020 0x20 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_aranges + 0x00000040 0x48 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_aranges + 0x00000088 0x30 ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_aranges + 0x000000b8 0x30 ../../../os/kernel/src/chsys.o + .debug_aranges + 0x000000e8 0x38 ../../../os/kernel/src/chvt.o + .debug_aranges + 0x00000120 0x60 ../../../os/kernel/src/chschd.o + .debug_aranges + 0x00000180 0x70 ../../../os/kernel/src/chthreads.o + .debug_aranges + 0x000001f0 0x38 ../../../os/kernel/src/chdynamic.o + .debug_aranges + 0x00000228 0x28 ../../../os/kernel/src/chregistry.o + .debug_aranges + 0x00000250 0x70 ../../../os/kernel/src/chsem.o + .debug_aranges + 0x000002c0 0x58 ../../../os/kernel/src/chmtx.o + .debug_aranges + 0x00000318 0x60 ../../../os/kernel/src/chcond.o + .debug_aranges + 0x00000378 0x90 ../../../os/kernel/src/chevents.o + .debug_aranges + 0x00000408 0x30 ../../../os/kernel/src/chmsg.o + .debug_aranges + 0x00000438 0x70 ../../../os/kernel/src/chmboxes.o + .debug_aranges + 0x000004a8 0x78 ../../../os/kernel/src/chqueues.o + .debug_aranges + 0x00000520 0x38 ../../../os/kernel/src/chmemcore.o + .debug_aranges + 0x00000558 0x40 ../../../os/kernel/src/chheap.o + .debug_aranges + 0x00000598 0x40 ../../../os/kernel/src/chmempools.o + .debug_aranges + 0x000005d8 0x98 ../../../test/test.o + .debug_aranges + 0x00000670 0x40 ../../../test/testthd.o + .debug_aranges + 0x000006b0 0x70 ../../../test/testsem.o + .debug_aranges + 0x00000720 0x108 ../../../test/testmtx.o + .debug_aranges + 0x00000828 0x28 ../../../test/testmsg.o + .debug_aranges + 0x00000850 0x28 ../../../test/testmbox.o + .debug_aranges + 0x00000878 0x70 ../../../test/testevt.o + .debug_aranges + 0x000008e8 0x28 ../../../test/testheap.o + .debug_aranges + 0x00000910 0x30 ../../../test/testpools.o + .debug_aranges + 0x00000940 0x58 ../../../test/testdyn.o + .debug_aranges + 0x00000998 0x50 ../../../test/testqueues.o + .debug_aranges + 0x000009e8 0xd0 ../../../test/testbmk.o + .debug_aranges + 0x00000ab8 0x20 ../../../os/hal/src/hal.o + .debug_aranges + 0x00000ad8 0x70 ../../../os/hal/src/gpt.o + .debug_aranges + 0x00000b48 0x30 ../../../os/hal/src/pal.o + .debug_aranges + 0x00000b78 0x90 ../../../os/hal/src/serial.o + .debug_aranges + 0x00000c08 0x28 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_aranges + 0x00000c30 0x68 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_aranges + 0x00000c98 0x28 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_aranges + 0x00000cc0 0x40 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_aranges + 0x00000d00 0x28 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_aranges + 0x00000d28 0x30 ../../../os/various/evtimer.o + .debug_aranges + 0x00000d58 0x50 ../../../os/various/syscalls.o + .debug_aranges + 0x00000da8 0x50 main.o + .debug_aranges + 0x00000df8 0x20 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_ranges 0x00000000 0x1418 + .debug_ranges 0x00000000 0x10 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_ranges 0x00000010 0x10 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_ranges 0x00000020 0x38 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_ranges 0x00000058 0x20 ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_ranges 0x00000078 0x20 ../../../os/kernel/src/chsys.o + .debug_ranges 0x00000098 0x28 ../../../os/kernel/src/chvt.o + .debug_ranges 0x000000c0 0x130 ../../../os/kernel/src/chschd.o + .debug_ranges 0x000001f0 0xc0 ../../../os/kernel/src/chthreads.o + .debug_ranges 0x000002b0 0x58 ../../../os/kernel/src/chdynamic.o + .debug_ranges 0x00000308 0x30 ../../../os/kernel/src/chregistry.o + .debug_ranges 0x00000338 0x108 ../../../os/kernel/src/chsem.o + .debug_ranges 0x00000440 0x200 ../../../os/kernel/src/chmtx.o + .debug_ranges 0x00000640 0xf0 ../../../os/kernel/src/chcond.o + .debug_ranges 0x00000730 0xc8 ../../../os/kernel/src/chevents.o + .debug_ranges 0x000007f8 0x70 ../../../os/kernel/src/chmsg.o + .debug_ranges 0x00000868 0x78 ../../../os/kernel/src/chmboxes.o + .debug_ranges 0x000008e0 0x98 ../../../os/kernel/src/chqueues.o + .debug_ranges 0x00000978 0x58 ../../../os/kernel/src/chmemcore.o + .debug_ranges 0x000009d0 0x30 ../../../os/kernel/src/chheap.o + .debug_ranges 0x00000a00 0xa8 ../../../os/kernel/src/chmempools.o + .debug_ranges 0x00000aa8 0x110 ../../../test/test.o + .debug_ranges 0x00000bb8 0x78 ../../../test/testthd.o + .debug_ranges 0x00000c30 0x60 ../../../test/testsem.o + .debug_ranges 0x00000c90 0x110 ../../../test/testmtx.o + .debug_ranges 0x00000da0 0x18 ../../../test/testmsg.o + .debug_ranges 0x00000db8 0x18 ../../../test/testmbox.o + .debug_ranges 0x00000dd0 0x60 ../../../test/testevt.o + .debug_ranges 0x00000e30 0x18 ../../../test/testheap.o + .debug_ranges 0x00000e48 0x20 ../../../test/testpools.o + .debug_ranges 0x00000e68 0x48 ../../../test/testdyn.o + .debug_ranges 0x00000eb0 0x40 ../../../test/testqueues.o + .debug_ranges 0x00000ef0 0xd8 ../../../test/testbmk.o + .debug_ranges 0x00000fc8 0x10 ../../../os/hal/src/hal.o + .debug_ranges 0x00000fd8 0x90 ../../../os/hal/src/gpt.o + .debug_ranges 0x00001068 0x20 ../../../os/hal/src/pal.o + .debug_ranges 0x00001088 0xc8 ../../../os/hal/src/serial.o + .debug_ranges 0x00001150 0x18 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_ranges 0x00001168 0xb8 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_ranges 0x00001220 0x18 ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_ranges 0x00001238 0x128 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_ranges 0x00001360 0x18 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_ranges 0x00001378 0x20 ../../../os/various/evtimer.o + .debug_ranges 0x00001398 0x40 ../../../os/various/syscalls.o + .debug_ranges 0x000013d8 0x40 main.o + +.debug_str 0x00000000 0x2e58 + .debug_str 0x00000000 0xda ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + 0x10e (size before relaxing) + .debug_str 0x000000da 0x30 ../../../os/ports/GCC/ARMCMx/chcore.o + 0xf1 (size before relaxing) + .debug_str 0x0000010a 0x223 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + 0x303 (size before relaxing) + .debug_str 0x0000032d 0xb6 ../../../os/ports/GCC/ARMCMx/nvic.o + 0x1cd (size before relaxing) + .debug_str 0x000003e3 0x117 ../../../os/kernel/src/chsys.o + 0x383 (size before relaxing) + .debug_str 0x000004fa 0x21 ../../../os/kernel/src/chdebug.o + 0xe2 (size before relaxing) + .debug_str 0x0000051b 0x21 ../../../os/kernel/src/chlists.o + 0xe2 (size before relaxing) + .debug_str 0x0000053c 0x57 ../../../os/kernel/src/chvt.o + 0x194 (size before relaxing) + .debug_str 0x00000593 0xd8 ../../../os/kernel/src/chschd.o + 0x390 (size before relaxing) + .debug_str 0x0000066b 0xe4 ../../../os/kernel/src/chthreads.o + 0x3b6 (size before relaxing) + .debug_str 0x0000074f 0xf5 ../../../os/kernel/src/chdynamic.o + 0x352 (size before relaxing) + .debug_str 0x00000844 0x45 ../../../os/kernel/src/chregistry.o + 0x2aa (size before relaxing) + .debug_str 0x00000889 0xcb ../../../os/kernel/src/chsem.o + 0x359 (size before relaxing) + .debug_str 0x00000954 0x8d ../../../os/kernel/src/chmtx.o + 0x315 (size before relaxing) + .debug_str 0x000009e1 0xb3 ../../../os/kernel/src/chcond.o + 0x335 (size before relaxing) + .debug_str 0x00000a94 0x17c ../../../os/kernel/src/chevents.o + 0x3eb (size before relaxing) + .debug_str 0x00000c10 0x40 ../../../os/kernel/src/chmsg.o + 0x2be (size before relaxing) + .debug_str 0x00000c50 0xe5 ../../../os/kernel/src/chmboxes.o + 0x31e (size before relaxing) + .debug_str 0x00000d35 0x11b ../../../os/kernel/src/chqueues.o + 0x367 (size before relaxing) + .debug_str 0x00000e50 0x7d ../../../os/kernel/src/chmemcore.o + 0x15b (size before relaxing) + .debug_str 0x00000ecd 0x6c ../../../os/kernel/src/chheap.o + 0x300 (size before relaxing) + .debug_str 0x00000f39 0x5f ../../../os/kernel/src/chmempools.o + 0x192 (size before relaxing) + .debug_str 0x00000f98 0x283 ../../../test/test.o + 0x5a9 (size before relaxing) + .debug_str 0x0000121b 0x70 ../../../test/testthd.o + 0x379 (size before relaxing) + .debug_str 0x0000128b 0xd9 ../../../test/testsem.o + 0x3ee (size before relaxing) + .debug_str 0x00001364 0x197 ../../../test/testmtx.o + 0x4b8 (size before relaxing) + .debug_str 0x000014fb 0x2e ../../../test/testmsg.o + 0x2d7 (size before relaxing) + .debug_str 0x00001529 0x42 ../../../test/testmbox.o + 0x320 (size before relaxing) + .debug_str 0x0000156b 0x82 ../../../test/testevt.o + 0x3ea (size before relaxing) + .debug_str 0x000015ed 0x47 ../../../test/testheap.o + 0x324 (size before relaxing) + .debug_str 0x00001634 0x4f ../../../test/testpools.o + 0x1a2 (size before relaxing) + .debug_str 0x00001683 0x89 ../../../test/testdyn.o + 0x417 (size before relaxing) + .debug_str 0x0000170c 0x6f ../../../test/testqueues.o + 0x3da (size before relaxing) + .debug_str 0x0000177b 0x182 ../../../test/testbmk.o + 0x50f (size before relaxing) + .debug_str 0x000018fd 0x54 ../../../os/hal/src/hal.o + 0x130 (size before relaxing) + .debug_str 0x00001951 0x1a ../../../os/hal/src/adc.o + 0xe8 (size before relaxing) + .debug_str 0x0000196b 0x1a ../../../os/hal/src/can.o + 0xe8 (size before relaxing) + .debug_str 0x00001985 0x178 ../../../os/hal/src/gpt.o + 0x265 (size before relaxing) + .debug_str 0x00001afd 0x1a ../../../os/hal/src/i2c.o + 0xe8 (size before relaxing) + .debug_str 0x00001b17 0x1a ../../../os/hal/src/mac.o + 0xe8 (size before relaxing) + .debug_str 0x00001b31 0xbc ../../../os/hal/src/pal.o + 0x1a2 (size before relaxing) + .debug_str 0x00001bed 0x1a ../../../os/hal/src/pwm.o + 0xe8 (size before relaxing) + .debug_str 0x00001c07 0x190 ../../../os/hal/src/serial.o + 0x4e4 (size before relaxing) + .debug_str 0x00001d97 0x1a ../../../os/hal/src/spi.o + 0xe8 (size before relaxing) + .debug_str 0x00001db1 0x1b ../../../os/hal/src/uart.o + 0xe9 (size before relaxing) + .debug_str 0x00001dcc 0x1a ../../../os/hal/src/usb.o + 0xed (size before relaxing) + .debug_str 0x00001de6 0x1e ../../../os/hal/src/mmc_spi.o + 0xec (size before relaxing) + .debug_str 0x00001e04 0x21 ../../../os/hal/src/serial_usb.o + 0xef (size before relaxing) + .debug_str 0x00001e25 0x30d ../../../os/hal/platforms/LPC13xx/hal_lld.o + 0x407 (size before relaxing) + .debug_str 0x00002132 0x447 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + 0x8ab (size before relaxing) + .debug_str 0x00002579 0x55 ../../../os/hal/platforms/LPC13xx/pal_lld.o + 0x1be (size before relaxing) + .debug_str 0x000025ce 0x211 ../../../os/hal/platforms/LPC13xx/serial_lld.o + 0xc55 (size before relaxing) + .debug_str 0x000027df 0x2c ../../../os/hal/platforms/LPC13xx/spi_lld.o + 0xfa (size before relaxing) + .debug_str 0x0000280b 0x45 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + 0x2f8 (size before relaxing) + .debug_str 0x00002850 0x55 ../../../os/various/evtimer.o + 0x2e6 (size before relaxing) + .debug_str 0x000028a5 0x4b5 ../../../os/various/syscalls.o + 0x5d8 (size before relaxing) + .debug_str 0x00002d5a 0x5a main.o + 0x5cd (size before relaxing) + .debug_str 0x00002db4 0xa4 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + 0x147 (size before relaxing) + +.debug_frame 0x00000000 0x2514 + .debug_frame 0x00000000 0x20 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + .debug_frame 0x00000020 0x20 ../../../os/ports/GCC/ARMCMx/chcore.o + .debug_frame 0x00000040 0x88 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_frame 0x000000c8 0x54 ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_frame 0x0000011c 0x5c ../../../os/kernel/src/chsys.o + .debug_frame 0x00000178 0x5c ../../../os/kernel/src/chvt.o + .debug_frame 0x000001d4 0xe4 ../../../os/kernel/src/chschd.o + .debug_frame 0x000002b8 0x140 ../../../os/kernel/src/chthreads.o + .debug_frame 0x000003f8 0x88 ../../../os/kernel/src/chdynamic.o + .debug_frame 0x00000480 0x3c ../../../os/kernel/src/chregistry.o + .debug_frame 0x000004bc 0x140 ../../../os/kernel/src/chsem.o + .debug_frame 0x000005fc 0xd4 ../../../os/kernel/src/chmtx.o + .debug_frame 0x000006d0 0x10c ../../../os/kernel/src/chcond.o + .debug_frame 0x000007dc 0x1b4 ../../../os/kernel/src/chevents.o + .debug_frame 0x00000990 0x64 ../../../os/kernel/src/chmsg.o + .debug_frame 0x000009f4 0x150 ../../../os/kernel/src/chmboxes.o + .debug_frame 0x00000b44 0x170 ../../../os/kernel/src/chqueues.o + .debug_frame 0x00000cb4 0x50 ../../../os/kernel/src/chmemcore.o + .debug_frame 0x00000d04 0xa8 ../../../os/kernel/src/chheap.o + .debug_frame 0x00000dac 0x78 ../../../os/kernel/src/chmempools.o + .debug_frame 0x00000e24 0x1c4 ../../../test/test.o + .debug_frame 0x00000fe8 0xc4 ../../../test/testthd.o + .debug_frame 0x000010ac 0x15c ../../../test/testsem.o + .debug_frame 0x00001208 0x3bc ../../../test/testmtx.o + .debug_frame 0x000015c4 0x48 ../../../test/testmsg.o + .debug_frame 0x0000160c 0x54 ../../../test/testmbox.o + .debug_frame 0x00001660 0x164 ../../../test/testevt.o + .debug_frame 0x000017c4 0x50 ../../../test/testheap.o + .debug_frame 0x00001814 0x5c ../../../test/testpools.o + .debug_frame 0x00001870 0x104 ../../../test/testdyn.o + .debug_frame 0x00001974 0xe0 ../../../test/testqueues.o + .debug_frame 0x00001a54 0x2d8 ../../../test/testbmk.o + .debug_frame 0x00001d2c 0x2c ../../../os/hal/src/hal.o + .debug_frame 0x00001d58 0x138 ../../../os/hal/src/gpt.o + .debug_frame 0x00001e90 0x4c ../../../os/hal/src/pal.o + .debug_frame 0x00001edc 0x19c ../../../os/hal/src/serial.o + .debug_frame 0x00002078 0x3c ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_frame 0x000020b4 0x104 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_frame 0x000021b8 0x3c ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_frame 0x000021f4 0xb0 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_frame 0x000022a4 0x3c ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_frame 0x000022e0 0x64 ../../../os/various/evtimer.o + .debug_frame 0x00002344 0x98 ../../../os/various/syscalls.o + .debug_frame 0x000023dc 0x110 main.o + .debug_frame 0x000024ec 0x28 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +.debug_loc 0x00000000 0x7127 + .debug_loc 0x00000000 0xf0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + .debug_loc 0x000000f0 0xea ../../../os/ports/GCC/ARMCMx/nvic.o + .debug_loc 0x000001da 0x9e ../../../os/kernel/src/chsys.o + .debug_loc 0x00000278 0xb4 ../../../os/kernel/src/chvt.o + .debug_loc 0x0000032c 0x2ed ../../../os/kernel/src/chschd.o + .debug_loc 0x00000619 0x4a7 ../../../os/kernel/src/chthreads.o + .debug_loc 0x00000ac0 0x2eb ../../../os/kernel/src/chdynamic.o + .debug_loc 0x00000dab 0xc9 ../../../os/kernel/src/chregistry.o + .debug_loc 0x00000e74 0x609 ../../../os/kernel/src/chsem.o + .debug_loc 0x0000147d 0x4ad ../../../os/kernel/src/chmtx.o + .debug_loc 0x0000192a 0x483 ../../../os/kernel/src/chcond.o + .debug_loc 0x00001dad 0x87a ../../../os/kernel/src/chevents.o + .debug_loc 0x00002627 0x19a ../../../os/kernel/src/chmsg.o + .debug_loc 0x000027c1 0x4d4 ../../../os/kernel/src/chmboxes.o + .debug_loc 0x00002c95 0x72e ../../../os/kernel/src/chqueues.o + .debug_loc 0x000033c3 0xe0 ../../../os/kernel/src/chmemcore.o + .debug_loc 0x000034a3 0x30f ../../../os/kernel/src/chheap.o + .debug_loc 0x000037b2 0x193 ../../../os/kernel/src/chmempools.o + .debug_loc 0x00003945 0x50b ../../../test/test.o + .debug_loc 0x00003e50 0x1f3 ../../../test/testthd.o + .debug_loc 0x00004043 0x2d2 ../../../test/testsem.o + .debug_loc 0x00004315 0x684 ../../../test/testmtx.o + .debug_loc 0x00004999 0xe0 ../../../test/testmsg.o + .debug_loc 0x00004a79 0x164 ../../../test/testmbox.o + .debug_loc 0x00004bdd 0x2e2 ../../../test/testevt.o + .debug_loc 0x00004ebf 0x1d8 ../../../test/testheap.o + .debug_loc 0x00005097 0x67 ../../../test/testpools.o + .debug_loc 0x000050fe 0x20b ../../../test/testdyn.o + .debug_loc 0x00005309 0x150 ../../../test/testqueues.o + .debug_loc 0x00005459 0x678 ../../../test/testbmk.o + .debug_loc 0x00005ad1 0x20 ../../../os/hal/src/hal.o + .debug_loc 0x00005af1 0x390 ../../../os/hal/src/gpt.o + .debug_loc 0x00005e81 0x64 ../../../os/hal/src/pal.o + .debug_loc 0x00005ee5 0x50e ../../../os/hal/src/serial.o + .debug_loc 0x000063f3 0x33 ../../../os/hal/platforms/LPC13xx/hal_lld.o + .debug_loc 0x00006426 0x1ee ../../../os/hal/platforms/LPC13xx/gpt_lld.o + .debug_loc 0x00006614 0x8d ../../../os/hal/platforms/LPC13xx/pal_lld.o + .debug_loc 0x000066a1 0x375 ../../../os/hal/platforms/LPC13xx/serial_lld.o + .debug_loc 0x00006a16 0x20 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + .debug_loc 0x00006a36 0x119 ../../../os/various/evtimer.o + .debug_loc 0x00006b4f 0x150 ../../../os/various/syscalls.o + .debug_loc 0x00006c9f 0x30a main.o + .debug_loc 0x00006fa9 0x17e c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + +Cross Reference Table + +Symbol File +BusFaultVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +DebugMonitorVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +GPTD1 main.o + ../../../os/hal/platforms/LPC13xx/gpt_lld.o +GPTD2 main.o + ../../../os/hal/platforms/LPC13xx/gpt_lld.o +GPTD3 ../../../os/hal/platforms/LPC13xx/gpt_lld.o +GPTD4 ../../../os/hal/platforms/LPC13xx/gpt_lld.o +HardFaultVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +LPC13xx_clock_init ../../../os/hal/platforms/LPC13xx/hal_lld.o + ../../../boards/EA_LPCXPRESSO_BB_1343/board.o +MemManageVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +NMIVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +NVICDisableVector ../../../os/ports/GCC/ARMCMx/nvic.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/platforms/LPC13xx/gpt_lld.o +NVICEnableVector ../../../os/ports/GCC/ARMCMx/nvic.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/platforms/LPC13xx/gpt_lld.o +NVICSetSystemHandlerPriority ../../../os/ports/GCC/ARMCMx/nvic.o + ../../../os/hal/platforms/LPC13xx/hal_lld.o + ../../../os/kernel/src/chsys.o +PendSVVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +ResetHandler ../../../os/ports/GCC/ARMCMx/crt0_v7m.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +SD1 main.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o +SVCallVector ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +SysTickVector ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +TestThread ../../../test/test.o +UsageFaultVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector100 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector104 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector108 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector10C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector110 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector114 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector118 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector11C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector1C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector20 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector24 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector28 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector34 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector40 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector44 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector48 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector4C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector50 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector54 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector58 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector5C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector60 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector64 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector68 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector6C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector70 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector74 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector78 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector7C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector80 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector84 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector88 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector8C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector90 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector94 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector98 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +Vector9C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorA0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorA4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorA8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorAC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorB0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorB4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorB8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorBC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorC0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorC4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorC8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorCC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorD0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorD4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorD8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorDC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorE0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorE4 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorE8 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorEC ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorF0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorF4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorF8 ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +VectorFC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +__early_init ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +__heap_base__ ../../../os/kernel/src/chmemcore.o +__heap_end__ ../../../os/kernel/src/chmemcore.o +__main_stack_size__ ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +__ram_end__ ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o + ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_bss_end ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_bss_start ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_close_r ../../../os/various/syscalls.o +_data ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_edata ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_fstat_r ../../../os/various/syscalls.o +_idle_thread ../../../os/kernel/src/chsys.o +_idle_thread_wa ../../../os/kernel/src/chsys.o +_isatty_r ../../../os/various/syscalls.o +_lseek_r ../../../os/various/syscalls.o +_main_exit_handler ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_pal_lld_init ../../../os/hal/platforms/LPC13xx/pal_lld.o + ../../../os/hal/src/hal.o +_pal_lld_setgroupmode ../../../os/hal/platforms/LPC13xx/pal_lld.o + ../../../os/hal/src/pal.o +_port_irq_epilogue ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/platforms/LPC13xx/gpt_lld.o +_port_switch_from_isr ../../../os/ports/GCC/ARMCMx/chcore_v7m.o +_port_thread_start ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + ../../../os/kernel/src/chthreads.o +_read_r ../../../os/various/syscalls.o +_sbrk_r ../../../os/various/syscalls.o +_test_assert ../../../test/test.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testpools.o + ../../../test/testheap.o + ../../../test/testevt.o + ../../../test/testmbox.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o +_test_assert_sequence ../../../test/test.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testevt.o + ../../../test/testmbox.o + ../../../test/testmsg.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o +_test_assert_time_window ../../../test/test.o + ../../../test/testevt.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o +_test_fail ../../../test/test.o +_textdata ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +_thread_init ../../../os/kernel/src/chthreads.o + ../../../os/kernel/src/chsys.o +_unhandled_exception ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +_vectors ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o +_write_r ../../../os/various/syscalls.o +boardInit ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + ../../../os/hal/src/hal.o +chCondBroadcast ../../../os/kernel/src/chcond.o + ../../../test/testmtx.o +chCondBroadcastI ../../../os/kernel/src/chcond.o +chCondInit ../../../os/kernel/src/chcond.o + ../../../test/testmtx.o +chCondSignal ../../../os/kernel/src/chcond.o + ../../../test/testmtx.o +chCondSignalI ../../../os/kernel/src/chcond.o + ../../../test/testmtx.o +chCondWait ../../../os/kernel/src/chcond.o + ../../../test/testmtx.o +chCondWaitS ../../../os/kernel/src/chcond.o +chCondWaitTimeout ../../../os/kernel/src/chcond.o + ../../../test/testmtx.o +chCondWaitTimeoutS ../../../os/kernel/src/chcond.o +chCoreAlloc ../../../os/kernel/src/chmemcore.o + ../../../os/various/syscalls.o + ../../../os/kernel/src/chheap.o +chCoreAllocI ../../../os/kernel/src/chmemcore.o +chCoreStatus ../../../os/kernel/src/chmemcore.o + ../../../test/testheap.o +chEvtAddFlags ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtBroadcastFlags ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtBroadcastFlagsI ../../../os/kernel/src/chevents.o + ../../../os/various/evtimer.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/src/serial.o +chEvtClearFlags ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtDispatch ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtRegisterMask ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtSignalFlags ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtSignalFlagsI ../../../os/kernel/src/chevents.o +chEvtUnregister ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtWaitAll ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtWaitAllTimeout ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtWaitAny ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtWaitAnyTimeout ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtWaitOne ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chEvtWaitOneTimeout ../../../os/kernel/src/chevents.o + ../../../test/testevt.o +chHeapAlloc ../../../os/kernel/src/chheap.o + ../../../test/testdyn.o + ../../../test/testheap.o + ../../../os/kernel/src/chdynamic.o +chHeapFree ../../../os/kernel/src/chheap.o + ../../../test/testdyn.o + ../../../test/testheap.o + ../../../os/kernel/src/chdynamic.o +chHeapInit ../../../os/kernel/src/chheap.o + ../../../test/testdyn.o + ../../../test/testheap.o +chHeapStatus ../../../os/kernel/src/chheap.o + ../../../test/testdyn.o + ../../../test/testheap.o +chIQGetFullI ../../../os/kernel/src/chqueues.o + ../../../test/testqueues.o +chIQGetTimeout ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testbmk.o + ../../../test/testqueues.o +chIQInit ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testbmk.o + ../../../test/testqueues.o +chIQPutI ../../../os/kernel/src/chqueues.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/src/serial.o + ../../../test/testbmk.o + ../../../test/testqueues.o +chIQReadTimeout ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chIQResetI ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chMBFetch ../../../os/kernel/src/chmboxes.o + main.o + ../../../test/testmbox.o +chMBFetchI ../../../os/kernel/src/chmboxes.o + ../../../test/testmbox.o +chMBFetchS ../../../os/kernel/src/chmboxes.o +chMBInit ../../../os/kernel/src/chmboxes.o + main.o + ../../../test/testmbox.o +chMBPost ../../../os/kernel/src/chmboxes.o + main.o + ../../../test/testmbox.o +chMBPostAhead ../../../os/kernel/src/chmboxes.o + ../../../test/testmbox.o +chMBPostAheadI ../../../os/kernel/src/chmboxes.o + ../../../test/testmbox.o +chMBPostAheadS ../../../os/kernel/src/chmboxes.o +chMBPostI ../../../os/kernel/src/chmboxes.o + main.o + ../../../test/testmbox.o +chMBPostS ../../../os/kernel/src/chmboxes.o +chMBReset ../../../os/kernel/src/chmboxes.o + ../../../test/testmbox.o +chMsgRelease ../../../os/kernel/src/chmsg.o + ../../../test/testbmk.o + ../../../test/testmsg.o +chMsgSend ../../../os/kernel/src/chmsg.o + ../../../test/testbmk.o + ../../../test/testmsg.o +chMsgWait ../../../os/kernel/src/chmsg.o + ../../../test/testbmk.o + ../../../test/testmsg.o +chMtxInit ../../../os/kernel/src/chmtx.o + ../../../test/testbmk.o + ../../../test/testmtx.o + ../../../os/kernel/src/chheap.o +chMtxLock ../../../os/kernel/src/chmtx.o + ../../../test/testbmk.o + ../../../test/testmtx.o + ../../../os/kernel/src/chheap.o +chMtxLockS ../../../os/kernel/src/chmtx.o + ../../../os/kernel/src/chcond.o +chMtxTryLock ../../../os/kernel/src/chmtx.o + ../../../test/testmtx.o +chMtxTryLockS ../../../os/kernel/src/chmtx.o +chMtxUnlock ../../../os/kernel/src/chmtx.o + ../../../test/testbmk.o + ../../../test/testmtx.o + ../../../os/kernel/src/chheap.o +chMtxUnlockAll ../../../os/kernel/src/chmtx.o + ../../../test/testmtx.o +chMtxUnlockS ../../../os/kernel/src/chmtx.o + ../../../test/testmtx.o + ../../../os/kernel/src/chcond.o +chOQGetFullI ../../../os/kernel/src/chqueues.o + ../../../test/testqueues.o +chOQGetI ../../../os/kernel/src/chqueues.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chOQInit ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chOQPutTimeout ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chOQResetI ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chOQWriteTimeout ../../../os/kernel/src/chqueues.o + ../../../os/hal/src/serial.o + ../../../test/testqueues.o +chPoolAlloc ../../../os/kernel/src/chmempools.o + ../../../test/testdyn.o + ../../../test/testpools.o + ../../../os/kernel/src/chdynamic.o +chPoolAllocI ../../../os/kernel/src/chmempools.o +chPoolFree ../../../os/kernel/src/chmempools.o + ../../../test/testdyn.o + ../../../test/testpools.o + ../../../os/kernel/src/chdynamic.o +chPoolFreeI ../../../os/kernel/src/chmempools.o +chPoolInit ../../../os/kernel/src/chmempools.o + ../../../test/testdyn.o + ../../../test/testpools.o +chRegFirstThread ../../../os/kernel/src/chregistry.o + ../../../test/testdyn.o +chRegNextThread ../../../os/kernel/src/chregistry.o + ../../../test/testdyn.o +chSchDoRescheduleI ../../../os/kernel/src/chschd.o + ../../../os/kernel/src/chthreads.o + ../../../os/ports/GCC/ARMCMx/chcore_v7m.o +chSchGoSleepS ../../../os/kernel/src/chschd.o + ../../../test/testbmk.o + ../../../os/kernel/src/chmsg.o + ../../../os/kernel/src/chevents.o + ../../../os/kernel/src/chcond.o + ../../../os/kernel/src/chmtx.o + ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chthreads.o +chSchGoSleepTimeoutS ../../../os/kernel/src/chschd.o + ../../../os/kernel/src/chevents.o + ../../../os/kernel/src/chcond.o + ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chthreads.o +chSchIsRescRequiredExI ../../../os/kernel/src/chschd.o + ../../../os/ports/GCC/ARMCMx/chcore_v7m.o +chSchReadyI ../../../os/kernel/src/chschd.o + ../../../os/kernel/src/chmsg.o + ../../../os/kernel/src/chevents.o + ../../../os/kernel/src/chcond.o + ../../../os/kernel/src/chmtx.o + ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chthreads.o +chSchRescheduleS ../../../os/kernel/src/chschd.o + ../../../os/hal/src/serial.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../os/kernel/src/chmboxes.o + ../../../os/kernel/src/chevents.o + ../../../os/kernel/src/chcond.o + ../../../os/kernel/src/chmtx.o + ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chthreads.o +chSchWakeupS ../../../os/kernel/src/chschd.o + ../../../test/testbmk.o + ../../../os/kernel/src/chmsg.o + ../../../os/kernel/src/chcond.o + ../../../os/kernel/src/chmtx.o + ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chdynamic.o + ../../../os/kernel/src/chthreads.o +chSemInit ../../../os/kernel/src/chsem.o + ../../../test/testbmk.o + ../../../test/testsem.o + ../../../os/kernel/src/chqueues.o + ../../../os/kernel/src/chmboxes.o +chSemReset ../../../os/kernel/src/chsem.o + ../../../test/testbmk.o + ../../../test/testsem.o +chSemResetI ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chqueues.o + ../../../os/kernel/src/chmboxes.o +chSemSetCounterI ../../../os/kernel/src/chsem.o + ../../../test/testsem.o +chSemSignal ../../../os/kernel/src/chsem.o + ../../../test/testbmk.o + ../../../test/testsem.o +chSemSignalI ../../../os/kernel/src/chsem.o + ../../../test/testsem.o + ../../../os/kernel/src/chqueues.o + ../../../os/kernel/src/chmboxes.o +chSemSignalWait ../../../os/kernel/src/chsem.o + ../../../test/testsem.o +chSemWait ../../../os/kernel/src/chsem.o + ../../../test/testbmk.o + ../../../test/testsem.o +chSemWaitS ../../../os/kernel/src/chsem.o +chSemWaitTimeout ../../../os/kernel/src/chsem.o + ../../../test/testsem.o +chSemWaitTimeoutS ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chqueues.o + ../../../os/kernel/src/chmboxes.o +chSysInit ../../../os/kernel/src/chsys.o + main.o +chSysTimerHandlerI ../../../os/kernel/src/chsys.o + ../../../os/ports/GCC/ARMCMx/chcore_v7m.o +chThdAddRef ../../../os/kernel/src/chdynamic.o + ../../../test/testdyn.o +chThdCreateFromHeap ../../../os/kernel/src/chdynamic.o + ../../../test/testdyn.o +chThdCreateFromMemoryPool ../../../os/kernel/src/chdynamic.o + ../../../test/testdyn.o +chThdCreateI ../../../os/kernel/src/chthreads.o + ../../../test/testthd.o + ../../../os/kernel/src/chdynamic.o +chThdCreateStatic ../../../os/kernel/src/chthreads.o + main.o + ../../../test/testbmk.o + ../../../test/testqueues.o + ../../../test/testevt.o + ../../../test/testmsg.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o + ../../../os/kernel/src/chsys.o +chThdExit ../../../os/kernel/src/chthreads.o + ../../../os/ports/GCC/ARMCMx/chcore_v7m.o +chThdRelease ../../../os/kernel/src/chdynamic.o + ../../../test/testdyn.o + ../../../os/kernel/src/chregistry.o + ../../../os/kernel/src/chthreads.o +chThdResume ../../../os/kernel/src/chthreads.o + ../../../test/testthd.o +chThdSetPriority ../../../os/kernel/src/chthreads.o + ../../../test/testthd.o +chThdSleep ../../../os/kernel/src/chthreads.o + main.o + ../../../test/testbmk.o + ../../../test/testdyn.o + ../../../test/testevt.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o + ../../../test/test.o +chThdSleepUntil ../../../os/kernel/src/chthreads.o + ../../../test/testthd.o +chThdTerminate ../../../os/kernel/src/chthreads.o + ../../../test/test.o +chThdWait ../../../os/kernel/src/chthreads.o + ../../../test/testbmk.o + ../../../test/test.o +chThdYield ../../../os/kernel/src/chthreads.o + ../../../test/testbmk.o +chTimeIsWithin ../../../os/kernel/src/chvt.o + ../../../test/test.o +chVTResetI ../../../os/kernel/src/chvt.o + ../../../os/various/evtimer.o + ../../../test/testbmk.o + ../../../os/kernel/src/chschd.o +chVTSetI ../../../os/kernel/src/chvt.o + ../../../os/various/evtimer.o + ../../../test/testbmk.o + ../../../test/test.o + ../../../os/kernel/src/chschd.o +core_init ../../../os/kernel/src/chmemcore.o + ../../../os/kernel/src/chsys.o +evtStart ../../../os/various/evtimer.o +evtStop ../../../os/various/evtimer.o +gptInit ../../../os/hal/src/gpt.o + ../../../os/hal/src/hal.o +gptObjectInit ../../../os/hal/src/gpt.o + ../../../os/hal/platforms/LPC13xx/gpt_lld.o +gptPolledDelay ../../../os/hal/src/gpt.o +gptStart ../../../os/hal/src/gpt.o + main.o +gptStartContinuous ../../../os/hal/src/gpt.o + main.o +gptStartContinuousI ../../../os/hal/src/gpt.o +gptStartOneShot ../../../os/hal/src/gpt.o +gptStartOneShotI ../../../os/hal/src/gpt.o +gptStop ../../../os/hal/src/gpt.o +gptStopTimer ../../../os/hal/src/gpt.o + main.o +gptStopTimerI ../../../os/hal/src/gpt.o +gpt_lld_init ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/hal/src/gpt.o +gpt_lld_polled_delay ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/hal/src/gpt.o +gpt_lld_start ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/hal/src/gpt.o +gpt_lld_start_timer ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/hal/src/gpt.o +gpt_lld_stop ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/hal/src/gpt.o +gpt_lld_stop_timer ../../../os/hal/platforms/LPC13xx/gpt_lld.o + ../../../os/hal/src/gpt.o +halInit ../../../os/hal/src/hal.o + main.o +hal_lld_init ../../../os/hal/platforms/LPC13xx/hal_lld.o + ../../../os/hal/src/hal.o +heap_init ../../../os/kernel/src/chheap.o + ../../../os/kernel/src/chsys.o +main main.o + ../../../os/ports/GCC/ARMCMx/crt0_v7m.o +memset c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) + ../../../os/various/syscalls.o +palReadBus ../../../os/hal/src/pal.o +palSetBusMode ../../../os/hal/src/pal.o +palWriteBus ../../../os/hal/src/pal.o +pal_default_config ../../../boards/EA_LPCXPRESSO_BB_1343/board.o + ../../../os/hal/src/hal.o +patternbmk ../../../test/testbmk.o + ../../../test/test.o +patterndyn ../../../test/testdyn.o + ../../../test/test.o +patternevt ../../../test/testevt.o + ../../../test/test.o +patternheap ../../../test/testheap.o + ../../../test/test.o +patternmbox ../../../test/testmbox.o + ../../../test/test.o +patternmsg ../../../test/testmsg.o + ../../../test/test.o +patternmtx ../../../test/testmtx.o + ../../../test/test.o +patternpools ../../../test/testpools.o + ../../../test/test.o +patternqueues ../../../test/testqueues.o + ../../../test/test.o +patternsem ../../../test/testsem.o + ../../../test/test.o +patternthd ../../../test/testthd.o + ../../../test/test.o +port_halt ../../../os/ports/GCC/ARMCMx/chcore.o +port_switch ../../../os/ports/GCC/ARMCMx/chcore_v7m.o + ../../../os/kernel/src/chschd.o +rlist ../../../test/testbmk.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testevt.o + ../../../test/testmsg.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o + ../../../test/test.o + ../../../os/kernel/src/chmsg.o + ../../../os/kernel/src/chevents.o + ../../../os/kernel/src/chcond.o + ../../../os/kernel/src/chmtx.o + ../../../os/kernel/src/chsem.o + ../../../os/kernel/src/chregistry.o + ../../../os/kernel/src/chthreads.o + ../../../os/kernel/src/chschd.o + ../../../os/kernel/src/chsys.o +scheduler_init ../../../os/kernel/src/chschd.o + ../../../os/kernel/src/chsys.o +sdIncomingDataI ../../../os/hal/src/serial.o +sdInit ../../../os/hal/src/serial.o + ../../../os/hal/src/hal.o +sdObjectInit ../../../os/hal/src/serial.o + ../../../os/hal/platforms/LPC13xx/serial_lld.o +sdRequestDataI ../../../os/hal/src/serial.o +sdStart ../../../os/hal/src/serial.o + main.o +sdStop ../../../os/hal/src/serial.o +sd_lld_init ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/src/serial.o +sd_lld_start ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/src/serial.o +sd_lld_stop ../../../os/hal/platforms/LPC13xx/serial_lld.o + ../../../os/hal/src/serial.o +test ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testheap.o + ../../../test/testmbox.o + ../../../test/test.o +test_cpu_pulse ../../../test/test.o + ../../../test/testmtx.o +test_emit_token ../../../test/test.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testevt.o + ../../../test/testmbox.o + ../../../test/testmsg.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o +test_print ../../../test/test.o + ../../../test/testbmk.o +test_println ../../../test/test.o + ../../../test/testbmk.o +test_printn ../../../test/test.o + ../../../test/testbmk.o +test_start_timer ../../../test/test.o + ../../../test/testbmk.o +test_terminate_threads ../../../test/test.o + ../../../test/testbmk.o +test_timer_done ../../../test/testbmk.o + ../../../test/test.o +test_wait_threads ../../../test/test.o + ../../../test/testbmk.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testevt.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o +test_wait_tick ../../../test/test.o + ../../../test/testbmk.o + ../../../test/testevt.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o +testbmk1 ../../../test/testbmk.o +testbmk10 ../../../test/testbmk.o +testbmk11 ../../../test/testbmk.o +testbmk12 ../../../test/testbmk.o +testbmk13 ../../../test/testbmk.o +testbmk2 ../../../test/testbmk.o +testbmk3 ../../../test/testbmk.o +testbmk4 ../../../test/testbmk.o +testbmk5 ../../../test/testbmk.o +testbmk6 ../../../test/testbmk.o +testbmk7 ../../../test/testbmk.o +testbmk8 ../../../test/testbmk.o +testbmk9 ../../../test/testbmk.o +testdyn1 ../../../test/testdyn.o +testdyn2 ../../../test/testdyn.o +testdyn3 ../../../test/testdyn.o +testevt1 ../../../test/testevt.o +testevt2 ../../../test/testevt.o +testevt3 ../../../test/testevt.o +testheap1 ../../../test/testheap.o +testmbox1 ../../../test/testmbox.o +testmsg1 ../../../test/testmsg.o +testmtx1 ../../../test/testmtx.o +testmtx2 ../../../test/testmtx.o +testmtx3 ../../../test/testmtx.o +testmtx4 ../../../test/testmtx.o +testmtx5 ../../../test/testmtx.o +testmtx6 ../../../test/testmtx.o +testmtx7 ../../../test/testmtx.o +testmtx8 ../../../test/testmtx.o +testpools1 ../../../test/testpools.o +testqueues1 ../../../test/testqueues.o +testqueues2 ../../../test/testqueues.o +testsem1 ../../../test/testsem.o +testsem2 ../../../test/testsem.o +testsem3 ../../../test/testsem.o +testsem4 ../../../test/testsem.o +testthd1 ../../../test/testthd.o +testthd2 ../../../test/testthd.o +testthd3 ../../../test/testthd.o +testthd4 ../../../test/testthd.o +thread4 ../../../test/testbmk.o +threads ../../../test/testbmk.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testevt.o + ../../../test/testmsg.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o + ../../../test/test.o +vt_init ../../../os/kernel/src/chvt.o + ../../../os/kernel/src/chsys.o +vtlist ../../../test/testevt.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o + ../../../test/test.o + ../../../os/kernel/src/chthreads.o + ../../../os/kernel/src/chvt.o + ../../../os/kernel/src/chsys.o +wa ../../../test/test.o + ../../../test/testbmk.o + ../../../test/testqueues.o + ../../../test/testdyn.o + ../../../test/testpools.o + ../../../test/testevt.o + ../../../test/testmsg.o + ../../../test/testmtx.o + ../../../test/testsem.o + ../../../test/testthd.o diff --git a/testhal/LPC13xx/IRQ_STORM/chconf.h b/testhal/LPC13xx/IRQ_STORM/chconf.h new file mode 100644 index 000000000..3353391ca --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/chconf.h @@ -0,0 +1,507 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h new file mode 100644 index 000000000..70c240431 --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -0,0 +1,280 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/LPC13xx/IRQ_STORM/main.c b/testhal/LPC13xx/IRQ_STORM/main.c new file mode 100644 index 000000000..407ad92a5 --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/main.c @@ -0,0 +1,321 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +#include "ch.h" +#include "hal.h" + +/*===========================================================================*/ +/* Configurable settings. */ +/*===========================================================================*/ + +#ifndef RANDOMIZE +#define RANDOMIZE FALSE +#endif + +#ifndef ITERATIONS +#define ITERATIONS 100 +#endif + +#ifndef NUM_THREADS +#define NUM_THREADS 4 +#endif + +#ifndef MAILBOX_SIZE +#define MAILBOX_SIZE 4 +#endif + +/*===========================================================================*/ +/* Test related code. */ +/*===========================================================================*/ + +#define MSG_SEND_LEFT 0 +#define MSG_SEND_RIGHT 1 + +static bool_t saturated; + +/* + * Mailboxes and buffers. + */ +static Mailbox mb[NUM_THREADS]; +static msg_t b[NUM_THREADS][MAILBOX_SIZE]; + +/* + * Test worker threads. + */ +static WORKING_AREA(waWorkerThread[NUM_THREADS], 128); +static msg_t WorkerThread(void *arg) { + static volatile unsigned x = 0; + static unsigned cnt = 0; + unsigned me = (unsigned)arg; + unsigned target; + unsigned r; + msg_t msg; + + /* Work loop.*/ + while (TRUE) { + /* Waiting for a message.*/ + chMBFetch(&mb[me], &msg, TIME_INFINITE); + +#if RANDOMIZE + /* Pseudo-random delay.*/ + { + chSysLock(); + r = rand() & 15; + chSysUnlock(); + while (r--) + x++; + } +#else + /* Fixed delay.*/ + { + r = me >> 4; + while (r--) + x++; + } +#endif + + /* Deciding in which direction to re-send the message.*/ + if (msg == MSG_SEND_LEFT) + target = me - 1; + else + target = me + 1; + + if (target < NUM_THREADS) { + /* If this thread is not at the end of a chain re-sending the message, + note this check works because the variable target is unsigned.*/ + msg = chMBPost(&mb[target], msg, TIME_IMMEDIATE); + if (msg != RDY_OK) + saturated = TRUE; + } + else { + /* Provides a visual feedback about the system.*/ + if (++cnt >= 500) { + cnt = 0; + palTogglePad(GPIO0, GPIO0_LED2); + } + } + } +} + +/* + * GPT1 callback. + */ +static void gpt1cb(GPTDriver *gptp) { + msg_t msg; + + (void)gptp; + chSysLockFromIsr(); + msg = chMBPostI(&mb[0], MSG_SEND_RIGHT); + if (msg != RDY_OK) + saturated = TRUE; + chSysUnlockFromIsr(); +} + +/* + * GPT2 callback. + */ +static void gpt2cb(GPTDriver *gptp) { + msg_t msg; + + (void)gptp; + chSysLockFromIsr(); + msg = chMBPostI(&mb[NUM_THREADS - 1], MSG_SEND_LEFT); + if (msg != RDY_OK) + saturated = TRUE; + chSysUnlockFromIsr(); +} + +/* + * GPT1 configuration. + */ +static const GPTConfig gpt1cfg = { + 1000000, /* 1MHz timer clock.*/ + gpt1cb /* Timer callback.*/ +}; + +/* + * GPT2 configuration. + */ +static const GPTConfig gpt2cfg = { + 1000000, /* 1MHz timer clock.*/ + gpt2cb /* Timer callback.*/ +}; + + +/*===========================================================================*/ +/* Generic demo code. */ +/*===========================================================================*/ + +static void print(char *p) { + + while (*p) { + chIOPut(&SD1, *p++); + } +} + +static void println(char *p) { + + while (*p) { + chIOPut(&SD1, *p++); + } + chIOWriteTimeout(&SD1, (uint8_t *)"\r\n", 2, TIME_INFINITE); +} + +static void printn(uint32_t n) { + char buf[16], *p; + + if (!n) + chIOPut(&SD1, '0'); + else { + p = buf; + while (n) + *p++ = (n % 10) + '0', n /= 10; + while (p > buf) + chIOPut(&SD1, *--p); + } +} + +/* + * Application entry point. + */ +int main(void) { + unsigned i; + gptcnt_t interval, threshold, worst; + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Prepares the Serial driver 2 and GPT drivers 1 and 2. + */ + sdStart(&SD1, NULL); /* Default is 38400-8-N-1.*/ + gptStart(&GPTD1, &gpt1cfg); + gptStart(&GPTD2, &gpt2cfg); + + /* + * Initializes the mailboxes and creates the worker threads. + */ + for (i = 0; i < NUM_THREADS; i++) { + chMBInit(&mb[i], b[i], MAILBOX_SIZE); + chThdCreateStatic(waWorkerThread[i], sizeof waWorkerThread[i], + NORMALPRIO - 20, WorkerThread, (void *)i); + } + + /* + * Test procedure. + */ + println(""); + println("*** ChibiOS/RT IRQ-STORM long duration test"); + println("***"); + print("*** Kernel: "); + println(CH_KERNEL_VERSION); +#ifdef __GNUC__ + print("*** GCC Version: "); + println(__VERSION__); +#endif + print("*** Architecture: "); + println(CH_ARCHITECTURE_NAME); +#ifdef CH_CORE_VARIANT_NAME + print("*** Core Variant: "); + println(CH_CORE_VARIANT_NAME); +#endif +#ifdef PLATFORM_NAME + print("*** Platform: "); + println(PLATFORM_NAME); +#endif +#ifdef BOARD_NAME + print("*** Test Board: "); + println(BOARD_NAME); +#endif + println("***"); + print("*** System Clock: "); + printn(LPC13xx_SYSCLK); + println(""); + print("*** Iterations: "); + printn(ITERATIONS); + println(""); + print("*** Randomize: "); + printn(RANDOMIZE); + println(""); + print("*** Threads: "); + printn(NUM_THREADS); + println(""); + print("*** Mailbox size: "); + printn(MAILBOX_SIZE); + println(""); + + println(""); + worst = 0; + for (i = 1; i <= ITERATIONS; i++){ + print("Iteration "); + printn(i); + println(""); + saturated = FALSE; + threshold = 0; + for (interval = 2000; interval >= 20; interval -= interval / 10) { + gptStartContinuous(&GPTD1, interval - 1); /* Slightly out of phase.*/ + gptStartContinuous(&GPTD2, interval + 1); /* Slightly out of phase.*/ + chThdSleepMilliseconds(1000); + gptStopTimer(&GPTD1); + gptStopTimer(&GPTD2); + if (!saturated) + print("."); + else { + print("#"); + if (threshold == 0) + threshold = interval; + } + } + /* Gives the worker threads a chance to empty the mailboxes before next + cycle.*/ + chThdSleepMilliseconds(20); + println(""); + print("Saturated at "); + printn(threshold); + println(" uS"); + println(""); + if (threshold > worst) + worst = threshold; + } + gptStopTimer(&GPTD1); + gptStopTimer(&GPTD2); + + print("Worst case at "); + printn(worst); + println(" uS"); + println(""); + println("Test Complete"); + + /* + * Normal main() thread activity, nothing in this test. + */ + while (TRUE) { + chThdSleepMilliseconds(5000); + } + return 0; +} diff --git a/testhal/LPC13xx/IRQ_STORM/mcuconf.h b/testhal/LPC13xx/IRQ_STORM/mcuconf.h new file mode 100644 index 000000000..195eb6c6a --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/mcuconf.h @@ -0,0 +1,79 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * LPC13xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the driver + * is enabled in halconf.h. + * + * IRQ priorities: + * 7...0 Lowest...highest. + */ + +/* + * HAL driver system settings. + */ +#define LPC13xx_PLLCLK_SOURCE SYSPLLCLKSEL_SYSOSC +#define LPC13xx_SYSPLL_MUL 6 +#define LPC13xx_SYSPLL_DIV 4 +#define LPC13xx_MAINCLK_SOURCE SYSMAINCLKSEL_PLLOUT +#define LPC13xx_SYSABHCLK_DIV 1 + +/* + * ADC driver system settings. + */ + +/* + * CAN driver system settings. + */ + +/* + * GPT driver system settings. + */ +#define LPC13xx_GPT_USE_CT16B0 TRUE +#define LPC13xx_GPT_USE_CT16B1 TRUE +#define LPC13xx_GPT_USE_CT32B0 TRUE +#define LPC13xx_GPT_USE_CT32B1 TRUE +#define LPC13xx_GPT_CT16B0_IRQ_PRIORITY 2 +#define LPC13xx_GPT_CT16B1_IRQ_PRIORITY 2 +#define LPC13xx_GPT_CT32B0_IRQ_PRIORITY 2 +#define LPC13xx_GPT_CT32B1_IRQ_PRIORITY 2 + +/* + * PWM driver system settings. + */ + +/* + * SERIAL driver system settings. + */ +#define LPC13xx_SERIAL_USE_UART0 TRUE +#define LPC13xx_SERIAL_FIFO_PRELOAD 16 +#define LPC13xx_SERIAL_UART0CLKDIV 1 +#define LPC13xx_SERIAL_UART0_IRQ_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define LPC13xx_SPI_USE_SSP0 TRUE +#define LPC13xx_SPI_SSP0CLKDIV 1 +#define LPC13xx_SPI_SSP0_IRQ_PRIORITY 5 +#define LPC13xx_SPI_SSP_ERROR_HOOK(spip) chSysHalt() +#define LPC13xx_SPI_SCK0_SELECTOR SCK0_IS_PIO2_11 diff --git a/testhal/LPC13xx/IRQ_STORM/readme.txt b/testhal/LPC13xx/IRQ_STORM/readme.txt new file mode 100644 index 000000000..3ddf2e2d6 --- /dev/null +++ b/testhal/LPC13xx/IRQ_STORM/readme.txt @@ -0,0 +1,25 @@ +***************************************************************************** +** ChibiOS/RT HAL - IRQ-STORM demo for LPC13xx. ** +***************************************************************************** + +** TARGET ** + +The demo will on an LPCXpresso LPC1114 board. + +** The Demo ** + +The application demonstrates the use of the LPC13xx GPT, PAL and Serial drivers +in order to implement a system stress demo. + +** Build Procedure ** + +The demo has been tested by using the free LPCXpresso toolchain but also with +Codesourcery and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +NXP and are licensed under a different license. + + http://www.nxp.com -- cgit v1.2.3 From 6c69a81ca1eda2824359f0ad265c00d842e22f66 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 10:58:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2805 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 6 +++--- todo.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index 5b0f0865a..3edbd9fee 100644 --- a/readme.txt +++ b/readme.txt @@ -89,9 +89,9 @@ IRQ handling faster and also saves some RAM/ROM space. The GCC port code now does not inline the epilogue code in each ISR saving significan ROM space for each interrupt handler in the system (backported to 2.2.3). -- NEW: Added "IRQ STORM" long duration tests for the STM32 and LPC11xx. The - test demonstrates the system stability in a thread-intensive, progressively - CPU-saturating, IRQ-intensive long duration test. +- NEW: Added "IRQ STORM" long duration tests for the STM32, LPC11xx and + LPC11xx. The test demonstrates the system stability in a thread-intensive, + progressively CPU-saturating, IRQ-intensive long duration test. - NEW: Added two new functions to the events subsystem: chEvtBroadcastFlags() and chEvtBroadcastFlagsI(). The old chEvtBroadcast() and chEvtBroadcastI() become macros. The new functions allow to add the same flags to all the diff --git a/todo.txt b/todo.txt index 7e16194b9..4931ceed7 100644 --- a/todo.txt +++ b/todo.txt @@ -19,6 +19,8 @@ Within 2.3.x (hopefully) * Improvements to the message passing mechanism in order to allow "delayed, out of order, responses". * New device driver models: GPT. +X GPT implementation and long duration "IRQ storm" stress test applications + for all the supported critical platforms. - Add UART4 support to the STM32 UART driver (CL line only, HD has a nasty shared interrupt). - Add ADC3 support to the STM32 ADC driver. @@ -29,8 +31,6 @@ Within 2.3.x (hopefully) with the compiler info. - Test suite overhaul, the API should be more generic in order to be used with different subsystems and not just the kernel. -- Long duration "IRQ storm" stress test applications for all supported - architectures. - Device drivers for STM8/STM8L (ADC, PWM, bring them on par with STM32). - Device drivers for LPC1xxx (ADC, PWM, bring them on par with STM32). - Implement USB Mass Storage Class support and demo using the MMC_SPI driver -- cgit v1.2.3 From c3cb79bec35415a930dd017f7c389c57784377ab Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 6 Mar 2011 13:47:03 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2806 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/LPC13xx/IRQ_STORM/ch.map | 2983 -------------------------------------- 1 file changed, 2983 deletions(-) delete mode 100644 testhal/LPC13xx/IRQ_STORM/ch.map diff --git a/testhal/LPC13xx/IRQ_STORM/ch.map b/testhal/LPC13xx/IRQ_STORM/ch.map deleted file mode 100644 index 95c41185f..000000000 --- a/testhal/LPC13xx/IRQ_STORM/ch.map +++ /dev/null @@ -1,2983 +0,0 @@ -Archive member included because of file (symbol) - -c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - ../../../os/various/syscalls.o (memset) - -Allocating common symbols -Common symbol size file - -GPTD2 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o -test_timer_done 0x4 ../../../test/test.o -GPTD4 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o -GPTD1 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o -threads 0x14 ../../../test/test.o -test 0x578 ../../../test/test.o -GPTD3 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o -vtlist 0x10 ../../../os/kernel/src/chvt.o -rlist 0x20 ../../../os/kernel/src/chschd.o -_idle_thread_wa 0xa0 ../../../os/kernel/src/chsys.o -SD1 0x74 ../../../os/hal/platforms/LPC13xx/serial_lld.o - -Discarded input sections - - .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o - .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o - .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore.o - .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore.o - .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore.o - .text.port_halt - 0x00000000 0x4 ../../../os/ports/GCC/ARMCMx/chcore.o - .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .text 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/nvic.o - .data 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/nvic.o - .bss 0x00000000 0x0 ../../../os/ports/GCC/ARMCMx/nvic.o - .text.NVICDisableVector - 0x00000000 0x3c ../../../os/ports/GCC/ARMCMx/nvic.o - .text 0x00000000 0x0 ../../../os/kernel/src/chsys.o - .data 0x00000000 0x0 ../../../os/kernel/src/chsys.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chsys.o - .text 0x00000000 0x0 ../../../os/kernel/src/chdebug.o - .data 0x00000000 0x0 ../../../os/kernel/src/chdebug.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chdebug.o - .text 0x00000000 0x0 ../../../os/kernel/src/chlists.o - .data 0x00000000 0x0 ../../../os/kernel/src/chlists.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chlists.o - .text 0x00000000 0x0 ../../../os/kernel/src/chvt.o - .data 0x00000000 0x0 ../../../os/kernel/src/chvt.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chvt.o - .text.chTimeIsWithin - 0x00000000 0x34 ../../../os/kernel/src/chvt.o - .text 0x00000000 0x0 ../../../os/kernel/src/chschd.o - .data 0x00000000 0x0 ../../../os/kernel/src/chschd.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chschd.o - .text 0x00000000 0x0 ../../../os/kernel/src/chthreads.o - .data 0x00000000 0x0 ../../../os/kernel/src/chthreads.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chthreads.o - .text.chThdSetPriority - 0x00000000 0x30 ../../../os/kernel/src/chthreads.o - .text.chThdResume - 0x00000000 0x1c ../../../os/kernel/src/chthreads.o - .text.chThdTerminate - 0x00000000 0x18 ../../../os/kernel/src/chthreads.o - .text.chThdSleepUntil - 0x00000000 0x24 ../../../os/kernel/src/chthreads.o - .text.chThdYield - 0x00000000 0x28 ../../../os/kernel/src/chthreads.o - .text.chThdWait - 0x00000000 0x38 ../../../os/kernel/src/chthreads.o - .text 0x00000000 0x0 ../../../os/kernel/src/chdynamic.o - .data 0x00000000 0x0 ../../../os/kernel/src/chdynamic.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chdynamic.o - .text.chThdAddRef - 0x00000000 0x14 ../../../os/kernel/src/chdynamic.o - .text.chThdRelease - 0x00000000 0x54 ../../../os/kernel/src/chdynamic.o - .text.chThdCreateFromHeap - 0x00000000 0x44 ../../../os/kernel/src/chdynamic.o - .text.chThdCreateFromMemoryPool - 0x00000000 0x44 ../../../os/kernel/src/chdynamic.o - .text 0x00000000 0x0 ../../../os/kernel/src/chregistry.o - .data 0x00000000 0x0 ../../../os/kernel/src/chregistry.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chregistry.o - .text.chRegFirstThread - 0x00000000 0x20 ../../../os/kernel/src/chregistry.o - .text.chRegNextThread - 0x00000000 0x2c ../../../os/kernel/src/chregistry.o - .text 0x00000000 0x0 ../../../os/kernel/src/chsem.o - .data 0x00000000 0x0 ../../../os/kernel/src/chsem.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chsem.o - .text.chSemResetI - 0x00000000 0x28 ../../../os/kernel/src/chsem.o - .text.chSemReset - 0x00000000 0x18 ../../../os/kernel/src/chsem.o - .text.chSemWaitS - 0x00000000 0x34 ../../../os/kernel/src/chsem.o - .text.chSemWait - 0x00000000 0x14 ../../../os/kernel/src/chsem.o - .text.chSemWaitTimeout - 0x00000000 0x14 ../../../os/kernel/src/chsem.o - .text.chSemSignal - 0x00000000 0x2c ../../../os/kernel/src/chsem.o - .text.chSemSetCounterI - 0x00000000 0x28 ../../../os/kernel/src/chsem.o - .text.chSemSignalWait - 0x00000000 0x64 ../../../os/kernel/src/chsem.o - .text 0x00000000 0x0 ../../../os/kernel/src/chmtx.o - .data 0x00000000 0x0 ../../../os/kernel/src/chmtx.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chmtx.o - .text.chMtxLockS - 0x00000000 0xcc ../../../os/kernel/src/chmtx.o - .text.chMtxLock - 0x00000000 0x14 ../../../os/kernel/src/chmtx.o - .text.chMtxTryLock - 0x00000000 0x2c ../../../os/kernel/src/chmtx.o - .text.chMtxTryLockS - 0x00000000 0x20 ../../../os/kernel/src/chmtx.o - .text.chMtxUnlock - 0x00000000 0x60 ../../../os/kernel/src/chmtx.o - .text.chMtxUnlockS - 0x00000000 0x50 ../../../os/kernel/src/chmtx.o - .text.chMtxUnlockAll - 0x00000000 0x54 ../../../os/kernel/src/chmtx.o - .text 0x00000000 0x0 ../../../os/kernel/src/chcond.o - .data 0x00000000 0x0 ../../../os/kernel/src/chcond.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chcond.o - .text.chCondInit - 0x00000000 0x8 ../../../os/kernel/src/chcond.o - .text.chCondSignal - 0x00000000 0x24 ../../../os/kernel/src/chcond.o - .text.chCondSignalI - 0x00000000 0x1c ../../../os/kernel/src/chcond.o - .text.chCondBroadcastI - 0x00000000 0x24 ../../../os/kernel/src/chcond.o - .text.chCondBroadcast - 0x00000000 0x18 ../../../os/kernel/src/chcond.o - .text.chCondWaitS - 0x00000000 0x48 ../../../os/kernel/src/chcond.o - .text.chCondWait - 0x00000000 0x14 ../../../os/kernel/src/chcond.o - .text.chCondWaitTimeoutS - 0x00000000 0x58 ../../../os/kernel/src/chcond.o - .text.chCondWaitTimeout - 0x00000000 0x14 ../../../os/kernel/src/chcond.o - .text 0x00000000 0x0 ../../../os/kernel/src/chevents.o - .data 0x00000000 0x0 ../../../os/kernel/src/chevents.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chevents.o - .text.chEvtRegisterMask - 0x00000000 0x2c ../../../os/kernel/src/chevents.o - .text.chEvtUnregister - 0x00000000 0x24 ../../../os/kernel/src/chevents.o - .text.chEvtClearFlags - 0x00000000 0x24 ../../../os/kernel/src/chevents.o - .text.chEvtAddFlags - 0x00000000 0x20 ../../../os/kernel/src/chevents.o - .text.chEvtSignalFlags - 0x00000000 0x18 ../../../os/kernel/src/chevents.o - .text.chEvtBroadcastFlags - 0x00000000 0x18 ../../../os/kernel/src/chevents.o - .text.chEvtDispatch - 0x00000000 0x34 ../../../os/kernel/src/chevents.o - .text.chEvtWaitOne - 0x00000000 0x3c ../../../os/kernel/src/chevents.o - .text.chEvtWaitAny - 0x00000000 0x34 ../../../os/kernel/src/chevents.o - .text.chEvtWaitAll - 0x00000000 0x38 ../../../os/kernel/src/chevents.o - .text.chEvtWaitOneTimeout - 0x00000000 0x54 ../../../os/kernel/src/chevents.o - .text.chEvtWaitAnyTimeout - 0x00000000 0x50 ../../../os/kernel/src/chevents.o - .text.chEvtWaitAllTimeout - 0x00000000 0x54 ../../../os/kernel/src/chevents.o - .text 0x00000000 0x0 ../../../os/kernel/src/chmsg.o - .data 0x00000000 0x0 ../../../os/kernel/src/chmsg.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chmsg.o - .text.chMsgSend - 0x00000000 0x44 ../../../os/kernel/src/chmsg.o - .text.chMsgWait - 0x00000000 0x3c ../../../os/kernel/src/chmsg.o - .text.chMsgRelease - 0x00000000 0x14 ../../../os/kernel/src/chmsg.o - .text 0x00000000 0x0 ../../../os/kernel/src/chmboxes.o - .data 0x00000000 0x0 ../../../os/kernel/src/chmboxes.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chmboxes.o - .text.chMBReset - 0x00000000 0x34 ../../../os/kernel/src/chmboxes.o - .text.chMBPostAheadS - 0x00000000 0x3c ../../../os/kernel/src/chmboxes.o - .text.chMBPostAhead - 0x00000000 0x14 ../../../os/kernel/src/chmboxes.o - .text.chMBPostAheadI - 0x00000000 0x34 ../../../os/kernel/src/chmboxes.o - .text.chMBFetchI - 0x00000000 0x30 ../../../os/kernel/src/chmboxes.o - .text 0x00000000 0x0 ../../../os/kernel/src/chqueues.o - .data 0x00000000 0x0 ../../../os/kernel/src/chqueues.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chqueues.o - .text.chIQGetFullI - 0x00000000 0x8 ../../../os/kernel/src/chqueues.o - .text.chIQResetI - 0x00000000 0x18 ../../../os/kernel/src/chqueues.o - .text.chOQGetFullI - 0x00000000 0x18 ../../../os/kernel/src/chqueues.o - .text.chOQResetI - 0x00000000 0x18 ../../../os/kernel/src/chqueues.o - .text 0x00000000 0x0 ../../../os/kernel/src/chmemcore.o - .data 0x00000000 0x0 ../../../os/kernel/src/chmemcore.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chmemcore.o - .text.chCoreAllocI - 0x00000000 0x28 ../../../os/kernel/src/chmemcore.o - .text.chCoreStatus - 0x00000000 0x18 ../../../os/kernel/src/chmemcore.o - .text 0x00000000 0x0 ../../../os/kernel/src/chheap.o - .data 0x00000000 0x0 ../../../os/kernel/src/chheap.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chheap.o - .text.chHeapInit - 0x00000000 0x24 ../../../os/kernel/src/chheap.o - .text.chHeapAlloc - 0x00000000 0x90 ../../../os/kernel/src/chheap.o - .text.chHeapFree - 0x00000000 0xa0 ../../../os/kernel/src/chheap.o - .text.chHeapStatus - 0x00000000 0x40 ../../../os/kernel/src/chheap.o - .text 0x00000000 0x0 ../../../os/kernel/src/chmempools.o - .data 0x00000000 0x0 ../../../os/kernel/src/chmempools.o - .bss 0x00000000 0x0 ../../../os/kernel/src/chmempools.o - .text.chPoolInit - 0x00000000 0x10 ../../../os/kernel/src/chmempools.o - .text.chPoolAllocI - 0x00000000 0x1c ../../../os/kernel/src/chmempools.o - .text.chPoolAlloc - 0x00000000 0x28 ../../../os/kernel/src/chmempools.o - .text.chPoolFreeI - 0x00000000 0x8 ../../../os/kernel/src/chmempools.o - .text.chPoolFree - 0x00000000 0x14 ../../../os/kernel/src/chmempools.o - .text 0x00000000 0x0 ../../../test/test.o - .data 0x00000000 0x0 ../../../test/test.o - .bss 0x00000000 0x0 ../../../test/test.o - .text.tmr 0x00000000 0x10 ../../../test/test.o - .text.print_line - 0x00000000 0x40 ../../../test/test.o - .text.test_printn - 0x00000000 0x64 ../../../test/test.o - .text.test_print - 0x00000000 0x24 ../../../test/test.o - .text.test_println - 0x00000000 0x2c ../../../test/test.o - .text.test_emit_token - 0x00000000 0x20 ../../../test/test.o - .text._test_fail - 0x00000000 0x28 ../../../test/test.o - .text._test_assert - 0x00000000 0x24 ../../../test/test.o - .text._test_assert_sequence - 0x00000000 0x50 ../../../test/test.o - .text._test_assert_time_window - 0x00000000 0x30 ../../../test/test.o - .text.test_terminate_threads - 0x00000000 0x1c ../../../test/test.o - .text.test_wait_threads - 0x00000000 0x24 ../../../test/test.o - .text.test_cpu_pulse - 0x00000000 0x64 ../../../test/test.o - .text.test_wait_tick - 0x00000000 0x14 ../../../test/test.o - .text.test_start_timer - 0x00000000 0x50 ../../../test/test.o - .text.TestThread - 0x00000000 0x240 ../../../test/test.o - .bss.failpoint - 0x00000000 0x4 ../../../test/test.o - .bss.local_fail - 0x00000000 0x4 ../../../test/test.o - .rodata.wa 0x00000000 0x14 ../../../test/test.o - .bss.tokp 0x00000000 0x4 ../../../test/test.o - .bss.global_fail - 0x00000000 0x4 ../../../test/test.o - .rodata.str1.4 - 0x00000000 0x174 ../../../test/test.o - .rodata.patterns - 0x00000000 0x30 ../../../test/test.o - .bss.vt 0x00000000 0x14 ../../../test/test.o - .bss.chp 0x00000000 0x4 ../../../test/test.o - .bss.tokens_buffer - 0x00000000 0x10 ../../../test/test.o - COMMON 0x00000000 0x590 ../../../test/test.o - .text 0x00000000 0x0 ../../../test/testthd.o - .data 0x00000000 0x0 ../../../test/testthd.o - .bss 0x00000000 0x0 ../../../test/testthd.o - .text.thd4_execute - 0x00000000 0x74 ../../../test/testthd.o - .text.thd3_execute - 0x00000000 0x138 ../../../test/testthd.o - .text.thd2_execute - 0x00000000 0xf8 ../../../test/testthd.o - .text.thd1_execute - 0x00000000 0xec ../../../test/testthd.o - .text.thread 0x00000000 0xc ../../../test/testthd.o - .rodata.testthd1 - 0x00000000 0x10 ../../../test/testthd.o - .rodata.testthd2 - 0x00000000 0x10 ../../../test/testthd.o - .rodata.testthd3 - 0x00000000 0x10 ../../../test/testthd.o - .rodata.testthd4 - 0x00000000 0x10 ../../../test/testthd.o - .rodata.patternthd - 0x00000000 0x14 ../../../test/testthd.o - .rodata.str1.4 - 0x00000000 0x80 ../../../test/testthd.o - .text 0x00000000 0x0 ../../../test/testsem.o - .data 0x00000000 0x0 ../../../test/testsem.o - .bss 0x00000000 0x0 ../../../test/testsem.o - .text.sem3_setup - 0x00000000 0x14 ../../../test/testsem.o - .text.sem2_setup - 0x00000000 0x14 ../../../test/testsem.o - .text.sem1_setup - 0x00000000 0x14 ../../../test/testsem.o - .text.sem4_execute - 0x00000000 0x100 ../../../test/testsem.o - .text.thread4 0x00000000 0x24 ../../../test/testsem.o - .text.sem3_execute - 0x00000000 0xa0 ../../../test/testsem.o - .text.thread3 0x00000000 0x1c ../../../test/testsem.o - .text.thread1 0x00000000 0x1c ../../../test/testsem.o - .text.sem2_execute - 0x00000000 0x154 ../../../test/testsem.o - .text.thread2 0x00000000 0x28 ../../../test/testsem.o - .text.sem1_execute - 0x00000000 0x140 ../../../test/testsem.o - .rodata.testsem1 - 0x00000000 0x10 ../../../test/testsem.o - .rodata.testsem2 - 0x00000000 0x10 ../../../test/testsem.o - .rodata.testsem3 - 0x00000000 0x10 ../../../test/testsem.o - .rodata.testsem4 - 0x00000000 0x10 ../../../test/testsem.o - .data.sem1 0x00000000 0xc ../../../test/testsem.o - .rodata.patternsem - 0x00000000 0x14 ../../../test/testsem.o - .rodata.str1.4 - 0x00000000 0x8c ../../../test/testsem.o - .text 0x00000000 0x0 ../../../test/testmtx.o - .data 0x00000000 0x0 ../../../test/testmtx.o - .bss 0x00000000 0x0 ../../../test/testmtx.o - .text.mtx8_execute - 0x00000000 0xb4 ../../../test/testmtx.o - .text.thread12 - 0x00000000 0x20 ../../../test/testmtx.o - .text.thread1 0x00000000 0x20 ../../../test/testmtx.o - .text.thread10 - 0x00000000 0x2c ../../../test/testmtx.o - .text.thread11 - 0x00000000 0x40 ../../../test/testmtx.o - .text.mtx8_setup - 0x00000000 0x28 ../../../test/testmtx.o - .text.mtx7_setup - 0x00000000 0x1c ../../../test/testmtx.o - .text.mtx6_setup - 0x00000000 0x1c ../../../test/testmtx.o - .text.mtx5_setup - 0x00000000 0x10 ../../../test/testmtx.o - .text.mtx4_setup - 0x00000000 0x1c ../../../test/testmtx.o - .text.mtx3_setup - 0x00000000 0x1c ../../../test/testmtx.o - .text.mtx2_setup - 0x00000000 0x10 ../../../test/testmtx.o - .text.mtx1_setup - 0x00000000 0x10 ../../../test/testmtx.o - .text.mtx7_execute - 0x00000000 0xe8 ../../../test/testmtx.o - .text.mtx6_execute - 0x00000000 0x110 ../../../test/testmtx.o - .text.mtx1_execute - 0x00000000 0xf0 ../../../test/testmtx.o - .text.mtx5_execute - 0x00000000 0xbc ../../../test/testmtx.o - .text.mtx4_execute - 0x00000000 0x260 ../../../test/testmtx.o - .text.thread4b - 0x00000000 0x1c ../../../test/testmtx.o - .text.thread4a - 0x00000000 0x1c ../../../test/testmtx.o - .text.mtx3_execute - 0x00000000 0xe4 ../../../test/testmtx.o - .text.mtx2_execute - 0x00000000 0xa8 ../../../test/testmtx.o - .text.thread3HH - 0x00000000 0x28 ../../../test/testmtx.o - .text.thread3H - 0x00000000 0x18 ../../../test/testmtx.o - .text.thread3M - 0x00000000 0x28 ../../../test/testmtx.o - .text.thread3L - 0x00000000 0x44 ../../../test/testmtx.o - .text.thread3LL - 0x00000000 0x24 ../../../test/testmtx.o - .text.thread2L - 0x00000000 0x28 ../../../test/testmtx.o - .text.thread2M - 0x00000000 0x18 ../../../test/testmtx.o - .text.thread2H - 0x00000000 0x28 ../../../test/testmtx.o - .rodata.testmtx5 - 0x00000000 0x10 ../../../test/testmtx.o - .rodata.testmtx6 - 0x00000000 0x10 ../../../test/testmtx.o - .rodata.testmtx7 - 0x00000000 0x10 ../../../test/testmtx.o - .rodata.testmtx8 - 0x00000000 0x10 ../../../test/testmtx.o - .data.m1 0x00000000 0x10 ../../../test/testmtx.o - .data.m2 0x00000000 0x10 ../../../test/testmtx.o - .rodata.str1.4 - 0x00000000 0x10c ../../../test/testmtx.o - .rodata.patternmtx - 0x00000000 0x24 ../../../test/testmtx.o - .data.c1 0x00000000 0x8 ../../../test/testmtx.o - .rodata.testmtx1 - 0x00000000 0x10 ../../../test/testmtx.o - .rodata.testmtx2 - 0x00000000 0x10 ../../../test/testmtx.o - .rodata.testmtx3 - 0x00000000 0x10 ../../../test/testmtx.o - .rodata.testmtx4 - 0x00000000 0x10 ../../../test/testmtx.o - .text 0x00000000 0x0 ../../../test/testmsg.o - .data 0x00000000 0x0 ../../../test/testmsg.o - .bss 0x00000000 0x0 ../../../test/testmsg.o - .text.msg1_execute - 0x00000000 0x80 ../../../test/testmsg.o - .text.thread 0x00000000 0x20 ../../../test/testmsg.o - .rodata.testmsg1 - 0x00000000 0x10 ../../../test/testmsg.o - .rodata.str1.4 - 0x00000000 0x14 ../../../test/testmsg.o - .rodata.patternmsg - 0x00000000 0x8 ../../../test/testmsg.o - .text 0x00000000 0x0 ../../../test/testmbox.o - .data 0x00000000 0x0 ../../../test/testmbox.o - .bss 0x00000000 0x0 ../../../test/testmbox.o - .text.mbox1_execute - 0x00000000 0x49c ../../../test/testmbox.o - .text.mbox1_setup - 0x00000000 0x1c ../../../test/testmbox.o - .data.mb1 0x00000000 0x28 ../../../test/testmbox.o - .rodata.patternmbox - 0x00000000 0x8 ../../../test/testmbox.o - .rodata.str1.4 - 0x00000000 0x28 ../../../test/testmbox.o - .rodata.testmbox1 - 0x00000000 0x10 ../../../test/testmbox.o - .text 0x00000000 0x0 ../../../test/testevt.o - .data 0x00000000 0x0 ../../../test/testevt.o - .bss 0x00000000 0x0 ../../../test/testevt.o - .text.evt3_execute - 0x00000000 0xa8 ../../../test/testevt.o - .text.evt3_setup - 0x00000000 0xc ../../../test/testevt.o - .text.evt2_setup - 0x00000000 0xc ../../../test/testevt.o - .text.evt1_setup - 0x00000000 0xc ../../../test/testevt.o - .text.evt2_execute - 0x00000000 0x274 ../../../test/testevt.o - .text.thread2 0x00000000 0x28 ../../../test/testevt.o - .text.thread1 0x00000000 0x18 ../../../test/testevt.o - .text.evt1_execute - 0x00000000 0x88 ../../../test/testevt.o - .text.h3 0x00000000 0xc ../../../test/testevt.o - .text.h2 0x00000000 0xc ../../../test/testevt.o - .text.h1 0x00000000 0xc ../../../test/testevt.o - .rodata.patternevt - 0x00000000 0x10 ../../../test/testevt.o - .rodata.testevt2 - 0x00000000 0x10 ../../../test/testevt.o - .rodata.str1.4 - 0x00000000 0x5c ../../../test/testevt.o - .rodata.testevt1 - 0x00000000 0x10 ../../../test/testevt.o - .rodata.evhndl - 0x00000000 0xc ../../../test/testevt.o - .rodata.testevt3 - 0x00000000 0x10 ../../../test/testevt.o - .data.es1 0x00000000 0x4 ../../../test/testevt.o - .data.es2 0x00000000 0x4 ../../../test/testevt.o - .text 0x00000000 0x0 ../../../test/testheap.o - .data 0x00000000 0x0 ../../../test/testheap.o - .bss 0x00000000 0x0 ../../../test/testheap.o - .text.heap1_execute - 0x00000000 0x24c ../../../test/testheap.o - .text.heap1_setup - 0x00000000 0x1c ../../../test/testheap.o - .rodata.patternheap - 0x00000000 0x8 ../../../test/testheap.o - .rodata.str1.4 - 0x00000000 0x28 ../../../test/testheap.o - .rodata.testheap1 - 0x00000000 0x10 ../../../test/testheap.o - .bss.test_heap - 0x00000000 0x20 ../../../test/testheap.o - .text 0x00000000 0x0 ../../../test/testpools.o - .data 0x00000000 0x0 ../../../test/testpools.o - .bss 0x00000000 0x0 ../../../test/testpools.o - .text.null_provider - 0x00000000 0x4 ../../../test/testpools.o - .text.pools1_execute - 0x00000000 0x78 ../../../test/testpools.o - .text.pools1_setup - 0x00000000 0x18 ../../../test/testpools.o - .rodata.str1.4 - 0x00000000 0x1c ../../../test/testpools.o - .rodata.patternpools - 0x00000000 0x8 ../../../test/testpools.o - .data.mp1 0x00000000 0xc ../../../test/testpools.o - .rodata.testpools1 - 0x00000000 0x10 ../../../test/testpools.o - .text 0x00000000 0x0 ../../../test/testdyn.o - .data 0x00000000 0x0 ../../../test/testdyn.o - .bss 0x00000000 0x0 ../../../test/testdyn.o - .text.regfind 0x00000000 0x24 ../../../test/testdyn.o - .text.dyn3_execute - 0x00000000 0x134 ../../../test/testdyn.o - .text.thread 0x00000000 0xc ../../../test/testdyn.o - .text.dyn3_setup - 0x00000000 0x1c ../../../test/testdyn.o - .text.dyn1_setup - 0x00000000 0x1c ../../../test/testdyn.o - .text.dyn2_execute - 0x00000000 0x108 ../../../test/testdyn.o - .text.dyn2_setup - 0x00000000 0x18 ../../../test/testdyn.o - .text.dyn1_execute - 0x00000000 0x10c ../../../test/testdyn.o - .rodata.testdyn1 - 0x00000000 0x10 ../../../test/testdyn.o - .rodata.testdyn2 - 0x00000000 0x10 ../../../test/testdyn.o - .rodata.testdyn3 - 0x00000000 0x10 ../../../test/testdyn.o - .bss.mp1 0x00000000 0xc ../../../test/testdyn.o - .rodata.str1.4 - 0x00000000 0xa4 ../../../test/testdyn.o - .rodata.patterndyn - 0x00000000 0x10 ../../../test/testdyn.o - .bss.heap1 0x00000000 0x20 ../../../test/testdyn.o - .text 0x00000000 0x0 ../../../test/testqueues.o - .data 0x00000000 0x0 ../../../test/testqueues.o - .bss 0x00000000 0x0 ../../../test/testqueues.o - .text.notify 0x00000000 0x4 ../../../test/testqueues.o - .text.thread2 0x00000000 0x18 ../../../test/testqueues.o - .text.queues2_execute - 0x00000000 0x1b8 ../../../test/testqueues.o - .text.queues2_setup - 0x00000000 0x24 ../../../test/testqueues.o - .text.thread1 0x00000000 0x14 ../../../test/testqueues.o - .text.queues1_execute - 0x00000000 0x1e4 ../../../test/testqueues.o - .text.queues1_setup - 0x00000000 0x24 ../../../test/testqueues.o - .rodata.testqueues1 - 0x00000000 0x10 ../../../test/testqueues.o - .rodata.testqueues2 - 0x00000000 0x10 ../../../test/testqueues.o - .rodata.str1.4 - 0x00000000 0x38 ../../../test/testqueues.o - .rodata.patternqueues - 0x00000000 0xc ../../../test/testqueues.o - .data.oq 0x00000000 0x20 ../../../test/testqueues.o - .data.iq 0x00000000 0x20 ../../../test/testqueues.o - .text 0x00000000 0x0 ../../../test/testbmk.o - .data 0x00000000 0x0 ../../../test/testbmk.o - .bss 0x00000000 0x0 ../../../test/testbmk.o - .text.thread2 0x00000000 0x4 ../../../test/testbmk.o - .text.tmo 0x00000000 0x4 ../../../test/testbmk.o - .text.bmk13_execute - 0x00000000 0x100 ../../../test/testbmk.o - .text.bmk12_execute - 0x00000000 0x68 ../../../test/testbmk.o - .text.bmk12_setup - 0x00000000 0x10 ../../../test/testbmk.o - .text.thread3 0x00000000 0x2c ../../../test/testbmk.o - .text.bmk11_execute - 0x00000000 0x70 ../../../test/testbmk.o - .text.bmk11_setup - 0x00000000 0x14 ../../../test/testbmk.o - .text.bmk7_setup - 0x00000000 0x14 ../../../test/testbmk.o - .text.bmk10_execute - 0x00000000 0x78 ../../../test/testbmk.o - .text.bmk9_execute - 0x00000000 0x98 ../../../test/testbmk.o - .text.bmk6_execute - 0x00000000 0x70 ../../../test/testbmk.o - .text.bmk8_execute - 0x00000000 0xe8 ../../../test/testbmk.o - .text.thread8 0x00000000 0x30 ../../../test/testbmk.o - .text.bmk7_execute - 0x00000000 0x104 ../../../test/testbmk.o - .text.bmk5_execute - 0x00000000 0x74 ../../../test/testbmk.o - .text.bmk4_execute - 0x00000000 0xb4 ../../../test/testbmk.o - .text.msg_loop_test - 0x00000000 0x34 ../../../test/testbmk.o - .text.bmk3_execute - 0x00000000 0xfc ../../../test/testbmk.o - .text.bmk2_execute - 0x00000000 0x80 ../../../test/testbmk.o - .text.bmk1_execute - 0x00000000 0x80 ../../../test/testbmk.o - .text.thread1 0x00000000 0x18 ../../../test/testbmk.o - .text.thread4 0x00000000 0x28 ../../../test/testbmk.o - .rodata.testbmk8 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk9 - 0x00000000 0x10 ../../../test/testbmk.o - .bss.vt2.2131 0x00000000 0x14 ../../../test/testbmk.o - .rodata.testbmk10 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk11 - 0x00000000 0x10 ../../../test/testbmk.o - .bss.vt1.2130 0x00000000 0x14 ../../../test/testbmk.o - .bss.mtx1 0x00000000 0x10 ../../../test/testbmk.o - .bss.ib.2119 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk12 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk13 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.str1.4 - 0x00000000 0x2c8 ../../../test/testbmk.o - .bss.iq.2120 0x00000000 0x20 ../../../test/testbmk.o - .bss.sem1 0x00000000 0xc ../../../test/testbmk.o - .rodata.patternbmk - 0x00000000 0x38 ../../../test/testbmk.o - .rodata.testbmk1 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk2 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk3 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk4 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk5 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk6 - 0x00000000 0x10 ../../../test/testbmk.o - .rodata.testbmk7 - 0x00000000 0x10 ../../../test/testbmk.o - .text 0x00000000 0x0 ../../../os/hal/src/hal.o - .data 0x00000000 0x0 ../../../os/hal/src/hal.o - .bss 0x00000000 0x0 ../../../os/hal/src/hal.o - .text 0x00000000 0x0 ../../../os/hal/src/adc.o - .data 0x00000000 0x0 ../../../os/hal/src/adc.o - .bss 0x00000000 0x0 ../../../os/hal/src/adc.o - .text 0x00000000 0x0 ../../../os/hal/src/can.o - .data 0x00000000 0x0 ../../../os/hal/src/can.o - .bss 0x00000000 0x0 ../../../os/hal/src/can.o - .text 0x00000000 0x0 ../../../os/hal/src/gpt.o - .data 0x00000000 0x0 ../../../os/hal/src/gpt.o - .bss 0x00000000 0x0 ../../../os/hal/src/gpt.o - .text.gptStop 0x00000000 0x1c ../../../os/hal/src/gpt.o - .text.gptStartContinuousI - 0x00000000 0xc ../../../os/hal/src/gpt.o - .text.gptStartOneShot - 0x00000000 0x18 ../../../os/hal/src/gpt.o - .text.gptStartOneShotI - 0x00000000 0xc ../../../os/hal/src/gpt.o - .text.gptStopTimerI - 0x00000000 0xc ../../../os/hal/src/gpt.o - .text.gptPolledDelay - 0x00000000 0xc ../../../os/hal/src/gpt.o - .text 0x00000000 0x0 ../../../os/hal/src/i2c.o - .data 0x00000000 0x0 ../../../os/hal/src/i2c.o - .bss 0x00000000 0x0 ../../../os/hal/src/i2c.o - .text 0x00000000 0x0 ../../../os/hal/src/mac.o - .data 0x00000000 0x0 ../../../os/hal/src/mac.o - .bss 0x00000000 0x0 ../../../os/hal/src/mac.o - .text 0x00000000 0x0 ../../../os/hal/src/pal.o - .data 0x00000000 0x0 ../../../os/hal/src/pal.o - .bss 0x00000000 0x0 ../../../os/hal/src/pal.o - .text.palReadBus - 0x00000000 0x10 ../../../os/hal/src/pal.o - .text.palWriteBus - 0x00000000 0x14 ../../../os/hal/src/pal.o - .text.palSetBusMode - 0x00000000 0x10 ../../../os/hal/src/pal.o - .text 0x00000000 0x0 ../../../os/hal/src/pwm.o - .data 0x00000000 0x0 ../../../os/hal/src/pwm.o - .bss 0x00000000 0x0 ../../../os/hal/src/pwm.o - .text 0x00000000 0x0 ../../../os/hal/src/serial.o - .data 0x00000000 0x0 ../../../os/hal/src/serial.o - .bss 0x00000000 0x0 ../../../os/hal/src/serial.o - .text.sdStop 0x00000000 0x30 ../../../os/hal/src/serial.o - .text.sdIncomingDataI - 0x00000000 0x40 ../../../os/hal/src/serial.o - .text.sdRequestDataI - 0x00000000 0x28 ../../../os/hal/src/serial.o - .text 0x00000000 0x0 ../../../os/hal/src/spi.o - .data 0x00000000 0x0 ../../../os/hal/src/spi.o - .bss 0x00000000 0x0 ../../../os/hal/src/spi.o - .text 0x00000000 0x0 ../../../os/hal/src/uart.o - .data 0x00000000 0x0 ../../../os/hal/src/uart.o - .bss 0x00000000 0x0 ../../../os/hal/src/uart.o - .text 0x00000000 0x0 ../../../os/hal/src/usb.o - .data 0x00000000 0x0 ../../../os/hal/src/usb.o - .bss 0x00000000 0x0 ../../../os/hal/src/usb.o - .text 0x00000000 0x0 ../../../os/hal/src/mmc_spi.o - .data 0x00000000 0x0 ../../../os/hal/src/mmc_spi.o - .bss 0x00000000 0x0 ../../../os/hal/src/mmc_spi.o - .text 0x00000000 0x0 ../../../os/hal/src/serial_usb.o - .data 0x00000000 0x0 ../../../os/hal/src/serial_usb.o - .bss 0x00000000 0x0 ../../../os/hal/src/serial_usb.o - .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .text.gpt_lld_stop - 0x00000000 0xac ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .text.gpt_lld_polled_delay - 0x00000000 0x20 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .text._pal_lld_setgroupmode - 0x00000000 0x38 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .text.sd_lld_stop - 0x00000000 0x60 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .text 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .data 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .bss 0x00000000 0x0 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .text 0x00000000 0x0 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .data 0x00000000 0x0 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .bss 0x00000000 0x0 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .text 0x00000000 0x0 ../../../os/various/evtimer.o - .data 0x00000000 0x0 ../../../os/various/evtimer.o - .bss 0x00000000 0x0 ../../../os/various/evtimer.o - .text.tmrcb 0x00000000 0x24 ../../../os/various/evtimer.o - .text.evtStart - 0x00000000 0x24 ../../../os/various/evtimer.o - .text.evtStop 0x00000000 0x18 ../../../os/various/evtimer.o - .text 0x00000000 0x0 ../../../os/various/syscalls.o - .data 0x00000000 0x0 ../../../os/various/syscalls.o - .bss 0x00000000 0x0 ../../../os/various/syscalls.o - .text._read_r 0x00000000 0xc ../../../os/various/syscalls.o - .text._lseek_r - 0x00000000 0x4 ../../../os/various/syscalls.o - .text._write_r - 0x00000000 0x4 ../../../os/various/syscalls.o - .text._close_r - 0x00000000 0x4 ../../../os/various/syscalls.o - .text._sbrk_r 0x00000000 0x18 ../../../os/various/syscalls.o - .text._fstat_r - 0x00000000 0x18 ../../../os/various/syscalls.o - .text._isatty_r - 0x00000000 0x4 ../../../os/various/syscalls.o - .text 0x00000000 0x0 main.o - .data 0x00000000 0x0 main.o - .bss 0x00000000 0x0 main.o - .text 0x00000000 0x9c c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - .data 0x00000000 0x0 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - .bss 0x00000000 0x0 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -Memory Configuration - -Name Origin Length Attributes -flash 0x00000000 0x00008000 -ram 0x10000000 0x00002000 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -LOAD ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -LOAD ../../../os/ports/GCC/ARMCMx/chcore.o -LOAD ../../../os/ports/GCC/ARMCMx/chcore_v7m.o -LOAD ../../../os/ports/GCC/ARMCMx/nvic.o -LOAD ../../../os/kernel/src/chsys.o -LOAD ../../../os/kernel/src/chdebug.o -LOAD ../../../os/kernel/src/chlists.o -LOAD ../../../os/kernel/src/chvt.o -LOAD ../../../os/kernel/src/chschd.o -LOAD ../../../os/kernel/src/chthreads.o -LOAD ../../../os/kernel/src/chdynamic.o -LOAD ../../../os/kernel/src/chregistry.o -LOAD ../../../os/kernel/src/chsem.o -LOAD ../../../os/kernel/src/chmtx.o -LOAD ../../../os/kernel/src/chcond.o -LOAD ../../../os/kernel/src/chevents.o -LOAD ../../../os/kernel/src/chmsg.o -LOAD ../../../os/kernel/src/chmboxes.o -LOAD ../../../os/kernel/src/chqueues.o -LOAD ../../../os/kernel/src/chmemcore.o -LOAD ../../../os/kernel/src/chheap.o -LOAD ../../../os/kernel/src/chmempools.o -LOAD ../../../test/test.o -LOAD ../../../test/testthd.o -LOAD ../../../test/testsem.o -LOAD ../../../test/testmtx.o -LOAD ../../../test/testmsg.o -LOAD ../../../test/testmbox.o -LOAD ../../../test/testevt.o -LOAD ../../../test/testheap.o -LOAD ../../../test/testpools.o -LOAD ../../../test/testdyn.o -LOAD ../../../test/testqueues.o -LOAD ../../../test/testbmk.o -LOAD ../../../os/hal/src/hal.o -LOAD ../../../os/hal/src/adc.o -LOAD ../../../os/hal/src/can.o -LOAD ../../../os/hal/src/gpt.o -LOAD ../../../os/hal/src/i2c.o -LOAD ../../../os/hal/src/mac.o -LOAD ../../../os/hal/src/pal.o -LOAD ../../../os/hal/src/pwm.o -LOAD ../../../os/hal/src/serial.o -LOAD ../../../os/hal/src/spi.o -LOAD ../../../os/hal/src/uart.o -LOAD ../../../os/hal/src/usb.o -LOAD ../../../os/hal/src/mmc_spi.o -LOAD ../../../os/hal/src/serial_usb.o -LOAD ../../../os/hal/platforms/LPC13xx/hal_lld.o -LOAD ../../../os/hal/platforms/LPC13xx/gpt_lld.o -LOAD ../../../os/hal/platforms/LPC13xx/pal_lld.o -LOAD ../../../os/hal/platforms/LPC13xx/serial_lld.o -LOAD ../../../os/hal/platforms/LPC13xx/spi_lld.o -LOAD ../../../boards/EA_LPCXPRESSO_BB_1343/board.o -LOAD ../../../os/various/evtimer.o -LOAD ../../../os/various/syscalls.o -LOAD main.o -START GROUP -LOAD c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/thumb/v7m\libgcc.a -LOAD c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a -END GROUP - 0x00000100 __main_stack_size__ = 0x100 - 0x00000100 __process_stack_size__ = 0x100 - 0x00000200 __stacks_total_size__ = (__main_stack_size__ + __process_stack_size__) - 0x10000000 __ram_start__ = ORIGIN (ram) - 0x00002000 __ram_size__ = 0x2000 - 0x10002000 __ram_end__ = (__ram_start__ + __ram_size__) - 0x00000000 . = 0x0 - -.text 0x00000000 0x1bb8 - 0x00000000 _text = . - *(vectors) - vectors 0x00000000 0x120 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - 0x00000000 _vectors - *(.text) - .text 0x00000120 0x64 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o - 0x00000120 ResetHandler - 0x00000164 _main_exit_handler - *(.text.*) - *fill* 0x00000184 0xc 00 - .text._unhandled_exception - 0x00000190 0x4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - 0x00000190 Vector58 - 0x00000190 Vector9C - 0x00000190 VectorAC - 0x00000190 Vector5C - 0x00000190 NMIVector - 0x00000190 Vector11C - 0x00000190 Vector8C - 0x00000190 VectorDC - 0x00000190 Vector110 - 0x00000190 VectorC8 - 0x00000190 Vector94 - 0x00000190 VectorA8 - 0x00000190 VectorB4 - 0x00000190 Vector74 - 0x00000190 UsageFaultVector - 0x00000190 DebugMonitorVector - 0x00000190 Vector40 - 0x00000190 Vector108 - 0x00000190 VectorBC - 0x00000190 PendSVVector - 0x00000190 Vector118 - 0x00000190 Vector64 - 0x00000190 VectorCC - 0x00000190 Vector54 - 0x00000190 Vector98 - 0x00000190 VectorD8 - 0x00000190 Vector24 - 0x00000190 Vector84 - 0x00000190 BusFaultVector - 0x00000190 VectorD0 - 0x00000190 VectorC0 - 0x00000190 HardFaultVector - 0x00000190 Vector100 - 0x00000190 VectorE0 - 0x00000190 VectorF4 - 0x00000190 MemManageVector - 0x00000190 Vector6C - 0x00000190 VectorA0 - 0x00000190 VectorC4 - 0x00000190 Vector7C - 0x00000190 VectorB0 - 0x00000190 Vector90 - 0x00000190 Vector114 - 0x00000190 Vector60 - 0x00000190 Vector1C - 0x00000190 Vector48 - 0x00000190 Vector70 - 0x00000190 VectorD4 - 0x00000190 Vector4C - 0x00000190 Vector80 - 0x00000190 Vector68 - 0x00000190 Vector78 - 0x00000190 _unhandled_exception - 0x00000190 Vector88 - 0x00000190 Vector104 - 0x00000190 Vector10C - 0x00000190 Vector50 - 0x00000190 Vector44 - 0x00000190 Vector28 - 0x00000190 VectorB8 - 0x00000190 VectorFC - 0x00000190 Vector34 - 0x00000190 VectorA4 - 0x00000190 Vector20 - *fill* 0x00000194 0xc 00 - .text._port_switch_from_isr - 0x000001a0 0x8 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x000001a0 _port_switch_from_isr - *fill* 0x000001a8 0x8 00 - .text.SVCallVector - 0x000001b0 0x14 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x000001b0 SVCallVector - *fill* 0x000001c4 0xc 00 - .text._port_irq_epilogue - 0x000001d0 0x44 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x000001d0 _port_irq_epilogue - *fill* 0x00000214 0xc 00 - .text.SysTickVector - 0x00000220 0x18 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x00000220 SysTickVector - *fill* 0x00000238 0x8 00 - .text.port_switch - 0x00000240 0x10 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x00000240 port_switch - .text._port_thread_start - 0x00000250 0x10 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x00000250 _port_thread_start - .text.NVICEnableVector - 0x00000260 0x4c ../../../os/ports/GCC/ARMCMx/nvic.o - 0x00000260 NVICEnableVector - *fill* 0x000002ac 0x4 00 - .text.NVICSetSystemHandlerPriority - 0x000002b0 0x30 ../../../os/ports/GCC/ARMCMx/nvic.o - 0x000002b0 NVICSetSystemHandlerPriority - .text._idle_thread - 0x000002e0 0x4 ../../../os/kernel/src/chsys.o - 0x000002e0 _idle_thread - *fill* 0x000002e4 0xc 00 - .text.chSysInit - 0x000002f0 0x78 ../../../os/kernel/src/chsys.o - 0x000002f0 chSysInit - *fill* 0x00000368 0x8 00 - .text.chSysTimerHandlerI - 0x00000370 0x50 ../../../os/kernel/src/chsys.o - 0x00000370 chSysTimerHandlerI - .text.vt_init 0x000003c0 0x18 ../../../os/kernel/src/chvt.o - 0x000003c0 vt_init - *fill* 0x000003d8 0x8 00 - .text.chVTSetI - 0x000003e0 0x3c ../../../os/kernel/src/chvt.o - 0x000003e0 chVTSetI - *fill* 0x0000041c 0x4 00 - .text.chVTResetI - 0x00000420 0x24 ../../../os/kernel/src/chvt.o - 0x00000420 chVTResetI - *fill* 0x00000444 0xc 00 - .text.wakeup 0x00000450 0x48 ../../../os/kernel/src/chschd.o - *fill* 0x00000498 0x8 00 - .text.scheduler_init - 0x000004a0 0x1c ../../../os/kernel/src/chschd.o - 0x000004a0 scheduler_init - *fill* 0x000004bc 0x4 00 - .text.chSchReadyI - 0x000004c0 0x20 ../../../os/kernel/src/chschd.o - 0x000004c0 chSchReadyI - .text.chSchGoSleepS - 0x000004e0 0x2c ../../../os/kernel/src/chschd.o - 0x000004e0 chSchGoSleepS - *fill* 0x0000050c 0x4 00 - .text.chSchGoSleepTimeoutS - 0x00000510 0x44 ../../../os/kernel/src/chschd.o - 0x00000510 chSchGoSleepTimeoutS - *fill* 0x00000554 0xc 00 - .text.chSchWakeupS - 0x00000560 0x60 ../../../os/kernel/src/chschd.o - 0x00000560 chSchWakeupS - .text.chSchDoRescheduleI - 0x000005c0 0x44 ../../../os/kernel/src/chschd.o - 0x000005c0 chSchDoRescheduleI - *fill* 0x00000604 0xc 00 - .text.chSchRescheduleS - 0x00000610 0x1c ../../../os/kernel/src/chschd.o - 0x00000610 chSchRescheduleS - *fill* 0x0000062c 0x4 00 - .text.chSchIsRescRequiredExI - 0x00000630 0x28 ../../../os/kernel/src/chschd.o - 0x00000630 chSchIsRescRequiredExI - *fill* 0x00000658 0x8 00 - .text._thread_init - 0x00000660 0x4c ../../../os/kernel/src/chthreads.o - 0x00000660 _thread_init - *fill* 0x000006ac 0x4 00 - .text.chThdCreateI - 0x000006b0 0x5c ../../../os/kernel/src/chthreads.o - 0x000006b0 chThdCreateI - *fill* 0x0000070c 0x4 00 - .text.chThdCreateStatic - 0x00000710 0x30 ../../../os/kernel/src/chthreads.o - 0x00000710 chThdCreateStatic - .text.chThdSleep - 0x00000740 0x18 ../../../os/kernel/src/chthreads.o - 0x00000740 chThdSleep - *fill* 0x00000758 0x8 00 - .text.chThdExit - 0x00000760 0x48 ../../../os/kernel/src/chthreads.o - 0x00000760 chThdExit - *fill* 0x000007a8 0x8 00 - .text.chSemInit - 0x000007b0 0x8 ../../../os/kernel/src/chsem.o - 0x000007b0 chSemInit - *fill* 0x000007b8 0x8 00 - .text.chSemWaitTimeoutS - 0x000007c0 0x40 ../../../os/kernel/src/chsem.o - 0x000007c0 chSemWaitTimeoutS - .text.chSemSignalI - 0x00000800 0x24 ../../../os/kernel/src/chsem.o - 0x00000800 chSemSignalI - *fill* 0x00000824 0xc 00 - .text.chMtxInit - 0x00000830 0xc ../../../os/kernel/src/chmtx.o - 0x00000830 chMtxInit - *fill* 0x0000083c 0x4 00 - .text.chEvtSignalFlagsI - 0x00000840 0x38 ../../../os/kernel/src/chevents.o - 0x00000840 chEvtSignalFlagsI - *fill* 0x00000878 0x8 00 - .text.chEvtBroadcastFlagsI - 0x00000880 0x20 ../../../os/kernel/src/chevents.o - 0x00000880 chEvtBroadcastFlagsI - .text.chMBInit - 0x000008a0 0x2c ../../../os/kernel/src/chmboxes.o - 0x000008a0 chMBInit - *fill* 0x000008cc 0x4 00 - .text.chMBPostS - 0x000008d0 0x38 ../../../os/kernel/src/chmboxes.o - 0x000008d0 chMBPostS - *fill* 0x00000908 0x8 00 - .text.chMBPost - 0x00000910 0x14 ../../../os/kernel/src/chmboxes.o - 0x00000910 chMBPost - *fill* 0x00000924 0xc 00 - .text.chMBPostI - 0x00000930 0x34 ../../../os/kernel/src/chmboxes.o - 0x00000930 chMBPostI - *fill* 0x00000964 0xc 00 - .text.chMBFetchS - 0x00000970 0x38 ../../../os/kernel/src/chmboxes.o - 0x00000970 chMBFetchS - *fill* 0x000009a8 0x8 00 - .text.chMBFetch - 0x000009b0 0x14 ../../../os/kernel/src/chmboxes.o - 0x000009b0 chMBFetch - *fill* 0x000009c4 0xc 00 - .text.chIQInit - 0x000009d0 0x1c ../../../os/kernel/src/chqueues.o - 0x000009d0 chIQInit - *fill* 0x000009ec 0x4 00 - .text.chIQPutI - 0x000009f0 0x34 ../../../os/kernel/src/chqueues.o - 0x000009f0 chIQPutI - *fill* 0x00000a24 0xc 00 - .text.chIQGetTimeout - 0x00000a30 0x44 ../../../os/kernel/src/chqueues.o - 0x00000a30 chIQGetTimeout - *fill* 0x00000a74 0xc 00 - .text.chIQReadTimeout - 0x00000a80 0x88 ../../../os/kernel/src/chqueues.o - 0x00000a80 chIQReadTimeout - *fill* 0x00000b08 0x8 00 - .text.chOQInit - 0x00000b10 0x20 ../../../os/kernel/src/chqueues.o - 0x00000b10 chOQInit - .text.chOQPutTimeout - 0x00000b30 0x48 ../../../os/kernel/src/chqueues.o - 0x00000b30 chOQPutTimeout - *fill* 0x00000b78 0x8 00 - .text.chOQGetI - 0x00000b80 0x38 ../../../os/kernel/src/chqueues.o - 0x00000b80 chOQGetI - *fill* 0x00000bb8 0x8 00 - .text.chOQWriteTimeout - 0x00000bc0 0x88 ../../../os/kernel/src/chqueues.o - 0x00000bc0 chOQWriteTimeout - *fill* 0x00000c48 0x8 00 - .text.core_init - 0x00000c50 0x2c ../../../os/kernel/src/chmemcore.o - 0x00000c50 core_init - *fill* 0x00000c7c 0x4 00 - .text.chCoreAlloc - 0x00000c80 0x34 ../../../os/kernel/src/chmemcore.o - 0x00000c80 chCoreAlloc - *fill* 0x00000cb4 0xc 00 - .text.heap_init - 0x00000cc0 0x24 ../../../os/kernel/src/chheap.o - 0x00000cc0 heap_init - *fill* 0x00000ce4 0xc 00 - .text.halInit 0x00000cf0 0x20 ../../../os/hal/src/hal.o - 0x00000cf0 halInit - .text.gptInit 0x00000d10 0x8 ../../../os/hal/src/gpt.o - 0x00000d10 gptInit - *fill* 0x00000d18 0x8 00 - .text.gptObjectInit - 0x00000d20 0xc ../../../os/hal/src/gpt.o - 0x00000d20 gptObjectInit - *fill* 0x00000d2c 0x4 00 - .text.gptStart - 0x00000d30 0x1c ../../../os/hal/src/gpt.o - 0x00000d30 gptStart - *fill* 0x00000d4c 0x4 00 - .text.gptStartContinuous - 0x00000d50 0x18 ../../../os/hal/src/gpt.o - 0x00000d50 gptStartContinuous - *fill* 0x00000d68 0x8 00 - .text.gptStopTimer - 0x00000d70 0x18 ../../../os/hal/src/gpt.o - 0x00000d70 gptStopTimer - *fill* 0x00000d88 0x8 00 - .text.putwouldblock - 0x00000d90 0xc ../../../os/hal/src/serial.o - *fill* 0x00000d9c 0x4 00 - .text.getwouldblock - 0x00000da0 0xc ../../../os/hal/src/serial.o - *fill* 0x00000dac 0x4 00 - .text.getflags - 0x00000db0 0x18 ../../../os/hal/src/serial.o - *fill* 0x00000dc8 0x8 00 - .text.readt 0x00000dd0 0xc ../../../os/hal/src/serial.o - *fill* 0x00000ddc 0x4 00 - .text.reads 0x00000de0 0x10 ../../../os/hal/src/serial.o - .text.writet 0x00000df0 0xc ../../../os/hal/src/serial.o - *fill* 0x00000dfc 0x4 00 - .text.writes 0x00000e00 0x10 ../../../os/hal/src/serial.o - .text.gett 0x00000e10 0xc ../../../os/hal/src/serial.o - *fill* 0x00000e1c 0x4 00 - .text.putt 0x00000e20 0xc ../../../os/hal/src/serial.o - *fill* 0x00000e2c 0x4 00 - .text.sdInit 0x00000e30 0x8 ../../../os/hal/src/serial.o - 0x00000e30 sdInit - *fill* 0x00000e38 0x8 00 - .text.sdObjectInit - 0x00000e40 0x4c ../../../os/hal/src/serial.o - 0x00000e40 sdObjectInit - *fill* 0x00000e8c 0x4 00 - .text.sdStart 0x00000e90 0x1c ../../../os/hal/src/serial.o - 0x00000e90 sdStart - *fill* 0x00000eac 0x4 00 - .text.hal_lld_init - 0x00000eb0 0x28 ../../../os/hal/platforms/LPC13xx/hal_lld.o - 0x00000eb0 hal_lld_init - *fill* 0x00000ed8 0x8 00 - .text.LPC13xx_clock_init - 0x00000ee0 0xa0 ../../../os/hal/platforms/LPC13xx/hal_lld.o - 0x00000ee0 LPC13xx_clock_init - .text.VectorE4 - 0x00000f80 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x00000f80 VectorE4 - *fill* 0x00000fb4 0xc 00 - .text.VectorE8 - 0x00000fc0 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x00000fc0 VectorE8 - *fill* 0x00000ff4 0xc 00 - .text.VectorEC - 0x00001000 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x00001000 VectorEC - *fill* 0x00001034 0xc 00 - .text.VectorF0 - 0x00001040 0x34 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x00001040 VectorF0 - *fill* 0x00001074 0xc 00 - .text.gpt_lld_init - 0x00001080 0x60 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x00001080 gpt_lld_init - .text.gpt_lld_start - 0x000010e0 0xd0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x000010e0 gpt_lld_start - .text.gpt_lld_start_timer - 0x000011b0 0x18 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x000011b0 gpt_lld_start_timer - *fill* 0x000011c8 0x8 00 - .text.gpt_lld_stop_timer - 0x000011d0 0x10 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x000011d0 gpt_lld_stop_timer - .text._pal_lld_init - 0x000011e0 0x64 ../../../os/hal/platforms/LPC13xx/pal_lld.o - 0x000011e0 _pal_lld_init - *fill* 0x00001244 0xc 00 - .text.notify1 0x00001250 0x4c ../../../os/hal/platforms/LPC13xx/serial_lld.o - *fill* 0x0000129c 0x4 00 - .text.VectorF8 - 0x000012a0 0x130 ../../../os/hal/platforms/LPC13xx/serial_lld.o - 0x000012a0 VectorF8 - .text.sd_lld_init - 0x000013d0 0x38 ../../../os/hal/platforms/LPC13xx/serial_lld.o - 0x000013d0 sd_lld_init - *fill* 0x00001408 0x8 00 - .text.sd_lld_start - 0x00001410 0x84 ../../../os/hal/platforms/LPC13xx/serial_lld.o - 0x00001410 sd_lld_start - *fill* 0x00001494 0xc 00 - .text.__early_init - 0x000014a0 0x8 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - 0x000014a0 __early_init - *fill* 0x000014a8 0x8 00 - .text.boardInit - 0x000014b0 0x18 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - 0x000014b0 boardInit - *fill* 0x000014c8 0x8 00 - .text.print 0x000014d0 0x24 main.o - *fill* 0x000014f4 0xc 00 - .text.println 0x00001500 0x3c main.o - *fill* 0x0000153c 0x4 00 - .text.printn 0x00001540 0x64 main.o - *fill* 0x000015a4 0xc 00 - .text.gpt2cb 0x000015b0 0x28 main.o - *fill* 0x000015d8 0x8 00 - .text.gpt1cb 0x000015e0 0x28 main.o - *fill* 0x00001608 0x8 00 - .text.WorkerThread - 0x00001610 0xb4 main.o - *fill* 0x000016c4 0xc 00 - .text.main 0x000016d0 0x2a4 main.o - 0x000016d0 main - *(.rodata) - *(.rodata.*) - *fill* 0x00001974 0xc 00 - .rodata.vmt 0x00001980 0x24 ../../../os/hal/src/serial.o - *fill* 0x000019a4 0xc 00 - .rodata.default_config - 0x000019b0 0xc ../../../os/hal/platforms/LPC13xx/serial_lld.o - *fill* 0x000019bc 0x4 00 - .rodata.pal_default_config - 0x000019c0 0x20 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - 0x000019c0 pal_default_config - .rodata.gpt2cfg - 0x000019e0 0x8 main.o - *fill* 0x000019e8 0x8 00 - .rodata.str1.4 - 0x000019f0 0x1c0 main.o - 0x1c4 (size before relaxing) - .rodata.gpt1cfg - 0x00001bb0 0x8 main.o - *(.glue_7t) - .glue_7t 0x00000000 0x0 linker stubs - *(.glue_7) - .glue_7 0x00000000 0x0 linker stubs - *(.gcc*) - -.vfp11_veneer 0x00001bb8 0x0 - .vfp11_veneer 0x00000000 0x0 linker stubs - -.v4_bx 0x00001bb8 0x0 - .v4_bx 0x00000000 0x0 linker stubs - -.ctors 0x00001bb8 0x0 - 0x00001bb8 PROVIDE (_ctors_start_, .) - *(SORT(.ctors.*)) - *(.ctors) - 0x00001bb8 PROVIDE (_ctors_end_, .) - -.dtors 0x00001bb8 0x0 - 0x00001bb8 PROVIDE (_dtors_start_, .) - *(SORT(.dtors.*)) - *(.dtors) - 0x00001bb8 PROVIDE (_dtors_end_, .) - -.ARM.extab - *(.ARM.extab* .gnu.linkonce.armextab.*) - 0x00001bb8 __exidx_start = . - -.ARM.exidx - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - 0x00001bb8 __exidx_end = . - -.eh_frame_hdr - *(.eh_frame_hdr) - -.eh_frame - *(.eh_frame) - 0x00001bb8 . = ALIGN (0x4) - 0x00001bb8 _etext = . - 0x00001bb8 _textdata = _etext - -.data 0x10000000 0x0 load address 0x00001bb8 - 0x10000000 _data = . - *(.data) - 0x10000000 . = ALIGN (0x4) - *(.data.*) - 0x10000000 . = ALIGN (0x4) - *(.ramtext) - 0x10000000 . = ALIGN (0x4) - 0x10000000 _edata = . - -.bss 0x10000000 0x744 load address 0x00001bb8 - 0x10000000 _bss_start = . - *(.bss) - 0x10000000 . = ALIGN (0x4) - *(.bss.*) - .bss.mainthread.1972 - 0x10000000 0x44 ../../../os/kernel/src/chsys.o - .bss.endmem 0x10000044 0x4 ../../../os/kernel/src/chmemcore.o - .bss.nextmem 0x10000048 0x4 ../../../os/kernel/src/chmemcore.o - *fill* 0x1000004c 0x4 00 - .bss.default_heap - 0x10000050 0x20 ../../../os/kernel/src/chheap.o - .bss.x.3296 0x10000070 0x4 main.o - .bss.cnt.3297 0x10000074 0x4 main.o - .bss.saturated - 0x10000078 0x4 main.o - .bss.mb 0x1000007c 0xa0 main.o - .bss.b 0x1000011c 0x40 main.o - *fill* 0x1000015c 0x4 00 - .bss.waWorkerThread - 0x10000160 0x460 main.o - 0x100005c0 . = ALIGN (0x4) - *(COMMON) - COMMON 0x100005c0 0xa0 ../../../os/kernel/src/chsys.o - 0x100005c0 _idle_thread_wa - COMMON 0x10000660 0x10 ../../../os/kernel/src/chvt.o - 0x10000660 vtlist - COMMON 0x10000670 0x20 ../../../os/kernel/src/chschd.o - 0x10000670 rlist - COMMON 0x10000690 0x40 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x10000690 GPTD2 - 0x100006a0 GPTD4 - 0x100006b0 GPTD1 - 0x100006c0 GPTD3 - COMMON 0x100006d0 0x74 ../../../os/hal/platforms/LPC13xx/serial_lld.o - 0x100006d0 SD1 - 0x10000744 . = ALIGN (0x4) - 0x10000744 _bss_end = . - 0x10000744 PROVIDE (end, .) - 0x10000744 _end = . - 0x10000744 __heap_base__ = _end - 0x10001e00 __heap_end__ = (__ram_end__ - __stacks_total_size__) -OUTPUT(ch.elf elf32-littlearm) - -.ARM.attributes - 0x00000000 0x2d - .ARM.attributes - 0x00000000 0x21 ../../../os/ports/GCC/ARMCMx/crt0_v7m.o - .ARM.attributes - 0x00000021 0x31 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .ARM.attributes - 0x00000052 0x31 ../../../os/ports/GCC/ARMCMx/chcore.o - .ARM.attributes - 0x00000083 0x31 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .ARM.attributes - 0x000000b4 0x31 ../../../os/ports/GCC/ARMCMx/nvic.o - .ARM.attributes - 0x000000e5 0x31 ../../../os/kernel/src/chsys.o - .ARM.attributes - 0x00000116 0x31 ../../../os/kernel/src/chdebug.o - .ARM.attributes - 0x00000147 0x31 ../../../os/kernel/src/chlists.o - .ARM.attributes - 0x00000178 0x31 ../../../os/kernel/src/chvt.o - .ARM.attributes - 0x000001a9 0x31 ../../../os/kernel/src/chschd.o - .ARM.attributes - 0x000001da 0x31 ../../../os/kernel/src/chthreads.o - .ARM.attributes - 0x0000020b 0x31 ../../../os/kernel/src/chdynamic.o - .ARM.attributes - 0x0000023c 0x31 ../../../os/kernel/src/chregistry.o - .ARM.attributes - 0x0000026d 0x31 ../../../os/kernel/src/chsem.o - .ARM.attributes - 0x0000029e 0x31 ../../../os/kernel/src/chmtx.o - .ARM.attributes - 0x000002cf 0x31 ../../../os/kernel/src/chcond.o - .ARM.attributes - 0x00000300 0x31 ../../../os/kernel/src/chevents.o - .ARM.attributes - 0x00000331 0x31 ../../../os/kernel/src/chmsg.o - .ARM.attributes - 0x00000362 0x31 ../../../os/kernel/src/chmboxes.o - .ARM.attributes - 0x00000393 0x31 ../../../os/kernel/src/chqueues.o - .ARM.attributes - 0x000003c4 0x31 ../../../os/kernel/src/chmemcore.o - .ARM.attributes - 0x000003f5 0x31 ../../../os/kernel/src/chheap.o - .ARM.attributes - 0x00000426 0x31 ../../../os/kernel/src/chmempools.o - .ARM.attributes - 0x00000457 0x31 ../../../test/test.o - .ARM.attributes - 0x00000488 0x31 ../../../test/testthd.o - .ARM.attributes - 0x000004b9 0x31 ../../../test/testsem.o - .ARM.attributes - 0x000004ea 0x31 ../../../test/testmtx.o - .ARM.attributes - 0x0000051b 0x31 ../../../test/testmsg.o - .ARM.attributes - 0x0000054c 0x31 ../../../test/testmbox.o - .ARM.attributes - 0x0000057d 0x31 ../../../test/testevt.o - .ARM.attributes - 0x000005ae 0x31 ../../../test/testheap.o - .ARM.attributes - 0x000005df 0x31 ../../../test/testpools.o - .ARM.attributes - 0x00000610 0x31 ../../../test/testdyn.o - .ARM.attributes - 0x00000641 0x31 ../../../test/testqueues.o - .ARM.attributes - 0x00000672 0x31 ../../../test/testbmk.o - .ARM.attributes - 0x000006a3 0x31 ../../../os/hal/src/hal.o - .ARM.attributes - 0x000006d4 0x31 ../../../os/hal/src/adc.o - .ARM.attributes - 0x00000705 0x31 ../../../os/hal/src/can.o - .ARM.attributes - 0x00000736 0x31 ../../../os/hal/src/gpt.o - .ARM.attributes - 0x00000767 0x31 ../../../os/hal/src/i2c.o - .ARM.attributes - 0x00000798 0x31 ../../../os/hal/src/mac.o - .ARM.attributes - 0x000007c9 0x31 ../../../os/hal/src/pal.o - .ARM.attributes - 0x000007fa 0x31 ../../../os/hal/src/pwm.o - .ARM.attributes - 0x0000082b 0x31 ../../../os/hal/src/serial.o - .ARM.attributes - 0x0000085c 0x31 ../../../os/hal/src/spi.o - .ARM.attributes - 0x0000088d 0x31 ../../../os/hal/src/uart.o - .ARM.attributes - 0x000008be 0x31 ../../../os/hal/src/usb.o - .ARM.attributes - 0x000008ef 0x31 ../../../os/hal/src/mmc_spi.o - .ARM.attributes - 0x00000920 0x31 ../../../os/hal/src/serial_usb.o - .ARM.attributes - 0x00000951 0x31 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .ARM.attributes - 0x00000982 0x31 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .ARM.attributes - 0x000009b3 0x31 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .ARM.attributes - 0x000009e4 0x31 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .ARM.attributes - 0x00000a15 0x31 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .ARM.attributes - 0x00000a46 0x31 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .ARM.attributes - 0x00000a77 0x31 ../../../os/various/evtimer.o - .ARM.attributes - 0x00000aa8 0x31 ../../../os/various/syscalls.o - .ARM.attributes - 0x00000ad9 0x31 main.o - .ARM.attributes - 0x00000b0a 0x29 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.comment 0x00000000 0x11 - .comment 0x00000000 0x11 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - 0x12 (size before relaxing) - .comment 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/chcore.o - .comment 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .comment 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/nvic.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chsys.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chdebug.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chlists.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chvt.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chschd.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chthreads.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chdynamic.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chregistry.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chsem.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chmtx.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chcond.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chevents.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chmsg.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chmboxes.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chqueues.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chmemcore.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chheap.o - .comment 0x00000000 0x12 ../../../os/kernel/src/chmempools.o - .comment 0x00000000 0x12 ../../../test/test.o - .comment 0x00000000 0x12 ../../../test/testthd.o - .comment 0x00000000 0x12 ../../../test/testsem.o - .comment 0x00000000 0x12 ../../../test/testmtx.o - .comment 0x00000000 0x12 ../../../test/testmsg.o - .comment 0x00000000 0x12 ../../../test/testmbox.o - .comment 0x00000000 0x12 ../../../test/testevt.o - .comment 0x00000000 0x12 ../../../test/testheap.o - .comment 0x00000000 0x12 ../../../test/testpools.o - .comment 0x00000000 0x12 ../../../test/testdyn.o - .comment 0x00000000 0x12 ../../../test/testqueues.o - .comment 0x00000000 0x12 ../../../test/testbmk.o - .comment 0x00000000 0x12 ../../../os/hal/src/hal.o - .comment 0x00000000 0x12 ../../../os/hal/src/adc.o - .comment 0x00000000 0x12 ../../../os/hal/src/can.o - .comment 0x00000000 0x12 ../../../os/hal/src/gpt.o - .comment 0x00000000 0x12 ../../../os/hal/src/i2c.o - .comment 0x00000000 0x12 ../../../os/hal/src/mac.o - .comment 0x00000000 0x12 ../../../os/hal/src/pal.o - .comment 0x00000000 0x12 ../../../os/hal/src/pwm.o - .comment 0x00000000 0x12 ../../../os/hal/src/serial.o - .comment 0x00000000 0x12 ../../../os/hal/src/spi.o - .comment 0x00000000 0x12 ../../../os/hal/src/uart.o - .comment 0x00000000 0x12 ../../../os/hal/src/usb.o - .comment 0x00000000 0x12 ../../../os/hal/src/mmc_spi.o - .comment 0x00000000 0x12 ../../../os/hal/src/serial_usb.o - .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .comment 0x00000000 0x12 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .comment 0x00000000 0x12 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .comment 0x00000000 0x12 ../../../os/various/evtimer.o - .comment 0x00000000 0x12 ../../../os/various/syscalls.o - .comment 0x00000000 0x12 main.o - .comment 0x00000000 0x12 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_abbrev 0x00000000 0x5409 - .debug_abbrev 0x00000000 0x74 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_abbrev 0x00000074 0x41 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_abbrev 0x000000b5 0x17a ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_abbrev 0x0000022f 0xfa ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_abbrev 0x00000329 0x182 ../../../os/kernel/src/chsys.o - .debug_abbrev 0x000004ab 0x2a ../../../os/kernel/src/chdebug.o - .debug_abbrev 0x000004d5 0x2a ../../../os/kernel/src/chlists.o - .debug_abbrev 0x000004ff 0x163 ../../../os/kernel/src/chvt.o - .debug_abbrev 0x00000662 0x29f ../../../os/kernel/src/chschd.o - .debug_abbrev 0x00000901 0x2e4 ../../../os/kernel/src/chthreads.o - .debug_abbrev 0x00000be5 0x1ac ../../../os/kernel/src/chdynamic.o - .debug_abbrev 0x00000d91 0x14b ../../../os/kernel/src/chregistry.o - .debug_abbrev 0x00000edc 0x27d ../../../os/kernel/src/chsem.o - .debug_abbrev 0x00001159 0x2c5 ../../../os/kernel/src/chmtx.o - .debug_abbrev 0x0000141e 0x26a ../../../os/kernel/src/chcond.o - .debug_abbrev 0x00001688 0x201 ../../../os/kernel/src/chevents.o - .debug_abbrev 0x00001889 0x1b1 ../../../os/kernel/src/chmsg.o - .debug_abbrev 0x00001a3a 0x1e2 ../../../os/kernel/src/chmboxes.o - .debug_abbrev 0x00001c1c 0x206 ../../../os/kernel/src/chqueues.o - .debug_abbrev 0x00001e22 0x167 ../../../os/kernel/src/chmemcore.o - .debug_abbrev 0x00001f89 0x18d ../../../os/kernel/src/chheap.o - .debug_abbrev 0x00002116 0x1ef ../../../os/kernel/src/chmempools.o - .debug_abbrev 0x00002305 0x40c ../../../test/test.o - .debug_abbrev 0x00002711 0x1c7 ../../../test/testthd.o - .debug_abbrev 0x000028d8 0x1e8 ../../../test/testsem.o - .debug_abbrev 0x00002ac0 0x27b ../../../test/testmtx.o - .debug_abbrev 0x00002d3b 0x171 ../../../test/testmsg.o - .debug_abbrev 0x00002eac 0x1a5 ../../../test/testmbox.o - .debug_abbrev 0x00003051 0x207 ../../../test/testevt.o - .debug_abbrev 0x00003258 0x1aa ../../../test/testheap.o - .debug_abbrev 0x00003402 0x14a ../../../test/testpools.o - .debug_abbrev 0x0000354c 0x211 ../../../test/testdyn.o - .debug_abbrev 0x0000375d 0x206 ../../../test/testqueues.o - .debug_abbrev 0x00003963 0x2cb ../../../test/testbmk.o - .debug_abbrev 0x00003c2e 0x98 ../../../os/hal/src/hal.o - .debug_abbrev 0x00003cc6 0x42 ../../../os/hal/src/adc.o - .debug_abbrev 0x00003d08 0x42 ../../../os/hal/src/can.o - .debug_abbrev 0x00003d4a 0x1e1 ../../../os/hal/src/gpt.o - .debug_abbrev 0x00003f2b 0x42 ../../../os/hal/src/i2c.o - .debug_abbrev 0x00003f6d 0x42 ../../../os/hal/src/mac.o - .debug_abbrev 0x00003faf 0x16d ../../../os/hal/src/pal.o - .debug_abbrev 0x0000411c 0x42 ../../../os/hal/src/pwm.o - .debug_abbrev 0x0000415e 0x24b ../../../os/hal/src/serial.o - .debug_abbrev 0x000043a9 0x42 ../../../os/hal/src/spi.o - .debug_abbrev 0x000043eb 0x42 ../../../os/hal/src/uart.o - .debug_abbrev 0x0000442d 0x42 ../../../os/hal/src/usb.o - .debug_abbrev 0x0000446f 0x42 ../../../os/hal/src/mmc_spi.o - .debug_abbrev 0x000044b1 0x42 ../../../os/hal/src/serial_usb.o - .debug_abbrev 0x000044f3 0x117 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_abbrev 0x0000460a 0x245 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_abbrev 0x0000484f 0x14c ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_abbrev 0x0000499b 0x301 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_abbrev 0x00004c9c 0x42 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .debug_abbrev 0x00004cde 0xec ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_abbrev 0x00004dca 0x152 ../../../os/various/evtimer.o - .debug_abbrev 0x00004f1c 0x1dc ../../../os/various/syscalls.o - .debug_abbrev 0x000050f8 0x275 main.o - .debug_abbrev 0x0000536d 0x9c c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_info 0x00000000 0x15945 - .debug_info 0x00000000 0xae ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_info 0x000000ae 0x84 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_info 0x00000132 0x66a ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_info 0x0000079c 0x356 ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_info 0x00000af2 0x714 ../../../os/kernel/src/chsys.o - .debug_info 0x00001206 0x6c ../../../os/kernel/src/chdebug.o - .debug_info 0x00001272 0x6c ../../../os/kernel/src/chlists.o - .debug_info 0x000012de 0x272 ../../../os/kernel/src/chvt.o - .debug_info 0x00001550 0x83a ../../../os/kernel/src/chschd.o - .debug_info 0x00001d8a 0xa69 ../../../os/kernel/src/chthreads.o - .debug_info 0x000027f3 0x729 ../../../os/kernel/src/chdynamic.o - .debug_info 0x00002f1c 0x4f0 ../../../os/kernel/src/chregistry.o - .debug_info 0x0000340c 0x9d6 ../../../os/kernel/src/chsem.o - .debug_info 0x00003de2 0x945 ../../../os/kernel/src/chmtx.o - .debug_info 0x00004727 0x860 ../../../os/kernel/src/chcond.o - .debug_info 0x00004f87 0xc03 ../../../os/kernel/src/chevents.o - .debug_info 0x00005b8a 0x60b ../../../os/kernel/src/chmsg.o - .debug_info 0x00006195 0x854 ../../../os/kernel/src/chmboxes.o - .debug_info 0x000069e9 0xa25 ../../../os/kernel/src/chqueues.o - .debug_info 0x0000740e 0x212 ../../../os/kernel/src/chmemcore.o - .debug_info 0x00007620 0x618 ../../../os/kernel/src/chheap.o - .debug_info 0x00007c38 0x322 ../../../os/kernel/src/chmempools.o - .debug_info 0x00007f5a 0xfc0 ../../../test/test.o - .debug_info 0x00008f1a 0x7bc ../../../test/testthd.o - .debug_info 0x000096d6 0x92f ../../../test/testsem.o - .debug_info 0x0000a005 0xc6c ../../../test/testmtx.o - .debug_info 0x0000ac71 0x589 ../../../test/testmsg.o - .debug_info 0x0000b1fa 0x60c ../../../test/testmbox.o - .debug_info 0x0000b806 0x8de ../../../test/testevt.o - .debug_info 0x0000c0e4 0x65a ../../../test/testheap.o - .debug_info 0x0000c73e 0x250 ../../../test/testpools.o - .debug_info 0x0000c98e 0x8f5 ../../../test/testdyn.o - .debug_info 0x0000d283 0x81e ../../../test/testqueues.o - .debug_info 0x0000daa1 0xd5e ../../../test/testbmk.o - .debug_info 0x0000e7ff 0x14a ../../../os/hal/src/hal.o - .debug_info 0x0000e949 0x8d ../../../os/hal/src/adc.o - .debug_info 0x0000e9d6 0x8d ../../../os/hal/src/can.o - .debug_info 0x0000ea63 0x682 ../../../os/hal/src/gpt.o - .debug_info 0x0000f0e5 0x8d ../../../os/hal/src/i2c.o - .debug_info 0x0000f172 0x8d ../../../os/hal/src/mac.o - .debug_info 0x0000f1ff 0x2c5 ../../../os/hal/src/pal.o - .debug_info 0x0000f4c4 0x8d ../../../os/hal/src/pwm.o - .debug_info 0x0000f551 0xe72 ../../../os/hal/src/serial.o - .debug_info 0x000103c3 0x8d ../../../os/hal/src/spi.o - .debug_info 0x00010450 0x8d ../../../os/hal/src/uart.o - .debug_info 0x000104dd 0x94 ../../../os/hal/src/usb.o - .debug_info 0x00010571 0x8d ../../../os/hal/src/mmc_spi.o - .debug_info 0x000105fe 0x8d ../../../os/hal/src/serial_usb.o - .debug_info 0x0001068b 0x58c ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_info 0x00010c17 0xb89 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_info 0x000117a0 0x2da ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_info 0x00011a7a 0x1654 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_info 0x000130ce 0x8d ../../../os/hal/platforms/LPC13xx/spi_lld.o - .debug_info 0x0001315b 0x411 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_info 0x0001356c 0x5a9 ../../../os/various/evtimer.o - .debug_info 0x00013b15 0xcc6 ../../../os/various/syscalls.o - .debug_info 0x000147db 0x1056 main.o - .debug_info 0x00015831 0x114 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_line 0x00000000 0x61f5 - .debug_line 0x00000000 0x60 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_line 0x00000060 0x56 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_line 0x000000b6 0x193 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_line 0x00000249 0xe6 ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_line 0x0000032f 0x18e ../../../os/kernel/src/chsys.o - .debug_line 0x000004bd 0x1d ../../../os/kernel/src/chdebug.o - .debug_line 0x000004da 0x1d ../../../os/kernel/src/chlists.o - .debug_line 0x000004f7 0x150 ../../../os/kernel/src/chvt.o - .debug_line 0x00000647 0x2c0 ../../../os/kernel/src/chschd.o - .debug_line 0x00000907 0x312 ../../../os/kernel/src/chthreads.o - .debug_line 0x00000c19 0x210 ../../../os/kernel/src/chdynamic.o - .debug_line 0x00000e29 0x151 ../../../os/kernel/src/chregistry.o - .debug_line 0x00000f7a 0x2f6 ../../../os/kernel/src/chsem.o - .debug_line 0x00001270 0x2fb ../../../os/kernel/src/chmtx.o - .debug_line 0x0000156b 0x260 ../../../os/kernel/src/chcond.o - .debug_line 0x000017cb 0x2d9 ../../../os/kernel/src/chevents.o - .debug_line 0x00001aa4 0x19f ../../../os/kernel/src/chmsg.o - .debug_line 0x00001c43 0x24c ../../../os/kernel/src/chmboxes.o - .debug_line 0x00001e8f 0x2de ../../../os/kernel/src/chqueues.o - .debug_line 0x0000216d 0x137 ../../../os/kernel/src/chmemcore.o - .debug_line 0x000022a4 0x269 ../../../os/kernel/src/chheap.o - .debug_line 0x0000250d 0x18e ../../../os/kernel/src/chmempools.o - .debug_line 0x0000269b 0x491 ../../../test/test.o - .debug_line 0x00002b2c 0x1e2 ../../../test/testthd.o - .debug_line 0x00002d0e 0x2b5 ../../../test/testsem.o - .debug_line 0x00002fc3 0x471 ../../../test/testmtx.o - .debug_line 0x00003434 0x157 ../../../test/testmsg.o - .debug_line 0x0000358b 0x1a8 ../../../test/testmbox.o - .debug_line 0x00003733 0x275 ../../../test/testevt.o - .debug_line 0x000039a8 0x1f2 ../../../test/testheap.o - .debug_line 0x00003b9a 0x113 ../../../test/testpools.o - .debug_line 0x00003cad 0x2df ../../../test/testdyn.o - .debug_line 0x00003f8c 0x29e ../../../test/testqueues.o - .debug_line 0x0000422a 0x562 ../../../test/testbmk.o - .debug_line 0x0000478c 0xdb ../../../os/hal/src/hal.o - .debug_line 0x00004867 0x4d ../../../os/hal/src/adc.o - .debug_line 0x000048b4 0x4d ../../../os/hal/src/can.o - .debug_line 0x00004901 0x1d8 ../../../os/hal/src/gpt.o - .debug_line 0x00004ad9 0x4d ../../../os/hal/src/i2c.o - .debug_line 0x00004b26 0x4d ../../../os/hal/src/mac.o - .debug_line 0x00004b73 0x125 ../../../os/hal/src/pal.o - .debug_line 0x00004c98 0x4d ../../../os/hal/src/pwm.o - .debug_line 0x00004ce5 0x331 ../../../os/hal/src/serial.o - .debug_line 0x00005016 0x4d ../../../os/hal/src/spi.o - .debug_line 0x00005063 0x4d ../../../os/hal/src/uart.o - .debug_line 0x000050b0 0x4d ../../../os/hal/src/usb.o - .debug_line 0x000050fd 0x4d ../../../os/hal/src/mmc_spi.o - .debug_line 0x0000514a 0x4d ../../../os/hal/src/serial_usb.o - .debug_line 0x00005197 0x109 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_line 0x000052a0 0x264 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_line 0x00005504 0xf0 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_line 0x000055f4 0x2e7 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_line 0x000058db 0x4d ../../../os/hal/platforms/LPC13xx/spi_lld.o - .debug_line 0x00005928 0x108 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_line 0x00005a30 0x170 ../../../os/various/evtimer.o - .debug_line 0x00005ba0 0x187 ../../../os/various/syscalls.o - .debug_line 0x00005d27 0x35f main.o - .debug_line 0x00006086 0x16f c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_pubnames - 0x00000000 0x13e4 - .debug_pubnames - 0x00000000 0x38 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_pubnames - 0x00000038 0x20 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_pubnames - 0x00000058 0x8d ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_pubnames - 0x000000e5 0x5e ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_pubnames - 0x00000143 0x5c ../../../os/kernel/src/chsys.o - .debug_pubnames - 0x0000019f 0x58 ../../../os/kernel/src/chvt.o - .debug_pubnames - 0x000001f7 0xc2 ../../../os/kernel/src/chschd.o - .debug_pubnames - 0x000002b9 0xd0 ../../../os/kernel/src/chthreads.o - .debug_pubnames - 0x00000389 0x69 ../../../os/kernel/src/chdynamic.o - .debug_pubnames - 0x000003f2 0x3b ../../../os/kernel/src/chregistry.o - .debug_pubnames - 0x0000042d 0xd1 ../../../os/kernel/src/chsem.o - .debug_pubnames - 0x000004fe 0x94 ../../../os/kernel/src/chmtx.o - .debug_pubnames - 0x00000592 0xb9 ../../../os/kernel/src/chcond.o - .debug_pubnames - 0x0000064b 0x14b ../../../os/kernel/src/chevents.o - .debug_pubnames - 0x00000796 0x3f ../../../os/kernel/src/chmsg.o - .debug_pubnames - 0x000007d5 0xba ../../../os/kernel/src/chmboxes.o - .debug_pubnames - 0x0000088f 0xd5 ../../../os/kernel/src/chqueues.o - .debug_pubnames - 0x00000964 0x52 ../../../os/kernel/src/chmemcore.o - .debug_pubnames - 0x000009b6 0x5f ../../../os/kernel/src/chheap.o - .debug_pubnames - 0x00000a15 0x61 ../../../os/kernel/src/chmempools.o - .debug_pubnames - 0x00000a76 0x158 ../../../test/test.o - .debug_pubnames - 0x00000bce 0x55 ../../../test/testthd.o - .debug_pubnames - 0x00000c23 0x55 ../../../test/testsem.o - .debug_pubnames - 0x00000c78 0x89 ../../../test/testmtx.o - .debug_pubnames - 0x00000d01 0x2e ../../../test/testmsg.o - .debug_pubnames - 0x00000d2f 0x30 ../../../test/testmbox.o - .debug_pubnames - 0x00000d5f 0x48 ../../../test/testevt.o - .debug_pubnames - 0x00000da7 0x30 ../../../test/testheap.o - .debug_pubnames - 0x00000dd7 0x32 ../../../test/testpools.o - .debug_pubnames - 0x00000e09 0x48 ../../../test/testdyn.o - .debug_pubnames - 0x00000e51 0x44 ../../../test/testqueues.o - .debug_pubnames - 0x00000e95 0xda ../../../test/testbmk.o - .debug_pubnames - 0x00000f6f 0x1e ../../../os/hal/src/hal.o - .debug_pubnames - 0x00000f8d 0xd7 ../../../os/hal/src/gpt.o - .debug_pubnames - 0x00001064 0x43 ../../../os/hal/src/pal.o - .debug_pubnames - 0x000010a7 0x6c ../../../os/hal/src/serial.o - .debug_pubnames - 0x00001113 0x3a ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_pubnames - 0x0000114d 0xea ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_pubnames - 0x00001237 0x3e ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_pubnames - 0x00001275 0x58 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_pubnames - 0x000012cd 0x48 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_pubnames - 0x00001315 0x2b ../../../os/various/evtimer.o - .debug_pubnames - 0x00001340 0x6c ../../../os/various/syscalls.o - .debug_pubnames - 0x000013ac 0x1b main.o - .debug_pubnames - 0x000013c7 0x1d c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_pubtypes - 0x00000000 0x34ef - .debug_pubtypes - 0x00000000 0x12 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_pubtypes - 0x00000012 0x12 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_pubtypes - 0x00000024 0x116 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_pubtypes - 0x0000013a 0x38 ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_pubtypes - 0x00000172 0x185 ../../../os/kernel/src/chsys.o - .debug_pubtypes - 0x000002f7 0x12 ../../../os/kernel/src/chdebug.o - .debug_pubtypes - 0x00000309 0x12 ../../../os/kernel/src/chlists.o - .debug_pubtypes - 0x0000031b 0x7e ../../../os/kernel/src/chvt.o - .debug_pubtypes - 0x00000399 0x16d ../../../os/kernel/src/chschd.o - .debug_pubtypes - 0x00000506 0x168 ../../../os/kernel/src/chthreads.o - .debug_pubtypes - 0x0000066e 0x191 ../../../os/kernel/src/chdynamic.o - .debug_pubtypes - 0x000007ff 0x117 ../../../os/kernel/src/chregistry.o - .debug_pubtypes - 0x00000916 0x133 ../../../os/kernel/src/chsem.o - .debug_pubtypes - 0x00000a49 0x122 ../../../os/kernel/src/chmtx.o - .debug_pubtypes - 0x00000b6b 0x12f ../../../os/kernel/src/chcond.o - .debug_pubtypes - 0x00000c9a 0x179 ../../../os/kernel/src/chevents.o - .debug_pubtypes - 0x00000e13 0x117 ../../../os/kernel/src/chmsg.o - .debug_pubtypes - 0x00000f2a 0x131 ../../../os/kernel/src/chmboxes.o - .debug_pubtypes - 0x0000105b 0x18a ../../../os/kernel/src/chqueues.o - .debug_pubtypes - 0x000011e5 0x36 ../../../os/kernel/src/chmemcore.o - .debug_pubtypes - 0x0000121b 0x166 ../../../os/kernel/src/chheap.o - .debug_pubtypes - 0x00001381 0x5a ../../../os/kernel/src/chmempools.o - .debug_pubtypes - 0x000013db 0x1c4 ../../../test/test.o - .debug_pubtypes - 0x0000159f 0x15e ../../../test/testthd.o - .debug_pubtypes - 0x000016fd 0x18e ../../../test/testsem.o - .debug_pubtypes - 0x0000188b 0x181 ../../../test/testmtx.o - .debug_pubtypes - 0x00001a0c 0x124 ../../../test/testmsg.o - .debug_pubtypes - 0x00001b30 0x16b ../../../test/testmbox.o - .debug_pubtypes - 0x00001c9b 0x1c0 ../../../test/testevt.o - .debug_pubtypes - 0x00001e5b 0x184 ../../../test/testheap.o - .debug_pubtypes - 0x00001fdf 0x5a ../../../test/testpools.o - .debug_pubtypes - 0x00002039 0x1c6 ../../../test/testdyn.o - .debug_pubtypes - 0x000021ff 0x1d2 ../../../test/testqueues.o - .debug_pubtypes - 0x000023d1 0x1b9 ../../../test/testbmk.o - .debug_pubtypes - 0x0000258a 0x46 ../../../os/hal/src/hal.o - .debug_pubtypes - 0x000025d0 0x12 ../../../os/hal/src/adc.o - .debug_pubtypes - 0x000025e2 0x12 ../../../os/hal/src/can.o - .debug_pubtypes - 0x000025f4 0x99 ../../../os/hal/src/gpt.o - .debug_pubtypes - 0x0000268d 0x12 ../../../os/hal/src/i2c.o - .debug_pubtypes - 0x0000269f 0x12 ../../../os/hal/src/mac.o - .debug_pubtypes - 0x000026b1 0x6f ../../../os/hal/src/pal.o - .debug_pubtypes - 0x00002720 0x12 ../../../os/hal/src/pwm.o - .debug_pubtypes - 0x00002732 0x293 ../../../os/hal/src/serial.o - .debug_pubtypes - 0x000029c5 0x12 ../../../os/hal/src/spi.o - .debug_pubtypes - 0x000029d7 0x12 ../../../os/hal/src/uart.o - .debug_pubtypes - 0x000029e9 0x12 ../../../os/hal/src/usb.o - .debug_pubtypes - 0x000029fb 0x12 ../../../os/hal/src/mmc_spi.o - .debug_pubtypes - 0x00002a0d 0x12 ../../../os/hal/src/serial_usb.o - .debug_pubtypes - 0x00002a1f 0x47 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_pubtypes - 0x00002a66 0xc6 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_pubtypes - 0x00002b2c 0x8c ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_pubtypes - 0x00002bb8 0x28e ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_pubtypes - 0x00002e46 0x12 ../../../os/hal/platforms/LPC13xx/spi_lld.o - .debug_pubtypes - 0x00002e58 0x6d ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_pubtypes - 0x00002ec5 0x17e ../../../os/various/evtimer.o - .debug_pubtypes - 0x00003043 0x180 ../../../os/various/syscalls.o - .debug_pubtypes - 0x000031c3 0x30f main.o - .debug_pubtypes - 0x000034d2 0x1d c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_aranges 0x00000000 0xe18 - .debug_aranges - 0x00000000 0x20 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_aranges - 0x00000020 0x20 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_aranges - 0x00000040 0x48 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_aranges - 0x00000088 0x30 ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_aranges - 0x000000b8 0x30 ../../../os/kernel/src/chsys.o - .debug_aranges - 0x000000e8 0x38 ../../../os/kernel/src/chvt.o - .debug_aranges - 0x00000120 0x60 ../../../os/kernel/src/chschd.o - .debug_aranges - 0x00000180 0x70 ../../../os/kernel/src/chthreads.o - .debug_aranges - 0x000001f0 0x38 ../../../os/kernel/src/chdynamic.o - .debug_aranges - 0x00000228 0x28 ../../../os/kernel/src/chregistry.o - .debug_aranges - 0x00000250 0x70 ../../../os/kernel/src/chsem.o - .debug_aranges - 0x000002c0 0x58 ../../../os/kernel/src/chmtx.o - .debug_aranges - 0x00000318 0x60 ../../../os/kernel/src/chcond.o - .debug_aranges - 0x00000378 0x90 ../../../os/kernel/src/chevents.o - .debug_aranges - 0x00000408 0x30 ../../../os/kernel/src/chmsg.o - .debug_aranges - 0x00000438 0x70 ../../../os/kernel/src/chmboxes.o - .debug_aranges - 0x000004a8 0x78 ../../../os/kernel/src/chqueues.o - .debug_aranges - 0x00000520 0x38 ../../../os/kernel/src/chmemcore.o - .debug_aranges - 0x00000558 0x40 ../../../os/kernel/src/chheap.o - .debug_aranges - 0x00000598 0x40 ../../../os/kernel/src/chmempools.o - .debug_aranges - 0x000005d8 0x98 ../../../test/test.o - .debug_aranges - 0x00000670 0x40 ../../../test/testthd.o - .debug_aranges - 0x000006b0 0x70 ../../../test/testsem.o - .debug_aranges - 0x00000720 0x108 ../../../test/testmtx.o - .debug_aranges - 0x00000828 0x28 ../../../test/testmsg.o - .debug_aranges - 0x00000850 0x28 ../../../test/testmbox.o - .debug_aranges - 0x00000878 0x70 ../../../test/testevt.o - .debug_aranges - 0x000008e8 0x28 ../../../test/testheap.o - .debug_aranges - 0x00000910 0x30 ../../../test/testpools.o - .debug_aranges - 0x00000940 0x58 ../../../test/testdyn.o - .debug_aranges - 0x00000998 0x50 ../../../test/testqueues.o - .debug_aranges - 0x000009e8 0xd0 ../../../test/testbmk.o - .debug_aranges - 0x00000ab8 0x20 ../../../os/hal/src/hal.o - .debug_aranges - 0x00000ad8 0x70 ../../../os/hal/src/gpt.o - .debug_aranges - 0x00000b48 0x30 ../../../os/hal/src/pal.o - .debug_aranges - 0x00000b78 0x90 ../../../os/hal/src/serial.o - .debug_aranges - 0x00000c08 0x28 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_aranges - 0x00000c30 0x68 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_aranges - 0x00000c98 0x28 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_aranges - 0x00000cc0 0x40 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_aranges - 0x00000d00 0x28 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_aranges - 0x00000d28 0x30 ../../../os/various/evtimer.o - .debug_aranges - 0x00000d58 0x50 ../../../os/various/syscalls.o - .debug_aranges - 0x00000da8 0x50 main.o - .debug_aranges - 0x00000df8 0x20 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_ranges 0x00000000 0x1418 - .debug_ranges 0x00000000 0x10 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_ranges 0x00000010 0x10 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_ranges 0x00000020 0x38 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_ranges 0x00000058 0x20 ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_ranges 0x00000078 0x20 ../../../os/kernel/src/chsys.o - .debug_ranges 0x00000098 0x28 ../../../os/kernel/src/chvt.o - .debug_ranges 0x000000c0 0x130 ../../../os/kernel/src/chschd.o - .debug_ranges 0x000001f0 0xc0 ../../../os/kernel/src/chthreads.o - .debug_ranges 0x000002b0 0x58 ../../../os/kernel/src/chdynamic.o - .debug_ranges 0x00000308 0x30 ../../../os/kernel/src/chregistry.o - .debug_ranges 0x00000338 0x108 ../../../os/kernel/src/chsem.o - .debug_ranges 0x00000440 0x200 ../../../os/kernel/src/chmtx.o - .debug_ranges 0x00000640 0xf0 ../../../os/kernel/src/chcond.o - .debug_ranges 0x00000730 0xc8 ../../../os/kernel/src/chevents.o - .debug_ranges 0x000007f8 0x70 ../../../os/kernel/src/chmsg.o - .debug_ranges 0x00000868 0x78 ../../../os/kernel/src/chmboxes.o - .debug_ranges 0x000008e0 0x98 ../../../os/kernel/src/chqueues.o - .debug_ranges 0x00000978 0x58 ../../../os/kernel/src/chmemcore.o - .debug_ranges 0x000009d0 0x30 ../../../os/kernel/src/chheap.o - .debug_ranges 0x00000a00 0xa8 ../../../os/kernel/src/chmempools.o - .debug_ranges 0x00000aa8 0x110 ../../../test/test.o - .debug_ranges 0x00000bb8 0x78 ../../../test/testthd.o - .debug_ranges 0x00000c30 0x60 ../../../test/testsem.o - .debug_ranges 0x00000c90 0x110 ../../../test/testmtx.o - .debug_ranges 0x00000da0 0x18 ../../../test/testmsg.o - .debug_ranges 0x00000db8 0x18 ../../../test/testmbox.o - .debug_ranges 0x00000dd0 0x60 ../../../test/testevt.o - .debug_ranges 0x00000e30 0x18 ../../../test/testheap.o - .debug_ranges 0x00000e48 0x20 ../../../test/testpools.o - .debug_ranges 0x00000e68 0x48 ../../../test/testdyn.o - .debug_ranges 0x00000eb0 0x40 ../../../test/testqueues.o - .debug_ranges 0x00000ef0 0xd8 ../../../test/testbmk.o - .debug_ranges 0x00000fc8 0x10 ../../../os/hal/src/hal.o - .debug_ranges 0x00000fd8 0x90 ../../../os/hal/src/gpt.o - .debug_ranges 0x00001068 0x20 ../../../os/hal/src/pal.o - .debug_ranges 0x00001088 0xc8 ../../../os/hal/src/serial.o - .debug_ranges 0x00001150 0x18 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_ranges 0x00001168 0xb8 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_ranges 0x00001220 0x18 ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_ranges 0x00001238 0x128 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_ranges 0x00001360 0x18 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_ranges 0x00001378 0x20 ../../../os/various/evtimer.o - .debug_ranges 0x00001398 0x40 ../../../os/various/syscalls.o - .debug_ranges 0x000013d8 0x40 main.o - -.debug_str 0x00000000 0x2e58 - .debug_str 0x00000000 0xda ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - 0x10e (size before relaxing) - .debug_str 0x000000da 0x30 ../../../os/ports/GCC/ARMCMx/chcore.o - 0xf1 (size before relaxing) - .debug_str 0x0000010a 0x223 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - 0x303 (size before relaxing) - .debug_str 0x0000032d 0xb6 ../../../os/ports/GCC/ARMCMx/nvic.o - 0x1cd (size before relaxing) - .debug_str 0x000003e3 0x117 ../../../os/kernel/src/chsys.o - 0x383 (size before relaxing) - .debug_str 0x000004fa 0x21 ../../../os/kernel/src/chdebug.o - 0xe2 (size before relaxing) - .debug_str 0x0000051b 0x21 ../../../os/kernel/src/chlists.o - 0xe2 (size before relaxing) - .debug_str 0x0000053c 0x57 ../../../os/kernel/src/chvt.o - 0x194 (size before relaxing) - .debug_str 0x00000593 0xd8 ../../../os/kernel/src/chschd.o - 0x390 (size before relaxing) - .debug_str 0x0000066b 0xe4 ../../../os/kernel/src/chthreads.o - 0x3b6 (size before relaxing) - .debug_str 0x0000074f 0xf5 ../../../os/kernel/src/chdynamic.o - 0x352 (size before relaxing) - .debug_str 0x00000844 0x45 ../../../os/kernel/src/chregistry.o - 0x2aa (size before relaxing) - .debug_str 0x00000889 0xcb ../../../os/kernel/src/chsem.o - 0x359 (size before relaxing) - .debug_str 0x00000954 0x8d ../../../os/kernel/src/chmtx.o - 0x315 (size before relaxing) - .debug_str 0x000009e1 0xb3 ../../../os/kernel/src/chcond.o - 0x335 (size before relaxing) - .debug_str 0x00000a94 0x17c ../../../os/kernel/src/chevents.o - 0x3eb (size before relaxing) - .debug_str 0x00000c10 0x40 ../../../os/kernel/src/chmsg.o - 0x2be (size before relaxing) - .debug_str 0x00000c50 0xe5 ../../../os/kernel/src/chmboxes.o - 0x31e (size before relaxing) - .debug_str 0x00000d35 0x11b ../../../os/kernel/src/chqueues.o - 0x367 (size before relaxing) - .debug_str 0x00000e50 0x7d ../../../os/kernel/src/chmemcore.o - 0x15b (size before relaxing) - .debug_str 0x00000ecd 0x6c ../../../os/kernel/src/chheap.o - 0x300 (size before relaxing) - .debug_str 0x00000f39 0x5f ../../../os/kernel/src/chmempools.o - 0x192 (size before relaxing) - .debug_str 0x00000f98 0x283 ../../../test/test.o - 0x5a9 (size before relaxing) - .debug_str 0x0000121b 0x70 ../../../test/testthd.o - 0x379 (size before relaxing) - .debug_str 0x0000128b 0xd9 ../../../test/testsem.o - 0x3ee (size before relaxing) - .debug_str 0x00001364 0x197 ../../../test/testmtx.o - 0x4b8 (size before relaxing) - .debug_str 0x000014fb 0x2e ../../../test/testmsg.o - 0x2d7 (size before relaxing) - .debug_str 0x00001529 0x42 ../../../test/testmbox.o - 0x320 (size before relaxing) - .debug_str 0x0000156b 0x82 ../../../test/testevt.o - 0x3ea (size before relaxing) - .debug_str 0x000015ed 0x47 ../../../test/testheap.o - 0x324 (size before relaxing) - .debug_str 0x00001634 0x4f ../../../test/testpools.o - 0x1a2 (size before relaxing) - .debug_str 0x00001683 0x89 ../../../test/testdyn.o - 0x417 (size before relaxing) - .debug_str 0x0000170c 0x6f ../../../test/testqueues.o - 0x3da (size before relaxing) - .debug_str 0x0000177b 0x182 ../../../test/testbmk.o - 0x50f (size before relaxing) - .debug_str 0x000018fd 0x54 ../../../os/hal/src/hal.o - 0x130 (size before relaxing) - .debug_str 0x00001951 0x1a ../../../os/hal/src/adc.o - 0xe8 (size before relaxing) - .debug_str 0x0000196b 0x1a ../../../os/hal/src/can.o - 0xe8 (size before relaxing) - .debug_str 0x00001985 0x178 ../../../os/hal/src/gpt.o - 0x265 (size before relaxing) - .debug_str 0x00001afd 0x1a ../../../os/hal/src/i2c.o - 0xe8 (size before relaxing) - .debug_str 0x00001b17 0x1a ../../../os/hal/src/mac.o - 0xe8 (size before relaxing) - .debug_str 0x00001b31 0xbc ../../../os/hal/src/pal.o - 0x1a2 (size before relaxing) - .debug_str 0x00001bed 0x1a ../../../os/hal/src/pwm.o - 0xe8 (size before relaxing) - .debug_str 0x00001c07 0x190 ../../../os/hal/src/serial.o - 0x4e4 (size before relaxing) - .debug_str 0x00001d97 0x1a ../../../os/hal/src/spi.o - 0xe8 (size before relaxing) - .debug_str 0x00001db1 0x1b ../../../os/hal/src/uart.o - 0xe9 (size before relaxing) - .debug_str 0x00001dcc 0x1a ../../../os/hal/src/usb.o - 0xed (size before relaxing) - .debug_str 0x00001de6 0x1e ../../../os/hal/src/mmc_spi.o - 0xec (size before relaxing) - .debug_str 0x00001e04 0x21 ../../../os/hal/src/serial_usb.o - 0xef (size before relaxing) - .debug_str 0x00001e25 0x30d ../../../os/hal/platforms/LPC13xx/hal_lld.o - 0x407 (size before relaxing) - .debug_str 0x00002132 0x447 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - 0x8ab (size before relaxing) - .debug_str 0x00002579 0x55 ../../../os/hal/platforms/LPC13xx/pal_lld.o - 0x1be (size before relaxing) - .debug_str 0x000025ce 0x211 ../../../os/hal/platforms/LPC13xx/serial_lld.o - 0xc55 (size before relaxing) - .debug_str 0x000027df 0x2c ../../../os/hal/platforms/LPC13xx/spi_lld.o - 0xfa (size before relaxing) - .debug_str 0x0000280b 0x45 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - 0x2f8 (size before relaxing) - .debug_str 0x00002850 0x55 ../../../os/various/evtimer.o - 0x2e6 (size before relaxing) - .debug_str 0x000028a5 0x4b5 ../../../os/various/syscalls.o - 0x5d8 (size before relaxing) - .debug_str 0x00002d5a 0x5a main.o - 0x5cd (size before relaxing) - .debug_str 0x00002db4 0xa4 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - 0x147 (size before relaxing) - -.debug_frame 0x00000000 0x2514 - .debug_frame 0x00000000 0x20 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - .debug_frame 0x00000020 0x20 ../../../os/ports/GCC/ARMCMx/chcore.o - .debug_frame 0x00000040 0x88 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_frame 0x000000c8 0x54 ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_frame 0x0000011c 0x5c ../../../os/kernel/src/chsys.o - .debug_frame 0x00000178 0x5c ../../../os/kernel/src/chvt.o - .debug_frame 0x000001d4 0xe4 ../../../os/kernel/src/chschd.o - .debug_frame 0x000002b8 0x140 ../../../os/kernel/src/chthreads.o - .debug_frame 0x000003f8 0x88 ../../../os/kernel/src/chdynamic.o - .debug_frame 0x00000480 0x3c ../../../os/kernel/src/chregistry.o - .debug_frame 0x000004bc 0x140 ../../../os/kernel/src/chsem.o - .debug_frame 0x000005fc 0xd4 ../../../os/kernel/src/chmtx.o - .debug_frame 0x000006d0 0x10c ../../../os/kernel/src/chcond.o - .debug_frame 0x000007dc 0x1b4 ../../../os/kernel/src/chevents.o - .debug_frame 0x00000990 0x64 ../../../os/kernel/src/chmsg.o - .debug_frame 0x000009f4 0x150 ../../../os/kernel/src/chmboxes.o - .debug_frame 0x00000b44 0x170 ../../../os/kernel/src/chqueues.o - .debug_frame 0x00000cb4 0x50 ../../../os/kernel/src/chmemcore.o - .debug_frame 0x00000d04 0xa8 ../../../os/kernel/src/chheap.o - .debug_frame 0x00000dac 0x78 ../../../os/kernel/src/chmempools.o - .debug_frame 0x00000e24 0x1c4 ../../../test/test.o - .debug_frame 0x00000fe8 0xc4 ../../../test/testthd.o - .debug_frame 0x000010ac 0x15c ../../../test/testsem.o - .debug_frame 0x00001208 0x3bc ../../../test/testmtx.o - .debug_frame 0x000015c4 0x48 ../../../test/testmsg.o - .debug_frame 0x0000160c 0x54 ../../../test/testmbox.o - .debug_frame 0x00001660 0x164 ../../../test/testevt.o - .debug_frame 0x000017c4 0x50 ../../../test/testheap.o - .debug_frame 0x00001814 0x5c ../../../test/testpools.o - .debug_frame 0x00001870 0x104 ../../../test/testdyn.o - .debug_frame 0x00001974 0xe0 ../../../test/testqueues.o - .debug_frame 0x00001a54 0x2d8 ../../../test/testbmk.o - .debug_frame 0x00001d2c 0x2c ../../../os/hal/src/hal.o - .debug_frame 0x00001d58 0x138 ../../../os/hal/src/gpt.o - .debug_frame 0x00001e90 0x4c ../../../os/hal/src/pal.o - .debug_frame 0x00001edc 0x19c ../../../os/hal/src/serial.o - .debug_frame 0x00002078 0x3c ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_frame 0x000020b4 0x104 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_frame 0x000021b8 0x3c ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_frame 0x000021f4 0xb0 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_frame 0x000022a4 0x3c ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_frame 0x000022e0 0x64 ../../../os/various/evtimer.o - .debug_frame 0x00002344 0x98 ../../../os/various/syscalls.o - .debug_frame 0x000023dc 0x110 main.o - .debug_frame 0x000024ec 0x28 c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -.debug_loc 0x00000000 0x7127 - .debug_loc 0x00000000 0xf0 ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - .debug_loc 0x000000f0 0xea ../../../os/ports/GCC/ARMCMx/nvic.o - .debug_loc 0x000001da 0x9e ../../../os/kernel/src/chsys.o - .debug_loc 0x00000278 0xb4 ../../../os/kernel/src/chvt.o - .debug_loc 0x0000032c 0x2ed ../../../os/kernel/src/chschd.o - .debug_loc 0x00000619 0x4a7 ../../../os/kernel/src/chthreads.o - .debug_loc 0x00000ac0 0x2eb ../../../os/kernel/src/chdynamic.o - .debug_loc 0x00000dab 0xc9 ../../../os/kernel/src/chregistry.o - .debug_loc 0x00000e74 0x609 ../../../os/kernel/src/chsem.o - .debug_loc 0x0000147d 0x4ad ../../../os/kernel/src/chmtx.o - .debug_loc 0x0000192a 0x483 ../../../os/kernel/src/chcond.o - .debug_loc 0x00001dad 0x87a ../../../os/kernel/src/chevents.o - .debug_loc 0x00002627 0x19a ../../../os/kernel/src/chmsg.o - .debug_loc 0x000027c1 0x4d4 ../../../os/kernel/src/chmboxes.o - .debug_loc 0x00002c95 0x72e ../../../os/kernel/src/chqueues.o - .debug_loc 0x000033c3 0xe0 ../../../os/kernel/src/chmemcore.o - .debug_loc 0x000034a3 0x30f ../../../os/kernel/src/chheap.o - .debug_loc 0x000037b2 0x193 ../../../os/kernel/src/chmempools.o - .debug_loc 0x00003945 0x50b ../../../test/test.o - .debug_loc 0x00003e50 0x1f3 ../../../test/testthd.o - .debug_loc 0x00004043 0x2d2 ../../../test/testsem.o - .debug_loc 0x00004315 0x684 ../../../test/testmtx.o - .debug_loc 0x00004999 0xe0 ../../../test/testmsg.o - .debug_loc 0x00004a79 0x164 ../../../test/testmbox.o - .debug_loc 0x00004bdd 0x2e2 ../../../test/testevt.o - .debug_loc 0x00004ebf 0x1d8 ../../../test/testheap.o - .debug_loc 0x00005097 0x67 ../../../test/testpools.o - .debug_loc 0x000050fe 0x20b ../../../test/testdyn.o - .debug_loc 0x00005309 0x150 ../../../test/testqueues.o - .debug_loc 0x00005459 0x678 ../../../test/testbmk.o - .debug_loc 0x00005ad1 0x20 ../../../os/hal/src/hal.o - .debug_loc 0x00005af1 0x390 ../../../os/hal/src/gpt.o - .debug_loc 0x00005e81 0x64 ../../../os/hal/src/pal.o - .debug_loc 0x00005ee5 0x50e ../../../os/hal/src/serial.o - .debug_loc 0x000063f3 0x33 ../../../os/hal/platforms/LPC13xx/hal_lld.o - .debug_loc 0x00006426 0x1ee ../../../os/hal/platforms/LPC13xx/gpt_lld.o - .debug_loc 0x00006614 0x8d ../../../os/hal/platforms/LPC13xx/pal_lld.o - .debug_loc 0x000066a1 0x375 ../../../os/hal/platforms/LPC13xx/serial_lld.o - .debug_loc 0x00006a16 0x20 ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - .debug_loc 0x00006a36 0x119 ../../../os/various/evtimer.o - .debug_loc 0x00006b4f 0x150 ../../../os/various/syscalls.o - .debug_loc 0x00006c9f 0x30a main.o - .debug_loc 0x00006fa9 0x17e c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - -Cross Reference Table - -Symbol File -BusFaultVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -DebugMonitorVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -GPTD1 main.o - ../../../os/hal/platforms/LPC13xx/gpt_lld.o -GPTD2 main.o - ../../../os/hal/platforms/LPC13xx/gpt_lld.o -GPTD3 ../../../os/hal/platforms/LPC13xx/gpt_lld.o -GPTD4 ../../../os/hal/platforms/LPC13xx/gpt_lld.o -HardFaultVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -LPC13xx_clock_init ../../../os/hal/platforms/LPC13xx/hal_lld.o - ../../../boards/EA_LPCXPRESSO_BB_1343/board.o -MemManageVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -NMIVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -NVICDisableVector ../../../os/ports/GCC/ARMCMx/nvic.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/platforms/LPC13xx/gpt_lld.o -NVICEnableVector ../../../os/ports/GCC/ARMCMx/nvic.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/platforms/LPC13xx/gpt_lld.o -NVICSetSystemHandlerPriority ../../../os/ports/GCC/ARMCMx/nvic.o - ../../../os/hal/platforms/LPC13xx/hal_lld.o - ../../../os/kernel/src/chsys.o -PendSVVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -ResetHandler ../../../os/ports/GCC/ARMCMx/crt0_v7m.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -SD1 main.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o -SVCallVector ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -SysTickVector ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -TestThread ../../../test/test.o -UsageFaultVector ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector100 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector104 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector108 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector10C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector110 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector114 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector118 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector11C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector1C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector20 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector24 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector28 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector34 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector40 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector44 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector48 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector4C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector50 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector54 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector58 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector5C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector60 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector64 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector68 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector6C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector70 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector74 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector78 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector7C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector80 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector84 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector88 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector8C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector90 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector94 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector98 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -Vector9C ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorA0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorA4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorA8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorAC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorB0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorB4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorB8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorBC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorC0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorC4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorC8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorCC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorD0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorD4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorD8 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorDC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorE0 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorE4 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorE8 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorEC ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorF0 ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorF4 ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorF8 ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -VectorFC ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -__early_init ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -__heap_base__ ../../../os/kernel/src/chmemcore.o -__heap_end__ ../../../os/kernel/src/chmemcore.o -__main_stack_size__ ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -__ram_end__ ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o - ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_bss_end ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_bss_start ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_close_r ../../../os/various/syscalls.o -_data ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_edata ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_fstat_r ../../../os/various/syscalls.o -_idle_thread ../../../os/kernel/src/chsys.o -_idle_thread_wa ../../../os/kernel/src/chsys.o -_isatty_r ../../../os/various/syscalls.o -_lseek_r ../../../os/various/syscalls.o -_main_exit_handler ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_pal_lld_init ../../../os/hal/platforms/LPC13xx/pal_lld.o - ../../../os/hal/src/hal.o -_pal_lld_setgroupmode ../../../os/hal/platforms/LPC13xx/pal_lld.o - ../../../os/hal/src/pal.o -_port_irq_epilogue ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/platforms/LPC13xx/gpt_lld.o -_port_switch_from_isr ../../../os/ports/GCC/ARMCMx/chcore_v7m.o -_port_thread_start ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - ../../../os/kernel/src/chthreads.o -_read_r ../../../os/various/syscalls.o -_sbrk_r ../../../os/various/syscalls.o -_test_assert ../../../test/test.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testpools.o - ../../../test/testheap.o - ../../../test/testevt.o - ../../../test/testmbox.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -_test_assert_sequence ../../../test/test.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testevt.o - ../../../test/testmbox.o - ../../../test/testmsg.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -_test_assert_time_window ../../../test/test.o - ../../../test/testevt.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -_test_fail ../../../test/test.o -_textdata ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -_thread_init ../../../os/kernel/src/chthreads.o - ../../../os/kernel/src/chsys.o -_unhandled_exception ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -_vectors ../../../os/ports/GCC/ARMCMx/LPC13xx/vectors.o -_write_r ../../../os/various/syscalls.o -boardInit ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - ../../../os/hal/src/hal.o -chCondBroadcast ../../../os/kernel/src/chcond.o - ../../../test/testmtx.o -chCondBroadcastI ../../../os/kernel/src/chcond.o -chCondInit ../../../os/kernel/src/chcond.o - ../../../test/testmtx.o -chCondSignal ../../../os/kernel/src/chcond.o - ../../../test/testmtx.o -chCondSignalI ../../../os/kernel/src/chcond.o - ../../../test/testmtx.o -chCondWait ../../../os/kernel/src/chcond.o - ../../../test/testmtx.o -chCondWaitS ../../../os/kernel/src/chcond.o -chCondWaitTimeout ../../../os/kernel/src/chcond.o - ../../../test/testmtx.o -chCondWaitTimeoutS ../../../os/kernel/src/chcond.o -chCoreAlloc ../../../os/kernel/src/chmemcore.o - ../../../os/various/syscalls.o - ../../../os/kernel/src/chheap.o -chCoreAllocI ../../../os/kernel/src/chmemcore.o -chCoreStatus ../../../os/kernel/src/chmemcore.o - ../../../test/testheap.o -chEvtAddFlags ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtBroadcastFlags ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtBroadcastFlagsI ../../../os/kernel/src/chevents.o - ../../../os/various/evtimer.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/src/serial.o -chEvtClearFlags ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtDispatch ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtRegisterMask ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtSignalFlags ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtSignalFlagsI ../../../os/kernel/src/chevents.o -chEvtUnregister ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtWaitAll ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtWaitAllTimeout ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtWaitAny ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtWaitAnyTimeout ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtWaitOne ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chEvtWaitOneTimeout ../../../os/kernel/src/chevents.o - ../../../test/testevt.o -chHeapAlloc ../../../os/kernel/src/chheap.o - ../../../test/testdyn.o - ../../../test/testheap.o - ../../../os/kernel/src/chdynamic.o -chHeapFree ../../../os/kernel/src/chheap.o - ../../../test/testdyn.o - ../../../test/testheap.o - ../../../os/kernel/src/chdynamic.o -chHeapInit ../../../os/kernel/src/chheap.o - ../../../test/testdyn.o - ../../../test/testheap.o -chHeapStatus ../../../os/kernel/src/chheap.o - ../../../test/testdyn.o - ../../../test/testheap.o -chIQGetFullI ../../../os/kernel/src/chqueues.o - ../../../test/testqueues.o -chIQGetTimeout ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testbmk.o - ../../../test/testqueues.o -chIQInit ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testbmk.o - ../../../test/testqueues.o -chIQPutI ../../../os/kernel/src/chqueues.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/src/serial.o - ../../../test/testbmk.o - ../../../test/testqueues.o -chIQReadTimeout ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chIQResetI ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chMBFetch ../../../os/kernel/src/chmboxes.o - main.o - ../../../test/testmbox.o -chMBFetchI ../../../os/kernel/src/chmboxes.o - ../../../test/testmbox.o -chMBFetchS ../../../os/kernel/src/chmboxes.o -chMBInit ../../../os/kernel/src/chmboxes.o - main.o - ../../../test/testmbox.o -chMBPost ../../../os/kernel/src/chmboxes.o - main.o - ../../../test/testmbox.o -chMBPostAhead ../../../os/kernel/src/chmboxes.o - ../../../test/testmbox.o -chMBPostAheadI ../../../os/kernel/src/chmboxes.o - ../../../test/testmbox.o -chMBPostAheadS ../../../os/kernel/src/chmboxes.o -chMBPostI ../../../os/kernel/src/chmboxes.o - main.o - ../../../test/testmbox.o -chMBPostS ../../../os/kernel/src/chmboxes.o -chMBReset ../../../os/kernel/src/chmboxes.o - ../../../test/testmbox.o -chMsgRelease ../../../os/kernel/src/chmsg.o - ../../../test/testbmk.o - ../../../test/testmsg.o -chMsgSend ../../../os/kernel/src/chmsg.o - ../../../test/testbmk.o - ../../../test/testmsg.o -chMsgWait ../../../os/kernel/src/chmsg.o - ../../../test/testbmk.o - ../../../test/testmsg.o -chMtxInit ../../../os/kernel/src/chmtx.o - ../../../test/testbmk.o - ../../../test/testmtx.o - ../../../os/kernel/src/chheap.o -chMtxLock ../../../os/kernel/src/chmtx.o - ../../../test/testbmk.o - ../../../test/testmtx.o - ../../../os/kernel/src/chheap.o -chMtxLockS ../../../os/kernel/src/chmtx.o - ../../../os/kernel/src/chcond.o -chMtxTryLock ../../../os/kernel/src/chmtx.o - ../../../test/testmtx.o -chMtxTryLockS ../../../os/kernel/src/chmtx.o -chMtxUnlock ../../../os/kernel/src/chmtx.o - ../../../test/testbmk.o - ../../../test/testmtx.o - ../../../os/kernel/src/chheap.o -chMtxUnlockAll ../../../os/kernel/src/chmtx.o - ../../../test/testmtx.o -chMtxUnlockS ../../../os/kernel/src/chmtx.o - ../../../test/testmtx.o - ../../../os/kernel/src/chcond.o -chOQGetFullI ../../../os/kernel/src/chqueues.o - ../../../test/testqueues.o -chOQGetI ../../../os/kernel/src/chqueues.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chOQInit ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chOQPutTimeout ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chOQResetI ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chOQWriteTimeout ../../../os/kernel/src/chqueues.o - ../../../os/hal/src/serial.o - ../../../test/testqueues.o -chPoolAlloc ../../../os/kernel/src/chmempools.o - ../../../test/testdyn.o - ../../../test/testpools.o - ../../../os/kernel/src/chdynamic.o -chPoolAllocI ../../../os/kernel/src/chmempools.o -chPoolFree ../../../os/kernel/src/chmempools.o - ../../../test/testdyn.o - ../../../test/testpools.o - ../../../os/kernel/src/chdynamic.o -chPoolFreeI ../../../os/kernel/src/chmempools.o -chPoolInit ../../../os/kernel/src/chmempools.o - ../../../test/testdyn.o - ../../../test/testpools.o -chRegFirstThread ../../../os/kernel/src/chregistry.o - ../../../test/testdyn.o -chRegNextThread ../../../os/kernel/src/chregistry.o - ../../../test/testdyn.o -chSchDoRescheduleI ../../../os/kernel/src/chschd.o - ../../../os/kernel/src/chthreads.o - ../../../os/ports/GCC/ARMCMx/chcore_v7m.o -chSchGoSleepS ../../../os/kernel/src/chschd.o - ../../../test/testbmk.o - ../../../os/kernel/src/chmsg.o - ../../../os/kernel/src/chevents.o - ../../../os/kernel/src/chcond.o - ../../../os/kernel/src/chmtx.o - ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chthreads.o -chSchGoSleepTimeoutS ../../../os/kernel/src/chschd.o - ../../../os/kernel/src/chevents.o - ../../../os/kernel/src/chcond.o - ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chthreads.o -chSchIsRescRequiredExI ../../../os/kernel/src/chschd.o - ../../../os/ports/GCC/ARMCMx/chcore_v7m.o -chSchReadyI ../../../os/kernel/src/chschd.o - ../../../os/kernel/src/chmsg.o - ../../../os/kernel/src/chevents.o - ../../../os/kernel/src/chcond.o - ../../../os/kernel/src/chmtx.o - ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chthreads.o -chSchRescheduleS ../../../os/kernel/src/chschd.o - ../../../os/hal/src/serial.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../os/kernel/src/chmboxes.o - ../../../os/kernel/src/chevents.o - ../../../os/kernel/src/chcond.o - ../../../os/kernel/src/chmtx.o - ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chthreads.o -chSchWakeupS ../../../os/kernel/src/chschd.o - ../../../test/testbmk.o - ../../../os/kernel/src/chmsg.o - ../../../os/kernel/src/chcond.o - ../../../os/kernel/src/chmtx.o - ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chdynamic.o - ../../../os/kernel/src/chthreads.o -chSemInit ../../../os/kernel/src/chsem.o - ../../../test/testbmk.o - ../../../test/testsem.o - ../../../os/kernel/src/chqueues.o - ../../../os/kernel/src/chmboxes.o -chSemReset ../../../os/kernel/src/chsem.o - ../../../test/testbmk.o - ../../../test/testsem.o -chSemResetI ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chqueues.o - ../../../os/kernel/src/chmboxes.o -chSemSetCounterI ../../../os/kernel/src/chsem.o - ../../../test/testsem.o -chSemSignal ../../../os/kernel/src/chsem.o - ../../../test/testbmk.o - ../../../test/testsem.o -chSemSignalI ../../../os/kernel/src/chsem.o - ../../../test/testsem.o - ../../../os/kernel/src/chqueues.o - ../../../os/kernel/src/chmboxes.o -chSemSignalWait ../../../os/kernel/src/chsem.o - ../../../test/testsem.o -chSemWait ../../../os/kernel/src/chsem.o - ../../../test/testbmk.o - ../../../test/testsem.o -chSemWaitS ../../../os/kernel/src/chsem.o -chSemWaitTimeout ../../../os/kernel/src/chsem.o - ../../../test/testsem.o -chSemWaitTimeoutS ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chqueues.o - ../../../os/kernel/src/chmboxes.o -chSysInit ../../../os/kernel/src/chsys.o - main.o -chSysTimerHandlerI ../../../os/kernel/src/chsys.o - ../../../os/ports/GCC/ARMCMx/chcore_v7m.o -chThdAddRef ../../../os/kernel/src/chdynamic.o - ../../../test/testdyn.o -chThdCreateFromHeap ../../../os/kernel/src/chdynamic.o - ../../../test/testdyn.o -chThdCreateFromMemoryPool ../../../os/kernel/src/chdynamic.o - ../../../test/testdyn.o -chThdCreateI ../../../os/kernel/src/chthreads.o - ../../../test/testthd.o - ../../../os/kernel/src/chdynamic.o -chThdCreateStatic ../../../os/kernel/src/chthreads.o - main.o - ../../../test/testbmk.o - ../../../test/testqueues.o - ../../../test/testevt.o - ../../../test/testmsg.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o - ../../../os/kernel/src/chsys.o -chThdExit ../../../os/kernel/src/chthreads.o - ../../../os/ports/GCC/ARMCMx/chcore_v7m.o -chThdRelease ../../../os/kernel/src/chdynamic.o - ../../../test/testdyn.o - ../../../os/kernel/src/chregistry.o - ../../../os/kernel/src/chthreads.o -chThdResume ../../../os/kernel/src/chthreads.o - ../../../test/testthd.o -chThdSetPriority ../../../os/kernel/src/chthreads.o - ../../../test/testthd.o -chThdSleep ../../../os/kernel/src/chthreads.o - main.o - ../../../test/testbmk.o - ../../../test/testdyn.o - ../../../test/testevt.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o - ../../../test/test.o -chThdSleepUntil ../../../os/kernel/src/chthreads.o - ../../../test/testthd.o -chThdTerminate ../../../os/kernel/src/chthreads.o - ../../../test/test.o -chThdWait ../../../os/kernel/src/chthreads.o - ../../../test/testbmk.o - ../../../test/test.o -chThdYield ../../../os/kernel/src/chthreads.o - ../../../test/testbmk.o -chTimeIsWithin ../../../os/kernel/src/chvt.o - ../../../test/test.o -chVTResetI ../../../os/kernel/src/chvt.o - ../../../os/various/evtimer.o - ../../../test/testbmk.o - ../../../os/kernel/src/chschd.o -chVTSetI ../../../os/kernel/src/chvt.o - ../../../os/various/evtimer.o - ../../../test/testbmk.o - ../../../test/test.o - ../../../os/kernel/src/chschd.o -core_init ../../../os/kernel/src/chmemcore.o - ../../../os/kernel/src/chsys.o -evtStart ../../../os/various/evtimer.o -evtStop ../../../os/various/evtimer.o -gptInit ../../../os/hal/src/gpt.o - ../../../os/hal/src/hal.o -gptObjectInit ../../../os/hal/src/gpt.o - ../../../os/hal/platforms/LPC13xx/gpt_lld.o -gptPolledDelay ../../../os/hal/src/gpt.o -gptStart ../../../os/hal/src/gpt.o - main.o -gptStartContinuous ../../../os/hal/src/gpt.o - main.o -gptStartContinuousI ../../../os/hal/src/gpt.o -gptStartOneShot ../../../os/hal/src/gpt.o -gptStartOneShotI ../../../os/hal/src/gpt.o -gptStop ../../../os/hal/src/gpt.o -gptStopTimer ../../../os/hal/src/gpt.o - main.o -gptStopTimerI ../../../os/hal/src/gpt.o -gpt_lld_init ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/hal/src/gpt.o -gpt_lld_polled_delay ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/hal/src/gpt.o -gpt_lld_start ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/hal/src/gpt.o -gpt_lld_start_timer ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/hal/src/gpt.o -gpt_lld_stop ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/hal/src/gpt.o -gpt_lld_stop_timer ../../../os/hal/platforms/LPC13xx/gpt_lld.o - ../../../os/hal/src/gpt.o -halInit ../../../os/hal/src/hal.o - main.o -hal_lld_init ../../../os/hal/platforms/LPC13xx/hal_lld.o - ../../../os/hal/src/hal.o -heap_init ../../../os/kernel/src/chheap.o - ../../../os/kernel/src/chsys.o -main main.o - ../../../os/ports/GCC/ARMCMx/crt0_v7m.o -memset c:/programmi/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb/v7m\libc.a(lib_a-memset.o) - ../../../os/various/syscalls.o -palReadBus ../../../os/hal/src/pal.o -palSetBusMode ../../../os/hal/src/pal.o -palWriteBus ../../../os/hal/src/pal.o -pal_default_config ../../../boards/EA_LPCXPRESSO_BB_1343/board.o - ../../../os/hal/src/hal.o -patternbmk ../../../test/testbmk.o - ../../../test/test.o -patterndyn ../../../test/testdyn.o - ../../../test/test.o -patternevt ../../../test/testevt.o - ../../../test/test.o -patternheap ../../../test/testheap.o - ../../../test/test.o -patternmbox ../../../test/testmbox.o - ../../../test/test.o -patternmsg ../../../test/testmsg.o - ../../../test/test.o -patternmtx ../../../test/testmtx.o - ../../../test/test.o -patternpools ../../../test/testpools.o - ../../../test/test.o -patternqueues ../../../test/testqueues.o - ../../../test/test.o -patternsem ../../../test/testsem.o - ../../../test/test.o -patternthd ../../../test/testthd.o - ../../../test/test.o -port_halt ../../../os/ports/GCC/ARMCMx/chcore.o -port_switch ../../../os/ports/GCC/ARMCMx/chcore_v7m.o - ../../../os/kernel/src/chschd.o -rlist ../../../test/testbmk.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testevt.o - ../../../test/testmsg.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o - ../../../test/test.o - ../../../os/kernel/src/chmsg.o - ../../../os/kernel/src/chevents.o - ../../../os/kernel/src/chcond.o - ../../../os/kernel/src/chmtx.o - ../../../os/kernel/src/chsem.o - ../../../os/kernel/src/chregistry.o - ../../../os/kernel/src/chthreads.o - ../../../os/kernel/src/chschd.o - ../../../os/kernel/src/chsys.o -scheduler_init ../../../os/kernel/src/chschd.o - ../../../os/kernel/src/chsys.o -sdIncomingDataI ../../../os/hal/src/serial.o -sdInit ../../../os/hal/src/serial.o - ../../../os/hal/src/hal.o -sdObjectInit ../../../os/hal/src/serial.o - ../../../os/hal/platforms/LPC13xx/serial_lld.o -sdRequestDataI ../../../os/hal/src/serial.o -sdStart ../../../os/hal/src/serial.o - main.o -sdStop ../../../os/hal/src/serial.o -sd_lld_init ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/src/serial.o -sd_lld_start ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/src/serial.o -sd_lld_stop ../../../os/hal/platforms/LPC13xx/serial_lld.o - ../../../os/hal/src/serial.o -test ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testheap.o - ../../../test/testmbox.o - ../../../test/test.o -test_cpu_pulse ../../../test/test.o - ../../../test/testmtx.o -test_emit_token ../../../test/test.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testevt.o - ../../../test/testmbox.o - ../../../test/testmsg.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -test_print ../../../test/test.o - ../../../test/testbmk.o -test_println ../../../test/test.o - ../../../test/testbmk.o -test_printn ../../../test/test.o - ../../../test/testbmk.o -test_start_timer ../../../test/test.o - ../../../test/testbmk.o -test_terminate_threads ../../../test/test.o - ../../../test/testbmk.o -test_timer_done ../../../test/testbmk.o - ../../../test/test.o -test_wait_threads ../../../test/test.o - ../../../test/testbmk.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testevt.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -test_wait_tick ../../../test/test.o - ../../../test/testbmk.o - ../../../test/testevt.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -testbmk1 ../../../test/testbmk.o -testbmk10 ../../../test/testbmk.o -testbmk11 ../../../test/testbmk.o -testbmk12 ../../../test/testbmk.o -testbmk13 ../../../test/testbmk.o -testbmk2 ../../../test/testbmk.o -testbmk3 ../../../test/testbmk.o -testbmk4 ../../../test/testbmk.o -testbmk5 ../../../test/testbmk.o -testbmk6 ../../../test/testbmk.o -testbmk7 ../../../test/testbmk.o -testbmk8 ../../../test/testbmk.o -testbmk9 ../../../test/testbmk.o -testdyn1 ../../../test/testdyn.o -testdyn2 ../../../test/testdyn.o -testdyn3 ../../../test/testdyn.o -testevt1 ../../../test/testevt.o -testevt2 ../../../test/testevt.o -testevt3 ../../../test/testevt.o -testheap1 ../../../test/testheap.o -testmbox1 ../../../test/testmbox.o -testmsg1 ../../../test/testmsg.o -testmtx1 ../../../test/testmtx.o -testmtx2 ../../../test/testmtx.o -testmtx3 ../../../test/testmtx.o -testmtx4 ../../../test/testmtx.o -testmtx5 ../../../test/testmtx.o -testmtx6 ../../../test/testmtx.o -testmtx7 ../../../test/testmtx.o -testmtx8 ../../../test/testmtx.o -testpools1 ../../../test/testpools.o -testqueues1 ../../../test/testqueues.o -testqueues2 ../../../test/testqueues.o -testsem1 ../../../test/testsem.o -testsem2 ../../../test/testsem.o -testsem3 ../../../test/testsem.o -testsem4 ../../../test/testsem.o -testthd1 ../../../test/testthd.o -testthd2 ../../../test/testthd.o -testthd3 ../../../test/testthd.o -testthd4 ../../../test/testthd.o -thread4 ../../../test/testbmk.o -threads ../../../test/testbmk.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testevt.o - ../../../test/testmsg.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o - ../../../test/test.o -vt_init ../../../os/kernel/src/chvt.o - ../../../os/kernel/src/chsys.o -vtlist ../../../test/testevt.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o - ../../../test/test.o - ../../../os/kernel/src/chthreads.o - ../../../os/kernel/src/chvt.o - ../../../os/kernel/src/chsys.o -wa ../../../test/test.o - ../../../test/testbmk.o - ../../../test/testqueues.o - ../../../test/testdyn.o - ../../../test/testpools.o - ../../../test/testevt.o - ../../../test/testmsg.o - ../../../test/testmtx.o - ../../../test/testsem.o - ../../../test/testthd.o -- cgit v1.2.3 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 --- demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c | 2 +- demos/ARMCM3-STM32F103-FATFS-GCC/main.c | 4 +- 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 ++-- os/hal/platforms/AT91SAM7/mac_lld.c | 44 +++--- os/hal/platforms/AT91SAM7/mac_lld.h | 25 ++-- os/hal/platforms/AT91SAM7/spi_lld.c | 88 ++++++------ os/hal/platforms/AT91SAM7/spi_lld.h | 20 +-- os/hal/platforms/LPC11xx/spi_lld.c | 102 +++++++------- os/hal/platforms/LPC11xx/spi_lld.h | 34 ++--- os/hal/platforms/LPC13xx/spi_lld.c | 100 +++++++------- os/hal/platforms/LPC13xx/spi_lld.h | 32 ++--- os/hal/platforms/LPC214x/spi_lld.c | 96 ++++++------- os/hal/platforms/LPC214x/spi_lld.h | 30 ++-- os/hal/platforms/STM32/adc_lld.c | 50 +++---- os/hal/platforms/STM32/adc_lld.h | 46 +++---- os/hal/platforms/STM32/can_lld.c | 136 +++++++++--------- os/hal/platforms/STM32/can_lld.h | 80 +++++------ os/hal/platforms/STM32/pwm_lld.c | 140 +++++++++---------- os/hal/platforms/STM32/pwm_lld.h | 28 ++-- os/hal/platforms/STM32/spi_lld.c | 96 ++++++------- os/hal/platforms/STM32/spi_lld.h | 26 ++-- os/hal/platforms/STM32/uart_lld.c | 168 +++++++++++----------- os/hal/platforms/STM32/uart_lld.h | 50 +++---- os/hal/platforms/STM8S/spi_lld.c | 42 +++--- os/hal/platforms/STM8S/spi_lld.h | 26 ++-- os/hal/src/adc.c | 78 +++++------ os/hal/src/can.c | 80 +++++------ os/hal/src/mac.c | 10 +- os/hal/src/mmc_spi.c | 199 +++++++++++++-------------- os/hal/src/pal.c | 12 +- os/hal/src/pwm.c | 18 +-- os/hal/src/spi.c | 77 +++++------ os/hal/src/uart.c | 97 ++++++------- os/hal/templates/adc_lld.c | 2 +- os/hal/templates/adc_lld.h | 22 +-- os/hal/templates/can_lld.c | 2 +- os/hal/templates/can_lld.h | 52 +++---- os/hal/templates/mac_lld.h | 14 +- os/hal/templates/pwm_lld.c | 2 +- os/hal/templates/pwm_lld.h | 12 +- os/hal/templates/spi_lld.c | 2 +- os/hal/templates/spi_lld.h | 12 +- os/hal/templates/uart_lld.h | 18 +-- readme.txt | 14 +- testhal/STM32/CAN/main.c | 16 +-- 51 files changed, 1152 insertions(+), 1183 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c index 4d0516c2c..4f43cef2a 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c @@ -69,7 +69,7 @@ static size_t network_device_read(void) { if (macWaitReceiveDescriptor(Ð1, &rd, TIME_IMMEDIATE) != RDY_OK) return 0; - size = rd.rd_size; + size = rd.size; macReadReceiveDescriptor(&rd, uip_buf, size); macReleaseReceiveDescriptor(&rd); return size; diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c index eb314d6ad..ec6769c47 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c @@ -310,8 +310,8 @@ int main(void) { * Normal main() thread activity, in this demo it does nothing except * sleeping in a loop and listen for events. */ - chEvtRegister(&MMCD1.mmc_inserted_event, &el0, 0); - chEvtRegister(&MMCD1.mmc_removed_event, &el1, 1); + chEvtRegister(&MMCD1.inserted_event, &el0, 0); + chEvtRegister(&MMCD1.removed_event, &el1, 1); while (TRUE) { if (!shelltp) shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); 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); \ } diff --git a/os/hal/platforms/AT91SAM7/mac_lld.c b/os/hal/platforms/AT91SAM7/mac_lld.c index ee71b2e23..15529ac04 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.c +++ b/os/hal/platforms/AT91SAM7/mac_lld.c @@ -100,9 +100,9 @@ static void serve_interrupt(void) { if ((isr & AT91C_EMAC_RCOMP) || (rsr & RSR_BITS)) { if (rsr & AT91C_EMAC_REC) { chSysLockFromIsr(); - chSemResetI(Ð1.md_rdsem, 0); + chSemResetI(Ð1.rdsem, 0); #if CH_USE_EVENTS - chEvtBroadcastI(Ð1.md_rdevent); + chEvtBroadcastI(Ð1.rdevent); #endif chSysUnlockFromIsr(); } @@ -112,7 +112,7 @@ static void serve_interrupt(void) { if ((isr & AT91C_EMAC_TCOMP) || (tsr & TSR_BITS)) { if (tsr & AT91C_EMAC_COMP) { chSysLockFromIsr(); - chSemResetI(Ð1.md_tdsem, 0); + chSemResetI(Ð1.tdsem, 0); chSysUnlockFromIsr(); } AT91C_BASE_EMAC->EMAC_TSR = TSR_BITS; @@ -291,9 +291,9 @@ msg_t max_lld_get_transmit_descriptor(MACDriver *macp, else edp->w2 = W2_T_LOCKED | W2_T_USED | W2_T_LAST_BUFFER; chSysUnlock(); - tdp->td_offset = 0; - tdp->td_size = EMAC_TRANSMIT_BUFFERS_SIZE; - tdp->td_physdesc = edp; + tdp->offset = 0; + tdp->size = EMAC_TRANSMIT_BUFFERS_SIZE; + tdp->physdesc = edp; return RDY_OK; } @@ -315,13 +315,13 @@ size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp, uint8_t *buf, size_t size) { - if (size > tdp->td_size - tdp->td_offset) - size = tdp->td_size - tdp->td_offset; + if (size > tdp->size - tdp->offset) + size = tdp->size - tdp->offset; if (size > 0) { - memcpy((uint8_t *)(tdp->td_physdesc->w1 & W1_T_ADDRESS_MASK) + - tdp->td_offset, + memcpy((uint8_t *)(tdp->physdesc->w1 & W1_T_ADDRESS_MASK) + + tdp->offset, buf, size); - tdp->td_offset += size; + tdp->offset += size; } return size; } @@ -337,9 +337,9 @@ size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp, void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) { chSysLock(); - tdp->td_physdesc->w2 = (tdp->td_physdesc->w2 & + tdp->physdesc->w2 = (tdp->physdesc->w2 & ~(W2_T_LOCKED | W2_T_USED | W2_T_LENGTH_MASK)) | - tdp->td_offset; + tdp->offset; AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_TSTART; chSysUnlock(); } @@ -400,9 +400,9 @@ restart: * End Of Frame found. */ if (rxptr->w2 & W2_R_FRAME_END) { - rdp->rd_offset = 0; - rdp->rd_size = rxptr->w2 & W2_T_LENGTH_MASK; - rdp->rd_physdesc = edp; + rdp->offset = 0; + rdp->size = rxptr->w2 & W2_T_LENGTH_MASK; + rdp->physdesc = edp; return RDY_OK; } @@ -435,11 +435,11 @@ restart: size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp, uint8_t *buf, size_t size) { - if (size > rdp->rd_size - rdp->rd_offset) - size = rdp->rd_size - rdp->rd_offset; + if (size > rdp->size - rdp->offset) + size = rdp->size - rdp->offset; if (size > 0) { - uint8_t *src = (uint8_t *)(rdp->rd_physdesc->w1 & W1_R_ADDRESS_MASK) + - rdp->rd_offset; + uint8_t *src = (uint8_t *)(rdp->physdesc->w1 & W1_R_ADDRESS_MASK) + + rdp->offset; uint8_t *limit = &rb[EMAC_RECEIVE_DESCRIPTORS * EMAC_RECEIVE_BUFFERS_SIZE]; if (src >= limit) src -= EMAC_RECEIVE_DESCRIPTORS * EMAC_RECEIVE_BUFFERS_SIZE; @@ -449,7 +449,7 @@ size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp, } else memcpy(buf, src, size); - rdp->rd_offset += size; + rdp->offset += size; } return size; } @@ -465,7 +465,7 @@ size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp, */ void mac_lld_release_receive_descriptor(MACReceiveDescriptor *rdp) { bool_t done; - EMACDescriptor *edp = rdp->rd_physdesc; + EMACDescriptor *edp = rdp->physdesc; unsigned n = EMAC_RECEIVE_DESCRIPTORS; do { diff --git a/os/hal/platforms/AT91SAM7/mac_lld.h b/os/hal/platforms/AT91SAM7/mac_lld.h index 21503dd53..ed8fb1ee2 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.h +++ b/os/hal/platforms/AT91SAM7/mac_lld.h @@ -66,7 +66,7 @@ #define W1_T_ADDRESS_MASK 0xFFFFFFFF #define W2_T_LENGTH_MASK 0x000007FF -#define W2_T_LOCKED 0x00000800 /* Not an EMAC flag, used by the driver */ +#define W2_T_LOCKED 0x00000800 /* Not an EMAC flag. */ #define W2_T_RFU1 0x00003000 #define W2_T_LAST_BUFFER 0x00008000 #define W2_T_NO_CRC 0x00010000 @@ -130,10 +130,10 @@ typedef struct { * @brief Structure representing a MAC driver. */ typedef struct { - Semaphore md_tdsem; /**< Transmit semaphore. */ - Semaphore md_rdsem; /**< Receive semaphore. */ + Semaphore tdsem; /**< Transmit semaphore. */ + Semaphore rdsem; /**< Receive semaphore. */ #if CH_USE_EVENTS - EventSource md_rdevent; /**< Receive event source. */ + EventSource rdevent; /**< Receive event source. */ #endif /* End of the mandatory fields.*/ } MACDriver; @@ -142,22 +142,23 @@ typedef struct { * @brief Structure representing a transmit descriptor. */ typedef struct { - size_t td_offset; /**< Current write offset. */ - size_t td_size; /**< Available space size. */ + size_t offset; /**< Current write offset. */ + size_t size; /**< Available space size. */ /* End of the mandatory fields.*/ - EMACDescriptor *td_physdesc; /**< Pointer to the physical - descriptor. */ + EMACDescriptor *physdesc; /**< Pointer to the physical + descriptor. */ } MACTransmitDescriptor; /** * @brief Structure representing a receive descriptor. */ typedef struct { - size_t rd_offset; /**< Current read offset. */ - size_t rd_size; /**< Available data size. */ + size_t offset; /**< Current read offset. */ + size_t size; /**< Available data size. */ /* End of the mandatory fields.*/ - EMACDescriptor *rd_physdesc; /**< Pointer to the first descriptor - of the buffers chain. */ + EMACDescriptor *physdesc; /**< Pointer to the first + descriptor of the buffers + chain. */ } MACReceiveDescriptor; /*===========================================================================*/ diff --git a/os/hal/platforms/AT91SAM7/spi_lld.c b/os/hal/platforms/AT91SAM7/spi_lld.c index 316ff65c9..ec3853872 100644 --- a/os/hal/platforms/AT91SAM7/spi_lld.c +++ b/os/hal/platforms/AT91SAM7/spi_lld.c @@ -121,14 +121,14 @@ __attribute__((noinline)) * @param[in] spip pointer to the @p SPIDriver object */ static void spi_lld_serve_interrupt(SPIDriver *spip) { - uint32_t sr = spip->spd_spi->SPI_SR; + uint32_t sr = spip->spi->SPI_SR; if ((sr & AT91C_SPI_ENDRX) != 0) { - (void)spip->spd_spi->SPI_RDR; /* Clears eventual overflow.*/ - spip->spd_spi->SPI_PTCR = AT91C_PDC_RXTDIS | + (void)spip->spi->SPI_RDR; /* Clears eventual overflow.*/ + spip->spi->SPI_PTCR = AT91C_PDC_RXTDIS | AT91C_PDC_TXTDIS; /* PDC disabled. */ - spip->spd_spi->SPI_IDR = AT91C_SPI_ENDRX; /* Interrupt disabled. */ - spip->spd_spi->SPI_CR = AT91C_SPI_SPIDIS; /* SPI disabled. */ + spip->spi->SPI_IDR = AT91C_SPI_ENDRX; /* Interrupt disabled. */ + spip->spi->SPI_CR = AT91C_SPI_SPIDIS; /* SPI disabled. */ /* Portable SPI ISR code defined in the high level driver, note, it is a macro.*/ _spi_isr_code(spip); @@ -182,7 +182,7 @@ void spi_lld_init(void) { #if AT91SAM7_SPI_USE_SPI0 spiObjectInit(&SPID1); - SPID1.spd_spi = AT91C_BASE_SPI0; + SPID1.spi = AT91C_BASE_SPI0; spi_init(AT91C_BASE_SPI0); AT91C_BASE_PIOA->PIO_PDR = SPI0_MISO | SPI0_MOSI | SPI0_SCK; AT91C_BASE_PIOA->PIO_ASR = SPI0_MISO | SPI0_MOSI | SPI0_SCK; @@ -194,7 +194,7 @@ void spi_lld_init(void) { #if AT91SAM7_SPI_USE_SPI1 spiObjectInit(&SPID2); - SPID2.spd_spi = AT91C_BASE_SPI1; + SPID2.spi = AT91C_BASE_SPI1; spi_init(AT91C_BASE_SPI1); AT91C_BASE_PIOA->PIO_PDR = SPI1_MISO | SPI1_MOSI | SPI1_SCK; AT91C_BASE_PIOA->PIO_BSR = SPI1_MISO | SPI1_MOSI | SPI1_SCK; @@ -214,7 +214,7 @@ void spi_lld_init(void) { */ void spi_lld_start(SPIDriver *spip) { - if (spip->spd_state == SPI_STOP) { + if (spip->state == SPI_STOP) { #if AT91SAM7_SPI_USE_SPI0 if (&SPID1 == spip) { /* Clock activation.*/ @@ -233,7 +233,7 @@ void spi_lld_start(SPIDriver *spip) { #endif } /* Configuration.*/ - spip->spd_spi->SPI_CSR[0] = spip->spd_config->spc_csr; + spip->spi->SPI_CSR[0] = spip->config->csr; } /** @@ -245,7 +245,7 @@ void spi_lld_start(SPIDriver *spip) { */ void spi_lld_stop(SPIDriver *spip) { - if (spip->spd_state != SPI_STOP) { + if (spip->state != SPI_STOP) { #if AT91SAM7_SPI_USE_SPI0 if (&SPID1 == spip) { AT91C_BASE_PMC->PMC_PCDR = (1 << AT91C_ID_SPI0); @@ -270,7 +270,7 @@ void spi_lld_stop(SPIDriver *spip) { */ void spi_lld_select(SPIDriver *spip) { - palClearPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palClearPad(spip->config->ssport, spip->config->sspad); } /** @@ -283,7 +283,7 @@ void spi_lld_select(SPIDriver *spip) { */ void spi_lld_unselect(SPIDriver *spip) { - palSetPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palSetPad(spip->config->ssport, spip->config->sspad); } /** @@ -299,13 +299,13 @@ void spi_lld_unselect(SPIDriver *spip) { */ void spi_lld_ignore(SPIDriver *spip, size_t n) { - spip->spd_spi->SPI_TCR = n; - spip->spd_spi->SPI_RCR = n; - spip->spd_spi->SPI_TPR = (AT91_REG)idle_buf; - spip->spd_spi->SPI_RPR = (AT91_REG)idle_buf; - spip->spd_spi->SPI_IER = AT91C_SPI_ENDRX; - spip->spd_spi->SPI_CR = AT91C_SPI_SPIEN; - spip->spd_spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; + spip->spi->SPI_TCR = n; + spip->spi->SPI_RCR = n; + spip->spi->SPI_TPR = (AT91_REG)idle_buf; + spip->spi->SPI_RPR = (AT91_REG)idle_buf; + spip->spi->SPI_IER = AT91C_SPI_ENDRX; + spip->spi->SPI_CR = AT91C_SPI_SPIEN; + spip->spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; } /** @@ -323,13 +323,13 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) { - spip->spd_spi->SPI_TCR = n; - spip->spd_spi->SPI_RCR = n; - spip->spd_spi->SPI_TPR = (AT91_REG)txbuf; - spip->spd_spi->SPI_RPR = (AT91_REG)rxbuf; - spip->spd_spi->SPI_IER = AT91C_SPI_ENDRX; - spip->spd_spi->SPI_CR = AT91C_SPI_SPIEN; - spip->spd_spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; + spip->spi->SPI_TCR = n; + spip->spi->SPI_RCR = n; + spip->spi->SPI_TPR = (AT91_REG)txbuf; + spip->spi->SPI_RPR = (AT91_REG)rxbuf; + spip->spi->SPI_IER = AT91C_SPI_ENDRX; + spip->spi->SPI_CR = AT91C_SPI_SPIEN; + spip->spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; } /** @@ -344,13 +344,13 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { - spip->spd_spi->SPI_TCR = n; - spip->spd_spi->SPI_RCR = n; - spip->spd_spi->SPI_TPR = (AT91_REG)txbuf; - spip->spd_spi->SPI_RPR = (AT91_REG)idle_buf; - spip->spd_spi->SPI_IER = AT91C_SPI_ENDRX; - spip->spd_spi->SPI_CR = AT91C_SPI_SPIEN; - spip->spd_spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; + spip->spi->SPI_TCR = n; + spip->spi->SPI_RCR = n; + spip->spi->SPI_TPR = (AT91_REG)txbuf; + spip->spi->SPI_RPR = (AT91_REG)idle_buf; + spip->spi->SPI_IER = AT91C_SPI_ENDRX; + spip->spi->SPI_CR = AT91C_SPI_SPIEN; + spip->spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; } /** @@ -365,13 +365,13 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { - spip->spd_spi->SPI_TCR = n; - spip->spd_spi->SPI_RCR = n; - spip->spd_spi->SPI_TPR = (AT91_REG)idle_buf; - spip->spd_spi->SPI_RPR = (AT91_REG)rxbuf; - spip->spd_spi->SPI_IER = AT91C_SPI_ENDRX; - spip->spd_spi->SPI_CR = AT91C_SPI_SPIEN; - spip->spd_spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; + spip->spi->SPI_TCR = n; + spip->spi->SPI_RCR = n; + spip->spi->SPI_TPR = (AT91_REG)idle_buf; + spip->spi->SPI_RPR = (AT91_REG)rxbuf; + spip->spi->SPI_IER = AT91C_SPI_ENDRX; + spip->spi->SPI_CR = AT91C_SPI_SPIEN; + spip->spi->SPI_PTCR = AT91C_PDC_RXTEN | AT91C_PDC_TXTEN; } /** @@ -388,11 +388,11 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { */ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { - spip->spd_spi->SPI_CR = AT91C_SPI_SPIEN; - spip->spd_spi->SPI_TDR = frame; - while ((spip->spd_spi->SPI_SR & AT91C_SPI_RDRF) == 0) + spip->spi->SPI_CR = AT91C_SPI_SPIEN; + spip->spi->SPI_TDR = frame; + while ((spip->spi->SPI_SR & AT91C_SPI_RDRF) == 0) ; - return spip->spd_spi->SPI_RDR; + return spip->spi->SPI_RDR; } #endif /* HAL_USE_SPI */ diff --git a/os/hal/platforms/AT91SAM7/spi_lld.h b/os/hal/platforms/AT91SAM7/spi_lld.h index 3b0bfaaba..ec0af3740 100644 --- a/os/hal/platforms/AT91SAM7/spi_lld.h +++ b/os/hal/platforms/AT91SAM7/spi_lld.h @@ -127,20 +127,20 @@ typedef struct { /** * @brief Operation complete callback or @p NULL. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief The chip select line port. */ - ioportid_t spc_ssport; + ioportid_t ssport; /** * @brief The chip select line pad number. */ - uint16_t spc_sspad; + uint16_t sspad; /** * @brief SPI Chip Select Register initialization data. */ - uint32_t spc_csr; + uint32_t csr; } SPIConfig; /** @@ -150,25 +150,25 @@ struct SPIDriver { /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) @@ -178,7 +178,7 @@ struct SPIDriver { /** * @brief Pointer to the SPIx registers block. */ - AT91PS_SPI spd_spi; + AT91PS_SPI spi; }; /*===========================================================================*/ diff --git a/os/hal/platforms/LPC11xx/spi_lld.c b/os/hal/platforms/LPC11xx/spi_lld.c index 47766088c..b165c42ee 100644 --- a/os/hal/platforms/LPC11xx/spi_lld.c +++ b/os/hal/platforms/LPC11xx/spi_lld.c @@ -58,27 +58,27 @@ SPIDriver SPID2; * @param[in] spip pointer to the @p SPIDriver object */ static void ssp_fifo_preload(SPIDriver *spip) { - LPC_SSP_TypeDef *ssp = spip->spd_ssp; - uint32_t n = spip->spd_txcnt > LPC11xx_SSP_FIFO_DEPTH ? - LPC11xx_SSP_FIFO_DEPTH : spip->spd_txcnt; + LPC_SSP_TypeDef *ssp = spip->ssp; + uint32_t n = spip->txcnt > LPC11xx_SSP_FIFO_DEPTH ? + LPC11xx_SSP_FIFO_DEPTH : spip->txcnt; while(((ssp->SR & SR_TNF) != 0) && (n > 0)) { - if (spip->spd_txptr != NULL) { + if (spip->txptr != NULL) { if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT) { - const uint16_t *p = spip->spd_txptr; + const uint16_t *p = spip->txptr; ssp->DR = *p++; - spip->spd_txptr = p; + spip->txptr = p; } else { - const uint8_t *p = spip->spd_txptr; + const uint8_t *p = spip->txptr; ssp->DR = *p++; - spip->spd_txptr = p; + spip->txptr = p; } } else ssp->DR = 0xFFFFFFFF; n--; - spip->spd_txcnt--; + spip->txcnt--; } } @@ -88,7 +88,7 @@ static void ssp_fifo_preload(SPIDriver *spip) { * @param[in] spip pointer to the @p SPIDriver object */ static void spi_serve_interrupt(SPIDriver *spip) { - LPC_SSP_TypeDef *ssp = spip->spd_ssp; + LPC_SSP_TypeDef *ssp = spip->ssp; if ((ssp->MIS & MIS_ROR) != 0) { /* The overflow condition should never happen because priority is given @@ -97,22 +97,22 @@ static void spi_serve_interrupt(SPIDriver *spip) { } ssp->ICR = ICR_RT | ICR_ROR; while ((ssp->SR & SR_RNE) != 0) { - if (spip->spd_rxptr != NULL) { + if (spip->rxptr != NULL) { if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT) { - uint16_t *p = spip->spd_rxptr; + uint16_t *p = spip->rxptr; *p++ = ssp->DR; - spip->spd_rxptr = p; + spip->rxptr = p; } else { - uint8_t *p = spip->spd_rxptr; + uint8_t *p = spip->rxptr; *p++ = ssp->DR; - spip->spd_rxptr = p; + spip->rxptr = p; } } else (void)ssp->DR; - if (--spip->spd_rxcnt == 0) { - chDbgAssert(spip->spd_txcnt == 0, + if (--spip->rxcnt == 0) { + chDbgAssert(spip->txcnt == 0, "spi_serve_interrupt(), #1", "counter out of synch"); /* Stops the IRQ sources.*/ ssp->IMSC = 0; @@ -123,7 +123,7 @@ static void spi_serve_interrupt(SPIDriver *spip) { } } ssp_fifo_preload(spip); - if (spip->spd_txcnt == 0) + if (spip->txcnt == 0) ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_RX; } @@ -176,7 +176,7 @@ void spi_lld_init(void) { #if LPC11xx_SPI_USE_SSP0 spiObjectInit(&SPID1); - SPID1.spd_ssp = LPC_SSP0; + SPID1.ssp = LPC_SSP0; LPC_IOCON->SCK_LOC = LPC11xx_SPI_SCK0_SELECTOR; #if LPC11xx_SPI_SCK0_SELECTOR == SCK0_IS_PIO0_10 LPC_IOCON->JTAG_TCK_PIO0_10 = 0xC2; /* SCK0 without resistors. */ @@ -191,7 +191,7 @@ void spi_lld_init(void) { #if LPC11xx_SPI_USE_SSP1 spiObjectInit(&SPID2); - SPID2.spd_ssp = LPC_SSP1; + SPID2.ssp = LPC_SSP1; LPC_IOCON->PIO2_1 = 0xC2; /* SCK1 without resistors. */ LPC_IOCON->PIO2_2 = 0xC2; /* MISO1 without resistors. */ LPC_IOCON->PIO2_3 = 0xC2; /* MOSI1 without resistors. */ @@ -207,7 +207,7 @@ void spi_lld_init(void) { */ void spi_lld_start(SPIDriver *spip) { - if (spip->spd_state == SPI_STOP) { + if (spip->state == SPI_STOP) { /* Clock activation.*/ #if LPC11xx_SPI_USE_SSP0 if (&SPID1 == spip) { @@ -229,11 +229,11 @@ void spi_lld_start(SPIDriver *spip) { #endif } /* Configuration.*/ - spip->spd_ssp->CR1 = 0; - spip->spd_ssp->ICR = ICR_RT | ICR_ROR; - spip->spd_ssp->CR0 = spip->spd_config->spc_cr0; - spip->spd_ssp->CPSR = spip->spd_config->spc_cpsr; - spip->spd_ssp->CR1 = CR1_SSE; + spip->ssp->CR1 = 0; + spip->ssp->ICR = ICR_RT | ICR_ROR; + spip->ssp->CR0 = spip->config->cr0; + spip->ssp->CPSR = spip->config->cpsr; + spip->ssp->CR1 = CR1_SSE; } /** @@ -245,10 +245,10 @@ void spi_lld_start(SPIDriver *spip) { */ void spi_lld_stop(SPIDriver *spip) { - if (spip->spd_state != SPI_STOP) { - spip->spd_ssp->CR1 = 0; - spip->spd_ssp->CR0 = 0; - spip->spd_ssp->CPSR = 0; + if (spip->state != SPI_STOP) { + spip->ssp->CR1 = 0; + spip->ssp->CR0 = 0; + spip->ssp->CPSR = 0; #if LPC11xx_SPI_USE_SSP0 if (&SPID1 == spip) { LPC_SYSCON->PRESETCTRL &= ~1; @@ -277,7 +277,7 @@ void spi_lld_stop(SPIDriver *spip) { */ void spi_lld_select(SPIDriver *spip) { - palClearPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palClearPad(spip->config->ssport, spip->config->sspad); } /** @@ -290,7 +290,7 @@ void spi_lld_select(SPIDriver *spip) { */ void spi_lld_unselect(SPIDriver *spip) { - palSetPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palSetPad(spip->config->ssport, spip->config->sspad); } /** @@ -306,11 +306,11 @@ void spi_lld_unselect(SPIDriver *spip) { */ void spi_lld_ignore(SPIDriver *spip, size_t n) { - spip->spd_rxptr = NULL; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -331,11 +331,11 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -353,11 +353,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { - spip->spd_rxptr = NULL; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -375,11 +375,11 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -396,10 +396,10 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { */ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { - spip->spd_ssp->DR = (uint32_t)frame; - while ((spip->spd_ssp->SR & SR_RNE) == 0) + spip->ssp->DR = (uint32_t)frame; + while ((spip->ssp->SR & SR_RNE) == 0) ; - return (uint16_t)spip->spd_ssp->DR; + return (uint16_t)spip->ssp->DR; } #endif /* HAL_USE_SPI */ diff --git a/os/hal/platforms/LPC11xx/spi_lld.h b/os/hal/platforms/LPC11xx/spi_lld.h index e0525387a..a99557b4a 100644 --- a/os/hal/platforms/LPC11xx/spi_lld.h +++ b/os/hal/platforms/LPC11xx/spi_lld.h @@ -194,13 +194,13 @@ /** * @brief SSP0 clock. */ -#define LPC11xx_SERIAL_SSP0_PCLK \ +#define LPC11xx_SERIAL_SSP0_PCLK \ (LPC11xx_MAINCLK / LPC11xx_SERIAL_SSP0CLKDIV) /** * @brief SSP1 clock. */ -#define LPC11xx_SERIAL_SSP1_PCLK \ +#define LPC11xx_SERIAL_SSP1_PCLK \ (LPC11xx_MAINCLK / LPC11xx_SERIAL_SSP1CLKDIV) /*===========================================================================*/ @@ -227,24 +227,24 @@ typedef struct { /** * @brief Operation complete callback or @p NULL. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief The chip select line port. */ - ioportid_t spc_ssport; + ioportid_t ssport; /** * @brief The chip select line pad number. */ - uint16_t spc_sspad; + uint16_t sspad; /** * @brief SSP CR0 initialization data. */ - uint16_t spc_cr0; + uint16_t cr0; /** * @brief SSP CPSR initialization data. */ - uint32_t spc_cpsr; + uint32_t cpsr; } SPIConfig; /** @@ -254,25 +254,25 @@ struct SPIDriver { /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) @@ -282,23 +282,23 @@ struct SPIDriver { /** * @brief Pointer to the SSP registers block. */ - LPC_SSP_TypeDef *spd_ssp; + LPC_SSP_TypeDef *ssp; /** * @brief Number of bytes yet to be received. */ - uint32_t spd_rxcnt; + uint32_t rxcnt; /** * @brief Receive pointer or @p NULL. */ - void *spd_rxptr; + void *rxptr; /** * @brief Number of bytes yet to be transmitted. */ - uint32_t spd_txcnt; + uint32_t txcnt; /** * @brief Transmit pointer or @p NULL. */ - const void *spd_txptr; + const void *txptr; }; /*===========================================================================*/ diff --git a/os/hal/platforms/LPC13xx/spi_lld.c b/os/hal/platforms/LPC13xx/spi_lld.c index 1a98a7a15..0e186ccd8 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.c +++ b/os/hal/platforms/LPC13xx/spi_lld.c @@ -53,27 +53,27 @@ SPIDriver SPID1; * @param[in] spip pointer to the @p SPIDriver object */ static void ssp_fifo_preload(SPIDriver *spip) { - LPC_SSP_TypeDef *ssp = spip->spd_ssp; - uint32_t n = spip->spd_txcnt > LPC13xx_SSP_FIFO_DEPTH ? - LPC13xx_SSP_FIFO_DEPTH : spip->spd_txcnt; + LPC_SSP_TypeDef *ssp = spip->ssp; + uint32_t n = spip->txcnt > LPC13xx_SSP_FIFO_DEPTH ? + LPC13xx_SSP_FIFO_DEPTH : spip->txcnt; while(((ssp->SR & SR_TNF) != 0) && (n > 0)) { - if (spip->spd_txptr != NULL) { + if (spip->txptr != NULL) { if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT) { - const uint16_t *p = spip->spd_txptr; + const uint16_t *p = spip->txptr; ssp->DR = *p++; - spip->spd_txptr = p; + spip->txptr = p; } else { - const uint8_t *p = spip->spd_txptr; + const uint8_t *p = spip->txptr; ssp->DR = *p++; - spip->spd_txptr = p; + spip->txptr = p; } } else ssp->DR = 0xFFFFFFFF; n--; - spip->spd_txcnt--; + spip->txcnt--; } } @@ -83,7 +83,7 @@ static void ssp_fifo_preload(SPIDriver *spip) { * @param[in] spip pointer to the @p SPIDriver object */ static void spi_serve_interrupt(SPIDriver *spip) { - LPC_SSP_TypeDef *ssp = spip->spd_ssp; + LPC_SSP_TypeDef *ssp = spip->ssp; if ((ssp->MIS & MIS_ROR) != 0) { /* The overflow condition should never happen because priority is given @@ -92,22 +92,22 @@ static void spi_serve_interrupt(SPIDriver *spip) { } ssp->ICR = ICR_RT | ICR_ROR; while ((ssp->SR & SR_RNE) != 0) { - if (spip->spd_rxptr != NULL) { + if (spip->rxptr != NULL) { if ((ssp->CR0 & CR0_DSSMASK) > CR0_DSS8BIT) { - uint16_t *p = spip->spd_rxptr; + uint16_t *p = spip->rxptr; *p++ = ssp->DR; - spip->spd_rxptr = p; + spip->rxptr = p; } else { - uint8_t *p = spip->spd_rxptr; + uint8_t *p = spip->rxptr; *p++ = ssp->DR; - spip->spd_rxptr = p; + spip->rxptr = p; } } else (void)ssp->DR; - if (--spip->spd_rxcnt == 0) { - chDbgAssert(spip->spd_txcnt == 0, + if (--spip->rxcnt == 0) { + chDbgAssert(spip->txcnt == 0, "spi_serve_interrupt(), #1", "counter out of synch"); /* Stops the IRQ sources.*/ ssp->IMSC = 0; @@ -118,7 +118,7 @@ static void spi_serve_interrupt(SPIDriver *spip) { } } ssp_fifo_preload(spip); - if (spip->spd_txcnt == 0) + if (spip->txcnt == 0) ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_RX; } @@ -155,7 +155,7 @@ void spi_lld_init(void) { #if LPC13xx_SPI_USE_SSP0 spiObjectInit(&SPID1); - SPID1.spd_ssp = LPC_SSP; + SPID1.ssp = LPC_SSP; LPC_IOCON->SCKLOC = LPC13xx_SPI_SCK0_SELECTOR; #if LPC13xx_SPI_SCK0_SELECTOR == SCK0_IS_PIO0_10 LPC_IOCON->JTAG_TCK_PIO0_10 = 0xC2; /* SCK0 without resistors. */ @@ -178,7 +178,7 @@ void spi_lld_init(void) { */ void spi_lld_start(SPIDriver *spip) { - if (spip->spd_state == SPI_STOP) { + if (spip->state == SPI_STOP) { /* Clock activation.*/ #if LPC13xx_SPI_USE_SSP0 if (&SPID1 == spip) { @@ -191,11 +191,11 @@ void spi_lld_start(SPIDriver *spip) { #endif } /* Configuration.*/ - spip->spd_ssp->CR1 = 0; - spip->spd_ssp->ICR = ICR_RT | ICR_ROR; - spip->spd_ssp->CR0 = spip->spd_config->spc_cr0; - spip->spd_ssp->CPSR = spip->spd_config->spc_cpsr; - spip->spd_ssp->CR1 = CR1_SSE; + spip->ssp->CR1 = 0; + spip->ssp->ICR = ICR_RT | ICR_ROR; + spip->ssp->CR0 = spip->config->cr0; + spip->ssp->CPSR = spip->config->cpsr; + spip->ssp->CR1 = CR1_SSE; } /** @@ -207,10 +207,10 @@ void spi_lld_start(SPIDriver *spip) { */ void spi_lld_stop(SPIDriver *spip) { - if (spip->spd_state != SPI_STOP) { - spip->spd_ssp->CR1 = 0; - spip->spd_ssp->CR0 = 0; - spip->spd_ssp->CPSR = 0; + if (spip->state != SPI_STOP) { + spip->ssp->CR1 = 0; + spip->ssp->CR0 = 0; + spip->ssp->CPSR = 0; #if LPC13xx_SPI_USE_SSP0 if (&SPID1 == spip) { LPC_SYSCON->PRESETCTRL &= ~1; @@ -231,7 +231,7 @@ void spi_lld_stop(SPIDriver *spip) { */ void spi_lld_select(SPIDriver *spip) { - palClearPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palClearPad(spip->config->ssport, spip->config->sspad); } /** @@ -244,7 +244,7 @@ void spi_lld_select(SPIDriver *spip) { */ void spi_lld_unselect(SPIDriver *spip) { - palSetPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palSetPad(spip->config->ssport, spip->config->sspad); } /** @@ -260,11 +260,11 @@ void spi_lld_unselect(SPIDriver *spip) { */ void spi_lld_ignore(SPIDriver *spip, size_t n) { - spip->spd_rxptr = NULL; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -285,11 +285,11 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -307,11 +307,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { - spip->spd_rxptr = NULL; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -329,11 +329,11 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -350,10 +350,10 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { */ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { - spip->spd_ssp->DR = (uint32_t)frame; - while ((spip->spd_ssp->SR & SR_RNE) == 0) + spip->ssp->DR = (uint32_t)frame; + while ((spip->ssp->SR & SR_RNE) == 0) ; - return (uint16_t)spip->spd_ssp->DR; + return (uint16_t)spip->ssp->DR; } #endif /* HAL_USE_SPI */ diff --git a/os/hal/platforms/LPC13xx/spi_lld.h b/os/hal/platforms/LPC13xx/spi_lld.h index 153ce815b..a4479a425 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.h +++ b/os/hal/platforms/LPC13xx/spi_lld.h @@ -167,7 +167,7 @@ /** * @brief SSP0 clock. */ -#define LPC13xx_SERIAL_SSP0_PCLK \ +#define LPC13xx_SERIAL_SSP0_PCLK \ (LPC13xx_MAINCLK / LPC13xx_SERIAL_SSP0CLKDIV) /*===========================================================================*/ @@ -194,24 +194,24 @@ typedef struct { /** * @brief Operation complete callback or @p NULL. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief The chip select line port. */ - ioportid_t spc_ssport; + ioportid_t ssport; /** * @brief The chip select line pad number. */ - uint16_t spc_sspad; + uint16_t sspad; /** * @brief SSP CR0 initialization data. */ - uint16_t spc_cr0; + uint16_t cr0; /** * @brief SSP CPSR initialization data. */ - uint32_t spc_cpsr; + uint32_t cpsr; } SPIConfig; /** @@ -221,25 +221,25 @@ struct SPIDriver { /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) @@ -249,23 +249,23 @@ struct SPIDriver { /** * @brief Pointer to the SSP registers block. */ - LPC_SSP_TypeDef *spd_ssp; + LPC_SSP_TypeDef *ssp; /** * @brief Number of bytes yet to be received. */ - uint32_t spd_rxcnt; + uint32_t rxcnt; /** * @brief Receive pointer or @p NULL. */ - void *spd_rxptr; + void *rxptr; /** * @brief Number of bytes yet to be transmitted. */ - uint32_t spd_txcnt; + uint32_t txcnt; /** * @brief Transmit pointer or @p NULL. */ - const void *spd_txptr; + const void *txptr; }; /*===========================================================================*/ diff --git a/os/hal/platforms/LPC214x/spi_lld.c b/os/hal/platforms/LPC214x/spi_lld.c index f920ecf87..808ede590 100644 --- a/os/hal/platforms/LPC214x/spi_lld.c +++ b/os/hal/platforms/LPC214x/spi_lld.c @@ -53,21 +53,21 @@ SPIDriver SPID1; * @param[in] spip pointer to the @p SPIDriver object */ static void ssp_fifo_preload(SPIDriver *spip) { - SSP *ssp = spip->spd_ssp; - uint32_t n = spip->spd_txcnt > LPC214x_SSP_FIFO_DEPTH ? - LPC214x_SSP_FIFO_DEPTH : spip->spd_txcnt; + SSP *ssp = spip->ssp; + uint32_t n = spip->txcnt > LPC214x_SSP_FIFO_DEPTH ? + LPC214x_SSP_FIFO_DEPTH : spip->txcnt; while(((ssp->SSP_SR & SR_TNF) != 0) && (n > 0)) { - if (spip->spd_txptr != NULL) { + if (spip->txptr != NULL) { if ((ssp->SSP_CR0 & CR0_DSSMASK) > CR0_DSS8BIT) - ssp->SSP_DR = *(uint16_t *)spip->spd_txptr++; + ssp->SSP_DR = *(uint16_t *)spip->txptr++; else - ssp->SSP_DR = *(uint8_t *)spip->spd_txptr++; + ssp->SSP_DR = *(uint8_t *)spip->txptr++; } else ssp->SSP_DR = 0xFFFFFFFF; n--; - spip->spd_txcnt--; + spip->txcnt--; } } @@ -80,7 +80,7 @@ __attribute__((noinline)) * @param[in] spip pointer to the @p SPIDriver object */ static void serve_interrupt(SPIDriver *spip) { - SSP *ssp = spip->spd_ssp; + SSP *ssp = spip->ssp; if ((ssp->SSP_MIS & MIS_ROR) != 0) { /* The overflow condition should never happen because priority is given @@ -89,16 +89,16 @@ static void serve_interrupt(SPIDriver *spip) { } ssp->SSP_ICR = ICR_RT | ICR_ROR; while ((ssp->SSP_SR & SR_RNE) != 0) { - if (spip->spd_rxptr != NULL) { + if (spip->rxptr != NULL) { if ((ssp->SSP_CR0 & CR0_DSSMASK) > CR0_DSS8BIT) - *(uint16_t *)spip->spd_rxptr++ = ssp->SSP_DR; + *(uint16_t *)spip->rxptr++ = ssp->SSP_DR; else - *(uint8_t *)spip->spd_rxptr++ = ssp->SSP_DR; + *(uint8_t *)spip->rxptr++ = ssp->SSP_DR; } else (void)ssp->SSP_DR; - if (--spip->spd_rxcnt == 0) { - chDbgAssert(spip->spd_txcnt == 0, + if (--spip->rxcnt == 0) { + chDbgAssert(spip->txcnt == 0, "spi_serve_interrupt(), #1", "counter out of synch"); /* Stops the IRQ sources.*/ ssp->SSP_IMSC = 0; @@ -109,7 +109,7 @@ static void serve_interrupt(SPIDriver *spip) { } } ssp_fifo_preload(spip); - if (spip->spd_txcnt == 0) + if (spip->txcnt == 0) ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_RX; } @@ -147,7 +147,7 @@ void spi_lld_init(void) { #if LPC214x_SPI_USE_SSP spiObjectInit(&SPID1); - SPID1.spd_ssp = SSPBase; + SPID1.ssp = SSPBase; SetVICVector(SPI1IrqHandler, LPC214x_SPI_SSP_IRQ_PRIORITY, SOURCE_SPI1); #endif } @@ -161,7 +161,7 @@ void spi_lld_init(void) { */ void spi_lld_start(SPIDriver *spip) { - if (spip->spd_state == SPI_STOP) { + if (spip->state == SPI_STOP) { /* Clock activation.*/ #if LPC214x_SPI_USE_SSP if (&SPID1 == spip) { @@ -171,14 +171,14 @@ void spi_lld_start(SPIDriver *spip) { #endif } /* Configuration.*/ - spip->spd_ssp->SSP_CR1 = 0; + spip->ssp->SSP_CR1 = 0; /* Emptying the receive FIFO, it happens to not be empty while debugging.*/ - while (spip->spd_ssp->SSP_SR & SR_RNE) - (void) spip->spd_ssp->SSP_DR; - spip->spd_ssp->SSP_ICR = ICR_RT | ICR_ROR; - spip->spd_ssp->SSP_CR0 = spip->spd_config->spc_cr0; - spip->spd_ssp->SSP_CPSR = spip->spd_config->spc_cpsr; - spip->spd_ssp->SSP_CR1 = CR1_SSE; + while (spip->ssp->SSP_SR & SR_RNE) + (void) spip->ssp->SSP_DR; + spip->ssp->SSP_ICR = ICR_RT | ICR_ROR; + spip->ssp->SSP_CR0 = spip->config->cr0; + spip->ssp->SSP_CPSR = spip->config->cpsr; + spip->ssp->SSP_CR1 = CR1_SSE; } /** @@ -190,10 +190,10 @@ void spi_lld_start(SPIDriver *spip) { */ void spi_lld_stop(SPIDriver *spip) { - if (spip->spd_state != SPI_STOP) { - spip->spd_ssp->SSP_CR1 = 0; - spip->spd_ssp->SSP_CR0 = 0; - spip->spd_ssp->SSP_CPSR = 0; + if (spip->state != SPI_STOP) { + spip->ssp->SSP_CR1 = 0; + spip->ssp->SSP_CR0 = 0; + spip->ssp->SSP_CPSR = 0; #if LPC214x_SPI_USE_SSP if (&SPID1 == spip) { PCONP = (PCONP & PCALL) & ~PCSPI1; @@ -212,7 +212,7 @@ void spi_lld_stop(SPIDriver *spip) { */ void spi_lld_select(SPIDriver *spip) { - palClearPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palClearPad(spip->config->ssport, spip->config->sspad); } /** @@ -225,7 +225,7 @@ void spi_lld_select(SPIDriver *spip) { */ void spi_lld_unselect(SPIDriver *spip) { - palSetPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palSetPad(spip->config->ssport, spip->config->sspad); } /** @@ -241,11 +241,11 @@ void spi_lld_unselect(SPIDriver *spip) { */ void spi_lld_ignore(SPIDriver *spip, size_t n) { - spip->spd_rxptr = NULL; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -266,11 +266,11 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -288,11 +288,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { - spip->spd_rxptr = NULL; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -310,11 +310,11 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; ssp_fifo_preload(spip); - spip->spd_ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; + spip->ssp->SSP_IMSC = IMSC_ROR | IMSC_RT | IMSC_TX | IMSC_RX; } /** @@ -331,10 +331,10 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { */ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { - spip->spd_ssp->SSP_DR = (uint32_t)frame; - while ((spip->spd_ssp->SSP_SR & SR_RNE) == 0) + spip->ssp->SSP_DR = (uint32_t)frame; + while ((spip->ssp->SSP_SR & SR_RNE) == 0) ; - return (uint16_t)spip->spd_ssp->SSP_DR; + return (uint16_t)spip->ssp->SSP_DR; } #endif /* HAL_USE_SPI */ diff --git a/os/hal/platforms/LPC214x/spi_lld.h b/os/hal/platforms/LPC214x/spi_lld.h index 0e9a3e782..f2d954e46 100644 --- a/os/hal/platforms/LPC214x/spi_lld.h +++ b/os/hal/platforms/LPC214x/spi_lld.h @@ -99,24 +99,24 @@ typedef struct { /** * @brief Operation complete callback or @p NULL. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief The chip select line port. */ - ioportid_t spc_ssport; + ioportid_t ssport; /** * @brief The chip select line pad number. */ - uint16_t spc_sspad; + uint16_t sspad; /** * @brief SSP CR0 initialization data. */ - uint16_t spc_cr0; + uint16_t cr0; /** * @brief SSP CPSR initialization data. */ - uint32_t spc_cpsr; + uint32_t cpsr; } SPIConfig; /** @@ -126,25 +126,25 @@ struct SPIDriver { /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) @@ -154,23 +154,23 @@ struct SPIDriver { /** * @brief Pointer to the SSP registers block. */ - SSP *spd_ssp; + SSP *ssp; /** * @brief Number of bytes yet to be received. */ - uint32_t spd_rxcnt; + uint32_t rxcnt; /** * @brief Receive pointer or @p NULL. */ - void *spd_rxptr; + void *rxptr; /** * @brief Number of bytes yet to be transmitted. */ - uint32_t spd_txcnt; + uint32_t txcnt; /** * @brief Transmit pointer or @p NULL. */ - const void *spd_txptr; + const void *txptr; }; /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index d8822e0ab..bbe8051d4 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -95,9 +95,9 @@ void adc_lld_init(void) { #if STM32_ADC_USE_ADC1 /* Driver initialization.*/ adcObjectInit(&ADCD1); - ADCD1.ad_adc = ADC1; - ADCD1.ad_dmachp = STM32_DMA1_CH1; - ADCD1.ad_dmaccr = (STM32_ADC_ADC1_DMA_PRIORITY << 12) | + ADCD1.adc = ADC1; + ADCD1.dmachp = STM32_DMA1_CH1; + ADCD1.dmaccr = (STM32_ADC_ADC1_DMA_PRIORITY << 12) | DMA_CCR1_EN | DMA_CCR1_MSIZE_0 | DMA_CCR1_PSIZE_0 | DMA_CCR1_MINC | DMA_CCR1_TCIE | DMA_CCR1_TEIE; @@ -132,21 +132,21 @@ void adc_lld_init(void) { void adc_lld_start(ADCDriver *adcp) { /* If in stopped state then enables the ADC and DMA clocks.*/ - if (adcp->ad_state == ADC_STOP) { + if (adcp->state == ADC_STOP) { #if STM32_ADC_USE_ADC1 if (&ADCD1 == adcp) { dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ NVICEnableVector(DMA1_Channel1_IRQn, CORTEX_PRIORITY_MASK(STM32_ADC_ADC1_IRQ_PRIORITY)); - dmaChannelSetPeripheral(adcp->ad_dmachp, &ADC1->DR); + dmaChannelSetPeripheral(adcp->dmachp, &ADC1->DR); RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; } #endif /* ADC setup, the calibration procedure has already been performed during initialization.*/ - adcp->ad_adc->CR1 = ADC_CR1_SCAN; - adcp->ad_adc->CR2 = 0; + adcp->adc->CR1 = ADC_CR1_SCAN; + adcp->adc->CR2 = 0; } } @@ -160,7 +160,7 @@ void adc_lld_start(ADCDriver *adcp) { void adc_lld_stop(ADCDriver *adcp) { /* If in ready state then disables the ADC clock.*/ - if (adcp->ad_state == ADC_READY) { + if (adcp->state == ADC_READY) { #if STM32_ADC_USE_ADC1 if (&ADCD1 == adcp) { ADC1->CR1 = 0; @@ -182,34 +182,34 @@ void adc_lld_stop(ADCDriver *adcp) { */ void adc_lld_start_conversion(ADCDriver *adcp) { uint32_t ccr, n; - const ADCConversionGroup *grpp = adcp->ad_grpp; + const ADCConversionGroup *grpp = adcp->grpp; /* DMA setup.*/ - ccr = adcp->ad_dmaccr; - if (grpp->acg_circular) + ccr = adcp->dmaccr; + if (grpp->circular) ccr |= DMA_CCR1_CIRC; - if (adcp->ad_depth > 1) { + if (adcp->depth > 1) { /* If the buffer depth is greater than one then the half transfer interrupt interrupt is enabled in order to allows streaming processing.*/ ccr |= DMA_CCR1_HTIE; - n = (uint32_t)grpp->acg_num_channels * (uint32_t)adcp->ad_depth; + n = (uint32_t)grpp->num_channels * (uint32_t)adcp->depth; } else - n = (uint32_t)grpp->acg_num_channels; - dmaChannelSetup(adcp->ad_dmachp, n, adcp->ad_samples, ccr); + n = (uint32_t)grpp->num_channels; + dmaChannelSetup(adcp->dmachp, n, adcp->samples, ccr); /* ADC setup.*/ - adcp->ad_adc->CR1 = grpp->acg_cr1 | ADC_CR1_SCAN; - adcp->ad_adc->CR2 = grpp->acg_cr2 | ADC_CR2_DMA | + adcp->adc->CR1 = grpp->cr1 | ADC_CR1_SCAN; + adcp->adc->CR2 = grpp->cr2 | ADC_CR2_DMA | ADC_CR2_CONT | ADC_CR2_ADON; - adcp->ad_adc->SMPR1 = grpp->acg_smpr1; - adcp->ad_adc->SMPR2 = grpp->acg_smpr2; - adcp->ad_adc->SQR1 = grpp->acg_sqr1; - adcp->ad_adc->SQR2 = grpp->acg_sqr2; - adcp->ad_adc->SQR3 = grpp->acg_sqr3; + adcp->adc->SMPR1 = grpp->smpr1; + adcp->adc->SMPR2 = grpp->smpr2; + adcp->adc->SQR1 = grpp->sqr1; + adcp->adc->SQR2 = grpp->sqr2; + adcp->adc->SQR3 = grpp->sqr3; /* ADC start by writing ADC_CR2_ADON a second time.*/ - adcp->ad_adc->CR2 = grpp->acg_cr2 | ADC_CR2_DMA | + adcp->adc->CR2 = grpp->cr2 | ADC_CR2_DMA | ADC_CR2_CONT | ADC_CR2_ADON; } @@ -222,8 +222,8 @@ void adc_lld_start_conversion(ADCDriver *adcp) { */ void adc_lld_stop_conversion(ADCDriver *adcp) { - dmaChannelDisable(adcp->ad_dmachp); - adcp->ad_adc->CR2 = 0; + dmaChannelDisable(adcp->dmachp); + adcp->adc->CR2 = 0; } #endif /* HAL_USE_ADC */ diff --git a/os/hal/platforms/STM32/adc_lld.h b/os/hal/platforms/STM32/adc_lld.h index 876560fca..8f01607d8 100644 --- a/os/hal/platforms/STM32/adc_lld.h +++ b/os/hal/platforms/STM32/adc_lld.h @@ -94,8 +94,8 @@ /** * @brief ADC1 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. + * @note The default action for DMA errors is a system halt because DMA + * error can only happen because programming errors. */ #if !defined(STM32_ADC1_DMA_ERROR_HOOK) || defined(__DOXYGEN__) #define STM32_ADC1_DMA_ERROR_HOOK() chSysHalt() @@ -154,56 +154,56 @@ typedef struct { /** * @brief Enables the circular buffer mode for the group. */ - bool_t acg_circular; + bool_t circular; /** * @brief Number of the analog channels belonging to the conversion group. */ - adc_channels_num_t acg_num_channels; + adc_channels_num_t num_channels; /** * @brief Callback function associated to the group or @p NULL. */ - adccallback_t acg_endcb; + adccallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief ADC CR1 register initialization data. * @note All the required bits must be defined into this field except * @p ADC_CR1_SCAN that is enforced inside the driver. */ - uint32_t acg_cr1; + uint32_t cr1; /** * @brief ADC CR2 register initialization data. * @note All the required bits must be defined into this field except * @p ADC_CR2_DMA, @p ADC_CR2_CONT and @p ADC_CR2_ADON that are * enforced inside the driver. */ - uint32_t acg_cr2; + uint32_t cr2; /** * @brief ADC SMPR1 register initialization data. * @details In this field must be specified the sample times for channels * 10...17. */ - uint32_t acg_smpr1; + uint32_t smpr1; /** * @brief ADC SMPR2 register initialization data. * @details In this field must be specified the sample times for channels * 0...9. */ - uint32_t acg_smpr2; + uint32_t smpr2; /** * @brief ADC SQR1 register initialization data. * @details Conversion group sequence 13...16 + sequence length. */ - uint32_t acg_sqr1; + uint32_t sqr1; /** * @brief ADC SQR2 register initialization data. * @details Conversion group sequence 7...12. */ - uint32_t acg_sqr2; + uint32_t sqr2; /** * @brief ADC SQR3 register initialization data. * @details Conversion group sequence 0...6. */ - uint32_t acg_sqr3; + uint32_t sqr3; } ADCConversionGroup; /** @@ -221,37 +221,37 @@ struct ADCDriver { /** * @brief Driver state. */ - adcstate_t ad_state; + adcstate_t state; /** * @brief Current configuration data. */ - const ADCConfig *ad_config; + const ADCConfig *config; /** * @brief Current samples buffer pointer or @p NULL. */ - adcsample_t *ad_samples; + adcsample_t *samples; /** * @brief Current samples buffer depth or @p 0. */ - size_t ad_depth; + size_t depth; /** * @brief Current conversion group pointer or @p NULL. */ - const ADCConversionGroup *ad_grpp; + const ADCConversionGroup *grpp; #if ADC_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *ad_thread; + Thread *thread; #endif #if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the peripheral. */ - Mutex ad_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore ad_semaphore; + Semaphore semaphore; #endif #endif /* ADC_USE_MUTUAL_EXCLUSION */ #if defined(ADC_DRIVER_EXT_FIELDS) @@ -261,15 +261,15 @@ struct ADCDriver { /** * @brief Pointer to the ADCx registers block. */ - ADC_TypeDef *ad_adc; + ADC_TypeDef *adc; /** * @brief Pointer to the DMA registers block. */ - stm32_dma_channel_t *ad_dmachp; + stm32_dma_channel_t *dmachp; /** * @brief DMA CCR register bit mask. */ - uint32_t ad_dmaccr; + uint32_t dmaccr; }; /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/can_lld.c b/os/hal/platforms/STM32/can_lld.c index 5dc7dc572..594471482 100644 --- a/os/hal/platforms/STM32/can_lld.c +++ b/os/hal/platforms/STM32/can_lld.c @@ -63,9 +63,9 @@ CH_IRQ_HANDLER(CAN1_TX_IRQHandler) { /* No more events until a message is transmitted.*/ CAN1->TSR = CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2; chSysLockFromIsr(); - while (chSemGetCounterI(&CAND1.cd_txsem) < 0) - chSemSignalI(&CAND1.cd_txsem); - chEvtBroadcastI(&CAND1.cd_txempty_event); + while (chSemGetCounterI(&CAND1.txsem) < 0) + chSemSignalI(&CAND1.txsem); + chEvtBroadcastI(&CAND1.txempty_event); chSysUnlockFromIsr(); CH_IRQ_EPILOGUE(); @@ -86,9 +86,9 @@ CH_IRQ_HANDLER(CAN1_RX0_IRQHandler) { /* No more receive events until the queue 0 has been emptied.*/ CAN1->IER &= ~CAN_IER_FMPIE0; chSysLockFromIsr(); - while (chSemGetCounterI(&CAND1.cd_rxsem) < 0) - chSemSignalI(&CAND1.cd_rxsem); - chEvtBroadcastI(&CAND1.cd_rxfull_event); + while (chSemGetCounterI(&CAND1.rxsem) < 0) + chSemSignalI(&CAND1.rxsem); + chEvtBroadcastI(&CAND1.rxfull_event); chSysUnlockFromIsr(); } if ((rf0r & CAN_RF0R_FOVR0) > 0) { @@ -96,7 +96,7 @@ CH_IRQ_HANDLER(CAN1_RX0_IRQHandler) { CAN1->RF0R = CAN_RF0R_FOVR0; canAddFlagsI(&CAND1, CAN_OVERFLOW_ERROR); chSysLockFromIsr(); - chEvtBroadcastI(&CAND1.cd_error_event); + chEvtBroadcastI(&CAND1.error_event); chSysUnlockFromIsr(); } @@ -132,7 +132,7 @@ CH_IRQ_HANDLER(CAN1_SCE_IRQHandler) { /* Wakeup event.*/ if (msr & CAN_MSR_WKUI) { chSysLockFromIsr(); - chEvtBroadcastI(&CAND1.cd_wakeup_event); + chEvtBroadcastI(&CAND1.wakeup_event); chSysUnlockFromIsr(); } /* Error event.*/ @@ -146,7 +146,7 @@ CH_IRQ_HANDLER(CAN1_SCE_IRQHandler) { flags |= CAN_FRAMING_ERROR; chSysLockFromIsr(); canAddFlagsI(&CAND1, flags | (canstatus_t)(flags < 16)); - chEvtBroadcastI(&CAND1.cd_error_event); + chEvtBroadcastI(&CAND1.error_event); chSysUnlockFromIsr(); } @@ -167,7 +167,7 @@ void can_lld_init(void) { #if STM32_CAN_USE_CAN1 /* Driver initialization.*/ canObjectInit(&CAND1); - CAND1.cd_can = CAN1; + CAND1.can = CAN1; #endif } @@ -196,37 +196,37 @@ void can_lld_start(CANDriver *canp) { #endif /* Entering initialization mode. */ - canp->cd_state = CAN_STARTING; - canp->cd_can->MCR = CAN_MCR_INRQ; - while ((canp->cd_can->MSR & CAN_MSR_INAK) == 0) + canp->state = CAN_STARTING; + canp->can->MCR = CAN_MCR_INRQ; + while ((canp->can->MSR & CAN_MSR_INAK) == 0) chThdSleepS(1); /* BTR initialization.*/ - canp->cd_can->BTR = canp->cd_config->cc_btr; + canp->can->BTR = canp->config->btr; /* MCR initialization.*/ - canp->cd_can->MCR = canp->cd_config->cc_mcr; + canp->can->MCR = canp->config->mcr; /* Filters initialization.*/ - canp->cd_can->FMR |= CAN_FMR_FINIT; - if (canp->cd_config->cc_num > 0) { + canp->can->FMR |= CAN_FMR_FINIT; + if (canp->config->num > 0) { uint32_t i, fmask; CAN_FilterRegister_TypeDef *cfp; - canp->cd_can->FA1R = 0; - canp->cd_can->FM1R = 0; - canp->cd_can->FS1R = 0; - canp->cd_can->FFA1R = 0; - cfp = canp->cd_can->sFilterRegister; + canp->can->FA1R = 0; + canp->can->FM1R = 0; + canp->can->FS1R = 0; + canp->can->FFA1R = 0; + cfp = canp->can->sFilterRegister; fmask = 1; for (i = 0; i < CAN_MAX_FILTERS; i++) { - if (i < canp->cd_config->cc_num) { - if (canp->cd_config->cc_filters[i].cf_mode) - canp->cd_can->FM1R |= fmask; - if (canp->cd_config->cc_filters[i].cf_scale) - canp->cd_can->FS1R |= fmask; - if (canp->cd_config->cc_filters[i].cf_assignment) - canp->cd_can->FFA1R |= fmask; - cfp->FR1 = canp->cd_config->cc_filters[i].cf_register1; - cfp->FR2 = canp->cd_config->cc_filters[i].cf_register2; - canp->cd_can->FA1R |= fmask; + if (i < canp->config->num) { + if (canp->config->filters[i].mode) + canp->can->FM1R |= fmask; + if (canp->config->filters[i].scale) + canp->can->FS1R |= fmask; + if (canp->config->filters[i].assignment) + canp->can->FFA1R |= fmask; + cfp->FR1 = canp->config->filters[i].register1; + cfp->FR2 = canp->config->filters[i].register2; + canp->can->FA1R |= fmask; } else { cfp->FR1 = 0; @@ -241,16 +241,16 @@ void can_lld_start(CANDriver *canp) { } else { /* Setup a default filter.*/ - canp->cd_can->sFilterRegister[0].FR1 = 0; - canp->cd_can->sFilterRegister[0].FR2 = 0; - canp->cd_can->FM1R = 0; - canp->cd_can->FFA1R = 0; - canp->cd_can->FS1R = 1; - canp->cd_can->FA1R = 1; + canp->can->sFilterRegister[0].FR1 = 0; + canp->can->sFilterRegister[0].FR2 = 0; + canp->can->FM1R = 0; + canp->can->FFA1R = 0; + canp->can->FS1R = 1; + canp->can->FA1R = 1; } - canp->cd_can->FMR &= ~CAN_FMR_FINIT; + canp->can->FMR &= ~CAN_FMR_FINIT; /* Interrupt sources initialization.*/ - canp->cd_can->IER = CAN_IER_TMEIE | CAN_IER_FMPIE0 | CAN_IER_FMPIE1 | + canp->can->IER = CAN_IER_TMEIE | CAN_IER_FMPIE0 | CAN_IER_FMPIE1 | CAN_IER_WKUIE | CAN_IER_ERRIE | CAN_IER_LECIE | CAN_IER_BOFIE | CAN_IER_EPVIE | CAN_IER_EWGIE | CAN_IER_FOVIE0 | CAN_IER_FOVIE1; @@ -266,7 +266,7 @@ void can_lld_start(CANDriver *canp) { void can_lld_stop(CANDriver *canp) { /* If in ready state then disables the CAN peripheral.*/ - if (canp->cd_state == CAN_READY) { + if (canp->state == CAN_READY) { #if STM32_CAN_USE_CAN1 if (&CAND1 == canp) { CAN1->MCR = 0x00010002; /* Register reset value. */ @@ -294,7 +294,7 @@ void can_lld_stop(CANDriver *canp) { */ bool_t can_lld_can_transmit(CANDriver *canp) { - return (canp->cd_can->TSR & CAN_TSR_TME) != 0; + return (canp->can->TSR & CAN_TSR_TME) != 0; } /** @@ -310,18 +310,18 @@ void can_lld_transmit(CANDriver *canp, const CANTxFrame *ctfp) { CAN_TxMailBox_TypeDef *tmbp; /* Pointer to a free transmission mailbox.*/ - tmbp = &canp->cd_can->sTxMailBox[(canp->cd_can->TSR & CAN_TSR_CODE) >> 24]; + tmbp = &canp->can->sTxMailBox[(canp->can->TSR & CAN_TSR_CODE) >> 24]; /* Preparing the message.*/ - if (ctfp->cf_IDE) - tir = ((uint32_t)ctfp->cf_EID << 3) | ((uint32_t)ctfp->cf_RTR << 1) | + if (ctfp->IDE) + tir = ((uint32_t)ctfp->EID << 3) | ((uint32_t)ctfp->RTR << 1) | CAN_TI0R_IDE; else - tir = ((uint32_t)ctfp->cf_SID << 21) | ((uint32_t)ctfp->cf_RTR << 1); - tmbp->TDTR = ctfp->cf_DLC; - tmbp->TDLR = ctfp->cf_data32[0]; - tmbp->TDHR = ctfp->cf_data32[1]; - tmbp->TIR = tir | CAN_TI0R_TXRQ; + tir = ((uint32_t)ctfp->SID << 21) | ((uint32_t)ctfp->RTR << 1); + tmbp->TDTR = ctfp->DLC; + tmbp->TDLR = ctfp->data32[0]; + tmbp->TDHR = ctfp->data32[1]; + tmbp->TIR = tir | CAN_TI0R_TXRQ; } /** @@ -337,7 +337,7 @@ void can_lld_transmit(CANDriver *canp, const CANTxFrame *ctfp) { */ bool_t can_lld_can_receive(CANDriver *canp) { - return (canp->cd_can->RF0R & CAN_RF0R_FMP0) > 0; + return (canp->can->RF0R & CAN_RF0R_FMP0) > 0; } /** @@ -352,27 +352,27 @@ void can_lld_receive(CANDriver *canp, CANRxFrame *crfp) { uint32_t r; /* Fetches the message.*/ - r = canp->cd_can->sFIFOMailBox[0].RIR; - crfp->cf_RTR = (r & CAN_RI0R_RTR) >> 1; - crfp->cf_IDE = (r & CAN_RI0R_IDE) >> 2; - if (crfp->cf_IDE) - crfp->cf_EID = r >> 3; + r = canp->can->sFIFOMailBox[0].RIR; + crfp->RTR = (r & CAN_RI0R_RTR) >> 1; + crfp->IDE = (r & CAN_RI0R_IDE) >> 2; + if (crfp->IDE) + crfp->EID = r >> 3; else - crfp->cf_SID = r >> 21; - r = canp->cd_can->sFIFOMailBox[0].RDTR; - crfp->cf_DLC = r & CAN_RDT0R_DLC; - crfp->cf_FMI = (uint8_t)(r >> 8); - crfp->cf_TIME = (uint16_t)(r >> 16); - crfp->cf_data32[0] = canp->cd_can->sFIFOMailBox[0].RDLR; - crfp->cf_data32[1] = canp->cd_can->sFIFOMailBox[0].RDHR; + crfp->SID = r >> 21; + r = canp->can->sFIFOMailBox[0].RDTR; + crfp->DLC = r & CAN_RDT0R_DLC; + crfp->FMI = (uint8_t)(r >> 8); + crfp->TIME = (uint16_t)(r >> 16); + crfp->data32[0] = canp->can->sFIFOMailBox[0].RDLR; + crfp->data32[1] = canp->can->sFIFOMailBox[0].RDHR; /* Releases the mailbox.*/ - canp->cd_can->RF0R = CAN_RF0R_RFOM0; + canp->can->RF0R = CAN_RF0R_RFOM0; /* If the queue is empty re-enables the interrupt in order to generate events again.*/ - if ((canp->cd_can->RF0R & CAN_RF0R_FMP0) == 0) - canp->cd_can->IER |= CAN_IER_FMPIE0; + if ((canp->can->RF0R & CAN_RF0R_FMP0) == 0) + canp->can->IER |= CAN_IER_FMPIE0; } #if CAN_USE_SLEEP_MODE || defined(__DOXYGEN__) @@ -385,7 +385,7 @@ void can_lld_receive(CANDriver *canp, CANRxFrame *crfp) { */ void can_lld_sleep(CANDriver *canp) { - canp->cd_can->MCR |= CAN_MCR_SLEEP; + canp->can->MCR |= CAN_MCR_SLEEP; } /** @@ -397,7 +397,7 @@ void can_lld_sleep(CANDriver *canp) { */ void can_lld_wakeup(CANDriver *canp) { - canp->cd_can->MCR &= ~CAN_MCR_SLEEP; + canp->can->MCR &= ~CAN_MCR_SLEEP; } #endif /* CAN_USE_SLEEP_MODE */ diff --git a/os/hal/platforms/STM32/can_lld.h b/os/hal/platforms/STM32/can_lld.h index 0d4c9b615..2e82c45e3 100644 --- a/os/hal/platforms/STM32/can_lld.h +++ b/os/hal/platforms/STM32/can_lld.h @@ -121,22 +121,22 @@ typedef uint32_t canstatus_t; */ typedef struct { struct { - uint8_t cf_DLC:4; /**< @brief Data length. */ - uint8_t cf_RTR:1; /**< @brief Frame type. */ - uint8_t cf_IDE:1; /**< @brief Identifier type. */ + uint8_t DLC:4; /**< @brief Data length. */ + uint8_t RTR:1; /**< @brief Frame type. */ + uint8_t IDE:1; /**< @brief Identifier type. */ }; union { struct { - uint32_t cf_SID:11; /**< @brief Standard identifier.*/ + uint32_t SID:11; /**< @brief Standard identifier.*/ }; struct { - uint32_t cf_EID:29; /**< @brief Extended identifier.*/ + uint32_t EID:29; /**< @brief Extended identifier.*/ }; }; union { - uint8_t cf_data8[8]; /**< @brief Frame data. */ - uint16_t cf_data16[4]; /**< @brief Frame data. */ - uint32_t cf_data32[2]; /**< @brief Frame data. */ + uint8_t data8[8]; /**< @brief Frame data. */ + uint16_t data16[4]; /**< @brief Frame data. */ + uint32_t data32[2]; /**< @brief Frame data. */ }; } CANTxFrame; @@ -147,26 +147,26 @@ typedef struct { */ typedef struct { struct { - uint8_t cf_FMI; /**< @brief Filter id. */ - uint16_t cf_TIME; /**< @brief Time stamp. */ + uint8_t FMI; /**< @brief Filter id. */ + uint16_t TIME; /**< @brief Time stamp. */ }; struct { - uint8_t cf_DLC:4; /**< @brief Data length. */ - uint8_t cf_RTR:1; /**< @brief Frame type. */ - uint8_t cf_IDE:1; /**< @brief Identifier type. */ + uint8_t DLC:4; /**< @brief Data length. */ + uint8_t RTR:1; /**< @brief Frame type. */ + uint8_t IDE:1; /**< @brief Identifier type. */ }; union { struct { - uint32_t cf_SID:11; /**< @brief Standard identifier.*/ + uint32_t SID:11; /**< @brief Standard identifier.*/ }; struct { - uint32_t cf_EID:29; /**< @brief Extended identifier.*/ + uint32_t EID:29; /**< @brief Extended identifier.*/ }; }; union { - uint8_t cf_data8[8]; /**< @brief Frame data. */ - uint16_t cf_data16[4]; /**< @brief Frame data. */ - uint32_t cf_data32[2]; /**< @brief Frame data. */ + uint8_t data8[8]; /**< @brief Frame data. */ + uint16_t data16[4]; /**< @brief Frame data. */ + uint32_t data32[2]; /**< @brief Frame data. */ }; } CANRxFrame; @@ -180,27 +180,27 @@ typedef struct { * @note This bit represent the CAN_FM1R register bit associated to this * filter (0=mask mode, 1=list mode). */ - uint32_t cf_mode:1; + uint32_t mode:1; /** * @brief Filter sclae. * @note This bit represent the CAN_FS1R register bit associated to this * filter (0=16 bits mode, 1=32 bits mode). */ - uint32_t cf_scale:1; + uint32_t scale:1; /** * @brief Filter mode. * @note This bit represent the CAN_FFA1R register bit associated to this * filter, must be set to zero in this version of the driver. */ - uint32_t cf_assignment:1; + uint32_t assignment:1; /** * @brief Filter register 1 (identifier). */ - uint32_t cf_register1; + uint32_t register1; /** - * @brief Filter register 2 (mask/identifier depending on cf_mode=0/1). + * @brief Filter register 2 (mask/identifier depending on mode=0/1). */ - uint32_t cf_register2; + uint32_t register2; } CANFilter; /** @@ -212,25 +212,25 @@ typedef struct { * @note Some bits in this register are enforced by the driver regardless * their status in this field. */ - uint32_t cc_mcr; + uint32_t mcr; /** * @brief CAN BTR register initialization data. * @note Some bits in this register are enforced by the driver regardless * their status in this field. */ - uint32_t cc_btr; + uint32_t btr; /** * @brief Number of elements into the filters array. * @note By setting this field to zero a default filter is enabled that * allows all frames, this should be adequate for simple applications. */ - uint32_t cc_num; + uint32_t num; /** * @brief Pointer to an array of @p CANFilter structures. - * @note This field can be set to @p NULL if the field @p cc_num is set to + * @note This field can be set to @p NULL if the field @p num is set to * zero. */ - const CANFilter *cc_filters; + const CANFilter *filters; } CANConfig; /** @@ -240,19 +240,19 @@ typedef struct { /** * @brief Driver state. */ - canstate_t cd_state; + canstate_t state; /** * @brief Current configuration data. */ - const CANConfig *cd_config; + const CANConfig *config; /** * @brief Transmission queue semaphore. */ - Semaphore cd_txsem; + Semaphore txsem; /** * @brief Receive queue semaphore. */ - Semaphore cd_rxsem; + Semaphore rxsem; /** * @brief One or more frames become available. * @note After broadcasting this event it will not be broadcasted again @@ -262,34 +262,34 @@ typedef struct { * invoking @p chReceive() when listening to this event. This behavior * minimizes the interrupt served by the system because CAN traffic. */ - EventSource cd_rxfull_event; + EventSource rxfull_event; /** * @brief One or more transmission slots become available. */ - EventSource cd_txempty_event; + EventSource txempty_event; /** * @brief A CAN bus error happened. */ - EventSource cd_error_event; + EventSource error_event; /** * @brief Error flags set when an error event is broadcasted. */ - canstatus_t cd_status; + canstatus_t status; #if CAN_USE_SLEEP_MODE || defined (__DOXYGEN__) /** * @brief Entering sleep state event. */ - EventSource cd_sleep_event; + EventSource sleep_event; /** * @brief Exiting sleep state event. */ - EventSource cd_wakeup_event; + EventSource wakeup_event; #endif /* CAN_USE_SLEEP_MODE */ /* End of the mandatory fields.*/ /** * @brief Pointer to the CAN registers. */ - CAN_TypeDef *cd_can; + CAN_TypeDef *can; } CANDriver; /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index a101b284a..6a5b210df 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -107,20 +107,20 @@ PWMDriver PWMD5; static void serve_interrupt(PWMDriver *pwmp) { uint16_t sr; - sr = pwmp->pd_tim->SR; - sr &= pwmp->pd_tim->DIER; - pwmp->pd_tim->SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | + sr = pwmp->tim->SR; + sr &= pwmp->tim->DIER; + pwmp->tim->SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | TIM_SR_CC4IF | TIM_SR_UIF); if ((sr & TIM_SR_CC1IF) != 0) - pwmp->pd_config->pc_channels[0].pcc_callback(pwmp); + pwmp->config->channels[0].callback(pwmp); if ((sr & TIM_SR_CC2IF) != 0) - pwmp->pd_config->pc_channels[1].pcc_callback(pwmp); + pwmp->config->channels[1].callback(pwmp); if ((sr & TIM_SR_CC3IF) != 0) - pwmp->pd_config->pc_channels[2].pcc_callback(pwmp); + pwmp->config->channels[2].callback(pwmp); if ((sr & TIM_SR_CC4IF) != 0) - pwmp->pd_config->pc_channels[3].pcc_callback(pwmp); + pwmp->config->channels[3].callback(pwmp); if ((sr & TIM_SR_UIF) != 0) - pwmp->pd_config->pc_callback(pwmp); + pwmp->config->callback(pwmp); } #endif /* STM32_PWM_USE_TIM2 || ... || STM32_PWM_USE_TIM5 */ @@ -142,7 +142,7 @@ CH_IRQ_HANDLER(TIM1_UP_IRQHandler) { CH_IRQ_PROLOGUE(); TIM1->SR = ~TIM_SR_UIF; - PWMD1.pd_config->pc_callback(&PWMD1); + PWMD1.config->callback(&PWMD1); CH_IRQ_EPILOGUE(); } @@ -163,13 +163,13 @@ CH_IRQ_HANDLER(TIM1_CC_IRQHandler) { sr = TIM1->SR & TIM1->DIER; TIM1->SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | TIM_SR_CC4IF); if ((sr & TIM_SR_CC1IF) != 0) - PWMD1.pd_config->pc_channels[0].pcc_callback(&PWMD1); + PWMD1.config->channels[0].callback(&PWMD1); if ((sr & TIM_SR_CC2IF) != 0) - PWMD1.pd_config->pc_channels[1].pcc_callback(&PWMD1); + PWMD1.config->channels[1].callback(&PWMD1); if ((sr & TIM_SR_CC3IF) != 0) - PWMD1.pd_config->pc_channels[2].pcc_callback(&PWMD1); + PWMD1.config->channels[2].callback(&PWMD1); if ((sr & TIM_SR_CC4IF) != 0) - PWMD1.pd_config->pc_channels[3].pcc_callback(&PWMD1); + PWMD1.config->channels[3].callback(&PWMD1); CH_IRQ_EPILOGUE(); } @@ -253,36 +253,36 @@ void pwm_lld_init(void) { #if STM32_PWM_USE_TIM1 /* Driver initialization.*/ pwmObjectInit(&PWMD1); - PWMD1.pd_enabled_channels = 0; - PWMD1.pd_tim = TIM1; + PWMD1.enabled_channels = 0; + PWMD1.tim = TIM1; #endif #if STM32_PWM_USE_TIM2 /* Driver initialization.*/ pwmObjectInit(&PWMD2); - PWMD2.pd_enabled_channels = 0; - PWMD2.pd_tim = TIM2; + PWMD2.enabled_channels = 0; + PWMD2.tim = TIM2; #endif #if STM32_PWM_USE_TIM3 /* Driver initialization.*/ pwmObjectInit(&PWMD3); - PWMD3.pd_enabled_channels = 0; - PWMD3.pd_tim = TIM3; + PWMD3.enabled_channels = 0; + PWMD3.tim = TIM3; #endif #if STM32_PWM_USE_TIM4 /* Driver initialization.*/ pwmObjectInit(&PWMD4); - PWMD4.pd_enabled_channels = 0; - PWMD4.pd_tim = TIM4; + PWMD4.enabled_channels = 0; + PWMD4.tim = TIM4; #endif #if STM32_PWM_USE_TIM5 /* Driver initialization.*/ pwmObjectInit(&PWMD5); - PWMD5.pd_enabled_channels = 0; - PWMD5.pd_tim = TIM5; + PWMD5.enabled_channels = 0; + PWMD5.tim = TIM5; #endif } @@ -297,9 +297,9 @@ void pwm_lld_start(PWMDriver *pwmp) { uint16_t ccer; /* Reset channels.*/ - pwmp->pd_enabled_channels = 0; /* All channels disabled. */ + pwmp->enabled_channels = 0; /* All channels disabled. */ - if (pwmp->pd_state == PWM_STOP) { + if (pwmp->state == PWM_STOP) { /* Clock activation and timer reset.*/ #if STM32_PWM_USE_TIM1 if (&PWMD1 == pwmp) { @@ -352,11 +352,11 @@ void pwm_lld_start(PWMDriver *pwmp) { /* All channels configured in PWM1 mode with preload enabled and will stay that way until the driver is stopped.*/ - pwmp->pd_tim->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 | + pwmp->tim->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1PE | TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2 | TIM_CCMR1_OC2PE; - pwmp->pd_tim->CCMR2 = TIM_CCMR2_OC3M_1 | TIM_CCMR2_OC3M_2 | + pwmp->tim->CCMR2 = TIM_CCMR2_OC3M_1 | TIM_CCMR2_OC3M_2 | TIM_CCMR2_OC3PE | TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4M_2 | TIM_CCMR2_OC4PE; @@ -364,23 +364,23 @@ void pwm_lld_start(PWMDriver *pwmp) { else { /* Driver re-configuration scenario, it must be stopped first.*/ /* Really required ?????????? */ - pwmp->pd_tim->CR1 = 0; /* Timer stopped. */ - pwmp->pd_tim->CR2 = 0; /* Timer stopped. */ - pwmp->pd_tim->SMCR = 0; /* Slave mode disabled. */ - pwmp->pd_tim->CCR1 = 0; /* Comparator 1 disabled. */ - pwmp->pd_tim->CCR2 = 0; /* Comparator 2 disabled. */ - pwmp->pd_tim->CCR3 = 0; /* Comparator 3 disabled. */ - pwmp->pd_tim->CCR4 = 0; /* Comparator 4 disabled. */ - pwmp->pd_tim->CNT = 0; + pwmp->tim->CR1 = 0; /* Timer stopped. */ + pwmp->tim->CR2 = 0; /* Timer stopped. */ + pwmp->tim->SMCR = 0; /* Slave mode disabled. */ + pwmp->tim->CCR1 = 0; /* Comparator 1 disabled. */ + pwmp->tim->CCR2 = 0; /* Comparator 2 disabled. */ + pwmp->tim->CCR3 = 0; /* Comparator 3 disabled. */ + pwmp->tim->CCR4 = 0; /* Comparator 4 disabled. */ + pwmp->tim->CNT = 0; } /* Timer configuration.*/ - pwmp->pd_tim->CR2 = pwmp->pd_config->pc_cr2; - pwmp->pd_tim->PSC = pwmp->pd_config->pc_psc; - pwmp->pd_tim->ARR = pwmp->pd_config->pc_arr; + pwmp->tim->CR2 = pwmp->config->cr2; + pwmp->tim->PSC = pwmp->config->psc; + pwmp->tim->ARR = pwmp->config->arr; /* Output enables and polarities setup.*/ ccer = 0; - switch (pwmp->pd_config->pc_channels[0].pcc_mode) { + switch (pwmp->config->channels[0].mode) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC1P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -388,7 +388,7 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - switch (pwmp->pd_config->pc_channels[1].pcc_mode) { + switch (pwmp->config->channels[1].mode) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC2P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -396,7 +396,7 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - switch (pwmp->pd_config->pc_channels[2].pcc_mode) { + switch (pwmp->config->channels[2].mode) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC3P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -404,7 +404,7 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - switch (pwmp->pd_config->pc_channels[3].pcc_mode) { + switch (pwmp->config->channels[3].mode) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC4P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -412,13 +412,13 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - pwmp->pd_tim->CCER = ccer; - pwmp->pd_tim->EGR = TIM_EGR_UG; /* Update event. */ - pwmp->pd_tim->SR = 0; /* Clear pending IRQs. */ - pwmp->pd_tim->DIER = pwmp->pd_config->pc_callback == NULL ? 0 : TIM_DIER_UIE; - pwmp->pd_tim->BDTR = TIM_BDTR_MOE; + pwmp->tim->CCER = ccer; + pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ + pwmp->tim->SR = 0; /* Clear pending IRQs. */ + pwmp->tim->DIER = pwmp->config->callback == NULL ? 0 : TIM_DIER_UIE; + pwmp->tim->BDTR = TIM_BDTR_MOE; /* Timer configured and started.*/ - pwmp->pd_tim->CR1 = TIM_CR1_ARPE | TIM_CR1_URS | TIM_CR1_CEN; + pwmp->tim->CR1 = TIM_CR1_ARPE | TIM_CR1_URS | TIM_CR1_CEN; } /** @@ -431,19 +431,19 @@ void pwm_lld_start(PWMDriver *pwmp) { void pwm_lld_stop(PWMDriver *pwmp) { /* If in ready state then disables the PWM clock.*/ - if (pwmp->pd_state == PWM_READY) { - pwmp->pd_enabled_channels = 0; /* All channels disabled. */ - pwmp->pd_tim->CR1 = 0; - pwmp->pd_tim->CR2 = 0; - pwmp->pd_tim->CCER = 0; /* Outputs disabled. */ - pwmp->pd_tim->CCR1 = 0; /* Comparator 1 disabled. */ - pwmp->pd_tim->CCR2 = 0; /* Comparator 2 disabled. */ - pwmp->pd_tim->CCR3 = 0; /* Comparator 3 disabled. */ - pwmp->pd_tim->CCR4 = 0; /* Comparator 4 disabled. */ - pwmp->pd_tim->BDTR = 0; - pwmp->pd_tim->DIER = 0; - pwmp->pd_tim->SR = 0; - pwmp->pd_tim->EGR = TIM_EGR_UG; /* Update event. */ + if (pwmp->state == PWM_READY) { + pwmp->enabled_channels = 0; /* All channels disabled. */ + pwmp->tim->CR1 = 0; + pwmp->tim->CR2 = 0; + pwmp->tim->CCER = 0; /* Outputs disabled. */ + pwmp->tim->CCR1 = 0; /* Comparator 1 disabled. */ + pwmp->tim->CCR2 = 0; /* Comparator 2 disabled. */ + pwmp->tim->CCR3 = 0; /* Comparator 3 disabled. */ + pwmp->tim->CCR4 = 0; /* Comparator 4 disabled. */ + pwmp->tim->BDTR = 0; + pwmp->tim->DIER = 0; + pwmp->tim->SR = 0; + pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ #if STM32_PWM_USE_TIM1 if (&PWMD1 == pwmp) { @@ -492,15 +492,15 @@ void pwm_lld_enable_channel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width) { - *(&pwmp->pd_tim->CCR1 + (channel * 2)) = width; /* New duty cycle. */ - if ((pwmp->pd_enabled_channels & (1 << channel)) == 0) { + *(&pwmp->tim->CCR1 + (channel * 2)) = width; /* New duty cycle. */ + if ((pwmp->enabled_channels & (1 << channel)) == 0) { /* The channel is not enabled yet.*/ - pwmp->pd_enabled_channels |= (1 << channel); + pwmp->enabled_channels |= (1 << channel); /* If there is a callback associated to the channel then the proper interrupt is cleared and enabled.*/ - if (pwmp->pd_config->pc_channels[channel].pcc_callback) { - pwmp->pd_tim->SR = ~(2 << channel); - pwmp->pd_tim->DIER |= (2 << channel); + if (pwmp->config->channels[channel].callback) { + pwmp->tim->SR = ~(2 << channel); + pwmp->tim->DIER |= (2 << channel); } } } @@ -517,9 +517,9 @@ void pwm_lld_enable_channel(PWMDriver *pwmp, */ void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) { - *(&pwmp->pd_tim->CCR1 + (channel * 2)) = 0; - pwmp->pd_tim->DIER &= ~(2 << channel); - pwmp->pd_enabled_channels &= ~(1 << channel); + *(&pwmp->tim->CCR1 + (channel * 2)) = 0; + pwmp->tim->DIER &= ~(2 << channel); + pwmp->enabled_channels &= ~(1 << channel); } #endif /* HAL_USE_PWM */ diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index 1e9dd855a..5954a29b0 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -186,13 +186,13 @@ typedef struct { /** * @brief Channel active logic level. */ - pwmmode_t pcc_mode; + pwmmode_t mode; /** * @brief Channel callback pointer. * @note This callback is invoked on the channel compare event. If set to * @p NULL then the callback is disabled. */ - pwmcallback_t pcc_callback; + pwmcallback_t callback; /* End of the mandatory fields.*/ } PWMChannelConfig; @@ -205,25 +205,25 @@ typedef struct { * @note This callback is invoked on PWM counter reset. If set to * @p NULL then the callback is disabled. */ - pwmcallback_t pc_callback; + pwmcallback_t callback; /** * @brief Channels configurations. */ - PWMChannelConfig pc_channels[PWM_CHANNELS]; + PWMChannelConfig channels[PWM_CHANNELS]; /* End of the mandatory fields.*/ /** * @brief TIM PSC (pre-scaler) register initialization data. */ - uint16_t pc_psc; + uint16_t psc; /** * @brief TIM ARR (auto-reload) register initialization data. */ - uint16_t pc_arr; + uint16_t arr; /** * @brief TIM CR2 register initialization data. * @note The value of this field should normally be equal to zero. */ - uint16_t pc_cr2; + uint16_t cr2; } PWMConfig; /** @@ -233,11 +233,11 @@ struct PWMDriver { /** * @brief Driver state. */ - pwmstate_t pd_state; + pwmstate_t state; /** * @brief Current driver configuration data. */ - const PWMConfig *pd_config; + const PWMConfig *config; #if defined(PWM_DRIVER_EXT_FIELDS) PWM_DRIVER_EXT_FIELDS #endif @@ -245,11 +245,11 @@ struct PWMDriver { /** * @brief Bit mask of the enabled channels. */ - uint32_t pd_enabled_channels; + uint32_t enabled_channels; /** * @brief Pointer to the TIMx registers block. */ - TIM_TypeDef *pd_tim; + TIM_TypeDef *tim; }; /*===========================================================================*/ @@ -272,7 +272,7 @@ struct PWMDriver { * and/or the STM32 Reference Manual for the right clock * source. * @param[in] pwmclk PWM clock frequency in cycles - * @return The value to be stored in the @p pc_psc field of the + * @return The value to be stored in the @p psc field of the * @p PWMConfig structure. */ #define PWM_COMPUTE_PSC(clksrc, pwmclk) \ @@ -284,7 +284,7 @@ struct PWMDriver { * * @param[in] pwmclk PWM clock frequency in cycles * @param[in] pwmperiod PWM cycle period in nanoseconds - * @return The value to be stored in the @p pc_arr field of the + * @return The value to be stored in the @p arr field of the * @p PWMConfig structure. */ #define PWM_COMPUTE_ARR(pwmclk, pwmperiod) \ @@ -305,7 +305,7 @@ struct PWMDriver { * @api */ #define PWM_FRACTION_TO_WIDTH(pwmp, numerator, denominator) \ - ((uint16_t)((((uint32_t)(pwmp)->pd_config->pc_arr + 1UL) * \ + ((uint16_t)((((uint32_t)(pwmp)->config->arr + 1UL) * \ (uint32_t)(denominator)) / (uint32_t)(numerator))) /** diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index 1987373ae..53f0ae1c7 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -66,8 +66,8 @@ static uint16_t dummyrx; * @param[in] spip pointer to the @p SPIDriver object */ #define dma_stop(spip) { \ - dmaChannelDisable(spip->spd_dmatx); \ - dmaChannelDisable(spip->spd_dmarx); \ + dmaChannelDisable(spip->dmatx); \ + dmaChannelDisable(spip->dmarx); \ } /** @@ -76,8 +76,8 @@ static uint16_t dummyrx; * @param[in] spip pointer to the @p SPIDriver object */ #define dma_start(spip) { \ - dmaChannelEnable((spip)->spd_dmarx); \ - dmaChannelEnable((spip)->spd_dmatx); \ + dmaChannelEnable((spip)->dmarx); \ + dmaChannelEnable((spip)->dmatx); \ } /** @@ -219,26 +219,26 @@ void spi_lld_init(void) { #if STM32_SPI_USE_SPI1 spiObjectInit(&SPID1); - SPID1.spd_thread = NULL; - SPID1.spd_spi = SPI1; - SPID1.spd_dmarx = STM32_DMA1_CH2; - SPID1.spd_dmatx = STM32_DMA1_CH3; + SPID1.thread = NULL; + SPID1.spi = SPI1; + SPID1.dmarx = STM32_DMA1_CH2; + SPID1.dmatx = STM32_DMA1_CH3; #endif #if STM32_SPI_USE_SPI2 spiObjectInit(&SPID2); - SPID2.spd_thread = NULL; - SPID2.spd_spi = SPI2; - SPID2.spd_dmarx = STM32_DMA1_CH4; - SPID2.spd_dmatx = STM32_DMA1_CH5; + SPID2.thread = NULL; + SPID2.spi = SPI2; + SPID2.dmarx = STM32_DMA1_CH4; + SPID2.dmatx = STM32_DMA1_CH5; #endif #if STM32_SPI_USE_SPI3 spiObjectInit(&SPID3); - SPID3.spd_thread = NULL; - SPID3.spd_spi = SPI3; - SPID3.spd_dmarx = STM32_DMA2_CH1; - SPID3.spd_dmatx = STM32_DMA2_CH2; + SPID3.thread = NULL; + SPID3.spi = SPI3; + SPID3.dmarx = STM32_DMA2_CH1; + SPID3.dmatx = STM32_DMA2_CH2; #endif } @@ -252,7 +252,7 @@ void spi_lld_init(void) { void spi_lld_start(SPIDriver *spip) { /* If in stopped state then enables the SPI and DMA clocks.*/ - if (spip->spd_state == SPI_STOP) { + if (spip->state == SPI_STOP) { #if STM32_SPI_USE_SPI1 if (&SPID1 == spip) { dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ @@ -285,23 +285,23 @@ void spi_lld_start(SPIDriver *spip) { #endif /* DMA setup.*/ - dmaChannelSetPeripheral(spip->spd_dmarx, &spip->spd_spi->DR); - dmaChannelSetPeripheral(spip->spd_dmatx, &spip->spd_spi->DR); + dmaChannelSetPeripheral(spip->dmarx, &spip->spi->DR); + dmaChannelSetPeripheral(spip->dmatx, &spip->spi->DR); } /* More DMA setup.*/ - if ((spip->spd_config->spc_cr1 & SPI_CR1_DFF) == 0) - spip->spd_dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | + if ((spip->config->cr1 & SPI_CR1_DFF) == 0) + spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | DMA_CCR1_TEIE; /* 8 bits transfers. */ else - spip->spd_dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | + spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | DMA_CCR1_TEIE | DMA_CCR1_MSIZE_0 | DMA_CCR1_PSIZE_0; /* 16 bits transfers. */ /* SPI setup and enable.*/ - spip->spd_spi->CR1 = 0; - spip->spd_spi->CR2 = SPI_CR2_SSOE | SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN; - spip->spd_spi->CR1 = spip->spd_config->spc_cr1 | SPI_CR1_MSTR | SPI_CR1_SPE; + spip->spi->CR1 = 0; + spip->spi->CR2 = SPI_CR2_SSOE | SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN; + spip->spi->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SPE; } /** @@ -314,10 +314,10 @@ void spi_lld_start(SPIDriver *spip) { void spi_lld_stop(SPIDriver *spip) { /* If in ready state then disables the SPI clock.*/ - if (spip->spd_state == SPI_READY) { + if (spip->state == SPI_READY) { /* SPI disable.*/ - spip->spd_spi->CR1 = 0; + spip->spi->CR1 = 0; #if STM32_SPI_USE_SPI1 if (&SPID1 == spip) { @@ -355,7 +355,7 @@ void spi_lld_stop(SPIDriver *spip) { */ void spi_lld_select(SPIDriver *spip) { - palClearPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palClearPad(spip->config->ssport, spip->config->sspad); } /** @@ -368,7 +368,7 @@ void spi_lld_select(SPIDriver *spip) { */ void spi_lld_unselect(SPIDriver *spip) { - palSetPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palSetPad(spip->config->ssport, spip->config->sspad); } /** @@ -384,10 +384,10 @@ void spi_lld_unselect(SPIDriver *spip) { */ void spi_lld_ignore(SPIDriver *spip, size_t n) { - dmaChannelSetup(spip->spd_dmarx, n, &dummyrx, - spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN); - dmaChannelSetup(spip->spd_dmatx, n, &dummytx, - spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN); + dmaChannelSetup(spip->dmarx, n, &dummyrx, + spip->dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN); + dmaChannelSetup(spip->dmatx, n, &dummytx, + spip->dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN); } /** @@ -408,11 +408,11 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) { - dmaChannelSetup(spip->spd_dmarx, n, rxbuf, - spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC | + dmaChannelSetup(spip->dmarx, n, rxbuf, + spip->dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC | DMA_CCR1_EN); - dmaChannelSetup(spip->spd_dmatx, n, txbuf, - spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC | + dmaChannelSetup(spip->dmatx, n, txbuf, + spip->dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC | DMA_CCR1_EN); } @@ -431,10 +431,10 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { - dmaChannelSetup(spip->spd_dmarx, n, &dummyrx, - spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN); - dmaChannelSetup(spip->spd_dmatx, n, txbuf, - spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC | + dmaChannelSetup(spip->dmarx, n, &dummyrx, + spip->dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN); + dmaChannelSetup(spip->dmatx, n, txbuf, + spip->dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC | DMA_CCR1_EN); } @@ -453,11 +453,11 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { - dmaChannelSetup(spip->spd_dmarx, n, rxbuf, - spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC | + dmaChannelSetup(spip->dmarx, n, rxbuf, + spip->dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC | DMA_CCR1_EN); - dmaChannelSetup(spip->spd_dmatx, n, &dummytx, - spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN); + dmaChannelSetup(spip->dmatx, n, &dummytx, + spip->dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN); } /** @@ -474,10 +474,10 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { */ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { - spip->spd_spi->DR = frame; - while ((spip->spd_spi->SR & SPI_SR_RXNE) == 0) + spip->spi->DR = frame; + while ((spip->spi->SR & SPI_SR_RXNE) == 0) ; - return spip->spd_spi->DR; + return spip->spi->DR; } #endif /* HAL_USE_SPI */ diff --git a/os/hal/platforms/STM32/spi_lld.h b/os/hal/platforms/STM32/spi_lld.h index 9e29c5d68..306540ed7 100644 --- a/os/hal/platforms/STM32/spi_lld.h +++ b/os/hal/platforms/STM32/spi_lld.h @@ -187,20 +187,20 @@ typedef struct { /** * @brief Operation complete callback or @p NULL. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief The chip select line port. */ - ioportid_t spc_ssport; + ioportid_t ssport; /** * @brief The chip select line pad number. */ - uint16_t spc_sspad; + uint16_t sspad; /** * @brief SPI initialization data. */ - uint16_t spc_cr1; + uint16_t cr1; } SPIConfig; /** @@ -210,25 +210,25 @@ struct SPIDriver{ /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) @@ -238,19 +238,19 @@ struct SPIDriver{ /** * @brief Pointer to the SPIx registers block. */ - SPI_TypeDef *spd_spi; + SPI_TypeDef *spi; /** * @brief Pointer to the receive DMA channel registers block. */ - stm32_dma_channel_t *spd_dmarx; + stm32_dma_channel_t *dmarx; /** * @brief Pointer to the transmit DMA channel registers block. */ - stm32_dma_channel_t *spd_dmatx; + stm32_dma_channel_t *dmatx; /** * @brief DMA priority bit mask. */ - uint32_t spd_dmaccr; + uint32_t dmaccr; }; /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/uart_lld.c b/os/hal/platforms/STM32/uart_lld.c index e05051a73..2f25f6c56 100644 --- a/os/hal/platforms/STM32/uart_lld.c +++ b/os/hal/platforms/STM32/uart_lld.c @@ -90,13 +90,13 @@ static void set_rx_idle_loop(UARTDriver *uartp) { /* RX DMA channel preparation, if the char callback is defined then the TCIE interrupt is enabled too.*/ - if (uartp->ud_config->uc_rxchar == NULL) + if (uartp->config->rxchar_cb == NULL) ccr = DMA_CCR1_CIRC | DMA_CCR1_TEIE; else ccr = DMA_CCR1_CIRC | DMA_CCR1_TEIE | DMA_CCR1_TCIE; - dmaSetupChannel(uartp->ud_dmap, uartp->ud_dmarx, 1, - &uartp->ud_rxbuf, uartp->ud_dmaccr | ccr); - dmaEnableChannel(uartp->ud_dmap, uartp->ud_dmarx); + dmaSetupChannel(uartp->dmap, uartp->dmarx, 1, + &uartp->rxbuf, uartp->dmaccr | ccr); + dmaEnableChannel(uartp->dmap, uartp->dmarx); } /** @@ -108,15 +108,15 @@ static void set_rx_idle_loop(UARTDriver *uartp) { static void usart_stop(UARTDriver *uartp) { /* Stops RX and TX DMA channels.*/ - dmaDisableChannel(uartp->ud_dmap, uartp->ud_dmarx); - dmaDisableChannel(uartp->ud_dmap, uartp->ud_dmatx); - dmaClearChannel(uartp->ud_dmap, uartp->ud_dmarx); - dmaClearChannel(uartp->ud_dmap, uartp->ud_dmatx); + dmaDisableChannel(uartp->dmap, uartp->dmarx); + dmaDisableChannel(uartp->dmap, uartp->dmatx); + dmaClearChannel(uartp->dmap, uartp->dmarx); + dmaClearChannel(uartp->dmap, uartp->dmatx); /* Stops USART operations.*/ - uartp->ud_usart->CR1 = 0; - uartp->ud_usart->CR2 = 0; - uartp->ud_usart->CR3 = 0; + uartp->usart->CR1 = 0; + uartp->usart->CR2 = 0; + uartp->usart->CR3 = 0; } /** @@ -127,16 +127,16 @@ static void usart_stop(UARTDriver *uartp) { */ static void usart_start(UARTDriver *uartp) { uint16_t cr1; - USART_TypeDef *u = uartp->ud_usart; + USART_TypeDef *u = uartp->usart; /* Defensive programming, starting from a clean state.*/ usart_stop(uartp); /* Baud rate setting.*/ - if (uartp->ud_usart == USART1) - u->BRR = STM32_PCLK2 / uartp->ud_config->uc_speed; + if (uartp->usart == USART1) + u->BRR = STM32_PCLK2 / uartp->config->speed; else - u->BRR = STM32_PCLK1 / uartp->ud_config->uc_speed; + u->BRR = STM32_PCLK1 / uartp->config->speed; /* Resetting eventual pending status flags.*/ (void)u->SR; /* SR reset step 1.*/ @@ -145,14 +145,14 @@ static void usart_start(UARTDriver *uartp) { /* Note that some bits are enforced because required for correct driver operations.*/ - if (uartp->ud_config->uc_txend2 == NULL) + if (uartp->config->txend2_cb == NULL) cr1 = USART_CR1_UE | USART_CR1_PEIE | USART_CR1_TE | USART_CR1_RE; else cr1 = USART_CR1_UE | USART_CR1_PEIE | USART_CR1_TE | USART_CR1_RE | USART_CR1_TCIE; - u->CR1 = uartp->ud_config->uc_cr1 | cr1; - u->CR2 = uartp->ud_config->uc_cr2 | USART_CR2_LBDIE; - u->CR3 = uartp->ud_config->uc_cr3 | USART_CR3_DMAT | USART_CR3_DMAR | + u->CR1 = uartp->config->cr1 | cr1; + u->CR2 = uartp->config->cr2 | USART_CR2_LBDIE; + u->CR3 = uartp->config->cr3 | USART_CR3_DMAT | USART_CR3_DMAR | USART_CR3_EIE; /* Starting the receiver idle loop.*/ @@ -166,13 +166,13 @@ static void usart_start(UARTDriver *uartp) { */ static void serve_rx_end_irq(UARTDriver *uartp) { - uartp->ud_rxstate = UART_RX_COMPLETE; - if (uartp->ud_config->uc_rxend != NULL) - uartp->ud_config->uc_rxend(uartp); + uartp->rxstate = UART_RX_COMPLETE; + if (uartp->config->rxend_cb != NULL) + uartp->config->rxend_cb(uartp); /* If the callback didn't explicitly change state then the receiver automatically returns to the idle state.*/ - if (uartp->ud_rxstate == UART_RX_COMPLETE) { - uartp->ud_rxstate = UART_RX_IDLE; + if (uartp->rxstate == UART_RX_COMPLETE) { + uartp->rxstate = UART_RX_IDLE; set_rx_idle_loop(uartp); } } @@ -185,13 +185,13 @@ static void serve_rx_end_irq(UARTDriver *uartp) { static void serve_tx_end_irq(UARTDriver *uartp) { /* A callback is generated, if enabled, after a completed transfer.*/ - uartp->ud_txstate = UART_TX_COMPLETE; - if (uartp->ud_config->uc_txend1 != NULL) - uartp->ud_config->uc_txend1(uartp); + uartp->txstate = UART_TX_COMPLETE; + if (uartp->config->txend1_cb != NULL) + uartp->config->txend1_cb(uartp); /* If the callback didn't explicitly change state then the transmitter automatically returns to the idle state.*/ - if (uartp->ud_txstate == UART_TX_COMPLETE) - uartp->ud_txstate = UART_TX_IDLE; + if (uartp->txstate == UART_TX_COMPLETE) + uartp->txstate = UART_TX_IDLE; } /** * @brief USART common service routine. @@ -200,21 +200,21 @@ static void serve_tx_end_irq(UARTDriver *uartp) { */ static void serve_usart_irq(UARTDriver *uartp) { uint16_t sr; - USART_TypeDef *u = uartp->ud_usart; + USART_TypeDef *u = uartp->usart; sr = u->SR; /* SR reset step 1.*/ (void)u->DR; /* SR reset step 2.*/ if (sr & (USART_SR_LBD | USART_SR_ORE | USART_SR_NE | USART_SR_FE | USART_SR_PE)) { u->SR = ~USART_SR_LBD; - if (uartp->ud_config->uc_rxerr != NULL) - uartp->ud_config->uc_rxerr(uartp, translate_errors(sr)); + if (uartp->config->rxerr_cb != NULL) + uartp->config->rxerr_cb(uartp, translate_errors(sr)); } if (sr & USART_SR_TC) { u->SR = ~USART_SR_TC; /* End of transmission, a callback is generated.*/ - if (uartp->ud_config->uc_txend2 != NULL) - uartp->ud_config->uc_txend2(uartp); + if (uartp->config->txend2_cb != NULL) + uartp->config->txend2_cb(uartp); } } @@ -237,13 +237,13 @@ CH_IRQ_HANDLER(DMA1_Ch5_IRQHandler) { if ((STM32_DMA1->ISR & DMA_ISR_TEIF5) != 0) { STM32_UART_USART1_DMA_ERROR_HOOK(); } - if (uartp->ud_rxstate == UART_RX_IDLE) { + if (uartp->rxstate == UART_RX_IDLE) { dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_5); /* Fast IRQ path, this is why it is not centralized in serve_rx_end_irq().*/ /* Receiver in idle state, a callback is generated, if enabled, for each received character and then the driver stays in the same state.*/ - if (uartp->ud_config->uc_rxchar != NULL) - uartp->ud_config->uc_rxchar(uartp, uartp->ud_rxbuf); + if (uartp->config->rxchar_cb != NULL) + uartp->config->rxchar_cb(uartp, uartp->rxbuf); } else { /* Receiver in active state, a callback is generated, if enabled, after @@ -305,13 +305,13 @@ CH_IRQ_HANDLER(DMA1_Ch6_IRQHandler) { if ((STM32_DMA1->ISR & DMA_ISR_TEIF6) != 0) { STM32_UART_USART2_DMA_ERROR_HOOK(); } - if (uartp->ud_rxstate == UART_RX_IDLE) { + if (uartp->rxstate == UART_RX_IDLE) { dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_6); /* Fast IRQ path, this is why it is not centralized in serve_rx_end_irq().*/ /* Receiver in idle state, a callback is generated, if enabled, for each received character and then the driver stays in the same state.*/ - if (uartp->ud_config->uc_rxchar != NULL) - uartp->ud_config->uc_rxchar(uartp, uartp->ud_rxbuf); + if (uartp->config->rxchar_cb != NULL) + uartp->config->rxchar_cb(uartp, uartp->rxbuf); } else { /* Receiver in active state, a callback is generated, if enabled, after @@ -373,13 +373,13 @@ CH_IRQ_HANDLER(DMA1_Ch3_IRQHandler) { if ((STM32_DMA1->ISR & DMA_ISR_TEIF3) != 0) { STM32_UART_USART1_DMA_ERROR_HOOK(); } - if (uartp->ud_rxstate == UART_RX_IDLE) { + if (uartp->rxstate == UART_RX_IDLE) { dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_3); /* Fast IRQ path, this is why it is not centralized in serve_rx_end_irq().*/ /* Receiver in idle state, a callback is generated, if enabled, for each received character and then the driver stays in the same state.*/ - if (uartp->ud_config->uc_rxchar != NULL) - uartp->ud_config->uc_rxchar(uartp, uartp->ud_rxbuf); + if (uartp->config->rxchar_cb != NULL) + uartp->config->rxchar_cb(uartp, uartp->rxbuf); } else { /* Receiver in active state, a callback is generated, if enabled, after @@ -439,29 +439,29 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART1 uartObjectInit(&UARTD1); - UARTD1.ud_usart = USART1; - UARTD1.ud_dmap = STM32_DMA1; - UARTD1.ud_dmarx = STM32_DMA_CHANNEL_5; - UARTD1.ud_dmatx = STM32_DMA_CHANNEL_4; - UARTD1.ud_dmaccr = 0; + UARTD1.usart = USART1; + UARTD1.dmap = STM32_DMA1; + UARTD1.dmarx = STM32_DMA_CHANNEL_5; + UARTD1.dmatx = STM32_DMA_CHANNEL_4; + UARTD1.dmaccr = 0; #endif #if STM32_UART_USE_USART2 uartObjectInit(&UARTD2); - UARTD2.ud_usart = USART2; - UARTD2.ud_dmap = STM32_DMA1; - UARTD2.ud_dmarx = STM32_DMA_CHANNEL_6; - UARTD2.ud_dmatx = STM32_DMA_CHANNEL_7; - UARTD2.ud_dmaccr = 0; + UARTD2.usart = USART2; + UARTD2.dmap = STM32_DMA1; + UARTD2.dmarx = STM32_DMA_CHANNEL_6; + UARTD2.dmatx = STM32_DMA_CHANNEL_7; + UARTD2.dmaccr = 0; #endif #if STM32_UART_USE_USART3 uartObjectInit(&UARTD3); - UARTD3.ud_usart = USART3; - UARTD3.ud_dmap = STM32_DMA1; - UARTD3.ud_dmarx = STM32_DMA_CHANNEL_3; - UARTD3.ud_dmatx = STM32_DMA_CHANNEL_2; - UARTD3.ud_dmaccr = 0; + UARTD3.usart = USART3; + UARTD3.dmap = STM32_DMA1; + UARTD3.dmarx = STM32_DMA_CHANNEL_3; + UARTD3.dmatx = STM32_DMA_CHANNEL_2; + UARTD3.dmaccr = 0; #endif } @@ -474,7 +474,7 @@ void uart_lld_init(void) { */ void uart_lld_start(UARTDriver *uartp) { - if (uartp->ud_state == UART_STOP) { + if (uartp->state == UART_STOP) { #if STM32_UART_USE_USART1 if (&UARTD1 == uartp) { dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ @@ -516,18 +516,18 @@ void uart_lld_start(UARTDriver *uartp) { /* Static DMA setup, the transfer size depends on the USART settings, it is 16 bits if M=1 and PCE=0 else it is 8 bits.*/ - uartp->ud_dmaccr = STM32_UART_USART1_DMA_PRIORITY << 12; - if ((uartp->ud_config->uc_cr1 & (USART_CR1_M | USART_CR1_PCE)) == USART_CR1_M) - uartp->ud_dmaccr |= DMA_CCR1_MSIZE_0 | DMA_CCR1_PSIZE_0; - dmaChannelSetPeripheral(&uartp->ud_dmap->channels[uartp->ud_dmarx], - &uartp->ud_usart->DR); - dmaChannelSetPeripheral(&uartp->ud_dmap->channels[uartp->ud_dmatx], - &uartp->ud_usart->DR); - uartp->ud_rxbuf = 0; + uartp->dmaccr = STM32_UART_USART1_DMA_PRIORITY << 12; + if ((uartp->config->cr1 & (USART_CR1_M | USART_CR1_PCE)) == USART_CR1_M) + uartp->dmaccr |= DMA_CCR1_MSIZE_0 | DMA_CCR1_PSIZE_0; + dmaChannelSetPeripheral(&uartp->dmap->channels[uartp->dmarx], + &uartp->usart->DR); + dmaChannelSetPeripheral(&uartp->dmap->channels[uartp->dmatx], + &uartp->usart->DR); + uartp->rxbuf = 0; } - uartp->ud_rxstate = UART_RX_IDLE; - uartp->ud_txstate = UART_TX_IDLE; + uartp->rxstate = UART_RX_IDLE; + uartp->txstate = UART_TX_IDLE; usart_start(uartp); } @@ -540,7 +540,7 @@ void uart_lld_start(UARTDriver *uartp) { */ void uart_lld_stop(UARTDriver *uartp) { - if (uartp->ud_state == UART_READY) { + if (uartp->state == UART_READY) { usart_stop(uartp); #if STM32_UART_USE_USART1 @@ -592,10 +592,10 @@ void uart_lld_stop(UARTDriver *uartp) { void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf) { /* TX DMA channel preparation and start.*/ - dmaSetupChannel(uartp->ud_dmap, uartp->ud_dmatx, n, txbuf, - uartp->ud_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC | + dmaSetupChannel(uartp->dmap, uartp->dmatx, n, txbuf, + uartp->dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC | DMA_CCR1_TEIE | DMA_CCR1_TCIE); - dmaEnableChannel(uartp->ud_dmap, uartp->ud_dmatx); + dmaEnableChannel(uartp->dmap, uartp->dmatx); } /** @@ -611,9 +611,9 @@ void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf) { */ size_t uart_lld_stop_send(UARTDriver *uartp) { - dmaDisableChannel(uartp->ud_dmap, uartp->ud_dmatx); - dmaClearChannel(uartp->ud_dmap, uartp->ud_dmatx); - return (size_t)uartp->ud_dmap->channels[uartp->ud_dmatx].CNDTR; + dmaDisableChannel(uartp->dmap, uartp->dmatx); + dmaClearChannel(uartp->dmap, uartp->dmatx); + return (size_t)uartp->dmap->channels[uartp->dmatx].CNDTR; } /** @@ -630,14 +630,14 @@ size_t uart_lld_stop_send(UARTDriver *uartp) { void uart_lld_start_receive(UARTDriver *uartp, size_t n, void *rxbuf) { /* Stopping previous activity (idle state).*/ - dmaDisableChannel(uartp->ud_dmap, uartp->ud_dmarx); - dmaClearChannel(uartp->ud_dmap, uartp->ud_dmarx); + dmaDisableChannel(uartp->dmap, uartp->dmarx); + dmaClearChannel(uartp->dmap, uartp->dmarx); /* RX DMA channel preparation and start.*/ - dmaSetupChannel(uartp->ud_dmap, uartp->ud_dmarx, n, rxbuf, - uartp->ud_dmaccr | DMA_CCR1_MINC | + dmaSetupChannel(uartp->dmap, uartp->dmarx, n, rxbuf, + uartp->dmaccr | DMA_CCR1_MINC | DMA_CCR1_TEIE | DMA_CCR1_TCIE); - dmaEnableChannel(uartp->ud_dmap, uartp->ud_dmarx); + dmaEnableChannel(uartp->dmap, uartp->dmarx); } /** @@ -654,9 +654,9 @@ void uart_lld_start_receive(UARTDriver *uartp, size_t n, void *rxbuf) { size_t uart_lld_stop_receive(UARTDriver *uartp) { size_t n; - dmaDisableChannel(uartp->ud_dmap, uartp->ud_dmarx); - dmaClearChannel(uartp->ud_dmap, uartp->ud_dmarx); - n = (size_t)uartp->ud_dmap->channels[uartp->ud_dmarx].CNDTR; + dmaDisableChannel(uartp->dmap, uartp->dmarx); + dmaClearChannel(uartp->dmap, uartp->dmarx); + n = (size_t)uartp->dmap->channels[uartp->dmarx].CNDTR; set_rx_idle_loop(uartp); return n; } diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h index f09fe7cd4..8394d8421 100644 --- a/os/hal/platforms/STM32/uart_lld.h +++ b/os/hal/platforms/STM32/uart_lld.h @@ -117,8 +117,8 @@ /** * @brief USART1 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. + * @note The default action for DMA errors is a system halt because DMA + * error can only happen because programming errors. */ #if !defined(STM32_UART_USART1_DMA_ERROR_HOOK) || defined(__DOXYGEN__) #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() @@ -126,8 +126,8 @@ /** * @brief USART2 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. + * @note The default action for DMA errors is a system halt because DMA + * error can only happen because programming errors. */ #if !defined(STM32_UART_USART2_DMA_ERROR_HOOK) || defined(__DOXYGEN__) #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() @@ -135,8 +135,8 @@ /** * @brief USART3 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. + * @note The default action for DMA errors is a system halt because DMA + * error can only happen because programming errors. */ #if !defined(STM32_UART_USART3_DMA_ERROR_HOOK) || defined(__DOXYGEN__) #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() @@ -208,40 +208,40 @@ typedef struct { /** * @brief End of transmission buffer callback. */ - uartcb_t uc_txend1; + uartcb_t txend1_cb; /** * @brief Physical end of transmission callback. */ - uartcb_t uc_txend2; + uartcb_t txend2_cb; /** * @brief Receive buffer filled callback. */ - uartcb_t uc_rxend; + uartcb_t rxend_cb; /** * @brief Character received while out if the @p UART_RECEIVE state. */ - uartccb_t uc_rxchar; + uartccb_t rxchar_cb; /** * @brief Receive error callback. */ - uartecb_t uc_rxerr; + uartecb_t rxerr_cb; /* End of the mandatory fields.*/ /** * @brief Bit rate. */ - uint32_t uc_speed; + uint32_t speed; /** * @brief Initialization value for the CR1 register. */ - uint16_t uc_cr1; + uint16_t cr1; /** * @brief Initialization value for the CR2 register. */ - uint16_t uc_cr2; + uint16_t cr2; /** * @brief Initialization value for the CR3 register. */ - uint16_t uc_cr3; + uint16_t cr3; } UARTConfig; /** @@ -251,19 +251,19 @@ struct UARTDriver { /** * @brief Driver state. */ - uartstate_t ud_state; + uartstate_t state; /** * @brief Transmitter state. */ - uarttxstate_t ud_txstate; + uarttxstate_t txstate; /** * @brief Receiver state. */ - uartrxstate_t ud_rxstate; + uartrxstate_t rxstate; /** * @brief Current configuration data. */ - const UARTConfig *ud_config; + const UARTConfig *config; #if defined(UART_DRIVER_EXT_FIELDS) UART_DRIVER_EXT_FIELDS #endif @@ -271,27 +271,27 @@ struct UARTDriver { /** * @brief Pointer to the USART registers block. */ - USART_TypeDef *ud_usart; + USART_TypeDef *usart; /** * @brief Pointer to the DMA registers block. */ - stm32_dma_t *ud_dmap; + stm32_dma_t *dmap; /** * @brief DMA priority bit mask. */ - uint32_t ud_dmaccr; + uint32_t dmaccr; /** * @brief Receive DMA channel. */ - uint8_t ud_dmarx; + uint8_t dmarx; /** * @brief Transmit DMA channel. */ - uint8_t ud_dmatx; + uint8_t dmatx; /** * @brief Default receive buffer while into @p UART_RX_IDLE state. */ - volatile uint16_t ud_rxbuf; + volatile uint16_t rxbuf; }; /*===========================================================================*/ diff --git a/os/hal/platforms/STM8S/spi_lld.c b/os/hal/platforms/STM8S/spi_lld.c index c950f0bd4..436a94f2b 100644 --- a/os/hal/platforms/STM8S/spi_lld.c +++ b/os/hal/platforms/STM8S/spi_lld.c @@ -70,12 +70,12 @@ CH_IRQ_HANDLER(10) { handle the case where a frame arrives immediately after reading the DR register.*/ while ((SPI->SR & SPI_SR_RXNE) != 0) { - if (SPID1.spd_rxptr != NULL) - *SPID1.spd_rxptr++ = SPI->DR; + if (SPID1.rxptr != NULL) + *SPID1.rxptr++ = SPI->DR; else (void)SPI->DR; - if (--SPID1.spd_rxcnt == 0) { - chDbgAssert(SPID1.spd_txcnt == 0, + if (--SPID1.rxcnt == 0) { + chDbgAssert(SPID1.txcnt == 0, "IRQ10, #1", "counter out of synch"); /* Stops all the IRQ sources.*/ SPI->ICR = 0; @@ -89,8 +89,8 @@ CH_IRQ_HANDLER(10) { } /* Loading the DR register.*/ if ((SPI->SR & SPI_SR_TXE) != 0) { - if (SPID1.spd_txptr != NULL) - SPI->DR = *SPID1.spd_txptr++; + if (SPID1.txptr != NULL) + SPI->DR = *SPID1.txptr++; else SPI->DR = 0xFF; } @@ -130,7 +130,7 @@ void spi_lld_start(SPIDriver *spip) { /* Configuration.*/ SPI->CR2 = 0; - SPI->CR1 = spip->spd_config->spc_cr1 | SPI_CR1_MSTR | SPI_CR1_SPE; + SPI->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SPE; } /** @@ -162,7 +162,7 @@ void spi_lld_stop(SPIDriver *spip) { */ void spi_lld_select(SPIDriver *spip) { - palClearPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palClearPad(spip->config->ssport, spip->config->sspad); } /** @@ -175,7 +175,7 @@ void spi_lld_select(SPIDriver *spip) { */ void spi_lld_unselect(SPIDriver *spip) { - palSetPad(spip->spd_config->spc_ssport, spip->spd_config->spc_sspad); + palSetPad(spip->config->ssport, spip->config->sspad); } /** @@ -191,9 +191,9 @@ void spi_lld_unselect(SPIDriver *spip) { */ void spi_lld_ignore(SPIDriver *spip, size_t n) { - spip->spd_rxptr = NULL; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; SPI->ICR = SPI_ICR_TXEI | SPI_ICR_RXEI | SPI_ICR_ERRIE; } @@ -215,9 +215,9 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; SPI->ICR = SPI_ICR_TXEI | SPI_ICR_RXEI | SPI_ICR_ERRIE; } @@ -236,9 +236,9 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { - spip->spd_rxptr = NULL; - spip->spd_txptr = txbuf; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = NULL; + spip->txptr = txbuf; + spip->rxcnt = spip->txcnt = n; SPI->ICR = SPI_ICR_TXEI | SPI_ICR_RXEI | SPI_ICR_ERRIE; } @@ -257,9 +257,9 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { - spip->spd_rxptr = rxbuf; - spip->spd_txptr = NULL; - spip->spd_rxcnt = spip->spd_txcnt = n; + spip->rxptr = rxbuf; + spip->txptr = NULL; + spip->rxcnt = spip->txcnt = n; SPI->ICR = SPI_ICR_TXEI | SPI_ICR_RXEI | SPI_ICR_ERRIE; } diff --git a/os/hal/platforms/STM8S/spi_lld.h b/os/hal/platforms/STM8S/spi_lld.h index 1f665d01a..b81241fd0 100644 --- a/os/hal/platforms/STM8S/spi_lld.h +++ b/os/hal/platforms/STM8S/spi_lld.h @@ -87,20 +87,20 @@ typedef struct { /** * @brief Operation complete callback or @p NULL. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ /** * @brief The chip select line port. */ - ioportid_t spc_ssport; + ioportid_t ssport; /** * @brief The chip select line pad number. */ - uint16_t spc_sspad; + uint16_t sspad; /** * @brief SPI initialization data. */ - uint8_t spc_cr1; + uint8_t cr1; } SPIConfig; /** @@ -110,25 +110,25 @@ struct SPIDriver { /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) @@ -138,19 +138,19 @@ struct SPIDriver { /** * @brief Number of bytes yet to be received. */ - uint16_t spd_rxcnt; + uint16_t rxcnt; /** * @brief Receive pointer or @p NULL. */ - uint8_t *spd_rxptr; + uint8_t *rxptr; /** * @brief Number of bytes yet to be transmitted. */ - uint16_t spd_txcnt; + uint16_t txcnt; /** * @brief Transmit pointer or @p NULL. */ - const uint8_t *spd_txptr; + const uint8_t *txptr; }; /*===========================================================================*/ diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c index 25cbfe750..956c7837f 100644 --- a/os/hal/src/adc.c +++ b/os/hal/src/adc.c @@ -67,19 +67,19 @@ void adcInit(void) { */ void adcObjectInit(ADCDriver *adcp) { - adcp->ad_state = ADC_STOP; - adcp->ad_config = NULL; - adcp->ad_samples = NULL; - adcp->ad_depth = 0; - adcp->ad_grpp = NULL; + adcp->state = ADC_STOP; + adcp->config = NULL; + adcp->samples = NULL; + adcp->depth = 0; + adcp->grpp = NULL; #if ADC_USE_WAIT - adcp->ad_thread = NULL; + adcp->thread = NULL; #endif /* ADC_USE_WAIT */ #if ADC_USE_MUTUAL_EXCLUSION #if CH_USE_MUTEXES - chMtxInit(&adcp->ad_mutex); + chMtxInit(&adcp->mutex); #else - chSemInit(&adcp->ad_semaphore, 1); + chSemInit(&adcp->semaphore, 1); #endif #endif /* ADC_USE_MUTUAL_EXCLUSION */ #if defined(ADC_DRIVER_EXT_INIT_HOOK) @@ -101,11 +101,11 @@ void adcStart(ADCDriver *adcp, const ADCConfig *config) { chDbgCheck(adcp != NULL, "adcStart"); chSysLock(); - chDbgAssert((adcp->ad_state == ADC_STOP) || (adcp->ad_state == ADC_READY), + chDbgAssert((adcp->state == ADC_STOP) || (adcp->state == ADC_READY), "adcStart(), #1", "invalid state"); - adcp->ad_config = config; + adcp->config = config; adc_lld_start(adcp); - adcp->ad_state = ADC_READY; + adcp->state = ADC_READY; chSysUnlock(); } @@ -121,10 +121,10 @@ void adcStop(ADCDriver *adcp) { chDbgCheck(adcp != NULL, "adcStop"); chSysLock(); - chDbgAssert((adcp->ad_state == ADC_STOP) || (adcp->ad_state == ADC_READY), + chDbgAssert((adcp->state == ADC_STOP) || (adcp->state == ADC_READY), "adcStop(), #1", "invalid state"); adc_lld_stop(adcp); - adcp->ad_state = ADC_STOP; + adcp->state = ADC_STOP; chSysUnlock(); } @@ -179,13 +179,13 @@ void adcStartConversionI(ADCDriver *adcp, ((depth == 1) || ((depth & 1) == 0)), "adcStartConversionI"); - chDbgAssert((adcp->ad_state == ADC_READY) || - (adcp->ad_state == ADC_COMPLETE), + chDbgAssert((adcp->state == ADC_READY) || + (adcp->state == ADC_COMPLETE), "adcStartConversionI(), #1", "not ready"); - adcp->ad_samples = samples; - adcp->ad_depth = depth; - adcp->ad_grpp = grpp; - adcp->ad_state = ADC_ACTIVE; + adcp->samples = samples; + adcp->depth = depth; + adcp->grpp = grpp; + adcp->state = ADC_ACTIVE; adc_lld_start_conversion(adcp); } @@ -204,13 +204,13 @@ void adcStopConversion(ADCDriver *adcp) { chDbgCheck(adcp != NULL, "adcStopConversion"); chSysLock(); - chDbgAssert((adcp->ad_state == ADC_READY) || - (adcp->ad_state == ADC_ACTIVE), + chDbgAssert((adcp->state == ADC_READY) || + (adcp->state == ADC_ACTIVE), "adcStopConversion(), #1", "invalid state"); - if (adcp->ad_state != ADC_READY) { + if (adcp->state != ADC_READY) { adc_lld_stop_conversion(adcp); - adcp->ad_grpp = NULL; - adcp->ad_state = ADC_READY; + adcp->grpp = NULL; + adcp->state = ADC_READY; _adc_reset_s(adcp); } chSysUnlock(); @@ -230,14 +230,14 @@ void adcStopConversionI(ADCDriver *adcp) { chDbgCheck(adcp != NULL, "adcStopConversionI"); - chDbgAssert((adcp->ad_state == ADC_READY) || - (adcp->ad_state == ADC_ACTIVE) || - (adcp->ad_state == ADC_COMPLETE), + chDbgAssert((adcp->state == ADC_READY) || + (adcp->state == ADC_ACTIVE) || + (adcp->state == ADC_COMPLETE), "adcStopConversionI(), #1", "invalid state"); - if (adcp->ad_state != ADC_READY) { + if (adcp->state != ADC_READY) { adc_lld_stop_conversion(adcp); - adcp->ad_grpp = NULL; - adcp->ad_state = ADC_READY; + adcp->grpp = NULL; + adcp->state = ADC_READY; _adc_reset_i(adcp); } } @@ -271,9 +271,9 @@ msg_t adcConvert(ADCDriver *adcp, msg_t msg; chSysLock(); - chDbgAssert(grpp->acg_endcb == NULL, "adcConvert(), #1", "has callback"); + chDbgAssert(grpp->end_cb == NULL, "adcConvert(), #1", "has callback"); adcStartConversionI(adcp, grpp, samples, depth); - (adcp)->ad_thread = chThdSelf(); + (adcp)->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); msg = chThdSelf()->p_u.rdymsg; chSysUnlock(); @@ -286,8 +286,8 @@ msg_t adcConvert(ADCDriver *adcp, * @brief Gains exclusive access to the ADC peripheral. * @details This function tries to gain ownership to the ADC bus, if the bus * is already being used then the invoking thread is queued. - * @pre In order to use this function the option @p ADC_USE_MUTUAL_EXCLUSION - * must be enabled. + * @pre In order to use this function the option + * @p ADC_USE_MUTUAL_EXCLUSION must be enabled. * * @param[in] adcp pointer to the @p ADCDriver object * @@ -298,16 +298,16 @@ void adcAcquireBus(ADCDriver *adcp) { chDbgCheck(adcp != NULL, "adcAcquireBus"); #if CH_USE_MUTEXES - chMtxLock(&adcp->ad_mutex); + chMtxLock(&adcp->mutex); #elif CH_USE_SEMAPHORES - chSemWait(&adcp->ad_semaphore); + chSemWait(&adcp->semaphore); #endif } /** * @brief Releases exclusive access to the ADC peripheral. - * @pre In order to use this function the option @p ADC_USE_MUTUAL_EXCLUSION - * must be enabled. + * @pre In order to use this function the option + * @p ADC_USE_MUTUAL_EXCLUSION must be enabled. * * @param[in] adcp pointer to the @p ADCDriver object * @@ -321,7 +321,7 @@ void adcReleaseBus(ADCDriver *adcp) { (void)adcp; chMtxUnlock(); #elif CH_USE_SEMAPHORES - chSemSignal(&adcp->ad_semaphore); + chSemSignal(&adcp->semaphore); #endif } #endif /* ADC_USE_MUTUAL_EXCLUSION */ diff --git a/os/hal/src/can.c b/os/hal/src/can.c index d63cbfd8a..c240c9e44 100644 --- a/os/hal/src/can.c +++ b/os/hal/src/can.c @@ -67,17 +67,17 @@ void canInit(void) { */ void canObjectInit(CANDriver *canp) { - canp->cd_state = CAN_STOP; - canp->cd_config = NULL; - chSemInit(&canp->cd_txsem, 0); - chSemInit(&canp->cd_rxsem, 0); - chEvtInit(&canp->cd_rxfull_event); - chEvtInit(&canp->cd_txempty_event); - chEvtInit(&canp->cd_error_event); - canp->cd_status = 0; + canp->state = CAN_STOP; + canp->config = NULL; + chSemInit(&canp->txsem, 0); + chSemInit(&canp->rxsem, 0); + chEvtInit(&canp->rxfull_event); + chEvtInit(&canp->txempty_event); + chEvtInit(&canp->error_event); + canp->status = 0; #if CAN_USE_SLEEP_MODE - chEvtInit(&canp->cd_sleep_event); - chEvtInit(&canp->cd_wakeup_event); + chEvtInit(&canp->sleep_event); + chEvtInit(&canp->wakeup_event); #endif /* CAN_USE_SLEEP_MODE */ } @@ -98,16 +98,16 @@ void canStart(CANDriver *canp, const CANConfig *config) { chDbgCheck(canp != NULL, "canStart"); chSysLock(); - chDbgAssert((canp->cd_state == CAN_STOP) || - (canp->cd_state == CAN_STARTING) || - (canp->cd_state == CAN_READY), + chDbgAssert((canp->state == CAN_STOP) || + (canp->state == CAN_STARTING) || + (canp->state == CAN_READY), "canStart(), #1", "invalid state"); - while (canp->cd_state == CAN_STARTING) + while (canp->state == CAN_STARTING) chThdSleepS(1); - if (canp->cd_state == CAN_STOP) { - canp->cd_config = config; + if (canp->state == CAN_STOP) { + canp->config = config; can_lld_start(canp); - canp->cd_state = CAN_READY; + canp->state = CAN_READY; } chSysUnlock(); } @@ -124,14 +124,14 @@ void canStop(CANDriver *canp) { chDbgCheck(canp != NULL, "canStop"); chSysLock(); - chDbgAssert((canp->cd_state == CAN_STOP) || (canp->cd_state == CAN_READY), + chDbgAssert((canp->state == CAN_STOP) || (canp->state == CAN_READY), "canStop(), #1", "invalid state"); can_lld_stop(canp); - chSemResetI(&canp->cd_rxsem, 0); - chSemResetI(&canp->cd_txsem, 0); + chSemResetI(&canp->rxsem, 0); + chSemResetI(&canp->txsem, 0); chSchRescheduleS(); - canp->cd_state = CAN_STOP; - canp->cd_status = 0; + canp->state = CAN_STOP; + canp->status = 0; chSysUnlock(); } @@ -142,7 +142,7 @@ void canStop(CANDriver *canp) { * @note Trying to transmit while in sleep mode simply enqueues the thread. * * @param[in] canp pointer to the @p CANDriver object - * @param[in] ctfp pointer to the CAN frame to be transmitted + * @param[in] ctfp pointer to the CAN frame to be transmitted * @param[in] timeout the number of ticks before the operation timeouts, * the following special values are allowed: * - @a TIME_IMMEDIATE immediate timeout. @@ -160,10 +160,10 @@ msg_t canTransmit(CANDriver *canp, const CANTxFrame *ctfp, systime_t timeout) { chDbgCheck((canp != NULL) && (ctfp != NULL), "canTransmit"); chSysLock(); - chDbgAssert((canp->cd_state == CAN_READY) || (canp->cd_state == CAN_SLEEP), + chDbgAssert((canp->state == CAN_READY) || (canp->state == CAN_SLEEP), "canTransmit(), #1", "invalid state"); - while ((canp->cd_state == CAN_SLEEP) || !can_lld_can_transmit(canp)) { - msg_t msg = chSemWaitTimeoutS(&canp->cd_txsem, timeout); + while ((canp->state == CAN_SLEEP) || !can_lld_can_transmit(canp)) { + msg_t msg = chSemWaitTimeoutS(&canp->txsem, timeout); if (msg != RDY_OK) { chSysUnlock(); return msg; @@ -200,10 +200,10 @@ msg_t canReceive(CANDriver *canp, CANRxFrame *crfp, systime_t timeout) { chDbgCheck((canp != NULL) && (crfp != NULL), "canReceive"); chSysLock(); - chDbgAssert((canp->cd_state == CAN_READY) || (canp->cd_state == CAN_SLEEP), + chDbgAssert((canp->state == CAN_READY) || (canp->state == CAN_SLEEP), "canReceive(), #1", "invalid state"); - while ((canp->cd_state == CAN_SLEEP) || !can_lld_can_receive(canp)) { - msg_t msg = chSemWaitTimeoutS(&canp->cd_rxsem, timeout); + while ((canp->state == CAN_SLEEP) || !can_lld_can_receive(canp)) { + msg_t msg = chSemWaitTimeoutS(&canp->rxsem, timeout); if (msg != RDY_OK) { chSysUnlock(); return msg; @@ -226,8 +226,8 @@ canstatus_t canGetAndClearFlags(CANDriver *canp) { canstatus_t status; chSysLock(); - status = canp->cd_status; - canp->cd_status = 0; + status = canp->status; + canp->status = 0; chSysUnlock(); return status; } @@ -236,7 +236,7 @@ canstatus_t canGetAndClearFlags(CANDriver *canp) { /** * @brief Enters the sleep mode. * @details This function puts the CAN driver in sleep mode and broadcasts - * the @p cd_sleep_event event source. + * the @p sleep_event event source. * @pre In order to use this function the option @p CAN_USE_SLEEP_MODE must * be enabled and the @p CAN_SUPPORTS_SLEEP mode must be supported * by the low level driver. @@ -250,12 +250,12 @@ void canSleep(CANDriver *canp) { chDbgCheck(canp != NULL, "canSleep"); chSysLock(); - chDbgAssert((canp->cd_state == CAN_READY) || (canp->cd_state == CAN_SLEEP), + chDbgAssert((canp->state == CAN_READY) || (canp->state == CAN_SLEEP), "canSleep(), #1", "invalid state"); - if (canp->cd_state == CAN_READY) { + if (canp->state == CAN_READY) { can_lld_sleep(canp); - canp->cd_state = CAN_SLEEP; - chEvtBroadcastI(&canp->cd_sleep_event); + canp->state = CAN_SLEEP; + chEvtBroadcastI(&canp->sleep_event); chSchRescheduleS(); } chSysUnlock(); @@ -273,12 +273,12 @@ void canWakeup(CANDriver *canp) { chDbgCheck(canp != NULL, "canWakeup"); chSysLock(); - chDbgAssert((canp->cd_state == CAN_READY) || (canp->cd_state == CAN_SLEEP), + chDbgAssert((canp->state == CAN_READY) || (canp->state == CAN_SLEEP), "canWakeup(), #1", "invalid state"); - if (canp->cd_state == CAN_SLEEP) { + if (canp->state == CAN_SLEEP) { can_lld_wakeup(canp); - canp->cd_state = CAN_READY; - chEvtBroadcastI(&canp->cd_wakeup_event); + canp->state = CAN_READY; + chEvtBroadcastI(&canp->wakeup_event); chSchRescheduleS(); } chSysUnlock(); diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c index 9d033fe33..0cf74a5c1 100644 --- a/os/hal/src/mac.c +++ b/os/hal/src/mac.c @@ -71,10 +71,10 @@ void macInit(void) { */ void macObjectInit(MACDriver *macp) { - chSemInit(&macp->md_tdsem, 0); - chSemInit(&macp->md_rdsem, 0); + chSemInit(&macp->tdsem, 0); + chSemInit(&macp->rdsem, 0); #if CH_USE_EVENTS - chEvtInit(&macp->md_rdevent); + chEvtInit(&macp->rdevent); #endif } @@ -123,7 +123,7 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp, (time > 0)) { chSysLock(); systime_t now = chTimeNow(); - if ((msg = chSemWaitTimeoutS(&macp->md_tdsem, time)) == RDY_TIMEOUT) { + if ((msg = chSemWaitTimeoutS(&macp->tdsem, time)) == RDY_TIMEOUT) { chSysUnlock(); break; } @@ -175,7 +175,7 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp, (time > 0)) { chSysLock(); systime_t now = chTimeNow(); - if ((msg = chSemWaitTimeoutS(&macp->md_rdsem, time)) == RDY_TIMEOUT) { + if ((msg = chSemWaitTimeoutS(&macp->rdsem, time)) == RDY_TIMEOUT) { chSysUnlock(); break; } diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c index 1b2d930c5..df429c8d3 100644 --- a/os/hal/src/mmc_spi.c +++ b/os/hal/src/mmc_spi.c @@ -18,7 +18,7 @@ */ /** - * @file mmc_spi.c + * @file spi.c * @brief MMC over SPI driver code. * * @addtogroup MMC_SPI @@ -52,24 +52,24 @@ static void tmrfunc(void *p) { MMCDriver *mmcp = p; - if (mmcp->mmc_cnt > 0) { - if (mmcp->mmc_is_inserted()) { - if (--mmcp->mmc_cnt == 0) { - mmcp->mmc_state = MMC_INSERTED; - chEvtBroadcastI(&mmcp->mmc_inserted_event); + if (mmcp->cnt > 0) { + if (mmcp->is_inserted()) { + if (--mmcp->cnt == 0) { + mmcp->state = MMC_INSERTED; + chEvtBroadcastI(&mmcp->inserted_event); } } else - mmcp->mmc_cnt = MMC_POLLING_INTERVAL; + mmcp->cnt = MMC_POLLING_INTERVAL; } else { - if (!mmcp->mmc_is_inserted()) { - mmcp->mmc_state = MMC_WAIT; - mmcp->mmc_cnt = MMC_POLLING_INTERVAL; - chEvtBroadcastI(&mmcp->mmc_removed_event); + if (!mmcp->is_inserted()) { + mmcp->state = MMC_WAIT; + mmcp->cnt = MMC_POLLING_INTERVAL; + chEvtBroadcastI(&mmcp->removed_event); } } - chVTSetI(&mmcp->mmc_vt, MS2ST(MMC_POLLING_DELAY), tmrfunc, mmcp); + chVTSetI(&mmcp->vt, MS2ST(MMC_POLLING_DELAY), tmrfunc, mmcp); } /** @@ -84,13 +84,13 @@ static void wait(MMCDriver *mmcp) { uint8_t buf[4]; for (i = 0; i < 16; i++) { - spiReceive(mmcp->mmc_spip, 1, buf); + spiReceive(mmcp->spip, 1, buf); if (buf[0] == 0xFF) break; } /* Looks like it is a long wait.*/ while (TRUE) { - spiReceive(mmcp->mmc_spip, 1, buf); + spiReceive(mmcp->spip, 1, buf); if (buf[0] == 0xFF) break; #ifdef MMC_NICE_WAITING @@ -121,7 +121,7 @@ static void send_hdr(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { buf[3] = arg >> 8; buf[4] = arg; buf[5] = 0x95; /* Valid for CMD0 ignored by other commands. */ - spiSend(mmcp->mmc_spip, 6, buf); + spiSend(mmcp->spip, 6, buf); } /** @@ -138,7 +138,7 @@ static uint8_t recvr1(MMCDriver *mmcp) { uint8_t r1[1]; for (i = 0; i < 9; i++) { - spiReceive(mmcp->mmc_spip, 1, r1); + spiReceive(mmcp->spip, 1, r1); if (r1[0] != 0xFF) return r1[0]; } @@ -159,10 +159,10 @@ static uint8_t recvr1(MMCDriver *mmcp) { static uint8_t send_command(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { uint8_t r1; - spiSelect(mmcp->mmc_spip); + spiSelect(mmcp->spip); send_hdr(mmcp, cmd, arg); r1 = recvr1(mmcp); - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); return r1; } @@ -176,16 +176,16 @@ static uint8_t send_command(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { static void sync(MMCDriver *mmcp) { uint8_t buf[1]; - spiSelect(mmcp->mmc_spip); + spiSelect(mmcp->spip); while (TRUE) { - spiReceive(mmcp->mmc_spip, 1, buf); + spiReceive(mmcp->spip, 1, buf); if (buf[0] == 0xFF) break; #ifdef MMC_NICE_WAITING chThdSleep(1); /* Trying to be nice with the other threads.*/ #endif } - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); } /*===========================================================================*/ @@ -221,15 +221,15 @@ void mmcObjectInit(MMCDriver *mmcp, SPIDriver *spip, const SPIConfig *lscfg, const SPIConfig *hscfg, mmcquery_t is_protected, mmcquery_t is_inserted) { - mmcp->mmc_state = MMC_STOP; - mmcp->mmc_config = NULL; - mmcp->mmc_spip = spip; - mmcp->mmc_lscfg = lscfg; - mmcp->mmc_hscfg = hscfg; - mmcp->mmc_is_protected = is_protected; - mmcp->mmc_is_inserted = is_inserted; - chEvtInit(&mmcp->mmc_inserted_event); - chEvtInit(&mmcp->mmc_removed_event); + mmcp->state = MMC_STOP; + mmcp->config = NULL; + mmcp->spip = spip; + mmcp->lscfg = lscfg; + mmcp->hscfg = hscfg; + mmcp->is_protected = is_protected; + mmcp->is_inserted = is_inserted; + chEvtInit(&mmcp->inserted_event); + chEvtInit(&mmcp->removed_event); } /** @@ -245,11 +245,11 @@ void mmcStart(MMCDriver *mmcp, const MMCConfig *config) { chDbgCheck((mmcp != NULL) && (config == NULL), "mmcStart"); chSysLock(); - chDbgAssert(mmcp->mmc_state == MMC_STOP, "mmcStart(), #1", "invalid state"); - mmcp->mmc_config = config; - mmcp->mmc_state = MMC_WAIT; - mmcp->mmc_cnt = MMC_POLLING_INTERVAL; - chVTSetI(&mmcp->mmc_vt, MS2ST(MMC_POLLING_DELAY), tmrfunc, mmcp); + chDbgAssert(mmcp->state == MMC_STOP, "mmcStart(), #1", "invalid state"); + mmcp->config = config; + mmcp->state = MMC_WAIT; + mmcp->cnt = MMC_POLLING_INTERVAL; + chVTSetI(&mmcp->vt, MS2ST(MMC_POLLING_DELAY), tmrfunc, mmcp); chSysUnlock(); } @@ -265,17 +265,16 @@ void mmcStop(MMCDriver *mmcp) { chDbgCheck(mmcp != NULL, "mmcStop"); chSysLock(); - chDbgAssert((mmcp->mmc_state != MMC_UNINIT) && - (mmcp->mmc_state != MMC_READING) && - (mmcp->mmc_state != MMC_WRITING), - "mmcStop(), #1", - "invalid state"); - if (mmcp->mmc_state != MMC_STOP) { - mmcp->mmc_state = MMC_STOP; - chVTResetI(&mmcp->mmc_vt); + chDbgAssert((mmcp->state != MMC_UNINIT) && + (mmcp->state != MMC_READING) && + (mmcp->state != MMC_WRITING), + "mmcStop(), #1", "invalid state"); + if (mmcp->state != MMC_STOP) { + mmcp->state = MMC_STOP; + chVTResetI(&mmcp->vt); } chSysUnlock(); - spiStop(mmcp->mmc_spip); + spiStop(mmcp->spip); } /** @@ -300,15 +299,13 @@ bool_t mmcConnect(MMCDriver *mmcp) { chDbgCheck(mmcp != NULL, "mmcConnect"); - chDbgAssert((mmcp->mmc_state != MMC_UNINIT) && - (mmcp->mmc_state != MMC_STOP), - "mmcConnect(), #1", - "invalid state"); + chDbgAssert((mmcp->state != MMC_UNINIT) && (mmcp->state != MMC_STOP), + "mmcConnect(), #1", "invalid state"); - if (mmcp->mmc_state == MMC_INSERTED) { + if (mmcp->state == MMC_INSERTED) { /* Slow clock mode and 128 clock pulses.*/ - spiStart(mmcp->mmc_spip, mmcp->mmc_lscfg); - spiIgnore(mmcp->mmc_spip, 16); + spiStart(mmcp->spip, mmcp->lscfg); + spiIgnore(mmcp->spip, 16); /* SPI mode selection.*/ i = 0; @@ -334,7 +331,7 @@ bool_t mmcConnect(MMCDriver *mmcp) { } /* Initialization complete, full speed. */ - spiStart(mmcp->mmc_spip, mmcp->mmc_hscfg); + spiStart(mmcp->spip, mmcp->hscfg); /* Setting block size.*/ if (send_command(mmcp, MMC_CMDSETBLOCKLEN, MMC_SECTOR_SIZE) != 0x00) @@ -342,8 +339,8 @@ bool_t mmcConnect(MMCDriver *mmcp) { /* Transition to MMC_READY state (if not extracted).*/ chSysLock(); - if (mmcp->mmc_state == MMC_INSERTED) { - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_INSERTED) { + mmcp->state = MMC_READY; result = FALSE; } else @@ -351,7 +348,7 @@ bool_t mmcConnect(MMCDriver *mmcp) { chSysUnlock(); return result; } - if (mmcp->mmc_state == MMC_READY) + if (mmcp->state == MMC_READY) return FALSE; /* Any other state is invalid.*/ return TRUE; @@ -373,24 +370,22 @@ bool_t mmcDisconnect(MMCDriver *mmcp) { chDbgCheck(mmcp != NULL, "mmcDisconnect"); - chDbgAssert((mmcp->mmc_state != MMC_UNINIT) && - (mmcp->mmc_state != MMC_STOP), - "mmcDisconnect(), #1", - "invalid state"); - switch (mmcp->mmc_state) { + chDbgAssert((mmcp->state != MMC_UNINIT) && (mmcp->state != MMC_STOP), + "mmcDisconnect(), #1", "invalid state"); + switch (mmcp->state) { case MMC_READY: /* Wait for the pending write operations to complete.*/ sync(mmcp); chSysLock(); - if (mmcp->mmc_state == MMC_READY) - mmcp->mmc_state = MMC_INSERTED; + if (mmcp->state == MMC_READY) + mmcp->state = MMC_INSERTED; chSysUnlock(); case MMC_INSERTED: status = FALSE; default: status = TRUE; } - spiStop(mmcp->mmc_spip); + spiStop(mmcp->spip); return status; } @@ -410,21 +405,21 @@ bool_t mmcStartSequentialRead(MMCDriver *mmcp, uint32_t startblk) { chDbgCheck(mmcp != NULL, "mmcStartSequentialRead"); chSysLock(); - if (mmcp->mmc_state != MMC_READY) { + if (mmcp->state != MMC_READY) { chSysUnlock(); return TRUE; } - mmcp->mmc_state = MMC_READING; + mmcp->state = MMC_READING; chSysUnlock(); - spiStart(mmcp->mmc_spip, mmcp->mmc_hscfg); - spiSelect(mmcp->mmc_spip); + spiStart(mmcp->spip, mmcp->hscfg); + spiSelect(mmcp->spip); send_hdr(mmcp, MMC_CMDREADMULTIPLE, startblk * MMC_SECTOR_SIZE); if (recvr1(mmcp) != 0x00) { - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); chSysLock(); - if (mmcp->mmc_state == MMC_READING) - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_READING) + mmcp->state = MMC_READY; chSysUnlock(); return TRUE; } @@ -448,26 +443,26 @@ bool_t mmcSequentialRead(MMCDriver *mmcp, uint8_t *buffer) { chDbgCheck((mmcp != NULL) && (buffer != NULL), "mmcSequentialRead"); chSysLock(); - if (mmcp->mmc_state != MMC_READING) { + if (mmcp->state != MMC_READING) { chSysUnlock(); return TRUE; } chSysUnlock(); for (i = 0; i < MMC_WAIT_DATA; i++) { - spiReceive(mmcp->mmc_spip, 1, buffer); + spiReceive(mmcp->spip, 1, buffer); if (buffer[0] == 0xFE) { - spiReceive(mmcp->mmc_spip, MMC_SECTOR_SIZE, buffer); + spiReceive(mmcp->spip, MMC_SECTOR_SIZE, buffer); /* CRC ignored. */ - spiIgnore(mmcp->mmc_spip, 2); + spiIgnore(mmcp->spip, 2); return FALSE; } } /* Timeout.*/ - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); chSysLock(); - if (mmcp->mmc_state == MMC_READING) - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_READING) + mmcp->state = MMC_READY; chSysUnlock(); return TRUE; } @@ -489,22 +484,22 @@ bool_t mmcStopSequentialRead(MMCDriver *mmcp) { chDbgCheck(mmcp != NULL, "mmcStopSequentialRead"); chSysLock(); - if (mmcp->mmc_state != MMC_READING) { + if (mmcp->state != MMC_READING) { chSysUnlock(); return TRUE; } chSysUnlock(); - spiSend(mmcp->mmc_spip, sizeof(stopcmd), stopcmd); + spiSend(mmcp->spip, sizeof(stopcmd), stopcmd); /* result = recvr1(mmcp) != 0x00;*/ /* Note, ignored r1 response, it can be not zero, unknown issue.*/ recvr1(mmcp); result = FALSE; - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); chSysLock(); - if (mmcp->mmc_state == MMC_READING) - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_READING) + mmcp->state = MMC_READY; chSysUnlock(); return result; } @@ -525,21 +520,21 @@ bool_t mmcStartSequentialWrite(MMCDriver *mmcp, uint32_t startblk) { chDbgCheck(mmcp != NULL, "mmcStartSequentialWrite"); chSysLock(); - if (mmcp->mmc_state != MMC_READY) { + if (mmcp->state != MMC_READY) { chSysUnlock(); return TRUE; } - mmcp->mmc_state = MMC_WRITING; + mmcp->state = MMC_WRITING; chSysUnlock(); - spiStart(mmcp->mmc_spip, mmcp->mmc_hscfg); - spiSelect(mmcp->mmc_spip); + spiStart(mmcp->spip, mmcp->hscfg); + spiSelect(mmcp->spip); send_hdr(mmcp, MMC_CMDWRITEMULTIPLE, startblk * MMC_SECTOR_SIZE); if (recvr1(mmcp) != 0x00) { - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); chSysLock(); - if (mmcp->mmc_state == MMC_WRITING) - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_WRITING) + mmcp->state = MMC_READY; chSysUnlock(); return TRUE; } @@ -564,26 +559,26 @@ bool_t mmcSequentialWrite(MMCDriver *mmcp, const uint8_t *buffer) { chDbgCheck((mmcp != NULL) && (buffer != NULL), "mmcSequentialWrite"); chSysLock(); - if (mmcp->mmc_state != MMC_WRITING) { + if (mmcp->state != MMC_WRITING) { chSysUnlock(); return TRUE; } chSysUnlock(); - spiSend(mmcp->mmc_spip, sizeof(start), start); /* Data prologue. */ - spiSend(mmcp->mmc_spip, MMC_SECTOR_SIZE, buffer); /* Data. */ - spiIgnore(mmcp->mmc_spip, 2); /* CRC ignored. */ - spiReceive(mmcp->mmc_spip, 1, b); + spiSend(mmcp->spip, sizeof(start), start); /* Data prologue. */ + spiSend(mmcp->spip, MMC_SECTOR_SIZE, buffer); /* Data. */ + spiIgnore(mmcp->spip, 2); /* CRC ignored. */ + spiReceive(mmcp->spip, 1, b); if ((b[0] & 0x1F) == 0x05) { wait(mmcp); return FALSE; } /* Error.*/ - spiUnselect(mmcp->mmc_spip); + spiUnselect(mmcp->spip); chSysLock(); - if (mmcp->mmc_state == MMC_WRITING) - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_WRITING) + mmcp->state = MMC_READY; chSysUnlock(); return TRUE; } @@ -604,18 +599,18 @@ bool_t mmcStopSequentialWrite(MMCDriver *mmcp) { chDbgCheck(mmcp != NULL, "mmcStopSequentialWrite"); chSysLock(); - if (mmcp->mmc_state != MMC_WRITING) { + if (mmcp->state != MMC_WRITING) { chSysUnlock(); return TRUE; } chSysUnlock(); - spiSend(mmcp->mmc_spip, sizeof(stop), stop); - spiUnselect(mmcp->mmc_spip); + spiSend(mmcp->spip, sizeof(stop), stop); + spiUnselect(mmcp->spip); chSysLock(); - if (mmcp->mmc_state == MMC_WRITING) { - mmcp->mmc_state = MMC_READY; + if (mmcp->state == MMC_WRITING) { + mmcp->state = MMC_READY; chSysUnlock(); return FALSE; } diff --git a/os/hal/src/pal.c b/os/hal/src/pal.c index ce7c226e9..de12baef6 100644 --- a/os/hal/src/pal.c +++ b/os/hal/src/pal.c @@ -64,9 +64,9 @@ ioportmask_t palReadBus(IOBus *bus) { chDbgCheck((bus != NULL) && - (bus->bus_offset > PAL_IOPORTS_WIDTH), "palReadBus"); + (bus->offset > PAL_IOPORTS_WIDTH), "palReadBus"); - return palReadGroup(bus->bus_portid, bus->bus_mask, bus->bus_offset); + return palReadGroup(bus->portid, bus->mask, bus->offset); } /** @@ -89,9 +89,9 @@ ioportmask_t palReadBus(IOBus *bus) { void palWriteBus(IOBus *bus, ioportmask_t bits) { chDbgCheck((bus != NULL) && - (bus->bus_offset > PAL_IOPORTS_WIDTH), "palWriteBus"); + (bus->offset > PAL_IOPORTS_WIDTH), "palWriteBus"); - palWriteGroup(bus->bus_portid, bus->bus_mask, bus->bus_offset, bits); + palWriteGroup(bus->portid, bus->mask, bus->offset, bits); } /** @@ -112,9 +112,9 @@ void palWriteBus(IOBus *bus, ioportmask_t bits) { void palSetBusMode(IOBus *bus, uint_fast8_t mode) { chDbgCheck((bus != NULL) && - (bus->bus_offset > PAL_IOPORTS_WIDTH), "palSetBusMode"); + (bus->offset > PAL_IOPORTS_WIDTH), "palSetBusMode"); - palSetGroupMode(bus->bus_portid, bus->bus_mask, mode); + palSetGroupMode(bus->portid, bus->mask, mode); } #endif /* HAL_USE_PAL */ diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c index cf619e508..40ad7428d 100644 --- a/os/hal/src/pwm.c +++ b/os/hal/src/pwm.c @@ -67,8 +67,8 @@ void pwmInit(void) { */ void pwmObjectInit(PWMDriver *pwmp) { - pwmp->pd_state = PWM_STOP; - pwmp->pd_config = NULL; + pwmp->state = PWM_STOP; + pwmp->config = NULL; #if defined(PWM_DRIVER_EXT_INIT_HOOK) PWM_DRIVER_EXT_INIT_HOOK(pwmp); #endif @@ -87,11 +87,11 @@ void pwmStart(PWMDriver *pwmp, const PWMConfig *config) { chDbgCheck((pwmp != NULL) && (config != NULL), "pwmStart"); chSysLock(); - chDbgAssert((pwmp->pd_state == PWM_STOP) || (pwmp->pd_state == PWM_READY), + chDbgAssert((pwmp->state == PWM_STOP) || (pwmp->state == PWM_READY), "pwmStart(), #1", "invalid state"); - pwmp->pd_config = config; + pwmp->config = config; pwm_lld_start(pwmp); - pwmp->pd_state = PWM_READY; + pwmp->state = PWM_READY; chSysUnlock(); } @@ -107,10 +107,10 @@ void pwmStop(PWMDriver *pwmp) { chDbgCheck(pwmp != NULL, "pwmStop"); chSysLock(); - chDbgAssert((pwmp->pd_state == PWM_STOP) || (pwmp->pd_state == PWM_READY), + chDbgAssert((pwmp->state == PWM_STOP) || (pwmp->state == PWM_READY), "pwmStop(), #1", "invalid state"); pwm_lld_stop(pwmp); - pwmp->pd_state = PWM_STOP; + pwmp->state = PWM_STOP; chSysUnlock(); } @@ -132,7 +132,7 @@ void pwmEnableChannel(PWMDriver *pwmp, "pwmEnableChannel"); chSysLock(); - chDbgAssert(pwmp->pd_state == PWM_READY, + chDbgAssert(pwmp->state == PWM_READY, "pwmEnableChannel(), #1", "not ready"); pwm_lld_enable_channel(pwmp, channel, width); chSysUnlock(); @@ -154,7 +154,7 @@ void pwmDisableChannel(PWMDriver *pwmp, pwmchannel_t channel) { "pwmEnableChannel"); chSysLock(); - chDbgAssert(pwmp->pd_state == PWM_READY, + chDbgAssert(pwmp->state == PWM_READY, "pwmDisableChannel(), #1", "not ready"); pwm_lld_disable_channel(pwmp, channel); chSysUnlock(); diff --git a/os/hal/src/spi.c b/os/hal/src/spi.c index e99126b9e..686006e0d 100644 --- a/os/hal/src/spi.c +++ b/os/hal/src/spi.c @@ -67,16 +67,16 @@ void spiInit(void) { */ void spiObjectInit(SPIDriver *spip) { - spip->spd_state = SPI_STOP; - spip->spd_config = NULL; + spip->state = SPI_STOP; + spip->config = NULL; #if SPI_USE_WAIT - spip->spd_thread = NULL; + spip->thread = NULL; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION #if CH_USE_MUTEXES - chMtxInit(&spip->spd_mutex); + chMtxInit(&spip->mutex); #else - chSemInit(&spip->spd_semaphore, 1); + chSemInit(&spip->semaphore, 1); #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_INIT_HOOK) @@ -97,11 +97,11 @@ void spiStart(SPIDriver *spip, const SPIConfig *config) { chDbgCheck((spip != NULL) && (config != NULL), "spiStart"); chSysLock(); - chDbgAssert((spip->spd_state == SPI_STOP) || (spip->spd_state == SPI_READY), + chDbgAssert((spip->state == SPI_STOP) || (spip->state == SPI_READY), "spiStart(), #1", "invalid state"); - spip->spd_config = config; + spip->config = config; spi_lld_start(spip); - spip->spd_state = SPI_READY; + spip->state = SPI_READY; chSysUnlock(); } @@ -119,11 +119,11 @@ void spiStop(SPIDriver *spip) { chDbgCheck(spip != NULL, "spiStop"); chSysLock(); - chDbgAssert((spip->spd_state == SPI_STOP) || (spip->spd_state == SPI_READY), + chDbgAssert((spip->state == SPI_STOP) || (spip->state == SPI_READY), "spiStop(), #1", "invalid state"); spi_lld_unselect(spip); spi_lld_stop(spip); - spip->spd_state = SPI_STOP; + spip->state = SPI_STOP; chSysUnlock(); } @@ -139,8 +139,7 @@ void spiSelect(SPIDriver *spip) { chDbgCheck(spip != NULL, "spiSelect"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiSelect(), #1", "not ready"); + chDbgAssert(spip->state == SPI_READY, "spiSelect(), #1", "not ready"); spiSelectI(spip); chSysUnlock(); } @@ -158,8 +157,7 @@ void spiUnselect(SPIDriver *spip) { chDbgCheck(spip != NULL, "spiUnselect"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiUnselect(), #1", "not ready"); + chDbgAssert(spip->state == SPI_READY, "spiUnselect(), #1", "not ready"); spiUnselectI(spip); chSysUnlock(); } @@ -182,8 +180,7 @@ void spiStartIgnore(SPIDriver *spip, size_t n) { chDbgCheck((spip != NULL) && (n > 0), "spiStartIgnore"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiStartIgnore(), #1", "not ready"); + chDbgAssert(spip->state == SPI_READY, "spiStartIgnore(), #1", "not ready"); spiStartIgnoreI(spip, n); chSysUnlock(); } @@ -212,8 +209,7 @@ void spiStartExchange(SPIDriver *spip, size_t n, "spiStartExchange"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiStartExchange(), #1", "not ready"); + chDbgAssert(spip->state == SPI_READY, "spiStartExchange(), #1", "not ready"); spiStartExchangeI(spip, n, txbuf, rxbuf); chSysUnlock(); } @@ -239,8 +235,7 @@ void spiStartSend(SPIDriver *spip, size_t n, const void *txbuf) { "spiStartSend"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiStartSend(), #1", "not ready"); + chDbgAssert(spip->state == SPI_READY, "spiStartSend(), #1", "not ready"); spiStartSendI(spip, n, txbuf); chSysUnlock(); } @@ -266,8 +261,7 @@ void spiStartReceive(SPIDriver *spip, size_t n, void *rxbuf) { "spiStartReceive"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiStartReceive(), #1", "not ready"); + chDbgAssert(spip->state == SPI_READY, "spiStartReceive(), #1", "not ready"); spiStartReceiveI(spip, n, rxbuf); chSysUnlock(); } @@ -280,7 +274,7 @@ void spiStartReceive(SPIDriver *spip, size_t n, void *rxbuf) { * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured - * without callbacks (@p spc_endcb = @p NULL). + * without callbacks (@p end_cb = @p NULL). * * @param[in] spip pointer to the @p SPIDriver object * @param[in] n number of words to be ignored @@ -292,10 +286,8 @@ void spiIgnore(SPIDriver *spip, size_t n) { chDbgCheck((spip != NULL) && (n > 0), "spiIgnoreWait"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiIgnore(), #1", "not ready"); - chDbgAssert(spip->spd_config->spc_endcb == NULL, - "spiIgnore(), #2", "has callback"); + chDbgAssert(spip->state == SPI_READY, "spiIgnore(), #1", "not ready"); + chDbgAssert(spip->config->end_cb == NULL, "spiIgnore(), #2", "has callback"); spiStartIgnoreI(spip, n); _spi_wait_s(spip); chSysUnlock(); @@ -308,7 +300,7 @@ void spiIgnore(SPIDriver *spip, size_t n) { * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured - * without callbacks (@p spc_endcb = @p NULL). + * without callbacks (@p end_cb = @p NULL). * @note The buffers are organized as uint8_t arrays for data sizes below * or equal to 8 bits else it is organized as uint16_t arrays. * @@ -326,9 +318,8 @@ void spiExchange(SPIDriver *spip, size_t n, "spiExchange"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiExchange(), #1", "not ready"); - chDbgAssert(spip->spd_config->spc_endcb == NULL, + chDbgAssert(spip->state == SPI_READY, "spiExchange(), #1", "not ready"); + chDbgAssert(spip->config->end_cb == NULL, "spiExchange(), #2", "has callback"); spiStartExchangeI(spip, n, txbuf, rxbuf); _spi_wait_s(spip); @@ -341,7 +332,7 @@ void spiExchange(SPIDriver *spip, size_t n, * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured - * without callbacks (@p spc_endcb = @p NULL). + * without callbacks (@p end_cb = @p NULL). * @note The buffers are organized as uint8_t arrays for data sizes below * or equal to 8 bits else it is organized as uint16_t arrays. * @@ -353,14 +344,11 @@ void spiExchange(SPIDriver *spip, size_t n, */ void spiSend(SPIDriver *spip, size_t n, const void *txbuf) { - chDbgCheck((spip != NULL) && (n > 0) && (txbuf != NULL), - "spiSend"); + chDbgCheck((spip != NULL) && (n > 0) && (txbuf != NULL), "spiSend"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiSend(), #1", "not ready"); - chDbgAssert(spip->spd_config->spc_endcb == NULL, - "spiSend(), #2", "has callback"); + chDbgAssert(spip->state == SPI_READY, "spiSend(), #1", "not ready"); + chDbgAssert(spip->config->end_cb == NULL, "spiSend(), #2", "has callback"); spiStartSendI(spip, n, txbuf); _spi_wait_s(spip); chSysUnlock(); @@ -372,7 +360,7 @@ void spiSend(SPIDriver *spip, size_t n, const void *txbuf) { * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured - * without callbacks (@p spc_endcb = @p NULL). + * without callbacks (@p end_cb = @p NULL). * @note The buffers are organized as uint8_t arrays for data sizes below * or equal to 8 bits else it is organized as uint16_t arrays. * @@ -388,9 +376,8 @@ void spiReceive(SPIDriver *spip, size_t n, void *rxbuf) { "spiReceive"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, - "spiReceive(), #1", "not ready"); - chDbgAssert(spip->spd_config->spc_endcb == NULL, + chDbgAssert(spip->state == SPI_READY, "spiReceive(), #1", "not ready"); + chDbgAssert(spip->config->end_cb == NULL, "spiReceive(), #2", "has callback"); spiStartReceiveI(spip, n, rxbuf); _spi_wait_s(spip); @@ -415,9 +402,9 @@ void spiAcquireBus(SPIDriver *spip) { chDbgCheck(spip != NULL, "spiAcquireBus"); #if CH_USE_MUTEXES - chMtxLock(&spip->spd_mutex); + chMtxLock(&spip->mutex); #elif CH_USE_SEMAPHORES - chSemWait(&spip->spd_semaphore); + chSemWait(&spip->semaphore); #endif } @@ -438,7 +425,7 @@ void spiReleaseBus(SPIDriver *spip) { (void)spip; chMtxUnlock(); #elif CH_USE_SEMAPHORES - chSemSignal(&spip->spd_semaphore); + chSemSignal(&spip->semaphore); #endif } #endif /* SPI_USE_MUTUAL_EXCLUSION */ diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c index 4a21e907f..2a9c6ce6f 100644 --- a/os/hal/src/uart.c +++ b/os/hal/src/uart.c @@ -67,10 +67,10 @@ void uartInit(void) { */ void uartObjectInit(UARTDriver *uartp) { - uartp->ud_state = UART_STOP; - uartp->ud_txstate = UART_TX_IDLE; - uartp->ud_rxstate = UART_RX_IDLE; - uartp->ud_config = NULL; + uartp->state = UART_STOP; + uartp->txstate = UART_TX_IDLE; + uartp->rxstate = UART_RX_IDLE; + uartp->config = NULL; /* Optional, user-defined initializer.*/ #if defined(UART_DRIVER_EXT_INIT_HOOK) UART_DRIVER_EXT_INIT_HOOK(uartp); @@ -90,14 +90,12 @@ void uartStart(UARTDriver *uartp, const UARTConfig *config) { chDbgCheck((uartp != NULL) && (config != NULL), "uartStart"); chSysLock(); - chDbgAssert((uartp->ud_state == UART_STOP) || - (uartp->ud_state == UART_READY), - "uartStart(), #1", - "invalid state"); + chDbgAssert((uartp->state == UART_STOP) || (uartp->state == UART_READY), + "uartStart(), #1", "invalid state"); - uartp->ud_config = config; + uartp->config = config; uart_lld_start(uartp); - uartp->ud_state = UART_READY; + uartp->state = UART_READY; chSysUnlock(); } @@ -113,15 +111,13 @@ void uartStop(UARTDriver *uartp) { chDbgCheck(uartp != NULL, "uartStop"); chSysLock(); - chDbgAssert((uartp->ud_state == UART_STOP) || - (uartp->ud_state == UART_READY), - "uartStop(), #1", - "invalid state"); + chDbgAssert((uartp->state == UART_STOP) || (uartp->state == UART_READY), + "uartStop(), #1", "invalid state"); uart_lld_stop(uartp); - uartp->ud_state = UART_STOP; - uartp->ud_txstate = UART_TX_IDLE; - uartp->ud_rxstate = UART_RX_IDLE; + uartp->state = UART_STOP; + uartp->txstate = UART_TX_IDLE; + uartp->rxstate = UART_RX_IDLE; chSysUnlock(); } @@ -142,13 +138,11 @@ void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf) { "uartStartSend"); chSysLock(); - chDbgAssert((uartp->ud_state == UART_READY) && - (uartp->ud_txstate == UART_TX_IDLE), - "uartStartSend(), #1", - "not active"); + chDbgAssert((uartp->state == UART_READY) && (uartp->txstate == UART_TX_IDLE), + "uartStartSend(), #1", "not active"); uart_lld_start_send(uartp, n, txbuf); - uartp->ud_txstate = UART_TX_ACTIVE; + uartp->txstate = UART_TX_ACTIVE; chSysUnlock(); } @@ -169,12 +163,11 @@ void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf) { chDbgCheck((uartp != NULL) && (n > 0) && (txbuf != NULL), "uartStartSendI"); - chDbgAssert((uartp->ud_state == UART_READY) && - (uartp->ud_txstate != UART_TX_ACTIVE), - "uartStartSendI(), #1", - "not active"); + chDbgAssert((uartp->state == UART_READY) && + (uartp->txstate != UART_TX_ACTIVE), + "uartStartSendI(), #1", "not active"); uart_lld_start_send(uartp, n, txbuf); - uartp->ud_txstate = UART_TX_ACTIVE; + uartp->txstate = UART_TX_ACTIVE; } /** @@ -195,13 +188,11 @@ size_t uartStopSend(UARTDriver *uartp) { chDbgCheck(uartp != NULL, "uartStopSend"); chSysLock(); - chDbgAssert(uartp->ud_state == UART_READY, - "uartStopSend(), #1", - "not active"); + chDbgAssert(uartp->state == UART_READY, "uartStopSend(), #1", "not active"); - if (uartp->ud_txstate == UART_TX_ACTIVE) { + if (uartp->txstate == UART_TX_ACTIVE) { n = uart_lld_stop_send(uartp); - uartp->ud_txstate = UART_TX_IDLE; + uartp->txstate = UART_TX_IDLE; } else n = 0; @@ -226,13 +217,11 @@ size_t uartStopSendI(UARTDriver *uartp) { chDbgCheck(uartp != NULL, "uartStopSendI"); - chDbgAssert(uartp->ud_state == UART_READY, - "uartStopSendI(), #1", - "not active"); + chDbgAssert(uartp->state == UART_READY, "uartStopSendI(), #1", "not active"); - if (uartp->ud_txstate == UART_TX_ACTIVE) { + if (uartp->txstate == UART_TX_ACTIVE) { size_t n = uart_lld_stop_send(uartp); - uartp->ud_txstate = UART_TX_IDLE; + uartp->txstate = UART_TX_IDLE; return n; } return 0; @@ -255,13 +244,11 @@ void uartStartReceive(UARTDriver *uartp, size_t n, void *rxbuf) { "uartStartReceive"); chSysLock(); - chDbgAssert((uartp->ud_state == UART_READY) && - (uartp->ud_rxstate == UART_RX_IDLE), - "uartStartReceive(), #1", - "not active"); + chDbgAssert((uartp->state == UART_READY) && (uartp->rxstate == UART_RX_IDLE), + "uartStartReceive(), #1", "not active"); uart_lld_start_receive(uartp, n, rxbuf); - uartp->ud_rxstate = UART_RX_ACTIVE; + uartp->rxstate = UART_RX_ACTIVE; chSysUnlock(); } @@ -282,13 +269,11 @@ void uartStartReceiveI(UARTDriver *uartp, size_t n, void *rxbuf) { chDbgCheck((uartp != NULL) && (n > 0) && (rxbuf != NULL), "uartStartReceiveI"); - chDbgAssert((uartp->ud_state == UART_READY) && - (uartp->ud_rxstate == UART_RX_IDLE), - "uartStartReceiveI(), #1", - "not active"); + chDbgAssert((uartp->state == UART_READY) && (uartp->rxstate == UART_RX_IDLE), + "uartStartReceiveI(), #1", "not active"); uart_lld_start_receive(uartp, n, rxbuf); - uartp->ud_rxstate = UART_RX_ACTIVE; + uartp->rxstate = UART_RX_ACTIVE; } /** @@ -309,13 +294,12 @@ size_t uartStopReceive(UARTDriver *uartp) { chDbgCheck(uartp != NULL, "uartStopReceive"); chSysLock(); - chDbgAssert(uartp->ud_state == UART_READY, - "uartStopReceive(), #1", - "not active"); + chDbgAssert(uartp->state == UART_READY, + "uartStopReceive(), #1", "not active"); - if (uartp->ud_rxstate == UART_RX_ACTIVE) { + if (uartp->rxstate == UART_RX_ACTIVE) { n = uart_lld_stop_receive(uartp); - uartp->ud_rxstate = UART_RX_IDLE; + uartp->rxstate = UART_RX_IDLE; } else n = 0; @@ -339,13 +323,12 @@ size_t uartStopReceive(UARTDriver *uartp) { size_t uartStopReceiveI(UARTDriver *uartp) { chDbgCheck(uartp != NULL, "uartStopReceiveI"); - chDbgAssert(uartp->ud_state == UART_READY, - "uartStopReceiveI(), #1", - "not active"); + chDbgAssert(uartp->state == UART_READY, + "uartStopReceiveI(), #1", "not active"); - if (uartp->ud_rxstate == UART_RX_ACTIVE) { + if (uartp->rxstate == UART_RX_ACTIVE) { size_t n = uart_lld_stop_receive(uartp); - uartp->ud_rxstate = UART_RX_IDLE; + uartp->rxstate = UART_RX_IDLE; return n; } return 0; diff --git a/os/hal/templates/adc_lld.c b/os/hal/templates/adc_lld.c index 6c541f557..4a6acbee6 100644 --- a/os/hal/templates/adc_lld.c +++ b/os/hal/templates/adc_lld.c @@ -83,7 +83,7 @@ void adc_lld_start(ADCDriver *adcp) { */ void adc_lld_stop(ADCDriver *adcp) { - if (adcp->ad_state == ADC_READY) { + if (adcp->state == ADC_READY) { /* Clock de-activation.*/ } diff --git a/os/hal/templates/adc_lld.h b/os/hal/templates/adc_lld.h index 54d78fd44..1cfba2f72 100644 --- a/os/hal/templates/adc_lld.h +++ b/os/hal/templates/adc_lld.h @@ -86,15 +86,15 @@ typedef struct { /** * @brief Enables the circular buffer mode for the group. */ - bool_t acg_circular; + bool_t circular; /** * @brief Number of the analog channels belonging to the conversion group. */ - adc_channels_num_t acg_num_channels; + adc_channels_num_t num_channels; /** * @brief Callback function associated to the group or @p NULL. */ - adccallback_t acg_endcb; + adccallback_t end_cb; /* End of the mandatory fields.*/ } ADCConversionGroup; @@ -117,37 +117,37 @@ struct ADCDriver { /** * @brief Driver state. */ - adcstate_t ad_state; + adcstate_t state; /** * @brief Current configuration data. */ - const ADCConfig *ad_config; + const ADCConfig *config; /** * @brief Current samples buffer pointer or @p NULL. */ - adcsample_t *ad_samples; + adcsample_t *samples; /** * @brief Current samples buffer depth or @p 0. */ - size_t ad_depth; + size_t depth; /** * @brief Current conversion group pointer or @p NULL. */ - const ADCConversionGroup *ad_grpp; + const ADCConversionGroup *grpp; #if ADC_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *ad_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the peripheral. */ - Mutex ad_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore ad_semaphore; + Semaphore semaphore; #endif #endif /* ADC_USE_MUTUAL_EXCLUSION */ #if defined(ADC_DRIVER_EXT_FIELDS) diff --git a/os/hal/templates/can_lld.c b/os/hal/templates/can_lld.c index 2dc92f169..3662d2867 100644 --- a/os/hal/templates/can_lld.c +++ b/os/hal/templates/can_lld.c @@ -80,7 +80,7 @@ void can_lld_start(CANDriver *canp) { void can_lld_stop(CANDriver *canp) { /* If in ready state then disables the CAN peripheral.*/ - if (canp->cd_state == CAN_READY) { + if (canp->state == CAN_READY) { } } diff --git a/os/hal/templates/can_lld.h b/os/hal/templates/can_lld.h index 37ce7f157..4817cdc7f 100644 --- a/os/hal/templates/can_lld.h +++ b/os/hal/templates/can_lld.h @@ -82,22 +82,22 @@ typedef uint32_t canstatus_t; */ typedef struct { struct { - uint8_t cf_DLC:4; /**< @brief Data length. */ - uint8_t cf_RTR:1; /**< @brief Frame type. */ - uint8_t cf_IDE:1; /**< @brief Identifier type. */ + uint8_t DLC:4; /**< @brief Data length. */ + uint8_t RTR:1; /**< @brief Frame type. */ + uint8_t IDE:1; /**< @brief Identifier type. */ }; union { struct { - uint32_t cf_SID:11; /**< @brief Standard identifier.*/ + uint32_t SID:11; /**< @brief Standard identifier.*/ }; struct { - uint32_t cf_EID:29; /**< @brief Extended identifier.*/ + uint32_t EID:29; /**< @brief Extended identifier.*/ }; }; union { - uint8_t cf_data8[8]; /**< @brief Frame data. */ - uint16_t cf_data16[4]; /**< @brief Frame data. */ - uint32_t cf_data32[2]; /**< @brief Frame data. */ + uint8_t data8[8]; /**< @brief Frame data. */ + uint16_t data16[4]; /**< @brief Frame data. */ + uint32_t data32[2]; /**< @brief Frame data. */ }; } CANTxFrame; @@ -109,22 +109,22 @@ typedef struct { */ typedef struct { struct { - uint8_t cf_DLC:4; /**< @brief Data length. */ - uint8_t cf_RTR:1; /**< @brief Frame type. */ - uint8_t cf_IDE:1; /**< @brief Identifier type. */ + uint8_t DLC:4; /**< @brief Data length. */ + uint8_t RTR:1; /**< @brief Frame type. */ + uint8_t IDE:1; /**< @brief Identifier type. */ }; union { struct { - uint32_t cf_SID:11; /**< @brief Standard identifier.*/ + uint32_t SID:11; /**< @brief Standard identifier.*/ }; struct { - uint32_t cf_EID:29; /**< @brief Extended identifier.*/ + uint32_t EID:29; /**< @brief Extended identifier.*/ }; }; union { - uint8_t cf_data8[8]; /**< @brief Frame data. */ - uint16_t cf_data16[4]; /**< @brief Frame data. */ - uint32_t cf_data32[2]; /**< @brief Frame data. */ + uint8_t data8[8]; /**< @brief Frame data. */ + uint16_t data16[4]; /**< @brief Frame data. */ + uint32_t data32[2]; /**< @brief Frame data. */ }; } CANRxFrame; @@ -155,19 +155,19 @@ typedef struct { /** * @brief Driver state. */ - canstate_t cd_state; + canstate_t state; /** * @brief Current configuration data. */ - const CANConfig *cd_config; + const CANConfig *config; /** * @brief Transmission queue semaphore. */ - Semaphore cd_txsem; + Semaphore txsem; /** * @brief Receive queue semaphore. */ - Semaphore cd_rxsem; + Semaphore rxsem; /** * @brief One or more frames become available. * @note After broadcasting this event it will not be broadcasted again @@ -177,28 +177,28 @@ typedef struct { * invoking @p chReceive() when listening to this event. This behavior * minimizes the interrupt served by the system because CAN traffic. */ - EventSource cd_rxfull_event; + EventSource rxfull_event; /** * @brief One or more transmission slots become available. */ - EventSource cd_txempty_event; + EventSource txempty_event; /** * @brief A CAN bus error happened. */ - EventSource cd_error_event; + EventSource error_event; /** * @brief Error flags set when an error event is broadcasted. */ - canstatus_t cd_status; + canstatus_t status; #if CAN_USE_SLEEP_MODE || defined (__DOXYGEN__) /** * @brief Entering sleep state event. */ - EventSource cd_sleep_event; + EventSource sleep_event; /** * @brief Exiting sleep state event. */ - EventSource cd_wakeup_event; + EventSource wakeup_event; #endif /* CAN_USE_SLEEP_MODE */ /* End of the mandatory fields.*/ } CANDriver; diff --git a/os/hal/templates/mac_lld.h b/os/hal/templates/mac_lld.h index 869fa5db8..f9b532009 100644 --- a/os/hal/templates/mac_lld.h +++ b/os/hal/templates/mac_lld.h @@ -73,10 +73,10 @@ * architecture dependent, fields. */ typedef struct { - Semaphore md_tdsem; /**< Transmit semaphore. */ - Semaphore md_rdsem; /**< Receive semaphore. */ + Semaphore tdsem; /**< Transmit semaphore. */ + Semaphore rdsem; /**< Receive semaphore. */ #if CH_USE_EVENTS - EventSource md_rdevent; /**< Receive event source. */ + EventSource rdevent; /**< Receive event source. */ #endif /* End of the mandatory fields.*/ } MACDriver; @@ -87,8 +87,8 @@ typedef struct { * architecture dependent, fields. */ typedef struct { - size_t td_offset; /**< Current write offset. */ - size_t td_size; /**< Available space size. */ + size_t offset; /**< Current write offset. */ + size_t size; /**< Available space size. */ /* End of the mandatory fields.*/ } MACTransmitDescriptor; @@ -98,8 +98,8 @@ typedef struct { * architecture dependent, fields. */ typedef struct { - size_t rd_offset; /**< Current read offset. */ - size_t rd_size; /**< Available data size. */ + size_t offset; /**< Current read offset. */ + size_t size; /**< Available data size. */ /* End of the mandatory fields.*/ } MACReceiveDescriptor; diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c index 7e904765a..712ab5982 100644 --- a/os/hal/templates/pwm_lld.c +++ b/os/hal/templates/pwm_lld.c @@ -68,7 +68,7 @@ void pwm_lld_init(void) { */ void pwm_lld_start(PWMDriver *pwmp) { - if (pwmp->pd_state == PWM_STOP) { + if (pwmp->state == PWM_STOP) { /* Clock activation.*/ } /* Configuration.*/ diff --git a/os/hal/templates/pwm_lld.h b/os/hal/templates/pwm_lld.h index 74fb280a7..bf0222981 100644 --- a/os/hal/templates/pwm_lld.h +++ b/os/hal/templates/pwm_lld.h @@ -84,13 +84,13 @@ typedef struct { /** * @brief Channel active logic level. */ - pwmmode_t pcc_mode; + pwmmode_t mode; /** * @brief Channel callback pointer. * @note This callback is invoked on the channel compare event. If set to * @p NULL then the callback is disabled. */ - pwmcallback_t pcc_callback; + pwmcallback_t callback; /* End of the mandatory fields.*/ } PWMChannelConfig; @@ -105,11 +105,11 @@ typedef struct { * @note This callback is invoked on PWM counter reset. If set to * @p NULL then the callback is disabled. */ - pwmcallback_t pc_callback; + pwmcallback_t callback; /** * @brief Channels configurations. */ - PWMChannelConfig pc_channels[PWM_CHANNELS]; + PWMChannelConfig channels[PWM_CHANNELS]; /* End of the mandatory fields.*/ } PWMConfig; @@ -122,11 +122,11 @@ struct PWMDriver { /** * @brief Driver state. */ - pwmstate_t pd_state; + pwmstate_t state; /** * @brief Current configuration data. */ - const PWMConfig *pd_config; + const PWMConfig *config; #if defined(PWM_DRIVER_EXT_FIELDS) PWM_DRIVER_EXT_FIELDS #endif diff --git a/os/hal/templates/spi_lld.c b/os/hal/templates/spi_lld.c index 5b76e3bdf..1235417c7 100644 --- a/os/hal/templates/spi_lld.c +++ b/os/hal/templates/spi_lld.c @@ -68,7 +68,7 @@ void spi_lld_init(void) { */ void spi_lld_start(SPIDriver *spip) { - if (spip->spd_state == SPI_STOP) { + if (spip->state == SPI_STOP) { /* Clock activation.*/ } /* Configuration.*/ diff --git a/os/hal/templates/spi_lld.h b/os/hal/templates/spi_lld.h index e985aa727..047f0756c 100644 --- a/os/hal/templates/spi_lld.h +++ b/os/hal/templates/spi_lld.h @@ -68,7 +68,7 @@ typedef struct { /** * @brief Operation complete callback. */ - spicallback_t spc_endcb; + spicallback_t end_cb; /* End of the mandatory fields.*/ } SPIConfig; @@ -81,25 +81,25 @@ struct SPIDriver { /** * @brief Driver state. */ - spistate_t spd_state; + spistate_t state; /** * @brief Current configuration data. */ - const SPIConfig *spd_config; + const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** * @brief Waiting thread. */ - Thread *spd_thread; + Thread *thread; #endif /* SPI_USE_WAIT */ #if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @brief Mutex protecting the bus. */ - Mutex spd_mutex; + Mutex mutex; #elif CH_USE_SEMAPHORES - Semaphore spd_semaphore; + Semaphore semaphore; #endif #endif /* SPI_USE_MUTUAL_EXCLUSION */ #if defined(SPI_DRIVER_EXT_FIELDS) diff --git a/os/hal/templates/uart_lld.h b/os/hal/templates/uart_lld.h index 531e7f3ab..8808d6589 100644 --- a/os/hal/templates/uart_lld.h +++ b/os/hal/templates/uart_lld.h @@ -90,23 +90,23 @@ typedef struct { /** * @brief End of transmission buffer callback. */ - uartcb_t uc_txend1; + uartcb_t txend1_cb; /** * @brief Physical end of transmission callback. */ - uartcb_t uc_txend2; + uartcb_t txend2_cb; /** * @brief Receive buffer filled callback. */ - uartcb_t uc_rxend; + uartcb_t rxend_cb; /** * @brief Character received while out if the @p UART_RECEIVE state. */ - uartccb_t uc_rxchar; + uartccb_t rxchar_cb; /** * @brief Receive error callback. */ - uartecb_t uc_rxerr; + uartecb_t rxerr_cb; /* End of the mandatory fields.*/ } UARTConfig; @@ -119,19 +119,19 @@ struct UARTDriver { /** * @brief Driver state. */ - uartstate_t ud_state; + uartstate_t state; /** * @brief Transmitter state. */ - uarttxstate_t ud_txstate; + uarttxstate_t txstate; /** * @brief Receiver state. */ - uartrxstate_t ud_rxstate; + uartrxstate_t rxstate; /** * @brief Current configuration data. */ - const UARTConfig *ud_config; + const UARTConfig *config; #if defined(UART_DRIVER_EXT_FIELDS) UART_DRIVER_EXT_FIELDS #endif diff --git a/readme.txt b/readme.txt index 3edbd9fee..a1a0a3ce4 100644 --- a/readme.txt +++ b/readme.txt @@ -61,13 +61,19 @@ +--test/ - Kernel test suite source code. | +--coverage/ - Code coverage project. +--testhal/ - HAL integration test demos. - +--STM32/ - STM32 HAL demos. - +--STM8S/ - STM8S HAL demos. + +--LPC11xx/ - LPC11xx HAL test demos. + +--LPC13xx/ - LPC13xx HAL test demos. + +--STM32/ - STM32 HAL test demos. + +--STM8S/ - STM8S HAL test demos. ***************************************************************************** *** Releases *** ***************************************************************************** +*** 2.3.1 *** +- CHANGE: Removed all the prefixes from the structure/union field names + in the HAL subsystem. + *** 2.3.0 *** - FIX: Fixed race condition in CM0 ports, the fix also improves the ISR latency (bug 3193062)(backported to 2.2.2). @@ -84,10 +90,10 @@ 2.2.1). - FIX: Error in MAC driver (bug 3179783)(backported to 2.2.1). - FIX: Fixed wrong serial driver macros (bug 3173336)(backported to 2.2.1). -- NEW: Inproved preemption implementation for the Cortex-M0, now it uses +- NEW: Improved preemption implementation for the Cortex-M0, now it uses the NMI vector in order to restore the original context. The change makes IRQ handling faster and also saves some RAM/ROM space. The GCC port code - now does not inline the epilogue code in each ISR saving significan ROM + now does not inline the epilogue code in each ISR saving significant ROM space for each interrupt handler in the system (backported to 2.2.3). - NEW: Added "IRQ STORM" long duration tests for the STM32, LPC11xx and LPC11xx. The test demonstrates the system stability in a thread-intensive, diff --git a/testhal/STM32/CAN/main.c b/testhal/STM32/CAN/main.c index ab7fb1c5e..7fb08de10 100644 --- a/testhal/STM32/CAN/main.c +++ b/testhal/STM32/CAN/main.c @@ -42,7 +42,7 @@ static msg_t can_rx(void *p) { CANRxFrame rxmsg; (void)p; - chEvtRegister(&CAND1.cd_rxfull_event, &el, 0); + chEvtRegister(&CAND1.rxfull_event, &el, 0); while(!chThdShouldTerminate()) { if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(100)) == 0) continue; @@ -51,7 +51,7 @@ static msg_t can_rx(void *p) { palTogglePad(IOPORT3, GPIOC_LED); } } - chEvtUnregister(&CAND1.cd_rxfull_event, &el); + chEvtUnregister(&CAND1.rxfull_event, &el); return 0; } @@ -63,12 +63,12 @@ static msg_t can_tx(void * p) { CANTxFrame txmsg; (void)p; - txmsg.cf_IDE = CAN_IDE_EXT; - txmsg.cf_EID = 0x01234567; - txmsg.cf_RTR = CAN_RTR_DATA; - txmsg.cf_DLC = 8; - txmsg.cf_data32[0] = 0x55AA55AA; - txmsg.cf_data32[1] = 0x00FF00FF; + txmsg.IDE = CAN_IDE_EXT; + txmsg.EID = 0x01234567; + txmsg.RTR = CAN_RTR_DATA; + txmsg.DLC = 8; + txmsg.data32[0] = 0x55AA55AA; + txmsg.data32[1] = 0x00FF00FF; while (!chThdShouldTerminate()) { canTransmit(&CAND1, &txmsg, MS2ST(100)); -- cgit v1.2.3 From 6b1c74271cf04a5f3ce225321912cdf3f365f673 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Mar 2011 20:04:26 +0000 Subject: Initial code for USB Mass Storage Class demo, still lot to do. Moved usb_cdc.h and mii.h into ./os/various. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2809 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/mii.h | 188 --------------- os/hal/include/usb_cdc.h | 73 ------ os/various/mii.h | 189 +++++++++++++++ os/various/usb_cdc.h | 73 ++++++ os/various/usb_msc.c | 207 ++++++++++++++++ os/various/usb_msc.h | 131 +++++++++++ testhal/STM32/USB_MSC/Makefile | 205 ++++++++++++++++ testhal/STM32/USB_MSC/ch.ld | 113 +++++++++ testhal/STM32/USB_MSC/chconf.h | 507 ++++++++++++++++++++++++++++++++++++++++ testhal/STM32/USB_MSC/halconf.h | 280 ++++++++++++++++++++++ testhal/STM32/USB_MSC/main.c | 315 +++++++++++++++++++++++++ testhal/STM32/USB_MSC/mcuconf.h | 142 +++++++++++ 12 files changed, 2162 insertions(+), 261 deletions(-) delete mode 100644 os/hal/include/mii.h delete mode 100644 os/hal/include/usb_cdc.h create mode 100644 os/various/mii.h create mode 100644 os/various/usb_cdc.h create mode 100644 os/various/usb_msc.c create mode 100644 os/various/usb_msc.h create mode 100644 testhal/STM32/USB_MSC/Makefile create mode 100644 testhal/STM32/USB_MSC/ch.ld create mode 100644 testhal/STM32/USB_MSC/chconf.h create mode 100644 testhal/STM32/USB_MSC/halconf.h create mode 100644 testhal/STM32/USB_MSC/main.c create mode 100644 testhal/STM32/USB_MSC/mcuconf.h diff --git a/os/hal/include/mii.h b/os/hal/include/mii.h deleted file mode 100644 index 87612273a..000000000 --- a/os/hal/include/mii.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * Parts of this file are borrowed by the Linux include file linux/mii.h: - * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) - */ - -/*-* - * @file mii.h - * @brief MII Driver macros and structures. - * - * @addtogroup MII - * @{ - */ - -#ifndef _MII_H_ -#define _MII_H_ - -/* - * Generic MII registers. Note, not all registers are present on all PHY - * devices and some extra registers may be present. - */ -#define MII_BMCR 0x00 /**< Basic mode control register. */ -#define MII_BMSR 0x01 /**< Basic mode status register. */ -#define MII_PHYSID1 0x02 /**< PHYS ID 1. */ -#define MII_PHYSID2 0x03 /**< PHYS ID 2. */ -#define MII_ADVERTISE 0x04 /**< Advertisement control reg. */ -#define MII_LPA 0x05 /**< Link partner ability reg. */ -#define MII_EXPANSION 0x06 /**< Expansion register. */ -#define MII_CTRL1000 0x09 /**< 1000BASE-T control. */ -#define MII_STAT1000 0x0a /**< 1000BASE-T status. */ -#define MII_ESTATUS 0x0f /**< Extended Status. */ -#define MII_DCOUNTER 0x12 /**< Disconnect counter. */ -#define MII_FCSCOUNTER 0x13 /**< False carrier counter. */ -#define MII_NWAYTEST 0x14 /**< N-way auto-neg test reg. */ -#define MII_RERRCOUNTER 0x15 /**< Receive error counter. */ -#define MII_SREVISION 0x16 /**< Silicon revision. */ -#define MII_RESV1 0x17 /**< Reserved. */ -#define MII_LBRERROR 0x18 /**< Lpback, rx, bypass error. */ -#define MII_PHYADDR 0x19 /**< PHY address. */ -#define MII_RESV2 0x1a /**< Reserved. */ -#define MII_TPISTATUS 0x1b /**< TPI status for 10mbps. */ -#define MII_NCONFIG 0x1c /**< Network interface config. */ - -/* - * Basic mode control register. - */ -#define BMCR_RESV 0x003f /**< Unused. */ -#define BMCR_SPEED1000 0x0040 /**< MSB of Speed (1000). */ -#define BMCR_CTST 0x0080 /**< Collision test. */ -#define BMCR_FULLDPLX 0x0100 /**< Full duplex. */ -#define BMCR_ANRESTART 0x0200 /**< Auto negotiation restart. */ -#define BMCR_ISOLATE 0x0400 /**< Disconnect DP83840 from MII. */ -#define BMCR_PDOWN 0x0800 /**< Powerdown. */ -#define BMCR_ANENABLE 0x1000 /**< Enable auto negotiation. */ -#define BMCR_SPEED100 0x2000 /**< Select 100Mbps. */ -#define BMCR_LOOPBACK 0x4000 /**< TXD loopback bits. */ -#define BMCR_RESET 0x8000 /**< Reset. */ - -/* - * Basic mode status register. - */ -#define BMSR_ERCAP 0x0001 /**< Ext-reg capability. */ -#define BMSR_JCD 0x0002 /**< Jabber detected. */ -#define BMSR_LSTATUS 0x0004 /**< Link status. */ -#define BMSR_ANEGCAPABLE 0x0008 /**< Able to do auto-negotiation. */ -#define BMSR_RFAULT 0x0010 /**< Remote fault detected. */ -#define BMSR_ANEGCOMPLETE 0x0020 /**< Auto-negotiation complete. */ -#define BMSR_RESV 0x00c0 /**< Unused. */ -#define BMSR_ESTATEN 0x0100 /**< Extended Status in R15. */ -#define BMSR_100HALF2 0x0200 /**< Can do 100BASE-T2 HDX. */ -#define BMSR_100FULL2 0x0400 /**< Can do 100BASE-T2 FDX. */ -#define BMSR_10HALF 0x0800 /**< Can do 10mbps, half-duplex. */ -#define BMSR_10FULL 0x1000 /**< Can do 10mbps, full-duplex. */ -#define BMSR_100HALF 0x2000 /**< Can do 100mbps, half-duplex. */ -#define BMSR_100FULL 0x4000 /**< Can do 100mbps, full-duplex. */ -#define BMSR_100BASE4 0x8000 /**< Can do 100mbps, 4k packets. */ - -/* - * Advertisement control register. - */ -#define ADVERTISE_SLCT 0x001f /**< Selector bits. */ -#define ADVERTISE_CSMA 0x0001 /**< Only selector supported. */ -#define ADVERTISE_10HALF 0x0020 /**< Try for 10mbps half-duplex. */ -#define ADVERTISE_1000XFULL 0x0020 /**< Try for 1000BASE-X full-duplex.*/ -#define ADVERTISE_10FULL 0x0040 /**< Try for 10mbps full-duplex. */ -#define ADVERTISE_1000XHALF 0x0040 /**< Try for 1000BASE-X half-duplex.*/ -#define ADVERTISE_100HALF 0x0080 /**< Try for 100mbps half-duplex. */ -#define ADVERTISE_1000XPAUSE 0x0080 /**< Try for 1000BASE-X pause. */ -#define ADVERTISE_100FULL 0x0100 /**< Try for 100mbps full-duplex. */ -#define ADVERTISE_1000XPSE_ASYM 0x0100 /**< Try for 1000BASE-X asym pause. */ -#define ADVERTISE_100BASE4 0x0200 /**< Try for 100mbps 4k packets. */ -#define ADVERTISE_PAUSE_CAP 0x0400 /**< Try for pause. */ -#define ADVERTISE_PAUSE_ASYM 0x0800 /**< Try for asymetric pause. */ -#define ADVERTISE_RESV 0x1000 /**< Unused. */ -#define ADVERTISE_RFAULT 0x2000 /**< Say we can detect faults. */ -#define ADVERTISE_LPACK 0x4000 /**< Ack link partners response. */ -#define ADVERTISE_NPAGE 0x8000 /**< Next page bit. */ - -#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ - ADVERTISE_CSMA) -#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ - ADVERTISE_100HALF | ADVERTISE_100FULL) - -/* - * Link partner ability register. - */ -#define LPA_SLCT 0x001f /**< Same as advertise selector. */ -#define LPA_10HALF 0x0020 /**< Can do 10mbps half-duplex. */ -#define LPA_1000XFULL 0x0020 /**< Can do 1000BASE-X full-duplex. */ -#define LPA_10FULL 0x0040 /**< Can do 10mbps full-duplex. */ -#define LPA_1000XHALF 0x0040 /**< Can do 1000BASE-X half-duplex. */ -#define LPA_100HALF 0x0080 /**< Can do 100mbps half-duplex. */ -#define LPA_1000XPAUSE 0x0080 /**< Can do 1000BASE-X pause. */ -#define LPA_100FULL 0x0100 /**< Can do 100mbps full-duplex. */ -#define LPA_1000XPAUSE_ASYM 0x0100 /**< Can do 1000BASE-X pause asym. */ -#define LPA_100BASE4 0x0200 /**< Can do 100mbps 4k packets. */ -#define LPA_PAUSE_CAP 0x0400 /**< Can pause. */ -#define LPA_PAUSE_ASYM 0x0800 /**< Can pause asymetrically. */ -#define LPA_RESV 0x1000 /**< Unused. */ -#define LPA_RFAULT 0x2000 /**< Link partner faulted. */ -#define LPA_LPACK 0x4000 /**< Link partner acked us. */ -#define LPA_NPAGE 0x8000 /**< Next page bit. */ - -#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) -#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) - -/* - * Expansion register for auto-negotiation. - */ -#define EXPANSION_NWAY 0x0001 /**< Can do N-way auto-nego. */ -#define EXPANSION_LCWP 0x0002 /**< Got new RX page code word. */ -#define EXPANSION_ENABLENPAGE 0x0004 /**< This enables npage words. */ -#define EXPANSION_NPCAPABLE 0x0008 /**< Link partner supports npage. */ -#define EXPANSION_MFAULTS 0x0010 /**< Multiple faults detected. */ -#define EXPANSION_RESV 0xffe0 /**< Unused. */ - -#define ESTATUS_1000_TFULL 0x2000 /**< Can do 1000BT Full. */ -#define ESTATUS_1000_THALF 0x1000 /**< Can do 1000BT Half. */ - -/* - * N-way test register. - */ -#define NWAYTEST_RESV1 0x00ff /**< Unused. */ -#define NWAYTEST_LOOPBACK 0x0100 /**< Enable loopback for N-way. */ -#define NWAYTEST_RESV2 0xfe00 /**< Unused. */ - -/* - * 1000BASE-T Control register. - */ -#define ADVERTISE_1000FULL 0x0200 /**< Advertise 1000BASE-T full duplex.*/ -#define ADVERTISE_1000HALF 0x0100 /**< Advertise 1000BASE-T half duplex.*/ - -/* - * 1000BASE-T Status register. - */ -#define LPA_1000LOCALRXOK 0x2000 /**< Link partner local receiver status.*/ -#define LPA_1000REMRXOK 0x1000 /**< Link partner remote receiver status.*/ -#define LPA_1000FULL 0x0800 /**< Link partner 1000BASE-T full duplex.*/ -#define LPA_1000HALF 0x0400 /**< Link partner 1000BASE-T half duplex.*/ - -/* - * PHY identifiers. - */ -#define MII_DM9161_ID 0x0181b8a0 -#define MII_AM79C875_ID 0x00225540 -#define MII_KS8721_ID 0x00221610 - -#endif /* _MII_H_ */ - -/*-* @} */ diff --git a/os/hal/include/usb_cdc.h b/os/hal/include/usb_cdc.h deleted file mode 100644 index 39df4ccf3..000000000 --- a/os/hal/include/usb_cdc.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/*-* - * @file usb_cdc.h - * @brief USB Communication Device Class support header. - * - * @addtogroup USB_CDC - * @{ - */ - -#ifndef _USB_CDC_H_ -#define _USB_CDC_H_ - -#define CDC_SEND_ENCAPSULATED_COMMAND 0x00 -#define CDC_GET_ENCAPSULATED_RESPONSE 0x01 -#define CDC_SET_COMM_FEATURE 0x02 -#define CDC_GET_COMM_FEATURE 0x03 -#define CDC_CLEAR_COMM_FEATURE 0x04 -#define CDC_SET_AUX_LINE_STATE 0x10 -#define CDC_SET_HOOK_STATE 0x11 -#define CDC_PULSE_SETUP 0x12 -#define CDC_SEND_PULSE 0x13 -#define CDC_SET_PULSE_TIME 0x14 -#define CDC_RING_AUX_JACK 0x15 -#define CDC_SET_LINE_CODING 0x20 -#define CDC_GET_LINE_CODING 0x21 -#define CDC_SET_CONTROL_LINE_STATE 0x22 -#define CDC_SEND_BREAK 0x23 -#define CDC_SET_RINGER_PARMS 0x30 -#define CDC_GET_RINGER_PARMS 0x31 -#define CDC_SET_OPERATION_PARMS 0x32 -#define CDC_GET_OPERATION_PARMS 0x33 - -/** - * @brief Type of Line Coding structure. - */ -typedef struct { - uint8_t dwDTERate[4]; - uint8_t bCharFormat; - uint8_t bParityType; - uint8_t bDataBits; -} cdc_linecoding_t; - -#define LC_STOP_1 0 -#define LC_STOP_1P5 1 -#define LC_STOP_2 2 - -#define LC_PARITY_NONE 0 -#define LC_PARITY_ODD 1 -#define LC_PARITY_EVEN 2 -#define LC_PARITY_MARK 3 -#define LC_PARITY_SPACE 4 - -#endif /* _USB_CDC_H_ */ - -/** @} */ diff --git a/os/various/mii.h b/os/various/mii.h new file mode 100644 index 000000000..a808b16f8 --- /dev/null +++ b/os/various/mii.h @@ -0,0 +1,189 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * Parts of this file have been borrowed from the Linux include file + * linux/mii.h: + * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) + */ + +/** + * @file mii.h + * @brief MII Driver macros and structures. + * + * @addtogroup MII + * @{ + */ + +#ifndef _MII_H_ +#define _MII_H_ + +/* + * Generic MII registers. Note, not all registers are present on all PHY + * devices and some extra registers may be present. + */ +#define MII_BMCR 0x00 /**< Basic mode control register. */ +#define MII_BMSR 0x01 /**< Basic mode status register. */ +#define MII_PHYSID1 0x02 /**< PHYS ID 1. */ +#define MII_PHYSID2 0x03 /**< PHYS ID 2. */ +#define MII_ADVERTISE 0x04 /**< Advertisement control reg. */ +#define MII_LPA 0x05 /**< Link partner ability reg. */ +#define MII_EXPANSION 0x06 /**< Expansion register. */ +#define MII_CTRL1000 0x09 /**< 1000BASE-T control. */ +#define MII_STAT1000 0x0a /**< 1000BASE-T status. */ +#define MII_ESTATUS 0x0f /**< Extended Status. */ +#define MII_DCOUNTER 0x12 /**< Disconnect counter. */ +#define MII_FCSCOUNTER 0x13 /**< False carrier counter. */ +#define MII_NWAYTEST 0x14 /**< N-way auto-neg test reg. */ +#define MII_RERRCOUNTER 0x15 /**< Receive error counter. */ +#define MII_SREVISION 0x16 /**< Silicon revision. */ +#define MII_RESV1 0x17 /**< Reserved. */ +#define MII_LBRERROR 0x18 /**< Lpback, rx, bypass error. */ +#define MII_PHYADDR 0x19 /**< PHY address. */ +#define MII_RESV2 0x1a /**< Reserved. */ +#define MII_TPISTATUS 0x1b /**< TPI status for 10mbps. */ +#define MII_NCONFIG 0x1c /**< Network interface config. */ + +/* + * Basic mode control register. + */ +#define BMCR_RESV 0x003f /**< Unused. */ +#define BMCR_SPEED1000 0x0040 /**< MSB of Speed (1000). */ +#define BMCR_CTST 0x0080 /**< Collision test. */ +#define BMCR_FULLDPLX 0x0100 /**< Full duplex. */ +#define BMCR_ANRESTART 0x0200 /**< Auto negotiation restart. */ +#define BMCR_ISOLATE 0x0400 /**< Disconnect DP83840 from MII. */ +#define BMCR_PDOWN 0x0800 /**< Powerdown. */ +#define BMCR_ANENABLE 0x1000 /**< Enable auto negotiation. */ +#define BMCR_SPEED100 0x2000 /**< Select 100Mbps. */ +#define BMCR_LOOPBACK 0x4000 /**< TXD loopback bits. */ +#define BMCR_RESET 0x8000 /**< Reset. */ + +/* + * Basic mode status register. + */ +#define BMSR_ERCAP 0x0001 /**< Ext-reg capability. */ +#define BMSR_JCD 0x0002 /**< Jabber detected. */ +#define BMSR_LSTATUS 0x0004 /**< Link status. */ +#define BMSR_ANEGCAPABLE 0x0008 /**< Able to do auto-negotiation. */ +#define BMSR_RFAULT 0x0010 /**< Remote fault detected. */ +#define BMSR_ANEGCOMPLETE 0x0020 /**< Auto-negotiation complete. */ +#define BMSR_RESV 0x00c0 /**< Unused. */ +#define BMSR_ESTATEN 0x0100 /**< Extended Status in R15. */ +#define BMSR_100HALF2 0x0200 /**< Can do 100BASE-T2 HDX. */ +#define BMSR_100FULL2 0x0400 /**< Can do 100BASE-T2 FDX. */ +#define BMSR_10HALF 0x0800 /**< Can do 10mbps, half-duplex. */ +#define BMSR_10FULL 0x1000 /**< Can do 10mbps, full-duplex. */ +#define BMSR_100HALF 0x2000 /**< Can do 100mbps, half-duplex. */ +#define BMSR_100FULL 0x4000 /**< Can do 100mbps, full-duplex. */ +#define BMSR_100BASE4 0x8000 /**< Can do 100mbps, 4k packets. */ + +/* + * Advertisement control register. + */ +#define ADVERTISE_SLCT 0x001f /**< Selector bits. */ +#define ADVERTISE_CSMA 0x0001 /**< Only selector supported. */ +#define ADVERTISE_10HALF 0x0020 /**< Try for 10mbps half-duplex. */ +#define ADVERTISE_1000XFULL 0x0020 /**< Try for 1000BASE-X full-duplex.*/ +#define ADVERTISE_10FULL 0x0040 /**< Try for 10mbps full-duplex. */ +#define ADVERTISE_1000XHALF 0x0040 /**< Try for 1000BASE-X half-duplex.*/ +#define ADVERTISE_100HALF 0x0080 /**< Try for 100mbps half-duplex. */ +#define ADVERTISE_1000XPAUSE 0x0080 /**< Try for 1000BASE-X pause. */ +#define ADVERTISE_100FULL 0x0100 /**< Try for 100mbps full-duplex. */ +#define ADVERTISE_1000XPSE_ASYM 0x0100 /**< Try for 1000BASE-X asym pause. */ +#define ADVERTISE_100BASE4 0x0200 /**< Try for 100mbps 4k packets. */ +#define ADVERTISE_PAUSE_CAP 0x0400 /**< Try for pause. */ +#define ADVERTISE_PAUSE_ASYM 0x0800 /**< Try for asymetric pause. */ +#define ADVERTISE_RESV 0x1000 /**< Unused. */ +#define ADVERTISE_RFAULT 0x2000 /**< Say we can detect faults. */ +#define ADVERTISE_LPACK 0x4000 /**< Ack link partners response. */ +#define ADVERTISE_NPAGE 0x8000 /**< Next page bit. */ + +#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ + ADVERTISE_CSMA) +#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ + ADVERTISE_100HALF | ADVERTISE_100FULL) + +/* + * Link partner ability register. + */ +#define LPA_SLCT 0x001f /**< Same as advertise selector. */ +#define LPA_10HALF 0x0020 /**< Can do 10mbps half-duplex. */ +#define LPA_1000XFULL 0x0020 /**< Can do 1000BASE-X full-duplex. */ +#define LPA_10FULL 0x0040 /**< Can do 10mbps full-duplex. */ +#define LPA_1000XHALF 0x0040 /**< Can do 1000BASE-X half-duplex. */ +#define LPA_100HALF 0x0080 /**< Can do 100mbps half-duplex. */ +#define LPA_1000XPAUSE 0x0080 /**< Can do 1000BASE-X pause. */ +#define LPA_100FULL 0x0100 /**< Can do 100mbps full-duplex. */ +#define LPA_1000XPAUSE_ASYM 0x0100 /**< Can do 1000BASE-X pause asym. */ +#define LPA_100BASE4 0x0200 /**< Can do 100mbps 4k packets. */ +#define LPA_PAUSE_CAP 0x0400 /**< Can pause. */ +#define LPA_PAUSE_ASYM 0x0800 /**< Can pause asymetrically. */ +#define LPA_RESV 0x1000 /**< Unused. */ +#define LPA_RFAULT 0x2000 /**< Link partner faulted. */ +#define LPA_LPACK 0x4000 /**< Link partner acked us. */ +#define LPA_NPAGE 0x8000 /**< Next page bit. */ + +#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) +#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) + +/* + * Expansion register for auto-negotiation. + */ +#define EXPANSION_NWAY 0x0001 /**< Can do N-way auto-nego. */ +#define EXPANSION_LCWP 0x0002 /**< Got new RX page code word. */ +#define EXPANSION_ENABLENPAGE 0x0004 /**< This enables npage words. */ +#define EXPANSION_NPCAPABLE 0x0008 /**< Link partner supports npage. */ +#define EXPANSION_MFAULTS 0x0010 /**< Multiple faults detected. */ +#define EXPANSION_RESV 0xffe0 /**< Unused. */ + +#define ESTATUS_1000_TFULL 0x2000 /**< Can do 1000BT Full. */ +#define ESTATUS_1000_THALF 0x1000 /**< Can do 1000BT Half. */ + +/* + * N-way test register. + */ +#define NWAYTEST_RESV1 0x00ff /**< Unused. */ +#define NWAYTEST_LOOPBACK 0x0100 /**< Enable loopback for N-way. */ +#define NWAYTEST_RESV2 0xfe00 /**< Unused. */ + +/* + * 1000BASE-T Control register. + */ +#define ADVERTISE_1000FULL 0x0200 /**< Advertise 1000BASE-T full duplex.*/ +#define ADVERTISE_1000HALF 0x0100 /**< Advertise 1000BASE-T half duplex.*/ + +/* + * 1000BASE-T Status register. + */ +#define LPA_1000LOCALRXOK 0x2000 /**< Link partner local receiver status.*/ +#define LPA_1000REMRXOK 0x1000 /**< Link partner remote receiver status.*/ +#define LPA_1000FULL 0x0800 /**< Link partner 1000BASE-T full duplex.*/ +#define LPA_1000HALF 0x0400 /**< Link partner 1000BASE-T half duplex.*/ + +/* + * PHY identifiers. + */ +#define MII_DM9161_ID 0x0181b8a0 +#define MII_AM79C875_ID 0x00225540 +#define MII_KS8721_ID 0x00221610 + +#endif /* _MII_H_ */ + +/** @} */ diff --git a/os/various/usb_cdc.h b/os/various/usb_cdc.h new file mode 100644 index 000000000..c1d3da3e7 --- /dev/null +++ b/os/various/usb_cdc.h @@ -0,0 +1,73 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file usb_cdc.h + * @brief USB Communication Device Class support header. + * + * @addtogroup USB_CDC + * @{ + */ + +#ifndef _USB_CDC_H_ +#define _USB_CDC_H_ + +#define CDC_SEND_ENCAPSULATED_COMMAND 0x00 +#define CDC_GET_ENCAPSULATED_RESPONSE 0x01 +#define CDC_SET_COMM_FEATURE 0x02 +#define CDC_GET_COMM_FEATURE 0x03 +#define CDC_CLEAR_COMM_FEATURE 0x04 +#define CDC_SET_AUX_LINE_STATE 0x10 +#define CDC_SET_HOOK_STATE 0x11 +#define CDC_PULSE_SETUP 0x12 +#define CDC_SEND_PULSE 0x13 +#define CDC_SET_PULSE_TIME 0x14 +#define CDC_RING_AUX_JACK 0x15 +#define CDC_SET_LINE_CODING 0x20 +#define CDC_GET_LINE_CODING 0x21 +#define CDC_SET_CONTROL_LINE_STATE 0x22 +#define CDC_SEND_BREAK 0x23 +#define CDC_SET_RINGER_PARMS 0x30 +#define CDC_GET_RINGER_PARMS 0x31 +#define CDC_SET_OPERATION_PARMS 0x32 +#define CDC_GET_OPERATION_PARMS 0x33 + +/** + * @brief Type of Line Coding structure. + */ +typedef struct { + uint8_t dwDTERate[4]; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; +} cdc_linecoding_t; + +#define LC_STOP_1 0 +#define LC_STOP_1P5 1 +#define LC_STOP_2 2 + +#define LC_PARITY_NONE 0 +#define LC_PARITY_ODD 1 +#define LC_PARITY_EVEN 2 +#define LC_PARITY_MARK 3 +#define LC_PARITY_SPACE 4 + +#endif /* _USB_CDC_H_ */ + +/** @} */ diff --git a/os/various/usb_msc.c b/os/various/usb_msc.c new file mode 100644 index 000000000..fdabcd6ad --- /dev/null +++ b/os/various/usb_msc.c @@ -0,0 +1,207 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file usb_msc.c + * @brief USB Mass Storage Class code. + * + * @addtogroup USB_MSC + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#include "usb_msc.h" + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/** + * @brief Zero-filled constant buffer. + */ +static const uint8_t zerobuf[4] = {0, 0, 0, 0}; + +/** + * @brief MSC state machine current state. + */ +static mscstate_t msc_state; + +/** + * @brief Transfer lenght specified in the CBW. + */ +static uint32_t cbw_length; + +/** + * @brief Tag specified in the CBW. + */ +static uint32_t cbw_tag; + +/** + * @brief Transmitted lenght. + */ +static uint32_t csw_sent; + +/** + * @brief Status . + */ +static uint8_t csw_status; + +/** + * @brief Multi purpose I/O buffer. + */ +static union { + uint8_t buf[512]; + msccbw_t CBW; + msccsw_t CSW; +} u; + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/** + * @brief MSC state machine initialization. + * + * @param[in] usbp pointer to the @p USBDriver object + */ +static void msc_reset(USBDriver *usbp) { + + msc_state = MSC_IDLE; + chSysLockFromIsr(); + usbStartReceiveI(usbp, MSC_DATA_OUT_EP, u.buf, sizeof(u.buf)); + chSysUnlockFromIsr(); +} + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Default requests hook. + * @details The application must use this function as callback for the + * messages hook. + * The following requests are emulated: + * - MSC_GET_MAX_LUN_COMMAND. + * - MSC_MASS_STORAGE_RESET_COMMAND. + * . + * + * @param[in] usbp pointer to the @p USBDriver object + * @return The hook status. + * @retval TRUE Message handled internally. + * @retval FALSE Message not handled. + */ +bool_t mscRequestsHook(USBDriver *usbp) { + + if ((usbp->setup[0] & (USB_RTYPE_TYPE_MASK | USB_RTYPE_RECIPIENT_MASK)) == + (USB_RTYPE_TYPE_CLASS | USB_RTYPE_RECIPIENT_INTERFACE)) { + switch (usbp->setup[1]) { + case MSC_GET_MAX_LUN_COMMAND: + usbSetupTransfer(usbp, (uint8_t *)zerobuf, 1, NULL); + return TRUE; + case MSC_MASS_STORAGE_RESET_COMMAND: + msc_reset(usbp); + usbSetupTransfer(usbp, NULL, 0, NULL); + return TRUE; + default: + return FALSE; + } + } + return FALSE; +} + +/** + * @brief Default data transmitted callback. + * @details The application must use this function as callback for the IN + * data endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + */ +void mscDataTransmitted(USBDriver *usbp, usbep_t ep) { + + switch (msc_state) { + case MSC_DATA_IN: + u.CSW.dCSWSignature = MSC_CSW_SIGNATURE; + u.CSW.dCSWTag = cbw_tag; + u.CSW.dCSWDataResidue = cbw_length - csw_sent; + u.CSW.bCSWStatus = csw_status; + chSysLockFromIsr(); + usbStartTransmitI(usbp, ep, (uint8_t *)&u.CSW, sizeof(u.CSW)); + chSysUnlockFromIsr(); + msc_state = MSC_SENDING_CSW; + break; + case MSC_SENDING_CSW: + chSysLockFromIsr(); + usbStartReceiveI(usbp, MSC_DATA_OUT_EP, u.buf, sizeof(u.buf)); + chSysUnlockFromIsr(); + msc_state = MSC_IDLE; + break; + default: + ; + } +} + +/** + * @brief Default data received callback. + * @details The application must use this function as callback for the OUT + * data endpoint. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + */ +void mscDataReceived(USBDriver *usbp, usbep_t ep) { + size_t n; + + n = usbGetReceiveTransactionSizeI(usbp, ep); + switch (msc_state) { + case MSC_IDLE: + if ((n != sizeof(msccbw_t)) || + (u.CBW.dCBWSignature != MSC_CBW_SIGNATURE)) + goto stallout; /* 6.6.1 */ + + cbw_length = u.CBW.dCBWDataTransferLength; + cbw_tag = u.CBW.dCBWTag; + if (u.CBW.bmCBWFlags & 0x80) { + /* IN, Device to Host.*/ +/* if (scsi_decode_in(usbp)) + goto stallout;*/ + msc_state = MSC_DATA_IN; + } + else { + /* OUT, Host to Device.*/ +/* if (scsi_decode_out(usbp)) + goto stallout;*/ + msc_state = MSC_DATA_OUT; + } + break; + default: + ; + } + return; +stallout: + msc_state = MSC_ERROR; + usbStallReceiveI(usbp, ep); + return; +} diff --git a/os/various/usb_msc.h b/os/various/usb_msc.h new file mode 100644 index 000000000..f7ab77c9c --- /dev/null +++ b/os/various/usb_msc.h @@ -0,0 +1,131 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file usb_msc.h + * @brief USB Mass Storage Class header. + * + * @addtogroup USB_MSC + * @{ + */ + +#ifndef _USB_MSC_H_ +#define _USB_MSC_H_ + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +#define MSC_CBW_SIGNATURE 0x43425355 +#define MSC_CSW_SIGNATURE 0x53425355 + +#define MSC_GET_MAX_LUN_COMMAND 0xFE +#define MSC_MASS_STORAGE_RESET_COMMAND 0xFF + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief Endpoint number for bulk IN. + */ +#if !defined(MSC_DATA_IN_EP) || defined(__DOXYGEN__) +#define MSC_DATA_IN_EP 1 +#endif + +/** + * @brief Endpoint number for bulk OUT. + */ +#if !defined(MSC_DATA_OUT_EP) || defined(__DOXYGEN__) +#define MSC_DATA_OUT_EP 2 +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Type of the MSC possible states. + */ +typedef enum { + MSC_IDLE = 0, + MSC_DATA_OUT, + MSC_DATA_IN, + MSC_SENDING_CSW, + MSC_ERROR +} mscstate_t; + +/** + * @brief CBW structure. + */ +struct CBW { + uint32_t dCBWSignature; + uint32_t dCBWTag; + uint32_t dCBWDataTransferLength; + uint8_t bmCBWFlags; + uint8_t bCBWLUN; + uint8_t bCBWCBLength; + uint8_t CBWCB[16]; +}; + +/** + * @brief CSW structure. + */ +struct CSW { + uint32_t dCSWSignature; + uint32_t dCSWTag; + uint32_t dCSWDataResidue; + uint8_t bCSWStatus; +}; + +/** + * @brief Type of a CBW structure. + */ +typedef struct CBW msccbw_t; + +/** + * @brief Type of a CSW structure. + */ +typedef struct CSW msccsw_t; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + bool_t mscRequestsHook(USBDriver *usbp); + void mscDataTransmitted(USBDriver *usbp, usbep_t ep); + void mscDataReceived(USBDriver *usbp, usbep_t ep); +#ifdef __cplusplus +} +#endif + +#endif /* _USB_MSC_H_ */ + +/** @} */ diff --git a/testhal/STM32/USB_MSC/Makefile b/testhal/STM32/USB_MSC/Makefile new file mode 100644 index 000000000..b98b34374 --- /dev/null +++ b/testhal/STM32/USB_MSC/Makefile @@ -0,0 +1,205 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/usb_msc.c \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/testhal/STM32/USB_MSC/ch.ld b/testhal/STM32/USB_MSC/ch.ld new file mode 100644 index 000000000..44f494121 --- /dev/null +++ b/testhal/STM32/USB_MSC/ch.ld @@ -0,0 +1,113 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/STM32/USB_MSC/chconf.h b/testhal/STM32/USB_MSC/chconf.h new file mode 100644 index 000000000..3353391ca --- /dev/null +++ b/testhal/STM32/USB_MSC/chconf.h @@ -0,0 +1,507 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h new file mode 100644 index 000000000..2babf6832 --- /dev/null +++ b/testhal/STM32/USB_MSC/halconf.h @@ -0,0 +1,280 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/USB_MSC/main.c b/testhal/STM32/USB_MSC/main.c new file mode 100644 index 000000000..e2eca2aa8 --- /dev/null +++ b/testhal/STM32/USB_MSC/main.c @@ -0,0 +1,315 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" +#include "test.h" + +#include "usb_msc.h" + +/*===========================================================================*/ +/* USB related stuff. */ +/*===========================================================================*/ + +/* + * USB Device Descriptor. + */ +static const uint8_t msc_device_descriptor_data[18] = { + USB_DESC_DEVICE (0x0110, /* bcdUSB (1.1). */ + 0x00, /* bDeviceClass (in interface). */ + 0x00, /* bDeviceSubClass. */ + 0x00, /* bDeviceProtocol. */ + 0x40, /* bMaxPacketSize. */ + 0x0483, /* idVendor (ST). */ + 0x2004, /* idProduct. */ + 0x0200, /* bcdDevice. */ + 1, /* iManufacturer. */ + 2, /* iProduct. */ + 3, /* iSerialNumber. */ + 1) /* bNumConfigurations. */ +}; + +/* + * Device Descriptor wrapper. + */ +static const USBDescriptor msc_device_descriptor = { + sizeof msc_device_descriptor_data, + msc_device_descriptor_data +}; + +/* Configuration Descriptor tree for a CDC.*/ +static const uint8_t msc_configuration_descriptor_data[32] = { + /* Configuration Descriptor.*/ + USB_DESC_CONFIGURATION(32, /* wTotalLength. */ + 0x01, /* bNumInterfaces. */ + 0x01, /* bConfigurationValue. */ + 0, /* iConfiguration. */ + 0xC0, /* bmAttributes (self powered). */ + 50), /* bMaxPower (100mA). */ + /* Interface Descriptor.*/ + USB_DESC_INTERFACE (0x00, /* bInterfaceNumber. */ + 0x00, /* bAlternateSetting. */ + 0x02, /* bNumEndpoints. */ + 0x08, /* bInterfaceClass (Mass Stprage). */ + 0x06, /* bInterfaceSubClass (SCSI + transparent command set, MSCO + chapter 2). */ + 0x50, /* bInterfaceProtocol (Bulk-Only + Mass Storage, MSCO chapter 3). */ + 4), /* iInterface. */ + /* Endpoint 1 Descriptor.*/ + USB_DESC_ENDPOINT (MSC_DATA_IN_EP|0x80, /* bEndpointAddress. */ + 0x02, /* bmAttributes (Bulk). */ + 0x0040, /* wMaxPacketSize. */ + 0x00), /* bInterval (ignored for bulk). */ + /* Endpoint 2 Descriptor.*/ + USB_DESC_ENDPOINT (MSC_DATA_OUT_EP, /* bEndpointAddress. */ + 0x02, /* bmAttributes (Bulk). */ + 0x0040, /* wMaxPacketSize. */ + 0x00), /* bInterval (ignored for bulk). */ +}; + +/* + * Configuration Descriptor wrapper. + */ +static const USBDescriptor msc_configuration_descriptor = { + sizeof msc_configuration_descriptor_data, + msc_configuration_descriptor_data +}; + +/* + * U.S. English language identifier. + */ +static const uint8_t msc_string0[] = { + USB_DESC_BYTE(4), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + USB_DESC_WORD(0x0409) /* wLANGID (U.S. English). */ +}; + +/* + * Vendor string. + */ +static const uint8_t msc_string1[] = { + USB_DESC_BYTE(38), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + 'S', 0, 'T', 0, 'M', 0, 'i', 0, 'c', 0, 'r', 0, 'o', 0, 'e', 0, + 'l', 0, 'e', 0, 'c', 0, 't', 0, 'r', 0, 'o', 0, 'n', 0, 'i', 0, + 'c', 0, 's', 0 +}; + +/* + * Device Description string. + */ +static const uint8_t msc_string2[] = { + USB_DESC_BYTE(50), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + 'C', 0, 'h', 0, 'i', 0, 'b', 0, 'i', 0, 'O', 0, 'S', 0, '/', 0, + 'R', 0, 'T', 0, ' ', 0, 'M', 0, 'a', 0, 's', 0, 's', 0, ' ', 0, + 'S', 0, 't', 0, 'o', 0, 'r', 0, 'a', 0, 'g', 0, 'e', 0 +}; + +/* + * Serial Number string. + */ +static const uint8_t msc_string3[] = { + USB_DESC_BYTE(8), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + '0' + CH_KERNEL_MAJOR, 0, + '0' + CH_KERNEL_MINOR, 0, + '0' + CH_KERNEL_PATCH, 0 +}; + +/* + * Interface string. + */ +static const uint8_t msc_string4[] = { + 16, /* bLength. */ + USB_DESCRIPTOR_STRING, /* bDescriptorType. */ + 'S', 0, 'T', 0, ' ', 0, 'M', 0, 'a', 0, 's', 0, 's', 0 +}; + +/* + * Strings wrappers array. + */ +static const USBDescriptor msc_strings[] = { + {sizeof msc_string0, msc_string0}, + {sizeof msc_string1, msc_string1}, + {sizeof msc_string2, msc_string2}, + {sizeof msc_string3, msc_string3}, + {sizeof msc_string4, msc_string4} +}; + +/* + * Handles the GET_DESCRIPTOR callback. All required descriptors must be + * handled here. + */ +static const USBDescriptor *get_descriptor(USBDriver *usbp, + uint8_t dtype, + uint8_t dindex, + uint16_t lang) { + + (void)usbp; + (void)lang; + switch (dtype) { + case USB_DESCRIPTOR_DEVICE: + return &msc_device_descriptor; + case USB_DESCRIPTOR_CONFIGURATION: + return &msc_configuration_descriptor; + case USB_DESCRIPTOR_STRING: + if (dindex < 5) + return &msc_strings[dindex]; + } + return NULL; +} + +/* + * IN EP1 state. + */ +USBInEndpointState ep1state; + +/* + * OUT EP2 state. + */ +USBOutEndpointState ep2state; + +/* + * EP1 initialization structure (IN only). + */ +static const USBEndpointConfig ep1config = { + USB_EP_MODE_TYPE_BULK | USB_EP_MODE_TRANSACTION, + mscDataTransmitted, + NULL, + 0x0040, + 0x0000, + &ep1state, + NULL +}; + +/* + * EP2 initialization structure (OUT only). + */ +static const USBEndpointConfig ep2config = { + USB_EP_MODE_TYPE_BULK | USB_EP_MODE_TRANSACTION, + NULL, + mscDataReceived, + 0x0000, + 0x0040, + NULL, + &ep2state +}; + +/* + * Handles the USB driver global events. + */ +static void usb_event(USBDriver *usbp, usbevent_t event) { + + switch (event) { + case USB_EVENT_RESET: + return; + case USB_EVENT_ADDRESS: + return; + case USB_EVENT_CONFIGURED: + /* Enables the endpoints specified into the configuration. + Note, this callback is invoked from an ISR so I-Class functions + must be used.*/ + chSysLockFromIsr(); + usbInitEndpointI(usbp, MSC_DATA_IN_EP, &ep1config); + usbInitEndpointI(usbp, MSC_DATA_OUT_EP, &ep2config); + chSysUnlockFromIsr(); + return; + case USB_EVENT_SUSPEND: + return; + case USB_EVENT_WAKEUP: + return; + case USB_EVENT_STALLED: + return; + } + return; +} + +/* + * Serial over USB driver configuration. + */ +static const USBConfig usbcfg = { + usb_event, + get_descriptor, + mscRequestsHook, + NULL +}; + +/*===========================================================================*/ +/* Generic code. */ +/*===========================================================================*/ + +/* + * Red LED blinker thread, times are in milliseconds. + */ +static WORKING_AREA(waThread1, 128); +static msg_t Thread1(void *arg) { + + (void)arg; + while (TRUE) { + palClearPad(IOPORT3, GPIOC_LED); + chThdSleepMilliseconds(500); + palSetPad(IOPORT3, GPIOC_LED); + chThdSleepMilliseconds(500); + } +} + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Activates the USB driver and then the USB bus pull-up on D+. + */ + usbStart(&USBD1, &usbcfg); + palClearPad(GPIOC, GPIOC_USB_DISC); + + /* + * Activates the serial driver 2 using the driver default configuration. + */ + sdStart(&SD2, NULL); + + /* + * Creates the blinker thread. + */ + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + + /* + * Normal main() thread activity, in this demo it does nothing except + * sleeping in a loop and check the button state. + */ + while (TRUE) { + if (palReadPad(IOPORT1, GPIOA_BUTTON)) + TestThread(&SD2); + chThdSleepMilliseconds(1000); + } +} diff --git a/testhal/STM32/USB_MSC/mcuconf.h b/testhal/STM32/USB_MSC/mcuconf.h new file mode 100644 index 000000000..ea7941a4f --- /dev/null +++ b/testhal/STM32/USB_MSC/mcuconf.h @@ -0,0 +1,142 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 -- cgit v1.2.3 From ebaac50aa4daa939814b783b1239073e3170860f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Mar 2011 21:09:14 +0000 Subject: Improvements to the Serial over USB driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2810 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/serial_usb.h | 12 --------- os/hal/src/serial_usb.c | 4 +-- os/various/usb_cdc.h | 61 ++++++++++++++++++++++++++++++++++++++------ readme.txt | 1 + testhal/STM32/USB_CDC/main.c | 11 +++----- 5 files changed, 59 insertions(+), 30 deletions(-) diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index b1d90cfb5..a220f7191 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -90,18 +90,6 @@ typedef struct { * @brief USB driver configuration structure. */ USBConfig usb_config; - /* - * @brief Endpoint used for data transmission. - */ - usbep_t data_request_ep; - /* - * @brief Endpoint used for data reception. - */ - usbep_t data_available_ep; - /* - * @brief Endpoint used for interrupt request. - */ - usbep_t interrupt_request_ep; } SerialUSBConfig; /** diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 0393ad141..6ed5d324c 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -119,7 +119,7 @@ static void inotify(GenericQueue *qp) { emptied, then a whole packet is loaded in the queue.*/ if (chIQIsEmptyI(&sdup->iqueue)) { - n = usbReadPacketI(sdup->config->usbp, sdup->config->data_available_ep, + n = usbReadPacketI(sdup->config->usbp, DATA_AVAILABLE_EP, sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; @@ -138,7 +138,7 @@ static void onotify(GenericQueue *qp) { /* If there is any data in the output queue then it is sent within a single packet and the queue is emptied.*/ - n = usbWritePacketI(sdup->config->usbp, sdup->config->data_request_ep, + n = usbWritePacketI(sdup->config->usbp, DATA_REQUEST_EP, sdup->oqueue.q_buffer, chOQGetFullI(&sdup->oqueue)); if (n != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; diff --git a/os/various/usb_cdc.h b/os/various/usb_cdc.h index c1d3da3e7..ac15b847b 100644 --- a/os/various/usb_cdc.h +++ b/os/various/usb_cdc.h @@ -28,6 +28,10 @@ #ifndef _USB_CDC_H_ #define _USB_CDC_H_ +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + #define CDC_SEND_ENCAPSULATED_COMMAND 0x00 #define CDC_GET_ENCAPSULATED_RESPONSE 0x01 #define CDC_SET_COMM_FEATURE 0x02 @@ -48,6 +52,49 @@ #define CDC_SET_OPERATION_PARMS 0x32 #define CDC_GET_OPERATION_PARMS 0x33 +#define LC_STOP_1 0 +#define LC_STOP_1P5 1 +#define LC_STOP_2 2 + +#define LC_PARITY_NONE 0 +#define LC_PARITY_ODD 1 +#define LC_PARITY_EVEN 2 +#define LC_PARITY_MARK 3 +#define LC_PARITY_SPACE 4 + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief Endpoint number for bulk IN. + */ +#if !defined(DATA_REQUEST_EP) || defined(__DOXYGEN__) +#define DATA_REQUEST_EP 1 +#endif + +/** + * @brief Endpoint number for interrupt IN. + */ +#if !defined(INTERRUPT_REQUEST_EP) || defined(__DOXYGEN__) +#define INTERRUPT_REQUEST_EP 2 +#endif + +/** + * @brief Endpoint number for bulk OUT. + */ +#if !defined(DATA_AVAILABLE_EP) || defined(__DOXYGEN__) +#define DATA_AVAILABLE_EP 3 +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + /** * @brief Type of Line Coding structure. */ @@ -58,15 +105,13 @@ typedef struct { uint8_t bDataBits; } cdc_linecoding_t; -#define LC_STOP_1 0 -#define LC_STOP_1P5 1 -#define LC_STOP_2 2 +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ -#define LC_PARITY_NONE 0 -#define LC_PARITY_ODD 1 -#define LC_PARITY_EVEN 2 -#define LC_PARITY_MARK 3 -#define LC_PARITY_SPACE 4 +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ #endif /* _USB_CDC_H_ */ diff --git a/readme.txt b/readme.txt index a1a0a3ce4..d07108ad3 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,7 @@ ***************************************************************************** *** 2.3.1 *** +- OPT: Simplified Serial over USB driver configuration. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 49d744d5d..e18275808 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -21,14 +21,12 @@ #include "hal.h" #include "test.h" +#include "usb_cdc.h" + /*===========================================================================*/ /* USB related stuff. */ /*===========================================================================*/ -#define DATA_REQUEST_EP 1 -#define INTERRUPT_REQUEST_EP 2 -#define DATA_AVAILABLE_EP 3 - /* * USB Driver structure. */ @@ -300,10 +298,7 @@ static const SerialUSBConfig serusbcfg = { get_descriptor, sduRequestsHook, NULL - }, - DATA_REQUEST_EP, - DATA_AVAILABLE_EP, - INTERRUPT_REQUEST_EP + } }; /*===========================================================================*/ -- cgit v1.2.3 From 0df60fe0a49f6fc1413e1a8cc4e0fb01c45224d8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Mar 2011 21:12:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2811 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile | 2 +- os/kernel/include/ch.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Doxyfile b/docs/Doxyfile index 5617db620..82fbc181d 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.0 +PROJECT_NUMBER = 2.3.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index 3bd81e16b..405ebc894 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -39,7 +39,7 @@ /** * @brief Kernel version string. */ -#define CH_KERNEL_VERSION "2.3.0unstable" +#define CH_KERNEL_VERSION "2.3.1unstable" /** * @brief Kernel version major number. @@ -54,7 +54,7 @@ /** * @brief Kernel version patch number. */ -#define CH_KERNEL_PATCH 0 +#define CH_KERNEL_PATCH 1 /* * Common values. -- cgit v1.2.3 From f27e4f46fe7db437775838da11e125f722e81c11 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 9 Mar 2011 16:38:56 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2812 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/usb_msc.c | 90 ++++++++++++++++++++++++++++++++++++++-------------- os/various/usb_msc.h | 4 +++ 2 files changed, 71 insertions(+), 23 deletions(-) diff --git a/os/various/usb_msc.c b/os/various/usb_msc.c index fdabcd6ad..dddc3f178 100644 --- a/os/various/usb_msc.c +++ b/os/various/usb_msc.c @@ -64,18 +64,19 @@ static uint32_t cbw_tag; static uint32_t csw_sent; /** - * @brief Status . + * @brief Status. */ static uint8_t csw_status; /** - * @brief Multi purpose I/O buffer. + * @brief Received CBW. */ -static union { - uint8_t buf[512]; - msccbw_t CBW; - msccsw_t CSW; -} u; +static msccbw_t CBW; + +/** + * @brief CSW to be transmitted. + */ +static msccsw_t CSW; /*===========================================================================*/ /* Driver local functions. */ @@ -90,10 +91,54 @@ static void msc_reset(USBDriver *usbp) { msc_state = MSC_IDLE; chSysLockFromIsr(); - usbStartReceiveI(usbp, MSC_DATA_OUT_EP, u.buf, sizeof(u.buf)); + usbStartReceiveI(usbp, MSC_DATA_OUT_EP, (uint8_t *)&CBW, sizeof CBW); + chSysUnlockFromIsr(); +} + +static void msc_transmit(USBDriver *usbp, const uint8_t *p, size_t n) { + + if (n > CBW.dCBWDataTransferLength) + n = CBW.dCBWDataTransferLength; + CSW.dCSWDataResidue = CBW.dCBWDataTransferLength - (uint32_t)n; + chSysLockFromIsr(); + usbStartTransmitI(usbp, MSC_DATA_IN_EP, scsi_inquiry_data, n); chSysUnlockFromIsr(); } +static bool_t msc_decode_in(USBDriver *usbp) { + uint32_t nblocks, secsize; + size_t n; + + switch (u.CBW.CBWCB[0]) { + case SCSI_INQUIRY: + msc_transmit(usbp, &scsi_inquiry_data, sizeof scsi_inquiry_data); + CSW.bCSWStatus = MSC_CSW_STATUS_PASSED; + break; + case SCSI_READ_FORMAT_CAPACITIES: + buf[8] = scsi_read_format_capacities(&nblocks, &secsize); + buf[0] = u.buf[1] = u.buf[2] = 0; + buf[3] = 8; + buf[4] = (tU8)(nblocks >> 24); + buf[5] = (tU8)(nblocks >> 16); + buf[6] = (tU8)(nblocks >> 8); + buf[7] = (tU8)(nblocks >> 0); + buf[9] = (tU8)(secsize >> 16); + buf[10] = (tU8)(secsize >> 8); + buf[11] = (tU8)(secsize >> 0); + msc_transmit(usbp, buf, 12); + CSW.bCSWStatus = MSC_CSW_STATUS_PASSED; + break; + default: + return TRUE; + } + return FALSE; +} + +static bool_t msc_decode_out(USBDriver *usbp) { + + return FALSE; +} + /*===========================================================================*/ /* Driver exported functions. */ /*===========================================================================*/ @@ -143,18 +188,16 @@ void mscDataTransmitted(USBDriver *usbp, usbep_t ep) { switch (msc_state) { case MSC_DATA_IN: - u.CSW.dCSWSignature = MSC_CSW_SIGNATURE; - u.CSW.dCSWTag = cbw_tag; - u.CSW.dCSWDataResidue = cbw_length - csw_sent; - u.CSW.bCSWStatus = csw_status; + CSW.dCSWSignature = MSC_CSW_SIGNATURE; + CSW.dCSWTag = CBW.dCBWTag; chSysLockFromIsr(); - usbStartTransmitI(usbp, ep, (uint8_t *)&u.CSW, sizeof(u.CSW)); + usbStartTransmitI(usbp, ep, (uint8_t *)&CSW, sizeof CSW); chSysUnlockFromIsr(); msc_state = MSC_SENDING_CSW; break; case MSC_SENDING_CSW: chSysLockFromIsr(); - usbStartReceiveI(usbp, MSC_DATA_OUT_EP, u.buf, sizeof(u.buf)); + usbStartReceiveI(usbp, MSC_DATA_OUT_EP, (uint8_t *)&CBW, sizeof CBW); chSysUnlockFromIsr(); msc_state = MSC_IDLE; break; @@ -177,31 +220,32 @@ void mscDataReceived(USBDriver *usbp, usbep_t ep) { n = usbGetReceiveTransactionSizeI(usbp, ep); switch (msc_state) { case MSC_IDLE: - if ((n != sizeof(msccbw_t)) || - (u.CBW.dCBWSignature != MSC_CBW_SIGNATURE)) + if ((n != sizeof(msccbw_t)) || (CBW.dCBWSignature != MSC_CBW_SIGNATURE)) goto stallout; /* 6.6.1 */ - cbw_length = u.CBW.dCBWDataTransferLength; - cbw_tag = u.CBW.dCBWTag; - if (u.CBW.bmCBWFlags & 0x80) { + if (CBW.bmCBWFlags & 0x80) { /* IN, Device to Host.*/ -/* if (scsi_decode_in(usbp)) - goto stallout;*/ + if (msc_decode_in(usbp)) + goto stallout; msc_state = MSC_DATA_IN; } else { /* OUT, Host to Device.*/ -/* if (scsi_decode_out(usbp)) - goto stallout;*/ + if (msc_decode_out(usbp)) + goto stallout; msc_state = MSC_DATA_OUT; } break; + case MSC_DATA_OUT: + break; default: ; } return; stallout: msc_state = MSC_ERROR; + chSysLockFromIsr(); usbStallReceiveI(usbp, ep); + chSysUnlockFromIsr(); return; } diff --git a/os/various/usb_msc.h b/os/various/usb_msc.h index f7ab77c9c..952903933 100644 --- a/os/various/usb_msc.h +++ b/os/various/usb_msc.h @@ -38,6 +38,10 @@ #define MSC_GET_MAX_LUN_COMMAND 0xFE #define MSC_MASS_STORAGE_RESET_COMMAND 0xFF +#define MSC_CSW_STATUS_PASSED 0 +#define MSC_CSW_STATUS_FAILED 1 +#define MSC_CSW_STATUS_PHASE_ERROR 2 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ -- cgit v1.2.3 From a849378300019b9d6c030ab7af46bfda646e619e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 10 Mar 2011 13:00:39 +0000 Subject: Fixed bug 3205410. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2813 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/adc.h | 5 +- os/hal/src/adc.c | 2 +- os/various/usb_msc.c | 133 +++++++++++++++++++++++++++++++++++---------------- os/various/usb_msc.h | 31 ++++++++++++ 4 files changed, 126 insertions(+), 45 deletions(-) diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h index 8bc013b38..b0d6d0938 100644 --- a/os/hal/include/adc.h +++ b/os/hal/include/adc.h @@ -124,9 +124,10 @@ typedef enum { */ #define _adc_wakeup_isr(adcp) { \ if ((adcp)->thread != NULL) { \ - Thread *tp = (adcp)->thread; \ - (adcp)->thread = NULL; \ + Thread *tp; \ chSysLockFromIsr(); \ + tp = (adcp)->thread; \ + (adcp)->thread = NULL; \ tp->p_u.rdymsg = RDY_OK; \ chSchReadyI(tp); \ chSysUnlockFromIsr(); \ diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c index 956c7837f..b70c46e1c 100644 --- a/os/hal/src/adc.c +++ b/os/hal/src/adc.c @@ -271,7 +271,7 @@ msg_t adcConvert(ADCDriver *adcp, msg_t msg; chSysLock(); - chDbgAssert(grpp->end_cb == NULL, "adcConvert(), #1", "has callback"); + chDbgAssert(adcp->thread == NULL, "adcConvert(), #1", "already waiting"); adcStartConversionI(adcp, grpp, samples, depth); (adcp)->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); diff --git a/os/various/usb_msc.c b/os/various/usb_msc.c index dddc3f178..19d5ba8d6 100644 --- a/os/various/usb_msc.c +++ b/os/various/usb_msc.c @@ -44,29 +44,56 @@ static const uint8_t zerobuf[4] = {0, 0, 0, 0}; /** - * @brief MSC state machine current state. + * @brief Answer to the INQUIRY command. */ -static mscstate_t msc_state; +static const uint8_t scsi_inquiry_data[] = { + 0x00, /* Direct Access Device. */ + 0x80, /* RMB = 1: Removable Medium. */ + 0x02, /* ISO, ECMA, ANSI = 2. */ + 0x00, /* UFI response format. */ + + 36 - 4, /* Additional Length. */ + 0x00, + 0x00, + 0x00, + /* Vendor Identification */ + 'C', 'h', 'i', 'b', 'i', 'O', 'S', ' ', + /* Product Identification */ + 'S', 'D', ' ', 'F', 'l', 'a', 's', 'h', + ' ', 'D', 'i', 's', 'k', ' ', ' ', ' ', + /* Product Revision Level */ + '1', '.', '0', ' ' +}; /** - * @brief Transfer lenght specified in the CBW. + * @brief Generic buffer. */ -static uint32_t cbw_length; +uint8_t buf[16]; -/** - * @brief Tag specified in the CBW. - */ -static uint32_t cbw_tag; +/*===========================================================================*/ +/* MMC interface code. */ +/*===========================================================================*/ -/** - * @brief Transmitted lenght. - */ -static uint32_t csw_sent; +/*===========================================================================*/ +/* SCSI emulation code. */ +/*===========================================================================*/ + +static uint8_t scsi_read_format_capacities(uint32_t *nblocks, + uint32_t *secsize) { + + *nblocks = 1024; + *secsize = 512; + return 3; /* No Media.*/ +} + +/*===========================================================================*/ +/* Mass Storage Class related code. */ +/*===========================================================================*/ /** - * @brief Status. + * @brief MSC state machine current state. */ -static uint8_t csw_status; +static mscstate_t msc_state; /** * @brief Received CBW. @@ -78,10 +105,6 @@ static msccbw_t CBW; */ static msccsw_t CSW; -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - /** * @brief MSC state machine initialization. * @@ -101,30 +124,40 @@ static void msc_transmit(USBDriver *usbp, const uint8_t *p, size_t n) { n = CBW.dCBWDataTransferLength; CSW.dCSWDataResidue = CBW.dCBWDataTransferLength - (uint32_t)n; chSysLockFromIsr(); - usbStartTransmitI(usbp, MSC_DATA_IN_EP, scsi_inquiry_data, n); + usbStartTransmitI(usbp, MSC_DATA_IN_EP, p, n); + chSysUnlockFromIsr(); +} + +static void msc_sendstatus(USBDriver *usbp) { + + msc_state = MSC_SENDING_CSW; + chSysLockFromIsr(); + usbStartTransmitI(usbp, MSC_DATA_IN_EP, (uint8_t *)&CSW, sizeof CSW); chSysUnlockFromIsr(); } -static bool_t msc_decode_in(USBDriver *usbp) { +static bool_t msc_decode(USBDriver *usbp) { uint32_t nblocks, secsize; - size_t n; - switch (u.CBW.CBWCB[0]) { + switch (CBW.CBWCB[0]) { + case SCSI_REQUEST_SENSE: + break; case SCSI_INQUIRY: - msc_transmit(usbp, &scsi_inquiry_data, sizeof scsi_inquiry_data); + msc_transmit(usbp, (uint8_t *)&scsi_inquiry_data, + sizeof scsi_inquiry_data); CSW.bCSWStatus = MSC_CSW_STATUS_PASSED; break; case SCSI_READ_FORMAT_CAPACITIES: buf[8] = scsi_read_format_capacities(&nblocks, &secsize); - buf[0] = u.buf[1] = u.buf[2] = 0; + buf[0] = buf[1] = buf[2] = 0; buf[3] = 8; - buf[4] = (tU8)(nblocks >> 24); - buf[5] = (tU8)(nblocks >> 16); - buf[6] = (tU8)(nblocks >> 8); - buf[7] = (tU8)(nblocks >> 0); - buf[9] = (tU8)(secsize >> 16); - buf[10] = (tU8)(secsize >> 8); - buf[11] = (tU8)(secsize >> 0); + buf[4] = (uint8_t)(nblocks >> 24); + buf[5] = (uint8_t)(nblocks >> 16); + buf[6] = (uint8_t)(nblocks >> 8); + buf[7] = (uint8_t)(nblocks >> 0); + buf[9] = (uint8_t)(secsize >> 16); + buf[10] = (uint8_t)(secsize >> 8); + buf[11] = (uint8_t)(secsize >> 0); msc_transmit(usbp, buf, 12); CSW.bCSWStatus = MSC_CSW_STATUS_PASSED; break; @@ -134,11 +167,6 @@ static bool_t msc_decode_in(USBDriver *usbp) { return FALSE; } -static bool_t msc_decode_out(USBDriver *usbp) { - - return FALSE; -} - /*===========================================================================*/ /* Driver exported functions. */ /*===========================================================================*/ @@ -221,18 +249,32 @@ void mscDataReceived(USBDriver *usbp, usbep_t ep) { switch (msc_state) { case MSC_IDLE: if ((n != sizeof(msccbw_t)) || (CBW.dCBWSignature != MSC_CBW_SIGNATURE)) - goto stallout; /* 6.6.1 */ + goto stall_out; /* 6.6.1 */ + + /* Decoding SCSI command.*/ + if (msc_decode(usbp)) { + if (CBW.dCBWDataTransferLength == 0) { + CSW.bCSWStatus = MSC_CSW_STATUS_FAILED; + CSW.dCSWDataResidue = 0; + msc_sendstatus(usbp); + return; + } + goto stall_both; + } + + /* Commands with zero transfer length, 5.1.*/ + if (CBW.dCBWDataTransferLength == 0) { + msc_sendstatus(usbp); + return; + } + /* Transfer direction.*/ if (CBW.bmCBWFlags & 0x80) { /* IN, Device to Host.*/ - if (msc_decode_in(usbp)) - goto stallout; msc_state = MSC_DATA_IN; } else { /* OUT, Host to Device.*/ - if (msc_decode_out(usbp)) - goto stallout; msc_state = MSC_DATA_OUT; } break; @@ -242,9 +284,16 @@ void mscDataReceived(USBDriver *usbp, usbep_t ep) { ; } return; -stallout: +stall_out: + msc_state = MSC_ERROR; + chSysLockFromIsr(); + usbStallReceiveI(usbp, ep); + chSysUnlockFromIsr(); + return; +stall_both: msc_state = MSC_ERROR; chSysLockFromIsr(); + usbStallTransmitI(usbp, ep); usbStallReceiveI(usbp, ep); chSysUnlockFromIsr(); return; diff --git a/os/various/usb_msc.h b/os/various/usb_msc.h index 952903933..d62bb001d 100644 --- a/os/various/usb_msc.h +++ b/os/various/usb_msc.h @@ -42,6 +42,37 @@ #define MSC_CSW_STATUS_FAILED 1 #define MSC_CSW_STATUS_PHASE_ERROR 2 + +#define SCSI_FORMAT_UNIT 0x04 +#define SCSI_INQUIRY 0x12 +#define SCSI_MODE_SELECT6 0x15 +#define SCSI_MODE_SELECT10 0x55 +#define SCSI_MODE_SENSE6 0x1A +#define SCSI_MODE_SENSE10 0x5A +#define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E +#define SCSI_READ6 0x08 +#define SCSI_READ10 0x28 +#define SCSI_READ12 0xA8 +#define SCSI_READ16 0x88 + +#define SCSI_READ_CAPACITY10 0x25 +#define SCSI_READ_CAPACITY16 0x9E + +#define SCSI_REQUEST_SENSE 0x03 +#define SCSI_START_STOP_UNIT 0x1B +#define SCSI_TEST_UNIT_READY 0x00 +#define SCSI_WRITE6 0x0A +#define SCSI_WRITE10 0x2A +#define SCSI_WRITE12 0xAA +#define SCSI_WRITE16 0x8A + +#define SCSI_VERIFY10 0x2F +#define SCSI_VERIFY12 0xAF +#define SCSI_VERIFY16 0x8F + +#define SCSI_SEND_DIAGNOSTIC 0x1D +#define SCSI_READ_FORMAT_CAPACITIES 0x23 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ -- cgit v1.2.3 From 310fd0745ef78c90279dcb0004971f26c01bae79 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 10 Mar 2011 13:00:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2814 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.txt b/readme.txt index d07108ad3..4c57b0dca 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.1 *** +- FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported + to 2.2.3). - OPT: Simplified Serial over USB driver configuration. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. -- cgit v1.2.3 From 3d50b5c9e0eee6ca4eb2e9c1114fcd8ff109e984 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 10 Mar 2011 18:54:58 +0000 Subject: USB improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2815 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/usb.h | 82 +++++++++++++++++++++++ os/hal/platforms/STM32/usb_lld.c | 92 ++++++++++++++----------- os/hal/platforms/STM32/usb_lld.h | 12 ++++ os/hal/src/usb.c | 140 +++++++++++++++++++++------------------ os/hal/templates/usb_lld.c | 18 +++++ os/hal/templates/usb_lld.h | 1 + readme.txt | 2 + testhal/STM32/USB_CDC/main.c | 3 + 8 files changed, 250 insertions(+), 100 deletions(-) diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index 24b492e2f..9b8d863b1 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -395,6 +395,86 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, (usbp)->ep0endcb = (endcb); \ } +/** + * @brief Reads a setup packet from the dedicated packet buffer. + * @details This function must be invoked in the context of the @p setup_cb + * callback in order to read the received setup packet. + * @pre In order to use this function the endpoint must have been + * initialized as a control endpoint. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * + * @special + */ +#define usbReadSetup(usbp, ep, buf) usb_lld_read_setup(usbp, ep, buf) + +/** + * @brief Common ISR code, usb event callback. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +#define _usb_isr_invoke_event_cb(usbp, evt) { \ + if (((usbp)->config->event_cb) != NULL) \ + (usbp)->config->event_cb(usbp, evt); \ +} + +/** + * @brief Common ISR code, SOF callback. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +#define _usb_isr_invoke_sof_cb(usbp) { \ + if (((usbp)->config->sof_cb) != NULL) \ + (usbp)->config->sof_cb(usbp); \ +} + +/** + * @brief Common ISR code, setup packet callback. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +#define _usb_isr_invoke_setup_cb(usbp, ep) { \ + (usbp)->epc[ep]->setup_cb(usbp, ep); \ +} + +/** + * @brief Common ISR code, IN endpoint callback. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +#define _usb_isr_invoke_in_cb(usbp, ep) { \ + (usbp)->transmitting &= ~(1 << (ep)); \ + (usbp)->epc[ep]->in_cb(usbp, ep); \ +} + +/** + * @brief Common ISR code, OUT endpoint event. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * + * @notapi + */ +#define _usb_isr_invoke_out_cb(usbp, ep) { \ + (usbp)->receiving &= ~(1 << (ep)); \ + (usbp)->epc[ep]->out_cb(usbp, ep); \ +} + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -409,6 +489,7 @@ extern "C" { void usbInitEndpointI(USBDriver *usbp, usbep_t ep, const USBEndpointConfig *epcp); void usbDisableEndpointsI(USBDriver *usbp); + void usbReadSetupI(USBDriver *usbp, usbep_t ep, uint8_t *buf); size_t usbReadPacketI(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n); size_t usbWritePacketI(USBDriver *usbp, usbep_t ep, @@ -420,6 +501,7 @@ extern "C" { bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep); bool_t usbStallTransmitI(USBDriver *usbp, usbep_t ep); void _usb_reset(USBDriver *usbp); + void _usb_ep0setup(USBDriver *usbp, usbep_t ep); void _usb_ep0in(USBDriver *usbp, usbep_t ep); void _usb_ep0out(USBDriver *usbp, usbep_t ep); #ifdef __cplusplus diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index b2198a806..09a8d7975 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -68,6 +68,7 @@ static union { */ static const USBEndpointConfig ep0config = { USB_EP_MODE_TYPE_CTRL | USB_EP_MODE_TRANSACTION, + _usb_ep0setup, _usb_ep0in, _usb_ep0out, 0x40, @@ -193,16 +194,14 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { /* USB bus reset condition handling.*/ if (istr & ISTR_RESET) { _usb_reset(usbp); - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_RESET); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_RESET); STM32_USB->ISTR = ~ISTR_RESET; } /* USB bus SUSPEND condition handling.*/ if (istr & ISTR_SUSP) { STM32_USB->CNTR |= CNTR_FSUSP; - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_SUSPEND); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_SUSPEND); #if STM32_USB_LOW_POWER_ON_SUSPEND STM32_USB->CNTR |= CNTR_LP_MODE; #endif @@ -214,8 +213,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { uint32_t fnr = STM32_USB->FNR; if (!(fnr & FNR_RXDP)) { STM32_USB->CNTR &= ~CNTR_FSUSP; - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_WAKEUP); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_WAKEUP); } #if STM32_USB_LOW_POWER_ON_SUSPEND else { @@ -229,8 +227,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { /* SOF handling.*/ if (istr & ISTR_SOF) { - if (usbp->config->sof_cb) - usbp->config->sof_cb(usbp); + _usb_isr_invoke_sof_cb(usbp); STM32_USB->ISTR = ~ISTR_SOF; } @@ -245,8 +242,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { EPR_CLEAR_CTR_TX(ep); if (epcp->ep_mode & USB_EP_MODE_PACKET) { /* Packet mode, just invokes the callback.*/ - (usbp)->transmitting &= ~(1 << ep); - epcp->in_cb(usbp, ep); + _usb_isr_invoke_in_cb(usbp, ep); } else { /* Transaction mode.*/ @@ -264,43 +260,36 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) { } else { /* Transfer completed, invokes the callback.*/ - (usbp)->transmitting &= ~(1 << ep); - epcp->in_cb(usbp, ep); + _usb_isr_invoke_in_cb(usbp, ep); } } } if (epr & EPR_CTR_RX) { EPR_CLEAR_CTR_RX(ep); /* OUT endpoint, receive.*/ - if (epcp->ep_mode & USB_EP_MODE_PACKET) { + if (epr & EPR_SETUP) { + /* Setup packets handling, setup packets are handled using a + specific callback.*/ + _usb_isr_invoke_setup_cb(usbp, ep); + } + else if (epcp->ep_mode & USB_EP_MODE_PACKET) { /* Packet mode, just invokes the callback.*/ - (usbp)->receiving &= ~(1 << ep); - epcp->out_cb(usbp, ep); + _usb_isr_invoke_out_cb(usbp, ep); } else { /* Transaction mode.*/ - if ((epr & EPR_SETUP) && (ep == 0)) { - /* Special case, setup packet for EP0, enforcing a reset of the - EP0 state machine for robustness.*/ - usbp->ep0state = USB_EP0_WAITING_SETUP; - read_packet(0, usbp->setup, 8); - epcp->out_cb(usbp, ep); + n = read_packet(ep, epcp->out_state->rxbuf, epcp->out_state->rxsize); + epcp->out_state->rxbuf += n; + epcp->out_state->rxcnt += n; + epcp->out_state->rxsize -= n; + epcp->out_state->rxpkts -= 1; + if (epcp->out_state->rxpkts > 0) { + /* Transfer not completed, there are more packets to receive.*/ + EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); } else { - n = read_packet(ep, epcp->out_state->rxbuf, epcp->out_state->rxsize); - epcp->out_state->rxbuf += n; - epcp->out_state->rxcnt += n; - epcp->out_state->rxsize -= n; - epcp->out_state->rxpkts -= 1; - if (epcp->out_state->rxpkts > 0) { - /* Transfer not completed, there are more packets to receive.*/ - EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); - } - else { - /* Transfer completed, invokes the callback.*/ - (usbp)->receiving &= ~(1 << ep); - epcp->out_cb(usbp, ep); - } + /* Transfer completed, invokes the callback.*/ + _usb_isr_invoke_out_cb(usbp, ep); } } } @@ -452,12 +441,12 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { } /* IN endpoint settings, always in NAK mode initially.*/ - if (epcp->in_cb) + if (epcp->in_cb != NULL) epr |= EPR_STAT_TX_NAK; /* OUT endpoint settings. If the endpoint is in packet mode then it must start ready to accept data else it must start in NAK mode.*/ - if (epcp->out_cb) { + if (epcp->out_cb != NULL) { if (epcp->ep_mode & USB_EP_MODE_PACKET) { usbp->receiving |= (1 << ep); epr |= EPR_STAT_RX_VALID; @@ -553,6 +542,35 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { } } +/** + * @brief Reads a setup packet from the dedicated packet buffer. + * @details This function must be invoked in the context of the @p setup_cb + * callback in order to read the received setup packet. + * @pre In order to use this function the endpoint must have been + * initialized as a control endpoint. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * + * @notapi + */ +void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) { + uint32_t *pmap; + stm32_usb_descriptor_t *udp; + uint32_t n; + + (void)usbp; + udp = USB_GET_DESCRIPTOR(ep); + pmap = USB_ADDR2PTR(udp->RXADDR); + for (n = 0; n < 4; n++) { + *(uint16_t *)buf = (uint16_t)*pmap++; + buf += 2; + } + EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID); +} + /** * @brief Reads a packet from the dedicated packet buffer. * @pre In order to use this function he endpoint must have been diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 9c4c899b3..0a351f932 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -149,6 +149,17 @@ typedef struct { * @brief Type and mode of the endpoint. */ uint32_t ep_mode; + /** + * @brief Setup packet notification callback. + * @details This callback is invoked when a setup packet has been + * received. + * @post The application must immediately call @p usbReadPacket() in + * order to access the received packet. + * @note This field is only valid for @p USB_EP_MODE_TYPE_CTRL + * endpoints, it should be set to @p NULL for other endpoint + * types. + */ + usbepcallback_t setup_cb; /** * @brief IN endpoint notification callback. * @details This field must be set to @p NULL if the IN endpoint is not @@ -359,6 +370,7 @@ extern "C" { void usb_lld_disable_endpoints(USBDriver *usbp); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); + void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf); size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n); void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index 0dbe4b39d..b82af84d8 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -58,8 +58,7 @@ static void set_address(USBDriver *usbp) { usbp->address = usbp->setup[2]; usb_lld_set_address(usbp); - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_ADDRESS); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_ADDRESS); usbp->state = USB_SELECTED; } @@ -137,8 +136,7 @@ static bool_t default_handler(USBDriver *usbp) { usbp->state = USB_SELECTED; else usbp->state = USB_ACTIVE; - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_CONFIGURED); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_CONFIGURED); usbSetupTransfer(usbp, NULL, 0, NULL); return TRUE; case USB_RTYPE_RECIPIENT_INTERFACE | (USB_REQ_GET_STATUS << 8): @@ -526,6 +524,77 @@ void _usb_reset(USBDriver *usbp) { usb_lld_reset(usbp); } +/** + * @brief Default EP0 SETUP callback. + * @details This function is used by the low level driver as default handler + * for EP0 SETUP events. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number, always zero + * + * @notapi + */ +void _usb_ep0setup(USBDriver *usbp, usbep_t ep) { + size_t max; + + usbp->ep0state = USB_EP0_WAITING_SETUP; + usbReadSetup(usbp, ep, usbp->setup); + + /* First verify if the application has an handler installed for this + request.*/ + if (!(usbp->config->requests_hook_cb) || + !(usbp->config->requests_hook_cb(usbp))) { + /* Invoking the default handler, if this fails then stalls the + endpoint zero as error.*/ + if (((usbp->setup[0] & USB_RTYPE_TYPE_MASK) != USB_RTYPE_TYPE_STD) || + !default_handler(usbp)) { + /* Error response, the state machine goes into an error state, the low + level layer will have to reset it to USB_EP0_WAITING_SETUP after + receiving a SETUP packet.*/ + usb_lld_stall_in(usbp, 0); + usb_lld_stall_out(usbp, 0); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_STALLED); + usbp->ep0state = USB_EP0_ERROR; + } + } + + /* Transfer preparation. The request handler must have populated + correctly the fields ep0next, ep0n and ep0endcb using the macro + usbSetupTransfer().*/ + max = usb_lld_fetch_word(&usbp->setup[6]); + /* The transfer size cannot exceed the specified amount.*/ + if (usbp->ep0n > max) + usbp->ep0n = max; + if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { + /* IN phase.*/ + if (usbp->ep0n > 0) { + /* Starts the transmit phase.*/ + usbp->ep0state = USB_EP0_TX; + usb_lld_start_in(usbp, 0, usbp->ep0next, usbp->ep0n); + } + else { + /* No transmission phase, directly receiving the zero sized status + packet.*/ + usbp->ep0state = USB_EP0_WAITING_STS; + usb_lld_start_out(usbp, 0, NULL, 0); + } + } + else { + /* OUT phase.*/ + if (usbp->ep0n > 0) { + /* Starts the receive phase.*/ + usbp->ep0state = USB_EP0_RX; + usb_lld_start_out(usbp, 0, usbp->ep0next, usbp->ep0n); + } + else { + /* No receive phase, directly sending the zero sized status + packet.*/ + usbp->ep0state = USB_EP0_SENDING_STS; + usb_lld_start_in(usbp, 0, NULL, 0); + } + } +} + /** * @brief Default EP0 IN callback. * @details This function is used by the low level driver as default handler @@ -558,7 +627,7 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { return; case USB_EP0_SENDING_STS: /* Status packet sent, invoking the callback if defined.*/ - if (usbp->ep0endcb) + if (usbp->ep0endcb != NULL) usbp->ep0endcb(usbp); usbp->ep0state = USB_EP0_WAITING_SETUP; return; @@ -570,8 +639,7 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { receiving a SETUP packet.*/ usb_lld_stall_in(usbp, 0); usb_lld_stall_out(usbp, 0); - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_STALLED); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_STALLED); usbp->ep0state = USB_EP0_ERROR; } @@ -586,62 +654,9 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) { * @notapi */ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { - size_t max; (void)ep; switch (usbp->ep0state) { - case USB_EP0_WAITING_SETUP: - /* SETUP packet handling. The setup packet is expected to be already - placed into the setup[8] field of the USBDriver structure, the low - level layer has to take care of this.*/ - - /* First verify if the application has an handler installed for this - request.*/ - if (!(usbp->config->requests_hook_cb) || - !(usbp->config->requests_hook_cb(usbp))) { - /* Invoking the default handler, if this fails then stalls the - endpoint zero as error.*/ - if (((usbp->setup[0] & USB_RTYPE_TYPE_MASK) != USB_RTYPE_TYPE_STD) || - !default_handler(usbp)) - break; - } - - /* Transfer preparation. The request handler must have populated - correctly the fields ep0next, ep0n and ep0endcb using the macro - usbSetupTransfer().*/ - max = usb_lld_fetch_word(&usbp->setup[6]); - /* The transfer size cannot exceed the specified amount.*/ - if (usbp->ep0n > max) - usbp->ep0n = max; - if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { - /* IN phase.*/ - if (usbp->ep0n > 0) { - /* Starts the transmit phase.*/ - usbp->ep0state = USB_EP0_TX; - usb_lld_start_in(usbp, 0, usbp->ep0next, usbp->ep0n); - } - else { - /* No transmission phase, directly receiving the zero sized status - packet.*/ - usbp->ep0state = USB_EP0_WAITING_STS; - usb_lld_start_out(usbp, 0, NULL, 0); - } - } - else { - /* OUT phase.*/ - if (usbp->ep0n > 0) { - /* Starts the receive phase.*/ - usbp->ep0state = USB_EP0_RX; - usb_lld_start_out(usbp, 0, usbp->ep0next, usbp->ep0n); - } - else { - /* No receive phase, directly sending the zero sized status - packet.*/ - usbp->ep0state = USB_EP0_SENDING_STS; - usb_lld_start_in(usbp, 0, NULL, 0); - } - } - return; case USB_EP0_RX: /* Receive phase over, sending the zero sized status packet.*/ usbp->ep0state = USB_EP0_SENDING_STS; @@ -652,7 +667,7 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { if defined.*/ if (usbGetReceiveTransactionSizeI(usbp, 0) != 0) break; - if (usbp->ep0endcb) + if (usbp->ep0endcb != NULL) usbp->ep0endcb(usbp); usbp->ep0state = USB_EP0_WAITING_SETUP; return; @@ -664,8 +679,7 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) { receiving a SETUP packet.*/ usb_lld_stall_in(usbp, 0); usb_lld_stall_out(usbp, 0); - if (usbp->config->event_cb) - usbp->config->event_cb(usbp, USB_EVENT_STALLED); + _usb_isr_invoke_event_cb(usbp, USB_EVENT_STALLED); usbp->ep0state = USB_EP0_ERROR; } diff --git a/os/hal/templates/usb_lld.c b/os/hal/templates/usb_lld.c index d2750d2e5..823946385 100644 --- a/os/hal/templates/usb_lld.c +++ b/os/hal/templates/usb_lld.c @@ -203,6 +203,24 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { } +/** + * @brief Reads a setup packet from the dedicated packet buffer. + * @details This function must be invoked in the context of the @p setup_cb + * callback in order to read the received setup packet. + * @pre In order to use this function the endpoint must have been + * initialized as a control endpoint. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * + * @notapi + */ +void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) { + +} + /** * @brief Reads a packet from the dedicated packet buffer. * @pre In order to use this function he endpoint must have been diff --git a/os/hal/templates/usb_lld.h b/os/hal/templates/usb_lld.h index 254f6c5da..5b235eaa4 100644 --- a/os/hal/templates/usb_lld.h +++ b/os/hal/templates/usb_lld.h @@ -282,6 +282,7 @@ extern "C" { void usb_lld_disable_endpoints(USBDriver *usbp); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); + void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf); size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n); void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, diff --git a/readme.txt b/readme.txt index 4c57b0dca..12ed129bf 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,8 @@ *** 2.3.1 *** - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). +- NEW: Improved setup packets handling in the USB driver through a specific + callback. - OPT: Simplified Serial over USB driver configuration. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index e18275808..6f4416364 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -224,6 +224,7 @@ static const USBDescriptor *get_descriptor(USBDriver *usbp, */ static const USBEndpointConfig ep1config = { USB_EP_MODE_TYPE_BULK | USB_EP_MODE_PACKET, + NULL, sduDataTransmitted, NULL, 0x0040, @@ -237,6 +238,7 @@ static const USBEndpointConfig ep1config = { */ static const USBEndpointConfig ep2config = { USB_EP_MODE_TYPE_INTR | USB_EP_MODE_PACKET, + NULL, sduInterruptTransmitted, NULL, 0x0010, @@ -251,6 +253,7 @@ static const USBEndpointConfig ep2config = { static const USBEndpointConfig ep3config = { USB_EP_MODE_TYPE_BULK | USB_EP_MODE_PACKET, NULL, + NULL, sduDataReceived, 0x0000, 0x0040, -- cgit v1.2.3 From 7475f73726faf6d5408bd12dc8120b7cfd44a5b2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 11 Mar 2011 20:29:04 +0000 Subject: Board support for Olimex STM32-P107. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2816 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/OLIMEX_STM32_P107/board.c | 63 +++++++++++++ boards/OLIMEX_STM32_P107/board.h | 190 ++++++++++++++++++++++++++++++++++++++ boards/OLIMEX_STM32_P107/board.mk | 5 + 3 files changed, 258 insertions(+) create mode 100644 boards/OLIMEX_STM32_P107/board.c create mode 100644 boards/OLIMEX_STM32_P107/board.h create mode 100644 boards/OLIMEX_STM32_P107/board.mk diff --git a/boards/OLIMEX_STM32_P107/board.c b/boards/OLIMEX_STM32_P107/board.c new file mode 100644 index 000000000..e83f3e227 --- /dev/null +++ b/boards/OLIMEX_STM32_P107/board.c @@ -0,0 +1,63 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + + /* + * Several I/O pins are re-mapped: + * USART3 to the PD8/PD9 pins. + * I2C1 to the PB8/PB9 pins. + * SPI3 to the PC10/PC11/PC12 pins. + */ + AFIO->MAPR |= AFIO_MAPR_USART3_REMAP_FULLREMAP | + AFIO_MAPR_I2C1_REMAP | + AFIO_MAPR_SPI3_REMAP; +} diff --git a/boards/OLIMEX_STM32_P107/board.h b/boards/OLIMEX_STM32_P107/board.h new file mode 100644 index 000000000..87c2398dd --- /dev/null +++ b/boards/OLIMEX_STM32_P107/board.h @@ -0,0 +1,190 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for the STMicroelectronics STM3210C-EVAL evaluation board. + */ + +/* + * Board identifier. + */ +#define BOARD_OLIMEX_STM32_P107 +#define BOARD_NAME "Olimex STM32-P107" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 25000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F10X_CL + +/* + * IO pins assignments. + */ +#define GPIOA_SWITCH_WKUP 0 + +#define GPIOC_LED_STATUS1 6 +#define GPIOC_LED_STATUS2 7 +#define GPIOC_SWITCH_TAMPER 13 + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA0 - Normal input (WKUP BUTTON). + * PA1 - Normal input (ETH_RMII_REF_CLK). + * PA2 - Alternate output (ETH_RMII_MDIO). + * PA3 - Input with PU (unconnected). + * PA4 - Normal input (MMC, external pull down). + * PA5 - Normal input (MMC, external pull up). + * PA6 - Normal input (MMC, external pull up). + * PA7 - Normal input (ETH_RMII_CRS_DV). + * PA8 - Alternate output (MCO). + * PA9 - Normal input (OTG_VBUS). + * PA10 - Normal input (OTG_ID). + * PA11 - Normal input (OTG_DM). + * PA12 - Normal input (OTG_DP). + * PA13 - Normal input (TMS). + * PA14 - Normal input (TCK). + * PA15 - Normal input (TDI). + */ +#define VAL_GPIOACRL 0x44448B44 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x4444444B /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup: + * PB0 - Input with PU (unconnected). + * PB1 - Input with PU (unconnected). + * PB2 - Normal input (BOOT1). + * PB3 - Normal input (TDO). + * PB4 - Normal input (TRST). + * PB5 - Normal input (MMC, external pull up). + * PB6 - Input with PU (unconnected). + * PB7 - Input with PU (unconnected). + * PB8 - Alternate O.D. (I2C1 SCL, remapped). + * PB9 - Alternate O.D. (I2C1 SDA, remapped). + * PB10 - Input with PU (unconnected). + * PB11 - Alternate output (ETH_RMII_TX_EN). + * PB12 - Alternate output (ETH_RMII_TXD0). + * PB13 - Alternate output (ETH_RMII_TXD1). + * PB14 - Input with PU (unconnected). + * PB15 - Push Pull output (CS_UEXT). + */ +#define VAL_GPIOBCRL 0x88844488 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x38BBB8FF /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup: + * PC0 - Input with PU (unconnected). + * PC1 - Alternate output (ETH_MDC). + * PC2 - Input with PU (unconnected). + * PC3 - Input with PU (unconnected). + * PC4 - Normal input (ETH_RMII_RXD0). + * PC5 - Normal input (ETH_RMII_RXD1). + * PC6 - Push Pull output (STAT1 green LED). + * PC7 - Push Pull output (STAT2 yellow LED). + * PC8 - Input with PU (unconnected). + * PC9 - Input with PU (unconnected). + * PC10 - Alternate output (SPI3 SCK). + * PC11 - Input with PU (SPI3 MISO). + * PC12 - Alternate output (SPI3 MOSI). + * PC13 - Normal input (TAMPER). + * PC14 - Normal input (OSC32 IN). + * PC15 - Normal input (OSC32 OUT). + */ +#define VAL_GPIOCCRL 0x334488B8 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x444B8B88 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup: + * PD0 - Input with PU (unconnected). + * PD1 - Input with PU (unconnected). + * PD2 - Input with PU (unconnected). + * PD3 - Input with PU (unconnected). + * PD4 - Input with PU (unconnected). + * PD5 - Alternate output (USART2 TX, UEXT). + * PD6 - Input with PU (USART2 RX, UEXT). + * PD7 - Push Pull output (USB_VBUSON). + * PD8 - Alternate output (USART2 TX, remapped). + * PD9 - Normal input (USART2 RX, remapped). + * PD10 - Input with PU (unconnected). + * PD11 - Normal input (USART2 CTS, remapped). + * PD12 - Alternate output (USART2 RTS, remapped). + * PD13 - Input with PU (unconnected). + * PD14 - Input with PU (unconnected). + * PD15 - Input with PU (unconnected). + */ +#define VAL_GPIODCRL 0x38B88888 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x888B484B /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + * PE12 - Normal input (ETH_RMII_MDINT). + * PE13 - Normal input (USB_FAULT). + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x44888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/boards/OLIMEX_STM32_P107/board.mk b/boards/OLIMEX_STM32_P107/board.mk new file mode 100644 index 000000000..63f70119a --- /dev/null +++ b/boards/OLIMEX_STM32_P107/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = ${CHIBIOS}/boards/OLIMEX_STM32_P107/board.c + +# Required include directories +BOARDINC = ${CHIBIOS}/boards/OLIMEX_STM32_P107 -- cgit v1.2.3 From f81c30406f47c57b8fcbec62ac66b66042eaa23f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Mar 2011 07:32:38 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2817 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/OLIMEX_STM32_P107/board.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/OLIMEX_STM32_P107/board.h b/boards/OLIMEX_STM32_P107/board.h index 87c2398dd..52639b0e2 100644 --- a/boards/OLIMEX_STM32_P107/board.h +++ b/boards/OLIMEX_STM32_P107/board.h @@ -170,8 +170,8 @@ /* * Port E setup. * Everything input with pull-up except: - * PE12 - Normal input (ETH_RMII_MDINT). - * PE13 - Normal input (USB_FAULT). + * PE14 - Normal input (ETH_RMII_MDINT). + * PE15 - Normal input (USB_FAULT). */ #define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ #define VAL_GPIOECRH 0x44888888 /* PE15...PE8 */ -- cgit v1.2.3 From 3e8aa7cd6ab42de755f5e873d3775c3d7065a58f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Mar 2011 08:25:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2818 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/OLIMEX_STM32_P107/board.h | 2 +- demos/ARMCM3-STM32F103/readme.txt | 6 +- demos/ARMCM3-STM32F107-GCC/Makefile | 2 +- demos/ARMCM3-STM32F107-GCC/main.c | 13 ++- demos/ARMCM3-STM32F107-GCC/mcuconf.h | 10 +-- demos/ARMCM3-STM32F107-GCC/readme.txt | 9 +- docs/reports/STM32F107-72-GCC.txt | 162 ++++++++++++++++++++++++++++++++++ readme.txt | 3 + 8 files changed, 187 insertions(+), 20 deletions(-) create mode 100644 docs/reports/STM32F107-72-GCC.txt diff --git a/boards/OLIMEX_STM32_P107/board.h b/boards/OLIMEX_STM32_P107/board.h index 52639b0e2..61ea865e0 100644 --- a/boards/OLIMEX_STM32_P107/board.h +++ b/boards/OLIMEX_STM32_P107/board.h @@ -142,7 +142,7 @@ */ #define VAL_GPIOCCRL 0x334488B8 /* PC7...PC0 */ #define VAL_GPIOCCRH 0x444B8B88 /* PC15...PC8 */ -#define VAL_GPIOCODR 0xFFFFFFFF +#define VAL_GPIOCODR 0xFFFFFF3F /* * Port D setup: diff --git a/demos/ARMCM3-STM32F103/readme.txt b/demos/ARMCM3-STM32F103/readme.txt index 5329bfb35..e14bc600f 100644 --- a/demos/ARMCM3-STM32F103/readme.txt +++ b/demos/ARMCM3-STM32F103/readme.txt @@ -10,12 +10,12 @@ The demo runs on an Olimex STM32-P103 board. The demo flashes the board LED using a thread, by pressing the button located on the board the test procedure is activated with output on the serial port -COM2 (USART2). +SD2 (USART2). ** Build Procedure ** -The demo has been tested by using the free Codesourcery GCC-based toolchain, -YAGARTO and an experimental WinARM build including GCC 4.3.0. +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. Just modify the TRGT line in the makefile in order to use different GCC ports. ** Notes ** diff --git a/demos/ARMCM3-STM32F107-GCC/Makefile b/demos/ARMCM3-STM32F107-GCC/Makefile index dc4ebeeeb..9a7631be9 100644 --- a/demos/ARMCM3-STM32F107-GCC/Makefile +++ b/demos/ARMCM3-STM32F107-GCC/Makefile @@ -57,7 +57,7 @@ LDSCRIPT= ch.ld # Imported source files CHIBIOS = ../.. -include $(CHIBIOS)/boards/ST_STM3210C_EVAL/board.mk +include $(CHIBIOS)/boards/OLIMEX_STM32_P107/board.mk include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk diff --git a/demos/ARMCM3-STM32F107-GCC/main.c b/demos/ARMCM3-STM32F107-GCC/main.c index 73bc0b402..418966941 100644 --- a/demos/ARMCM3-STM32F107-GCC/main.c +++ b/demos/ARMCM3-STM32F107-GCC/main.c @@ -22,19 +22,18 @@ #include "test.h" /* - * Red LED blinker thread, times are in milliseconds. + * Green LED blinker thread, times are in milliseconds. */ static WORKING_AREA(waThread1, 128); static msg_t Thread1(void *arg) { (void)arg; while (TRUE) { - palClearPad(IOPORT4, 7); + palClearPad(GPIOC, GPIOC_LED_STATUS1); chThdSleepMilliseconds(500); - palSetPad(IOPORT4, 7); + palSetPad(GPIOC, GPIOC_LED_STATUS1); chThdSleepMilliseconds(500); } - return 0; } /* @@ -55,7 +54,7 @@ int main(void) { /* * Activates the serial driver 2 using the driver default configuration. */ - sdStart(&SD2, NULL); + sdStart(&SD3, NULL); /* * Creates the blinker thread. @@ -67,8 +66,8 @@ int main(void) { * sleeping in a loop and check the button state. */ while (TRUE) { - if (palReadPad(IOPORT2, 9) == 0) - TestThread(&SD2); + if (palReadPad(GPIOC, GPIOC_SWITCH_TAMPER) == 0) + TestThread(&SD3); chThdSleepMilliseconds(500); } return 0; diff --git a/demos/ARMCM3-STM32F107-GCC/mcuconf.h b/demos/ARMCM3-STM32F107-GCC/mcuconf.h index f3e7ad40b..3c741ceb8 100644 --- a/demos/ARMCM3-STM32F107-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F107-GCC/mcuconf.h @@ -94,8 +94,8 @@ * SERIAL driver system settings. */ #define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 TRUE #define STM32_SERIAL_USE_UART4 FALSE #define STM32_SERIAL_USE_UART5 FALSE #define STM32_SERIAL_USART1_PRIORITY 12 @@ -107,9 +107,9 @@ /* * SPI driver system settings. */ -#define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 TRUE -#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 TRUE #define STM32_SPI_SPI1_DMA_PRIORITY 2 #define STM32_SPI_SPI2_DMA_PRIORITY 2 #define STM32_SPI_SPI3_DMA_PRIORITY 2 diff --git a/demos/ARMCM3-STM32F107-GCC/readme.txt b/demos/ARMCM3-STM32F107-GCC/readme.txt index 959a23363..f535df8b4 100644 --- a/demos/ARMCM3-STM32F107-GCC/readme.txt +++ b/demos/ARMCM3-STM32F107-GCC/readme.txt @@ -4,15 +4,18 @@ ** TARGET ** -The demo runs on an ST STM3210C-EVAL board. +The demo runs on an Olimex STM32-P107 board. ** The Demo ** +The demo flashes the board LED using a thread, by pressing the button located +on the board the test procedure is activated with output on the serial port +SD3 (USART3). ** Build Procedure ** -The demo has been tested by using the free Codesourcery GCC-based toolchain, -YAGARTO and an experimental WinARM build including GCC 4.3.0. +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. Just modify the TRGT line in the makefile in order to use different GCC ports. ** Notes ** diff --git a/docs/reports/STM32F107-72-GCC.txt b/docs/reports/STM32F107-72-GCC.txt new file mode 100644 index 000000000..884a1b30e --- /dev/null +++ b/docs/reports/STM32F107-72-GCC.txt @@ -0,0 +1,162 @@ +*************************************************************************** +Options: -O2 -fomit-frame-pointer -mabi=apcs-gnu -falign-functions=16 +Settings: SYSCLK=72, ACR=0x12 (2 wait states) +*************************************************************************** + +*** ChibiOS/RT test suite +*** +*** Kernel: 2.3.1unstable +*** GCC Version: 4.5.2 +*** Architecture: ARMv7-M +*** Core Variant: Cortex-M3 +*** Platform: STM32 Connectivity Line +*** Test Board: Olimex STM32-P107 + +---------------------------------------------------------------------------- +--- Test Case 1.1 (Threads, enqueuing test #1) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.2 (Threads, enqueuing test #2) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.3 (Threads, priority change) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.4 (Threads, delays) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.1 (Semaphores, enqueuing) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.2 (Semaphores, timeout) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.3 (Semaphores, atomic signal-wait) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.4 (Binary Semaphores, functionality) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.1 (Mutexes, priority enqueuing test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.2 (Mutexes, priority inheritance, simple case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.3 (Mutexes, priority inheritance, complex case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.4 (Mutexes, priority return) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.5 (Mutexes, status) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.6 (CondVar, signal test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.7 (CondVar, broadcast test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.8 (CondVar, boost test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 4.1 (Messages, loop) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 5.1 (Mailboxes, queuing and timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.1 (Events, registration and dispatch) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.2 (Events, wait and broadcast) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.3 (Events, timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 7.1 (Heap, allocation and fragmentation test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 8.1 (Memory Pools, queue/dequeue) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.1 (Dynamic APIs, threads creation from heap) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.2 (Dynamic APIs, threads creation from memory pool) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.3 (Dynamic APIs, registry and references) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.1 (Queues, input queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.2 (Queues, output queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.1 (Benchmark, messages #1) +--- Score : 249425 msgs/S, 498850 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.2 (Benchmark, messages #2) +--- Score : 198438 msgs/S, 396876 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.3 (Benchmark, messages #3) +--- Score : 198438 msgs/S, 396876 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.4 (Benchmark, context switch) +--- Score : 848888 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.5 (Benchmark, threads, full cycle) +--- Score : 156166 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.6 (Benchmark, threads, create only) +--- Score : 235534 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) +--- Score : 61032 reschedules/S, 366192 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.8 (Benchmark, round robin context switching) +--- Score : 472600 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.9 (Benchmark, I/O Queues throughput) +--- Score : 474216 bytes/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.10 (Benchmark, virtual timers set/reset) +--- Score : 644340 timers/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.11 (Benchmark, semaphores wait/signal) +--- Score : 787320 wait+signal/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.12 (Benchmark, mutexes lock/unlock) +--- Score : 586488 lock+unlock/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.13 (Benchmark, RAM footprint) +--- System: 360 bytes +--- Thread: 68 bytes +--- Timer : 20 bytes +--- Semaph: 12 bytes +--- EventS: 4 bytes +--- EventL: 12 bytes +--- Mutex : 16 bytes +--- CondV.: 8 bytes +--- Queue : 32 bytes +--- MailB.: 40 bytes +--- Result: SUCCESS +---------------------------------------------------------------------------- + +Final result: SUCCESS diff --git a/readme.txt b/readme.txt index 12ed129bf..ddf0b0ceb 100644 --- a/readme.txt +++ b/readme.txt @@ -73,9 +73,12 @@ *** 2.3.1 *** - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). +- NEW: Added board files for the Olimex STM32-P107. - NEW: Improved setup packets handling in the USB driver through a specific callback. - OPT: Simplified Serial over USB driver configuration. +- CHANGE: Now the STM32F107 demo targets the board Olimex STM32-P107 as + default. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. -- cgit v1.2.3 From 3ed4800b9b4126acd3b79b108658a1145dccff6f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Mar 2011 08:34:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2819 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F107-GCC/Makefile | 204 -------------- demos/ARMCM3-STM32F107-GCC/ch.ld | 113 -------- demos/ARMCM3-STM32F107-GCC/chconf.h | 507 ---------------------------------- demos/ARMCM3-STM32F107-GCC/halconf.h | 280 ------------------- demos/ARMCM3-STM32F107-GCC/main.c | 74 ----- demos/ARMCM3-STM32F107-GCC/mcuconf.h | 137 --------- demos/ARMCM3-STM32F107-GCC/readme.txt | 28 -- demos/ARMCM3-STM32F107/Makefile | 204 ++++++++++++++ demos/ARMCM3-STM32F107/ch.ld | 113 ++++++++ demos/ARMCM3-STM32F107/chconf.h | 507 ++++++++++++++++++++++++++++++++++ demos/ARMCM3-STM32F107/halconf.h | 280 +++++++++++++++++++ demos/ARMCM3-STM32F107/main.c | 74 +++++ demos/ARMCM3-STM32F107/mcuconf.h | 137 +++++++++ demos/ARMCM3-STM32F107/readme.txt | 28 ++ readme.txt | 5 +- 15 files changed, 1346 insertions(+), 1345 deletions(-) delete mode 100644 demos/ARMCM3-STM32F107-GCC/Makefile delete mode 100644 demos/ARMCM3-STM32F107-GCC/ch.ld delete mode 100644 demos/ARMCM3-STM32F107-GCC/chconf.h delete mode 100644 demos/ARMCM3-STM32F107-GCC/halconf.h delete mode 100644 demos/ARMCM3-STM32F107-GCC/main.c delete mode 100644 demos/ARMCM3-STM32F107-GCC/mcuconf.h delete mode 100644 demos/ARMCM3-STM32F107-GCC/readme.txt create mode 100644 demos/ARMCM3-STM32F107/Makefile create mode 100644 demos/ARMCM3-STM32F107/ch.ld create mode 100644 demos/ARMCM3-STM32F107/chconf.h create mode 100644 demos/ARMCM3-STM32F107/halconf.h create mode 100644 demos/ARMCM3-STM32F107/main.c create mode 100644 demos/ARMCM3-STM32F107/mcuconf.h create mode 100644 demos/ARMCM3-STM32F107/readme.txt diff --git a/demos/ARMCM3-STM32F107-GCC/Makefile b/demos/ARMCM3-STM32F107-GCC/Makefile deleted file mode 100644 index 9a7631be9..000000000 --- a/demos/ARMCM3-STM32F107-GCC/Makefile +++ /dev/null @@ -1,204 +0,0 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable register caching optimization (read documentation). -ifeq ($(USE_CURRP_CACHING),) - USE_CURRP_CACHING = no -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Enable this if you really want to use the STM FWLib. -ifeq ($(USE_FWLIB),) - USE_FWLIB = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Define linker script file here -LDSCRIPT= ch.ld - -# Imported source files -CHIBIOS = ../.. -include $(CHIBIOS)/boards/OLIMEX_STM32_P107/board.mk -include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk -include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk -include $(CHIBIOS)/os/kernel/kernel.mk -include $(CHIBIOS)/test/test.mk - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(PORTSRC) \ - $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(CHIBIOS)/os/various/evtimer.c \ - $(CHIBIOS)/os/various/syscalls.c \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = $(PORTASM) - -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m3 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -OD = $(TRGT)objdump -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of default section -# - -# List all default C defines here, like -D_DEBUG=1 -DDEFS = - -# List all default ASM defines here, like -D_DEBUG=1 -DADEFS = - -# List all default directories to look for include files here -DINCDIR = - -# List the default directory to look for the libraries here -DLIBDIR = - -# List all default libraries here -DLIBS = - -# -# End of default section -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# -# End of user defines -############################################################################## - -ifeq ($(USE_FWLIB),yes) - include $(CHIBIOS)/ext/stm32lib/stm32lib.mk - CSRC += $(STM32SRC) - INCDIR += $(STM32INC) - USE_OPT += -DUSE_STDPERIPH_DRIVER -endif - -include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F107-GCC/ch.ld b/demos/ARMCM3-STM32F107-GCC/ch.ld deleted file mode 100644 index 0595192db..000000000 --- a/demos/ARMCM3-STM32F107-GCC/ch.ld +++ /dev/null @@ -1,113 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F107 memory setup. - */ -__main_stack_size__ = 0x0200; -__process_stack_size__ = 0x0400; -__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; - -MEMORY -{ - flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 64k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -SECTIONS -{ - . = 0; - - .text : ALIGN(16) SUBALIGN(16) - { - _text = .; - KEEP(*(vectors)) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ctors : - { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); - } > flash - - .dtors : - { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); - } > flash - - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .data : - { - _data = .; - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - _edata = .; - } > ram AT > flash - - .bss : - { - _bss_start = .; - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - _bss_end = .; - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F107-GCC/chconf.h b/demos/ARMCM3-STM32F107-GCC/chconf.h deleted file mode 100644 index 3353391ca..000000000 --- a/demos/ARMCM3-STM32F107-GCC/chconf.h +++ /dev/null @@ -1,507 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/* Kernel parameters. */ -/*===========================================================================*/ - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) -#define CH_FREQUENCY 1000 -#endif - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - */ -#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) -#define CH_TIME_QUANTUM 20 -#endif - -/** - * @brief Nested locks. - * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() - * operations is allowed.
- * For performance and code size reasons the recommended setting - * is to leave this option disabled.
- * You may use this option if you need to merge ChibiOS/RT with - * external libraries that require nested lock/unlock operations. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) -#define CH_USE_NESTED_LOCKS FALSE -#endif - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. - */ -#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) -#define CH_MEMCORE_SIZE 0 -#endif - -/*===========================================================================*/ -/* Performance options. */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) -#define CH_OPTIMIZE_SPEED TRUE -#endif - -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - -/*===========================================================================*/ -/* Subsystem options. */ -/*===========================================================================*/ - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) -#define CH_USE_REGISTRY TRUE -#endif - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) -#define CH_USE_WAITEXIT TRUE -#endif - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES TRUE -#endif - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES_PRIORITY FALSE -#endif - -/** - * @brief Atomic semaphore API. - * @details If enabled then the semaphores the @p chSemSignalWait() API - * is included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) -#define CH_USE_SEMSW TRUE -#endif - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) -#define CH_USE_MUTEXES TRUE -#endif - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MUTEXES. - */ -#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS TRUE -#endif - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_CONDVARS. - */ -#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS_TIMEOUT TRUE -#endif - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) -#define CH_USE_EVENTS TRUE -#endif - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_EVENTS. - */ -#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_EVENTS_TIMEOUT TRUE -#endif - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES TRUE -#endif - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_MESSAGES. - */ -#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES_PRIORITY FALSE -#endif - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) -#define CH_USE_MAILBOXES TRUE -#endif - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) -#define CH_USE_QUEUES TRUE -#endif - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) -#define CH_USE_MEMCORE TRUE -#endif - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or - * @p CH_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) -#define CH_USE_HEAP TRUE -#endif - -/** - * @brief C-runtime allocator. - * @details If enabled the the heap allocator APIs just wrap the C-runtime - * @p malloc() and @p free() functions. - * - * @note The default is @p FALSE. - * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the - * appropriate documentation. - */ -#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) -#define CH_USE_MALLOC_HEAP FALSE -#endif - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) -#define CH_USE_MEMPOOLS TRUE -#endif - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_WAITEXIT. - * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. - */ -#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) -#define CH_USE_DYNAMIC TRUE -#endif - -/*===========================================================================*/ -/* Debug options. */ -/*===========================================================================*/ - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_CHECKS FALSE -#endif - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_ASSERTS FALSE -#endif - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_TRACE FALSE -#endif - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_STACK_CHECK FALSE -#endif - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) -#define CH_DBG_FILL_THREADS FALSE -#endif - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p Thread structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p TRUE. - * @note This debug option is defaulted to TRUE because it is required by - * some test cases into the test suite. - */ -#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) -#define CH_DBG_THREADS_PROFILING TRUE -#endif - -/*===========================================================================*/ -/* Kernel hooks. */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p Thread structure. - */ -#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) -#define THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ -#endif - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitily from all - * the threads creation APIs. - */ -#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} -#endif - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} -#endif - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) -#define IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} -#endif - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_TICK_EVENT_HOOK() { \ - /* System tick event code here.*/ \ -} -#endif - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_HALT_HOOK() { \ - /* System halt code here.*/ \ -} -#endif - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/demos/ARMCM3-STM32F107-GCC/halconf.h b/demos/ARMCM3-STM32F107-GCC/halconf.h deleted file mode 100644 index b74a05529..000000000 --- a/demos/ARMCM3-STM32F107-GCC/halconf.h +++ /dev/null @@ -1,280 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Block size for MMC transfers. - */ -#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) -#define MMC_SECTOR_SIZE 512 -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/** - * @brief Number of positive insertion queries before generating the - * insertion event. - */ -#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) -#define MMC_POLLING_INTERVAL 10 -#endif - -/** - * @brief Interval, in milliseconds, between insertion queries. - */ -#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) -#define MMC_POLLING_DELAY 10 -#endif - -/** - * @brief Uses the SPI polled API for small data transfers. - * @details Polled transfers usually improve performance because it - * saves two context switches and interrupt servicing. Note - * that this option has no effect on large transfers which - * are always performed using DMAs/IRQs. - */ -#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) -#define MMC_USE_SPI_POLLING TRUE -#endif - -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/demos/ARMCM3-STM32F107-GCC/main.c b/demos/ARMCM3-STM32F107-GCC/main.c deleted file mode 100644 index 418966941..000000000 --- a/demos/ARMCM3-STM32F107-GCC/main.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "test.h" - -/* - * Green LED blinker thread, times are in milliseconds. - */ -static WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { - - (void)arg; - while (TRUE) { - palClearPad(GPIOC, GPIOC_LED_STATUS1); - chThdSleepMilliseconds(500); - palSetPad(GPIOC, GPIOC_LED_STATUS1); - chThdSleepMilliseconds(500); - } -} - -/* - * Application entry point. - */ -int main(void) { - - /* - * System initializations. - * - HAL initialization, this also initializes the configured device drivers - * and performs the board-specific initializations. - * - Kernel initialization, the main() function becomes a thread and the - * RTOS is active. - */ - halInit(); - chSysInit(); - - /* - * Activates the serial driver 2 using the driver default configuration. - */ - sdStart(&SD3, NULL); - - /* - * Creates the blinker thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - - /* - * Normal main() thread activity, in this demo it does nothing except - * sleeping in a loop and check the button state. - */ - while (TRUE) { - if (palReadPad(GPIOC, GPIOC_SWITCH_TAMPER) == 0) - TestThread(&SD3); - chThdSleepMilliseconds(500); - } - return 0; -} diff --git a/demos/ARMCM3-STM32F107-GCC/mcuconf.h b/demos/ARMCM3-STM32F107-GCC/mcuconf.h deleted file mode 100644 index 3c741ceb8..000000000 --- a/demos/ARMCM3-STM32F107-GCC/mcuconf.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * STM32 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -/* - * HAL driver system settings. - */ -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_PREDIV1 -#define STM32_PREDIV1SRC STM32_PREDIV1SRC_PLL2 -#define STM32_PREDIV1_VALUE 5 -#define STM32_PLLMUL_VALUE 9 -#define STM32_PREDIV2_VALUE 5 -#define STM32_PLL2MUL_VALUE 8 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_OTGFSPRE STM32_OTGFSPRE_DIV3 -#define STM32_MCO STM32_MCO_NOCLOCK - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 -#define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 TRUE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_TIM1 TRUE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 TRUE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 TRUE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 TRUE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() diff --git a/demos/ARMCM3-STM32F107-GCC/readme.txt b/demos/ARMCM3-STM32F107-GCC/readme.txt deleted file mode 100644 index f535df8b4..000000000 --- a/demos/ARMCM3-STM32F107-GCC/readme.txt +++ /dev/null @@ -1,28 +0,0 @@ -***************************************************************************** -** ChibiOS/RT port for ARM-Cortex-M3 STM32F107. ** -***************************************************************************** - -** TARGET ** - -The demo runs on an Olimex STM32-P107 board. - -** The Demo ** - -The demo flashes the board LED using a thread, by pressing the button located -on the board the test procedure is activated with output on the serial port -SD3 (USART3). - -** Build Procedure ** - -The demo has been tested by using the free Codesourcery GCC-based toolchain -and YAGARTO. -Just modify the TRGT line in the makefile in order to use different GCC ports. - -** Notes ** - -Some files used by the demo are not part of ChibiOS/RT but are copyright of -ST Microelectronics and are licensed under a different license. -Also note that not all the files present in the ST library are distribited -with ChibiOS/RT, you can find the whole library on the ST web site: - - http://www.st.com diff --git a/demos/ARMCM3-STM32F107/Makefile b/demos/ARMCM3-STM32F107/Makefile new file mode 100644 index 000000000..9a7631be9 --- /dev/null +++ b/demos/ARMCM3-STM32F107/Makefile @@ -0,0 +1,204 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P107/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F107/ch.ld b/demos/ARMCM3-STM32F107/ch.ld new file mode 100644 index 000000000..0595192db --- /dev/null +++ b/demos/ARMCM3-STM32F107/ch.ld @@ -0,0 +1,113 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F107 memory setup. + */ +__main_stack_size__ = 0x0200; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 256k + ram : org = 0x20000000, len = 64k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F107/chconf.h b/demos/ARMCM3-STM32F107/chconf.h new file mode 100644 index 000000000..3353391ca --- /dev/null +++ b/demos/ARMCM3-STM32F107/chconf.h @@ -0,0 +1,507 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h new file mode 100644 index 000000000..b74a05529 --- /dev/null +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -0,0 +1,280 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F107/main.c b/demos/ARMCM3-STM32F107/main.c new file mode 100644 index 000000000..418966941 --- /dev/null +++ b/demos/ARMCM3-STM32F107/main.c @@ -0,0 +1,74 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" +#include "test.h" + +/* + * Green LED blinker thread, times are in milliseconds. + */ +static WORKING_AREA(waThread1, 128); +static msg_t Thread1(void *arg) { + + (void)arg; + while (TRUE) { + palClearPad(GPIOC, GPIOC_LED_STATUS1); + chThdSleepMilliseconds(500); + palSetPad(GPIOC, GPIOC_LED_STATUS1); + chThdSleepMilliseconds(500); + } +} + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Activates the serial driver 2 using the driver default configuration. + */ + sdStart(&SD3, NULL); + + /* + * Creates the blinker thread. + */ + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + + /* + * Normal main() thread activity, in this demo it does nothing except + * sleeping in a loop and check the button state. + */ + while (TRUE) { + if (palReadPad(GPIOC, GPIOC_SWITCH_TAMPER) == 0) + TestThread(&SD3); + chThdSleepMilliseconds(500); + } + return 0; +} diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h new file mode 100644 index 000000000..3c741ceb8 --- /dev/null +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -0,0 +1,137 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_PREDIV1 +#define STM32_PREDIV1SRC STM32_PREDIV1SRC_PLL2 +#define STM32_PREDIV1_VALUE 5 +#define STM32_PLLMUL_VALUE 9 +#define STM32_PREDIV2_VALUE 5 +#define STM32_PLL2MUL_VALUE 8 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_OTGFSPRE STM32_OTGFSPRE_DIV3 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 TRUE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() diff --git a/demos/ARMCM3-STM32F107/readme.txt b/demos/ARMCM3-STM32F107/readme.txt new file mode 100644 index 000000000..f535df8b4 --- /dev/null +++ b/demos/ARMCM3-STM32F107/readme.txt @@ -0,0 +1,28 @@ +***************************************************************************** +** ChibiOS/RT port for ARM-Cortex-M3 STM32F107. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an Olimex STM32-P107 board. + +** The Demo ** + +The demo flashes the board LED using a thread, by pressing the button located +on the board the test procedure is activated with output on the serial port +SD3 (USART3). + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com diff --git a/readme.txt b/readme.txt index ddf0b0ceb..540a66d9e 100644 --- a/readme.txt +++ b/readme.txt @@ -77,8 +77,9 @@ - NEW: Improved setup packets handling in the USB driver through a specific callback. - OPT: Simplified Serial over USB driver configuration. -- CHANGE: Now the STM32F107 demo targets the board Olimex STM32-P107 as - default. +- CHANGE: Renamed the demo ARMCM3-STM32F107-GCC in ARMCM3-STM32F107. +- CHANGE: Now the ARMCM3-STM32F107 demo targets the board Olimex STM32-P107 + as default. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. -- cgit v1.2.3 From 887409c0c96c911862f21955ee956e5fa2d8ad6f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 12 Mar 2011 11:19:24 +0000 Subject: STM32 HAL improvements (CL devices). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2820 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F107/mcuconf.h | 6 +- os/hal/platforms/STM32/hal_lld.c | 50 ++++++----- os/hal/platforms/STM32/hal_lld_f105_f107.h | 131 ++++++++++++++++++++++++----- readme.txt | 2 + 4 files changed, 144 insertions(+), 45 deletions(-) diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h index 3c741ceb8..9ff306342 100644 --- a/demos/ARMCM3-STM32F107/mcuconf.h +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -34,6 +34,9 @@ /* * HAL driver system settings. */ +#define STM32_ACTIVATE_PLL1 TRUE +#define STM32_ACTIVATE_PLL2 TRUE +#define STM32_ACTIVATE_PLL3 TRUE #define STM32_SW STM32_SW_PLL #define STM32_PLLSRC STM32_PLLSRC_PREDIV1 #define STM32_PREDIV1SRC STM32_PREDIV1SRC_PLL2 @@ -41,12 +44,13 @@ #define STM32_PLLMUL_VALUE 9 #define STM32_PREDIV2_VALUE 5 #define STM32_PLL2MUL_VALUE 8 +#define STM32_PLL3MUL_VALUE 10 #define STM32_HPRE STM32_HPRE_DIV1 #define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_ADCPRE STM32_ADCPRE_DIV4 #define STM32_OTGFSPRE STM32_OTGFSPRE_DIV3 -#define STM32_MCO STM32_MCO_NOCLOCK +#define STM32_MCO STM32_MCO_PLL3 /* * ADC driver system settings. diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 7878bb518..b2a7a0fe5 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -146,43 +146,51 @@ void stm32_clock_init(void) { */ void stm32_clock_init(void) { - /* HSI setup, it enforces the reset situation in order to handle possible - problems with JTAG probes and re-initializations.*/ + /* HSI setup.*/ RCC->CR |= RCC_CR_HSION; /* Make sure HSI is ON. */ while (!(RCC->CR & RCC_CR_HSIRDY)) ; /* Wait until HSI is stable. */ + RCC->CFGR = 0; RCC->CR &= RCC_CR_HSITRIM | RCC_CR_HSION; /* CR Reset value. */ - RCC->CFGR = 0; /* CFGR reset value. */ while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_HSI) ; /* Wait until HSI is the source.*/ - RCC->CFGR2 = 0; - /* HSE setup, it is only performed if the HSE clock is selected as source - of the system clock (directly or through the PLLs).*/ -#if (STM32_SW == STM32_SW_HSE) || \ - ((STM32_SW == STM32_SW_PLL) && (STM32_PLLSRC == STM32_PLLSRC_PREDIV1)) + /* HSE setup, it is only performed if the current configuration uses + it somehow.*/ +#if STM32_ACTIVATE_PLL2 || \ + STM32_ACTIVATE_PLL3 || \ + (STM32_SW == STM32_SW_HSE) || \ + ((STM32_PREDIV1SRC == STM32_PREDIV1SRC_HSE) && \ + (STM32_PLLSRC == STM32_PLLSRC_PREDIV1)) RCC->CR |= RCC_CR_HSEON; while (!(RCC->CR & RCC_CR_HSERDY)) ; /* Waits until HSE is stable. */ #endif - /* PLL2 setup, it is only performed if the PLL2 clock is selected as source - for the PLL clock else it is left disabled.*/ -#if STM32_SW == STM32_SW_PLL -#if STM32_PREDIV1SRC == STM32_PREDIV1SRC_PLL2 - RCC->CFGR2 |= STM32_PREDIV2 | STM32_PLL2MUL; - RCC->CR |= RCC_CR_PLL2ON; + /* Settings of various dividers and multipliers in CFGR2.*/ + RCC->CFGR2 = STM32_PLL3MUL | STM32_PLL2MUL | STM32_PREDIV2 | + STM32_PREDIV1 | STM32_PREDIV1SRC; + + /* PLL2 setup, if activated.*/ +#if STM32_ACTIVATE_PLL2 + RCC->CR |= RCC_CR_PLL2ON; while (!(RCC->CR & RCC_CR_PLL2RDY)) - ; /* Waits until PLL is stable. */ + ; /* Waits until PLL2 is stable. */ #endif - /* PLL setup, it is only performed if the PLL is the selected source of - the system clock else it is left disabled.*/ - RCC->CFGR2 |= STM32_PREDIV1 | STM32_PREDIV1SRC; - RCC->CFGR |= STM32_PLLMUL | STM32_PLLSRC; - RCC->CR |= RCC_CR_PLLON; + /* PLL3 setup, if activated.*/ +#if STM32_ACTIVATE_PLL3 + RCC->CR |= RCC_CR_PLL3ON; + while (!(RCC->CR & RCC_CR_PLL3RDY)) + ; /* Waits until PLL3 is stable. */ +#endif + + /* PLL1 setup, if activated.*/ +#if STM32_ACTIVATE_PLL1 + RCC->CFGR |= STM32_PLLMUL | STM32_PLLSRC; + RCC->CR |= RCC_CR_PLLON; while (!(RCC->CR & RCC_CR_PLLRDY)) - ; /* Waits until PLL2 is stable. */ + ; /* Waits until PLL1 is stable. */ #endif /* Clock settings.*/ diff --git a/os/hal/platforms/STM32/hal_lld_f105_f107.h b/os/hal/platforms/STM32/hal_lld_f105_f107.h index d4477e705..fd4f96aa0 100644 --- a/os/hal/platforms/STM32/hal_lld_f105_f107.h +++ b/os/hal/platforms/STM32/hal_lld_f105_f107.h @@ -170,10 +170,35 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief PLL1 main switch. + * @note If this constant is set to @p TRUE then the PLL1 is initialized + * and started. + */ +#if !defined(STM32_ACTIVATE_PLL1) || defined(__DOXYGEN__) +#define STM32_ACTIVATE_PLL1 TRUE +#endif + +/** + * @brief PLL2 main switch. + * @note If this constant is set to @p TRUE then the PLL2 is initialized + * and started. + */ +#if !defined(STM32_ACTIVATE_PLL2) || defined(__DOXYGEN__) +#define STM32_ACTIVATE_PLL2 TRUE +#endif + +/** + * @brief PLL3 main switch. + * @note If this constant is set to @p TRUE then the PLL3 is initialized + * and started. + */ +#if !defined(STM32_ACTIVATE_PLL3) || defined(__DOXYGEN__) +#define STM32_ACTIVATE_PLL3 TRUE +#endif + /** * @brief Main clock source selection. - * @note If the selected clock source is not the PLL then the PLL is not - * initialized and started. * @note The default value is calculated for a 72MHz system clock from * a 25MHz crystal using both PLL and PLL2. */ @@ -183,8 +208,6 @@ /** * @brief Clock source for the PLL. - * @note This setting has only effect if the PLL is selected as the - * system clock source. * @note The default value is calculated for a 72MHz system clock from * a 25MHz crystal using both PLL and PLL2. */ @@ -194,8 +217,6 @@ /** * @brief PREDIV1 clock source. - * @note This setting has only effect if the PLL is selected as the - * system clock source. * @note The default value is calculated for a 72MHz system clock from * a 25MHz crystal using both PLL and PLL2. */ @@ -205,8 +226,6 @@ /** * @brief PREDIV1 division factor. - * @note This setting has only effect if the PLL is selected as the - * system clock source. * @note The allowed range is 1...16. * @note The default value is calculated for a 72MHz system clock from * a 25MHz crystal using both PLL and PLL2. @@ -227,8 +246,6 @@ /** * @brief PREDIV2 division factor. - * @note This setting has only effect if the PLL2 is selected as the - * clock source for the PLL. * @note The allowed range is 1...16. * @note The default value is calculated for a 72MHz system clock from * a 25MHz crystal using both PLL and PLL2. @@ -246,6 +263,15 @@ #define STM32_PLL2MUL_VALUE 8 #endif +/** + * @brief PLL3 multiplier value. + * @note The default value is calculated for a 50MHz clock from + * a 25MHz crystal. + */ +#if !defined(STM32_PLL3MUL_VALUE) || defined(__DOXYGEN__) +#define STM32_PLL3MUL_VALUE 10 +#endif + /** * @brief AHB prescaler value. * @note The default value is calculated for a 72MHz system clock from @@ -294,6 +320,14 @@ /* Derived constants and error checks. */ /*===========================================================================*/ +/* PLL2 usage check.*/ +#if STM32_ACTIVATE_PLL2 && \ + (STM32_PREDIV1SRC != STM32_PREDIV1SRC_PLL2) && \ + (STM32_MCO != STM32_MCO_PLL2) + +#error "PLL2 activated but not used" +#endif + /** * @brief PREDIV1 field. */ @@ -338,9 +372,22 @@ #error "invalid STM32_PLL2MUL_VALUE value specified" #endif -/* The following values are only used if PLL2 clock is selected as source - for the PLL clock */ -#if (STM32_PREDIV1SRC == STM32_PREDIV1SRC_PLL2) || defined(__DOXYGEN__) +/** + * @brief PLL3MUL field. + */ +#if ((STM32_PLL3MUL_VALUE >= 8) && (STM32_PLL3MUL_VALUE <= 14)) || \ + defined(__DOXYGEN__) +#define STM32_PLL3MUL ((STM32_PLL3MUL_VALUE - 2) << 12) +#elif (STM32_PLL3MUL_VALUE == 16) +#define STM32_PLL3MUL (14 << 12) +#elif (STM32_PLL3MUL_VALUE == 20) +#define STM32_PLL3MUL (15 << 12) +#else +#error "invalid STM32_PLL3MUL_VALUE value specified" +#endif + +/* The following values are only used if PLL2 is activated */ +#if STM32_ACTIVATE_PLL2 /** * @brief PLL2 input frequency. */ @@ -356,11 +403,44 @@ */ #define STM32_PLL2CLKOUT (STM32_PLL2CLKIN * STM32_PLL2MUL_VALUE) +/** + * @brief PLL2 VCO clock frequency. + */ +#define STM32_PLL2VCO (STM32_PLL2CLKOUT * 2) + /* PLL2 output frequency range check.*/ -#if (STM32_PLL2CLKOUT < 40000000) || (STM32_PLL2CLKOUT > 74000000) -#error "STM32_PLL2CLKOUT outside acceptable range (40...74MHz)" +#if (STM32_PLL2VCO < 80000000) || (STM32_PLL2VCO > 148000000) +#error "STM32_PLL2VCO outside acceptable range (80...148MHz)" +#endif +#endif /* STM32_ACTIVATE_PLL2 */ + +/* The following values are only used if PLL3 is activated */ +#if STM32_ACTIVATE_PLL3 +/** + * @brief PLL3 input frequency. + */ +#define STM32_PLL3CLKIN (STM32_HSECLK / STM32_PREDIV2_VALUE) + +/* PLL3 input frequency range check.*/ +#if (STM32_PLL3CLKIN < 3000000) || (STM32_PLL3CLKIN > 5000000) +#error "STM32_PLL3CLKIN outside acceptable range (3...5MHz)" #endif -#endif /* STM32_PREDIV1SRC == STM32_PREDIV1SRC_PLL2 */ + +/** + * @brief PLL3 output clock frequency. + */ +#define STM32_PLL3CLKOUT (STM32_PLL3CLKIN * STM32_PLL3MUL_VALUE) + +/** + * @brief PLL3 VCO clock frequency. + */ +#define STM32_PLL3VCO (STM32_PLL3CLKOUT * 2) + +/* PLL3 output frequency range check.*/ +#if (STM32_PLL3VCO < 80000000) || (STM32_PLL3VCO > 148000000) +#error "STM32_PLL3CLKOUT outside acceptable range (80...148MHz)" +#endif +#endif /* STM32_ACTIVATE_PLL3 */ /** * @brief PREDIV1 input frequency. @@ -377,9 +457,9 @@ * @brief PLL input clock frequency. */ #if (STM32_PLLSRC == STM32_PLLSRC_PREDIV1) || defined(__DOXYGEN__) -#define STM32_PLLCLKIN (STM32_PREDIV1CLK / STM32_PREDIV1_VALUE) +#define STM32_PLLCLKIN (STM32_PREDIV1CLK / STM32_PREDIV1_VALUE) #elif STM32_PLLSRC == STM32_PLLSRC_HSI -#define STM32_PLLCLKIN (STM32_HSICLK / 2) +#define STM32_PLLCLKIN (STM32_HSICLK / 2) #else #error "invalid STM32_PLLSRC value specified" #endif @@ -392,11 +472,16 @@ /** * @brief PLL output clock frequency. */ -#define STM32_PLLCLKOUT (STM32_PLLCLKIN * STM32_PLLMUL_VALUE) +#define STM32_PLLCLKOUT (STM32_PLLCLKIN * STM32_PLLMUL_VALUE) + +/** + * @brief PLL VCO clock frequency. + */ +#define STM32_PLLVCO (STM32_PLLCLKOUT * 2) /* PLL output frequency range check.*/ -#if (STM32_PLLCLKOUT < 18000000) || (STM32_PLLCLKOUT > 72000000) -#error "STM32_PLLCLKOUT outside acceptable range (18...72MHz)" +#if (STM32_PLLVCO < 36000000) || (STM32_PLLVCO > 144000000) +#error "STM32_PLLVCO outside acceptable range (36...144MHz)" #endif /** @@ -515,9 +600,9 @@ * @brief OTG frequency. */ #if (STM32_OTGFSPRE == STM32_OTGFSPRE_DIV3) || defined(__DOXYGEN__) -#define STM32_OTGFSCLK ((STM32_PLLCLKOUT * 2) / 3) +#define STM32_OTGFSCLK (STM32_PLLVCO / 3) #elif (STM32_OTGFSPRE == STM32_OTGFSPRE_DIV2) -#define STM32_OTGFSCLK STM32_PLLCLKOUT +#define STM32_OTGFSCLK (STM32_PLLVCO / 2) #else #error "invalid STM32_OTGFSPRE value specified" #endif diff --git a/readme.txt b/readme.txt index 540a66d9e..a86e0265b 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,8 @@ *** 2.3.1 *** - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). +- NEW: Added support for PLL3 in STM32 HAL driver. Note, the format of the + mcuconf.h file is changed for STM32F105/STM32F107 devices. - NEW: Added board files for the Olimex STM32-P107. - NEW: Improved setup packets handling in the USB driver through a specific callback. -- cgit v1.2.3 From a1427e9a2201f3b87eace5b11ad64992197dfdf1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 13 Mar 2011 08:27:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2821 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/hal_lld_f105_f107.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/os/hal/platforms/STM32/hal_lld_f105_f107.h b/os/hal/platforms/STM32/hal_lld_f105_f107.h index fd4f96aa0..b28f8c297 100644 --- a/os/hal/platforms/STM32/hal_lld_f105_f107.h +++ b/os/hal/platforms/STM32/hal_lld_f105_f107.h @@ -324,7 +324,6 @@ #if STM32_ACTIVATE_PLL2 && \ (STM32_PREDIV1SRC != STM32_PREDIV1SRC_PLL2) && \ (STM32_MCO != STM32_MCO_PLL2) - #error "PLL2 activated but not used" #endif @@ -442,10 +441,15 @@ #endif #endif /* STM32_ACTIVATE_PLL3 */ +/* The following values are only used if PLL1 is activated */ +#if STM32_ACTIVATE_PLL1 /** * @brief PREDIV1 input frequency. */ #if (STM32_PREDIV1SRC == STM32_PREDIV1SRC_PLL2) || defined(__DOXYGEN__) +#if !STM32_ACTIVATE_PLL2 +#error "PLL2 selected as clock source for STM32_PREDIV1SRC but not activated" +#endif #define STM32_PREDIV1CLK STM32_PLL2CLKOUT #elif STM32_PREDIV1SRC == STM32_PREDIV1SRC_HSE #define STM32_PREDIV1CLK STM32_HSECLK @@ -483,11 +487,15 @@ #if (STM32_PLLVCO < 36000000) || (STM32_PLLVCO > 144000000) #error "STM32_PLLVCO outside acceptable range (36...144MHz)" #endif +#endif /* STM32_ACTIVATE_PLL1 */ /** * @brief System clock source. */ #if (STM32_SW == STM32_SW_PLL) || defined(__DOXYGEN__) +#if !STM32_ACTIVATE_PLL1 +#error "PLL1 selected as clock source for STM32_SYSCLK but not activated" +#endif #define STM32_SYSCLK STM32_PLLCLKOUT #elif (STM32_SW == STM32_SW_HSI) #define STM32_SYSCLK STM32_HSICLK -- cgit v1.2.3 From 47326e33d39ac1086cd0c62a10b0a30428033335 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 17 Mar 2011 09:01:09 +0000 Subject: Fixed bug 3219197. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2822 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F107-72-GCC.txt | 4 ++-- os/kernel/include/chqueues.h | 6 ++++-- readme.txt | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/reports/STM32F107-72-GCC.txt b/docs/reports/STM32F107-72-GCC.txt index 884a1b30e..3240b2663 100644 --- a/docs/reports/STM32F107-72-GCC.txt +++ b/docs/reports/STM32F107-72-GCC.txt @@ -98,7 +98,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 249425 msgs/S, 498850 ctxswc/S +--- Score : 249426 msgs/S, 498852 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) @@ -130,7 +130,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 474216 bytes/S +--- Score : 478964 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index 1913e8bdd..8a00f404d 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -134,7 +134,8 @@ typedef GenericQueue InputQueue; * * @iclass */ -#define chIQIsFullI(iqp) ((bool_t)(chQSpaceI(iqp) >= chQSizeI(iqp))) +#define chIQIsFullI(iqp) ((bool_t)(((iqp)->q_wrptr == (iqp)->q_rdptr) && \ + !chIQIsEmptyI(iqp))) /** * @brief Input queue read. @@ -205,7 +206,8 @@ typedef GenericQueue OutputQueue; * * @iclass */ -#define chOQIsEmptyI(oqp) ((bool_t)(chQSpaceI(oqp) >= chQSizeI(oqp))) +#define chOQIsEmptyI(oqp) ((bool_t)(((oqp)->q_wrptr == (oqp)->q_rdptr) && \ + !chOQIsFullI(oqp))) /** * @brief Evaluates to @p TRUE if the specified output queue is full. diff --git a/readme.txt b/readme.txt index a86e0265b..d1534bd9b 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,7 @@ ***************************************************************************** *** 2.3.1 *** +- FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). - NEW: Added support for PLL3 in STM32 HAL driver. Note, the format of the -- cgit v1.2.3 From e7e79a6ccb4f3e320b2b8b7bad1b14d65218641d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Mar 2011 18:38:08 +0000 Subject: License updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2827 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/EA_LPCXPRESSO_BB_1114/board.c | 3 ++- boards/EA_LPCXPRESSO_BB_1114/board.h | 3 ++- boards/EA_LPCXPRESSO_BB_1343/board.c | 3 ++- boards/EA_LPCXPRESSO_BB_1343/board.h | 3 ++- boards/GENERIC_SPC563/board.c | 3 ++- boards/GENERIC_SPC563/board.h | 3 ++- boards/OLIMEX_AVR_CAN/board.c | 3 ++- boards/OLIMEX_AVR_CAN/board.h | 3 ++- boards/OLIMEX_AVR_MT_128/board.c | 3 ++- boards/OLIMEX_AVR_MT_128/board.h | 3 ++- boards/OLIMEX_LPC_P2148/board.c | 3 ++- boards/OLIMEX_LPC_P2148/board.h | 3 ++- boards/OLIMEX_LPC_P2148/buzzer.c | 3 ++- boards/OLIMEX_LPC_P2148/buzzer.h | 3 ++- boards/OLIMEX_MSP430_P1611/board.c | 3 ++- boards/OLIMEX_MSP430_P1611/board.h | 3 ++- boards/OLIMEX_SAM7_EX256/board.c | 3 ++- boards/OLIMEX_SAM7_EX256/board.h | 3 ++- boards/OLIMEX_SAM7_P256/board.c | 3 ++- boards/OLIMEX_SAM7_P256/board.h | 3 ++- boards/OLIMEX_STM32_H103/board.c | 3 ++- boards/OLIMEX_STM32_H103/board.h | 3 ++- boards/OLIMEX_STM32_P103/board.c | 3 ++- boards/OLIMEX_STM32_P103/board.h | 3 ++- boards/OLIMEX_STM32_P107/board.c | 3 ++- boards/OLIMEX_STM32_P107/board.h | 3 ++- boards/RAISONANCE_REVA_STM8S/board.c | 3 ++- boards/RAISONANCE_REVA_STM8S/board.h | 3 ++- boards/ST_STM3210C_EVAL/board.c | 3 ++- boards/ST_STM3210C_EVAL/board.h | 3 ++- boards/ST_STM32VL_DISCOVERY/board.c | 3 ++- boards/ST_STM32VL_DISCOVERY/board.h | 3 ++- boards/ST_STM8L_DISCOVERY/board.c | 3 ++- boards/ST_STM8L_DISCOVERY/board.h | 3 ++- boards/ST_STM8S_DISCOVERY/board.c | 3 ++- boards/ST_STM8S_DISCOVERY/board.h | 3 ++- boards/simulator/board.c | 3 ++- boards/simulator/board.h | 3 ++- demos/ARM7-AT91SAM7S-FATFS-GCC/ch.ld | 3 ++- demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h | 3 ++- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 3 ++- demos/ARM7-AT91SAM7S-FATFS-GCC/main.c | 3 ++- demos/ARM7-AT91SAM7S-FATFS-GCC/mcuconf.h | 3 ++- demos/ARM7-AT91SAM7S-GCC/ch.ld | 3 ++- demos/ARM7-AT91SAM7S-GCC/chconf.h | 3 ++- demos/ARM7-AT91SAM7S-GCC/halconf.h | 3 ++- demos/ARM7-AT91SAM7S-GCC/main.c | 3 ++- demos/ARM7-AT91SAM7S-GCC/mcuconf.h | 3 ++- demos/ARM7-AT91SAM7X-FATFS-GCC/ch.ld | 3 ++- demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h | 3 ++- demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 3 ++- demos/ARM7-AT91SAM7X-FATFS-GCC/main.c | 3 ++- demos/ARM7-AT91SAM7X-FATFS-GCC/mcuconf.h | 3 ++- demos/ARM7-AT91SAM7X-GCC/ch.ld | 3 ++- demos/ARM7-AT91SAM7X-GCC/chconf.h | 3 ++- demos/ARM7-AT91SAM7X-GCC/halconf.h | 3 ++- demos/ARM7-AT91SAM7X-GCC/main.c | 3 ++- demos/ARM7-AT91SAM7X-GCC/mcuconf.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/main.c | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c | 3 ++- demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/ch.ld | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/main.c | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/mcuconf.h | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c | 3 ++- demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.h | 3 ++- demos/ARM7-LPC214x-FATFS-GCC/ch.ld | 3 ++- demos/ARM7-LPC214x-FATFS-GCC/chconf.h | 3 ++- demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 3 ++- demos/ARM7-LPC214x-FATFS-GCC/main.c | 3 ++- demos/ARM7-LPC214x-FATFS-GCC/mcuconf.h | 3 ++- demos/ARM7-LPC214x-G++/ch.ld | 3 ++- demos/ARM7-LPC214x-G++/chconf.h | 3 ++- demos/ARM7-LPC214x-G++/halconf.h | 3 ++- demos/ARM7-LPC214x-G++/main.cpp | 3 ++- demos/ARM7-LPC214x-G++/mcuconf.h | 3 ++- demos/ARM7-LPC214x-GCC/ch.ld | 3 ++- demos/ARM7-LPC214x-GCC/chconf.h | 3 ++- demos/ARM7-LPC214x-GCC/halconf.h | 3 ++- demos/ARM7-LPC214x-GCC/main.c | 3 ++- demos/ARM7-LPC214x-GCC/mcuconf.h | 3 ++- demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld | 3 ++- demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h | 3 ++- demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 3 ++- demos/ARMCM0-LPC1114-LPCXPRESSO/main.c | 3 ++- demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h | 3 ++- demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld | 3 ++- demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h | 3 ++- demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 3 ++- demos/ARMCM3-LPC1343-LPCXPRESSO/main.c | 3 ++- demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h | 3 ++- demos/ARMCM3-STM32F100-DISCOVERY/ch.ld | 3 ++- demos/ARMCM3-STM32F100-DISCOVERY/chconf.h | 3 ++- demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 3 ++- demos/ARMCM3-STM32F100-DISCOVERY/main.c | 3 ++- demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 3 ++- demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld | 3 ++- demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h | 3 ++- demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 3 ++- demos/ARMCM3-STM32F103-FATFS-GCC/main.c | 3 ++- demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 3 ++- demos/ARMCM3-STM32F103/ch.ld | 3 ++- demos/ARMCM3-STM32F103/chconf.h | 3 ++- demos/ARMCM3-STM32F103/halconf.h | 3 ++- demos/ARMCM3-STM32F103/main.c | 3 ++- demos/ARMCM3-STM32F103/mcuconf.h | 3 ++- demos/ARMCM3-STM32F107/ch.ld | 3 ++- demos/ARMCM3-STM32F107/chconf.h | 3 ++- demos/ARMCM3-STM32F107/halconf.h | 3 ++- demos/ARMCM3-STM32F107/main.c | 3 ++- demos/ARMCM3-STM32F107/mcuconf.h | 3 ++- demos/AVR-AT90CANx-GCC/chconf.h | 3 ++- demos/AVR-AT90CANx-GCC/halconf.h | 3 ++- demos/AVR-AT90CANx-GCC/main.c | 3 ++- demos/AVR-AT90CANx-GCC/mcuconf.h | 3 ++- demos/AVR-ATmega128-GCC/chconf.h | 3 ++- demos/AVR-ATmega128-GCC/halconf.h | 3 ++- demos/AVR-ATmega128-GCC/lcd.c | 3 ++- demos/AVR-ATmega128-GCC/lcd.h | 3 ++- demos/AVR-ATmega128-GCC/main.c | 3 ++- demos/AVR-ATmega128-GCC/mcuconf.h | 3 ++- demos/MSP430-MSP430x1611-GCC/chconf.h | 3 ++- demos/MSP430-MSP430x1611-GCC/halconf.h | 3 ++- demos/MSP430-MSP430x1611-GCC/main.c | 3 ++- demos/MSP430-MSP430x1611-GCC/mcuconf.h | 5 +++-- demos/PPC-SPC563-GCC/ch.ld | 3 ++- demos/PPC-SPC563-GCC/chconf.h | 3 ++- demos/PPC-SPC563-GCC/halconf.h | 3 ++- demos/PPC-SPC563-GCC/main.c | 3 ++- demos/Posix-GCC/chconf.h | 3 ++- demos/Posix-GCC/halconf.h | 3 ++- demos/Posix-GCC/main.c | 3 ++- demos/STM8L-STM8L152-DISCOVERY-STVD/cosmic/vectors.c | 3 ++- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h | 3 ++- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 3 ++- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c | 3 ++- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/mcuconf.h | 3 ++- demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c | 3 ++- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h | 3 ++- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 3 ++- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/main.c | 3 ++- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/mcuconf.h | 3 ++- demos/STM8S-STM8S208-RC/chconf.h | 3 ++- demos/STM8S-STM8S208-RC/halconf.h | 3 ++- demos/STM8S-STM8S208-RC/main.c | 3 ++- demos/STM8S-STM8S208-RC/mcuconf.h | 3 ++- demos/Win32-MinGW/chconf.h | 3 ++- demos/Win32-MinGW/halconf.h | 3 ++- demos/Win32-MinGW/main.c | 3 ++- docs/src/concepts.dox | 3 ++- docs/src/main.dox | 3 ++- ext/ext.dox | 3 ++- os/hal/dox/adc.dox | 3 ++- os/hal/dox/can.dox | 3 ++- os/hal/dox/gpt.dox | 3 ++- os/hal/dox/hal.dox | 3 ++- os/hal/dox/i2c.dox | 3 ++- os/hal/dox/mac.dox | 3 ++- os/hal/dox/mmc_spi.dox | 3 ++- os/hal/dox/pal.dox | 3 ++- os/hal/dox/pwm.dox | 3 ++- os/hal/dox/serial.dox | 3 ++- os/hal/dox/serial_usb.dox | 3 ++- os/hal/dox/spi.dox | 3 ++- os/hal/dox/uart.dox | 3 ++- os/hal/dox/usb.dox | 3 ++- os/hal/hal.dox | 3 ++- os/hal/include/adc.h | 3 ++- os/hal/include/can.h | 3 ++- os/hal/include/gpt.h | 3 ++- os/hal/include/hal.h | 3 ++- os/hal/include/i2c.h | 3 ++- os/hal/include/mac.h | 3 ++- os/hal/include/mmc_spi.h | 3 ++- os/hal/include/pal.h | 3 ++- os/hal/include/pwm.h | 3 ++- os/hal/include/serial.h | 3 ++- os/hal/include/serial_usb.h | 3 ++- os/hal/include/spi.h | 3 ++- os/hal/include/uart.h | 3 ++- os/hal/include/usb.h | 3 ++- os/hal/platforms/AT91SAM7/at91sam7.h | 3 ++- os/hal/platforms/AT91SAM7/at91sam7_mii.c | 3 ++- os/hal/platforms/AT91SAM7/at91sam7_mii.h | 3 ++- os/hal/platforms/AT91SAM7/hal_lld.c | 3 ++- os/hal/platforms/AT91SAM7/hal_lld.h | 3 ++- os/hal/platforms/AT91SAM7/mac_lld.c | 3 ++- os/hal/platforms/AT91SAM7/mac_lld.h | 3 ++- os/hal/platforms/AT91SAM7/pal_lld.c | 3 ++- os/hal/platforms/AT91SAM7/pal_lld.h | 3 ++- os/hal/platforms/AT91SAM7/platform.dox | 3 ++- os/hal/platforms/AT91SAM7/serial_lld.c | 7 ++++--- os/hal/platforms/AT91SAM7/serial_lld.h | 3 ++- os/hal/platforms/AT91SAM7/spi_lld.c | 9 +++++---- os/hal/platforms/AT91SAM7/spi_lld.h | 3 ++- os/hal/platforms/AVR/hal_lld.c | 3 ++- os/hal/platforms/AVR/hal_lld.h | 3 ++- os/hal/platforms/AVR/platform.dox | 3 ++- os/hal/platforms/AVR/serial_lld.c | 11 ++++++----- os/hal/platforms/AVR/serial_lld.h | 3 ++- os/hal/platforms/LPC11xx/core_cm0.h | 3 ++- os/hal/platforms/LPC11xx/gpt_lld.c | 3 ++- os/hal/platforms/LPC11xx/gpt_lld.h | 3 ++- os/hal/platforms/LPC11xx/hal_lld.c | 3 ++- os/hal/platforms/LPC11xx/hal_lld.h | 3 ++- os/hal/platforms/LPC11xx/pal_lld.c | 3 ++- os/hal/platforms/LPC11xx/pal_lld.h | 3 ++- os/hal/platforms/LPC11xx/platform.dox | 3 ++- os/hal/platforms/LPC11xx/serial_lld.c | 3 ++- os/hal/platforms/LPC11xx/serial_lld.h | 3 ++- os/hal/platforms/LPC11xx/spi_lld.c | 3 ++- os/hal/platforms/LPC11xx/spi_lld.h | 3 ++- os/hal/platforms/LPC13xx/core_cm3.h | 3 ++- os/hal/platforms/LPC13xx/gpt_lld.c | 3 ++- os/hal/platforms/LPC13xx/gpt_lld.h | 3 ++- os/hal/platforms/LPC13xx/hal_lld.c | 3 ++- os/hal/platforms/LPC13xx/hal_lld.h | 3 ++- os/hal/platforms/LPC13xx/pal_lld.c | 3 ++- os/hal/platforms/LPC13xx/pal_lld.h | 3 ++- os/hal/platforms/LPC13xx/platform.dox | 3 ++- os/hal/platforms/LPC13xx/serial_lld.c | 3 ++- os/hal/platforms/LPC13xx/serial_lld.h | 3 ++- os/hal/platforms/LPC13xx/spi_lld.c | 3 ++- os/hal/platforms/LPC13xx/spi_lld.h | 3 ++- os/hal/platforms/LPC214x/hal_lld.c | 3 ++- os/hal/platforms/LPC214x/hal_lld.h | 3 ++- os/hal/platforms/LPC214x/lpc214x.h | 3 ++- os/hal/platforms/LPC214x/pal_lld.c | 3 ++- os/hal/platforms/LPC214x/pal_lld.h | 3 ++- os/hal/platforms/LPC214x/platform.dox | 3 ++- os/hal/platforms/LPC214x/serial_lld.c | 3 ++- os/hal/platforms/LPC214x/serial_lld.h | 3 ++- os/hal/platforms/LPC214x/spi_lld.c | 3 ++- os/hal/platforms/LPC214x/spi_lld.h | 7 ++++--- os/hal/platforms/LPC214x/vic.c | 3 ++- os/hal/platforms/LPC214x/vic.h | 3 ++- os/hal/platforms/MSP430/hal_lld.c | 3 ++- os/hal/platforms/MSP430/hal_lld.h | 3 ++- os/hal/platforms/MSP430/pal_lld.c | 3 ++- os/hal/platforms/MSP430/pal_lld.h | 3 ++- os/hal/platforms/MSP430/platform.dox | 3 ++- os/hal/platforms/MSP430/serial_lld.c | 5 +++-- os/hal/platforms/MSP430/serial_lld.h | 3 ++- os/hal/platforms/Posix/console.c | 3 ++- os/hal/platforms/Posix/console.h | 3 ++- os/hal/platforms/Posix/hal_lld.c | 3 ++- os/hal/platforms/Posix/hal_lld.h | 3 ++- os/hal/platforms/Posix/pal_lld.c | 3 ++- os/hal/platforms/Posix/pal_lld.h | 3 ++- os/hal/platforms/Posix/serial_lld.c | 3 ++- os/hal/platforms/Posix/serial_lld.h | 3 ++- os/hal/platforms/SPC56x/hal_lld.c | 3 ++- os/hal/platforms/SPC56x/hal_lld.h | 3 ++- os/hal/platforms/SPC56x/platform.dox | 3 ++- os/hal/platforms/SPC56x/serial_lld.c | 3 ++- os/hal/platforms/SPC56x/serial_lld.h | 3 ++- os/hal/platforms/SPC56x/typedefs.h | 3 ++- os/hal/platforms/STM32/adc_lld.c | 3 ++- os/hal/platforms/STM32/adc_lld.h | 3 ++- os/hal/platforms/STM32/can_lld.c | 3 ++- os/hal/platforms/STM32/can_lld.h | 3 ++- os/hal/platforms/STM32/core_cm3.h | 3 ++- os/hal/platforms/STM32/gpt_lld.c | 3 ++- os/hal/platforms/STM32/gpt_lld.h | 3 ++- os/hal/platforms/STM32/hal_lld.c | 3 ++- os/hal/platforms/STM32/hal_lld.h | 3 ++- os/hal/platforms/STM32/hal_lld_f100.h | 3 ++- os/hal/platforms/STM32/hal_lld_f103.h | 3 ++- os/hal/platforms/STM32/hal_lld_f105_f107.h | 3 ++- os/hal/platforms/STM32/pal_lld.c | 3 ++- os/hal/platforms/STM32/pal_lld.h | 3 ++- os/hal/platforms/STM32/platform.dox | 3 ++- os/hal/platforms/STM32/pwm_lld.c | 3 ++- os/hal/platforms/STM32/pwm_lld.h | 3 ++- os/hal/platforms/STM32/serial_lld.c | 3 ++- os/hal/platforms/STM32/serial_lld.h | 3 ++- os/hal/platforms/STM32/spi_lld.c | 3 ++- os/hal/platforms/STM32/spi_lld.h | 3 ++- os/hal/platforms/STM32/stm32_dma.c | 3 ++- os/hal/platforms/STM32/stm32_dma.h | 3 ++- os/hal/platforms/STM32/stm32_usb.h | 3 ++- os/hal/platforms/STM32/uart_lld.c | 3 ++- os/hal/platforms/STM32/uart_lld.h | 3 ++- os/hal/platforms/STM32/usb_lld.c | 3 ++- os/hal/platforms/STM32/usb_lld.h | 3 ++- os/hal/platforms/STM8L/hal_lld.c | 3 ++- os/hal/platforms/STM8L/hal_lld.h | 3 ++- os/hal/platforms/STM8L/hal_lld_stm8l_hd.h | 3 ++- os/hal/platforms/STM8L/hal_lld_stm8l_md.h | 3 ++- os/hal/platforms/STM8L/hal_lld_stm8l_mdp.h | 3 ++- os/hal/platforms/STM8L/pal_lld.c | 3 ++- os/hal/platforms/STM8L/pal_lld.h | 3 ++- os/hal/platforms/STM8L/platform.dox | 3 ++- os/hal/platforms/STM8L/serial_lld.c | 3 ++- os/hal/platforms/STM8L/serial_lld.h | 15 ++++++++------- os/hal/platforms/STM8L/shared_isr.c | 3 ++- os/hal/platforms/STM8S/hal_lld.c | 3 ++- os/hal/platforms/STM8S/hal_lld.h | 5 +++-- os/hal/platforms/STM8S/pal_lld.c | 3 ++- os/hal/platforms/STM8S/pal_lld.h | 3 ++- os/hal/platforms/STM8S/platform.dox | 3 ++- os/hal/platforms/STM8S/serial_lld.c | 5 +++-- os/hal/platforms/STM8S/serial_lld.h | 3 ++- os/hal/platforms/STM8S/spi_lld.c | 3 ++- os/hal/platforms/STM8S/spi_lld.h | 5 +++-- os/hal/platforms/Win32/console.c | 3 ++- os/hal/platforms/Win32/console.h | 3 ++- os/hal/platforms/Win32/hal_lld.c | 3 ++- os/hal/platforms/Win32/hal_lld.h | 3 ++- os/hal/platforms/Win32/pal_lld.c | 3 ++- os/hal/platforms/Win32/pal_lld.h | 3 ++- os/hal/platforms/Win32/serial_lld.c | 3 ++- os/hal/platforms/Win32/serial_lld.h | 3 ++- os/hal/platforms/platforms.dox | 3 ++- os/hal/src/adc.c | 3 ++- os/hal/src/can.c | 3 ++- os/hal/src/gpt.c | 3 ++- os/hal/src/hal.c | 3 ++- os/hal/src/i2c.c | 3 ++- os/hal/src/mac.c | 3 ++- os/hal/src/mmc_spi.c | 3 ++- os/hal/src/pal.c | 3 ++- os/hal/src/pwm.c | 3 ++- os/hal/src/serial.c | 3 ++- os/hal/src/serial_usb.c | 3 ++- os/hal/src/spi.c | 3 ++- os/hal/src/uart.c | 3 ++- os/hal/src/usb.c | 3 ++- os/hal/templates/adc_lld.c | 3 ++- os/hal/templates/adc_lld.h | 3 ++- os/hal/templates/can_lld.c | 3 ++- os/hal/templates/can_lld.h | 3 ++- os/hal/templates/gpt_lld.c | 3 ++- os/hal/templates/gpt_lld.h | 3 ++- os/hal/templates/hal_lld.c | 3 ++- os/hal/templates/hal_lld.h | 3 ++- os/hal/templates/halconf.h | 3 ++- os/hal/templates/i2c_lld.c | 3 ++- os/hal/templates/i2c_lld.h | 3 ++- os/hal/templates/mac_lld.c | 3 ++- os/hal/templates/mac_lld.h | 3 ++- os/hal/templates/meta/driver.c | 3 ++- os/hal/templates/meta/driver.h | 3 ++- os/hal/templates/meta/driver_lld.c | 3 ++- os/hal/templates/meta/driver_lld.h | 3 ++- os/hal/templates/pal_lld.c | 3 ++- os/hal/templates/pal_lld.h | 3 ++- os/hal/templates/pwm_lld.c | 3 ++- os/hal/templates/pwm_lld.h | 3 ++- os/hal/templates/serial_lld.c | 3 ++- os/hal/templates/serial_lld.h | 3 ++- os/hal/templates/spi_lld.c | 3 ++- os/hal/templates/spi_lld.h | 7 ++++--- os/hal/templates/uart_lld.c | 3 ++- os/hal/templates/uart_lld.h | 3 ++- os/hal/templates/usb_lld.c | 3 ++- os/hal/templates/usb_lld.h | 3 ++- os/kernel/include/ch.h | 3 ++- os/kernel/include/chbsem.h | 3 ++- os/kernel/include/chcond.h | 3 ++- os/kernel/include/chdebug.h | 3 ++- os/kernel/include/chdynamic.h | 3 ++- os/kernel/include/chevents.h | 3 ++- os/kernel/include/chfiles.h | 3 ++- os/kernel/include/chheap.h | 3 ++- os/kernel/include/chinline.h | 3 ++- os/kernel/include/chioch.h | 3 ++- os/kernel/include/chlists.h | 3 ++- os/kernel/include/chmboxes.h | 3 ++- os/kernel/include/chmemcore.h | 3 ++- os/kernel/include/chmempools.h | 3 ++- os/kernel/include/chmsg.h | 3 ++- os/kernel/include/chmtx.h | 3 ++- os/kernel/include/chqueues.h | 3 ++- os/kernel/include/chregistry.h | 3 ++- os/kernel/include/chschd.h | 3 ++- os/kernel/include/chsem.h | 3 ++- os/kernel/include/chstreams.h | 3 ++- os/kernel/include/chsys.h | 3 ++- os/kernel/include/chthreads.h | 3 ++- os/kernel/include/chvt.h | 3 ++- os/kernel/kernel.dox | 5 +++-- os/kernel/src/chcond.c | 3 ++- os/kernel/src/chdebug.c | 3 ++- os/kernel/src/chdynamic.c | 3 ++- os/kernel/src/chevents.c | 3 ++- os/kernel/src/chheap.c | 3 ++- os/kernel/src/chlists.c | 3 ++- os/kernel/src/chmboxes.c | 3 ++- os/kernel/src/chmemcore.c | 3 ++- os/kernel/src/chmempools.c | 3 ++- os/kernel/src/chmsg.c | 3 ++- os/kernel/src/chmtx.c | 3 ++- os/kernel/src/chqueues.c | 3 ++- os/kernel/src/chregistry.c | 3 ++- os/kernel/src/chschd.c | 3 ++- os/kernel/src/chsem.c | 3 ++- os/kernel/src/chsys.c | 3 ++- os/kernel/src/chthreads.c | 3 ++- os/kernel/src/chvt.c | 3 ++- os/kernel/templates/chconf.h | 3 ++- os/kernel/templates/chcore.c | 3 ++- os/kernel/templates/chcore.h | 3 ++- os/kernel/templates/chtypes.h | 5 +++-- os/ports/GCC/ARM/AT91SAM7/armparams.h | 3 ++- os/ports/GCC/ARM/AT91SAM7/vectors.s | 3 ++- os/ports/GCC/ARM/AT91SAM7/wfi.h | 3 ++- os/ports/GCC/ARM/LPC214x/armparams.h | 3 ++- os/ports/GCC/ARM/LPC214x/vectors.s | 3 ++- os/ports/GCC/ARM/LPC214x/wfi.h | 3 ++- os/ports/GCC/ARM/chcore.c | 3 ++- os/ports/GCC/ARM/chcore.h | 3 ++- os/ports/GCC/ARM/chcoreasm.s | 3 ++- os/ports/GCC/ARM/chtypes.h | 3 ++- os/ports/GCC/ARM/crt0.s | 3 ++- os/ports/GCC/ARM/port.dox | 3 ++- os/ports/GCC/ARMCMx/LPC11xx/cmparams.h | 3 ++- os/ports/GCC/ARMCMx/LPC11xx/vectors.c | 7 ++++--- os/ports/GCC/ARMCMx/LPC13xx/cmparams.h | 3 ++- os/ports/GCC/ARMCMx/LPC13xx/vectors.c | 7 ++++--- os/ports/GCC/ARMCMx/STM32/cmparams.h | 3 ++- os/ports/GCC/ARMCMx/STM32/vectors.c | 7 ++++--- os/ports/GCC/ARMCMx/chcore.c | 3 ++- os/ports/GCC/ARMCMx/chcore.h | 7 ++++--- os/ports/GCC/ARMCMx/chcore_v6m.c | 3 ++- os/ports/GCC/ARMCMx/chcore_v6m.h | 3 ++- os/ports/GCC/ARMCMx/chcore_v7m.c | 7 ++++--- os/ports/GCC/ARMCMx/chcore_v7m.h | 3 ++- os/ports/GCC/ARMCMx/chtypes.h | 3 ++- os/ports/GCC/ARMCMx/crt0_v6m.s | 3 ++- os/ports/GCC/ARMCMx/crt0_v7m.s | 3 ++- os/ports/GCC/ARMCMx/nvic.c | 3 ++- os/ports/GCC/ARMCMx/nvic.h | 3 ++- os/ports/GCC/ARMCMx/old/chcore_v7m.c | 3 ++- os/ports/GCC/ARMCMx/old/chcore_v7m.h | 3 ++- os/ports/GCC/ARMCMx/port.dox | 3 ++- os/ports/GCC/AVR/chcore.c | 3 ++- os/ports/GCC/AVR/chcore.h | 3 ++- os/ports/GCC/AVR/chtypes.h | 3 ++- os/ports/GCC/AVR/port.dox | 3 ++- os/ports/GCC/MSP430/chcore.c | 3 ++- os/ports/GCC/MSP430/chcore.h | 3 ++- os/ports/GCC/MSP430/chtypes.h | 3 ++- os/ports/GCC/MSP430/port.dox | 3 ++- os/ports/GCC/PPC/SPC56x/ivor.s | 3 ++- os/ports/GCC/PPC/SPC56x/vectors.s | 3 ++- os/ports/GCC/PPC/chcore.c | 3 ++- os/ports/GCC/PPC/chcore.h | 3 ++- os/ports/GCC/PPC/chtypes.h | 3 ++- os/ports/GCC/PPC/crt0.s | 3 ++- os/ports/GCC/PPC/port.dox | 3 ++- os/ports/GCC/SIMIA32/chcore.c | 3 ++- os/ports/GCC/SIMIA32/chcore.h | 3 ++- os/ports/GCC/SIMIA32/chtypes.h | 3 ++- os/ports/IAR/ARMCMx/LPC11xx/cmparams.h | 3 ++- os/ports/IAR/ARMCMx/LPC11xx/vectors.s | 3 ++- os/ports/IAR/ARMCMx/LPC13xx/cmparams.h | 3 ++- os/ports/IAR/ARMCMx/LPC13xx/vectors.s | 3 ++- os/ports/IAR/ARMCMx/STM32/cmparams.h | 3 ++- os/ports/IAR/ARMCMx/STM32/vectors.s | 3 ++- os/ports/IAR/ARMCMx/chcore.c | 3 ++- os/ports/IAR/ARMCMx/chcore.h | 3 ++- os/ports/IAR/ARMCMx/chcore_v6m.c | 3 ++- os/ports/IAR/ARMCMx/chcore_v6m.h | 3 ++- os/ports/IAR/ARMCMx/chcore_v7m.c | 3 ++- os/ports/IAR/ARMCMx/chcore_v7m.h | 3 ++- os/ports/IAR/ARMCMx/chcoreasm_v6m.s | 3 ++- os/ports/IAR/ARMCMx/chcoreasm_v7m.s | 3 ++- os/ports/IAR/ARMCMx/chtypes.h | 3 ++- os/ports/IAR/ARMCMx/cstartup.s | 3 ++- os/ports/IAR/ARMCMx/nvic.c | 3 ++- os/ports/IAR/ARMCMx/nvic.h | 3 ++- os/ports/IAR/ARMCMx/port.dox | 3 ++- os/ports/RC/STM8/chcore.c | 3 ++- os/ports/RC/STM8/chcore.h | 3 ++- os/ports/RC/STM8/chtypes.h | 3 ++- os/ports/RC/STM8/port.dox | 3 ++- os/ports/RVCT/ARMCMx/LPC11xx/cmparams.h | 3 ++- os/ports/RVCT/ARMCMx/LPC11xx/vectors.s | 3 ++- os/ports/RVCT/ARMCMx/LPC13xx/cmparams.h | 3 ++- os/ports/RVCT/ARMCMx/LPC13xx/vectors.s | 3 ++- os/ports/RVCT/ARMCMx/STM32/cmparams.h | 3 ++- os/ports/RVCT/ARMCMx/STM32/vectors.s | 3 ++- os/ports/RVCT/ARMCMx/chcore.c | 3 ++- os/ports/RVCT/ARMCMx/chcore.h | 3 ++- os/ports/RVCT/ARMCMx/chcore_v6m.c | 3 ++- os/ports/RVCT/ARMCMx/chcore_v6m.h | 3 ++- os/ports/RVCT/ARMCMx/chcore_v7m.c | 3 ++- os/ports/RVCT/ARMCMx/chcore_v7m.h | 3 ++- os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 3 ++- os/ports/RVCT/ARMCMx/chcoreasm_v7m.s | 3 ++- os/ports/RVCT/ARMCMx/chtypes.h | 3 ++- os/ports/RVCT/ARMCMx/cstartup.s | 3 ++- os/ports/RVCT/ARMCMx/nvic.c | 3 ++- os/ports/RVCT/ARMCMx/nvic.h | 3 ++- os/ports/RVCT/ARMCMx/port.dox | 3 ++- os/ports/cosmic/STM8/chcore.c | 3 ++- os/ports/cosmic/STM8/chcore.h | 3 ++- os/ports/cosmic/STM8/chtypes.h | 3 ++- os/ports/cosmic/STM8/port.dox | 3 ++- os/ports/ports.dox | 3 ++- os/various/ch.cpp | 3 ++- os/various/ch.hpp | 3 ++- os/various/evtimer.c | 3 ++- os/various/evtimer.h | 3 ++- os/various/memstreams.c | 3 ++- os/various/memstreams.h | 3 ++- os/various/mii.h | 3 ++- os/various/shell.c | 3 ++- os/various/shell.h | 3 ++- os/various/syscalls.c | 3 ++- os/various/usb_cdc.h | 3 ++- os/various/usb_msc.c | 3 ++- os/various/usb_msc.h | 3 ++- os/various/various.dox | 3 ++- test/coverage/chconf.h | 3 ++- test/coverage/halconf.h | 3 ++- test/coverage/main.c | 3 ++- test/test.c | 3 ++- test/test.dox | 3 ++- test/test.h | 3 ++- test/testbmk.c | 3 ++- test/testbmk.h | 3 ++- test/testdyn.c | 3 ++- test/testdyn.h | 3 ++- test/testevt.c | 3 ++- test/testevt.h | 3 ++- test/testheap.c | 3 ++- test/testheap.h | 3 ++- test/testmbox.c | 3 ++- test/testmbox.h | 3 ++- test/testmsg.c | 3 ++- test/testmsg.h | 3 ++- test/testmtx.c | 3 ++- test/testmtx.h | 3 ++- test/testpools.c | 3 ++- test/testpools.h | 3 ++- test/testqueues.c | 3 ++- test/testqueues.h | 3 ++- test/testsem.c | 3 ++- test/testsem.h | 3 ++- test/testthd.c | 3 ++- test/testthd.h | 3 ++- testhal/LPC11xx/IRQ_STORM/ch.ld | 3 ++- testhal/LPC11xx/IRQ_STORM/chconf.h | 3 ++- testhal/LPC11xx/IRQ_STORM/halconf.h | 3 ++- testhal/LPC11xx/IRQ_STORM/main.c | 3 ++- testhal/LPC11xx/IRQ_STORM/mcuconf.h | 3 ++- testhal/LPC13xx/IRQ_STORM/ch.ld | 3 ++- testhal/LPC13xx/IRQ_STORM/chconf.h | 3 ++- testhal/LPC13xx/IRQ_STORM/halconf.h | 3 ++- testhal/LPC13xx/IRQ_STORM/main.c | 3 ++- testhal/LPC13xx/IRQ_STORM/mcuconf.h | 3 ++- testhal/STM32/ADC/ch.ld | 3 ++- testhal/STM32/ADC/chconf.h | 3 ++- testhal/STM32/ADC/halconf.h | 3 ++- testhal/STM32/ADC/main.c | 3 ++- testhal/STM32/ADC/mcuconf.h | 3 ++- testhal/STM32/CAN/ch.ld | 3 ++- testhal/STM32/CAN/chconf.h | 3 ++- testhal/STM32/CAN/halconf.h | 3 ++- testhal/STM32/CAN/main.c | 9 +++++---- testhal/STM32/CAN/mcuconf.h | 3 ++- testhal/STM32/GPT/ch.ld | 3 ++- testhal/STM32/GPT/chconf.h | 3 ++- testhal/STM32/GPT/halconf.h | 3 ++- testhal/STM32/GPT/main.c | 3 ++- testhal/STM32/GPT/mcuconf.h | 3 ++- testhal/STM32/IRQ_STORM/ch.ld | 3 ++- testhal/STM32/IRQ_STORM/chconf.h | 3 ++- testhal/STM32/IRQ_STORM/halconf.h | 3 ++- testhal/STM32/IRQ_STORM/main.c | 3 ++- testhal/STM32/IRQ_STORM/mcuconf.h | 3 ++- testhal/STM32/PWM/ch.ld | 3 ++- testhal/STM32/PWM/chconf.h | 3 ++- testhal/STM32/PWM/halconf.h | 3 ++- testhal/STM32/PWM/main.c | 5 +++-- testhal/STM32/PWM/mcuconf.h | 3 ++- testhal/STM32/SPI/ch.ld | 3 ++- testhal/STM32/SPI/chconf.h | 3 ++- testhal/STM32/SPI/halconf.h | 3 ++- testhal/STM32/SPI/main.c | 11 ++++++----- testhal/STM32/SPI/mcuconf.h | 3 ++- testhal/STM32/UART/ch.ld | 3 ++- testhal/STM32/UART/chconf.h | 3 ++- testhal/STM32/UART/halconf.h | 3 ++- testhal/STM32/UART/main.c | 17 +++++++++-------- testhal/STM32/UART/mcuconf.h | 3 ++- testhal/STM32/USB_CDC/ch.ld | 3 ++- testhal/STM32/USB_CDC/chconf.h | 3 ++- testhal/STM32/USB_CDC/halconf.h | 3 ++- testhal/STM32/USB_CDC/main.c | 3 ++- testhal/STM32/USB_CDC/mcuconf.h | 3 ++- testhal/STM32/USB_MSC/ch.ld | 3 ++- testhal/STM32/USB_MSC/chconf.h | 3 ++- testhal/STM32/USB_MSC/halconf.h | 3 ++- testhal/STM32/USB_MSC/main.c | 3 ++- testhal/STM32/USB_MSC/mcuconf.h | 3 ++- testhal/STM8S/SPI/cosmic/vectors.c | 3 ++- testhal/STM8S/SPI/demo/chconf.h | 3 ++- testhal/STM8S/SPI/demo/halconf.h | 3 ++- testhal/STM8S/SPI/demo/main.c | 3 ++- testhal/STM8S/SPI/demo/mcuconf.h | 3 ++- 615 files changed, 1281 insertions(+), 666 deletions(-) diff --git a/boards/EA_LPCXPRESSO_BB_1114/board.c b/boards/EA_LPCXPRESSO_BB_1114/board.c index 31b194aef..b087dd227 100644 --- a/boards/EA_LPCXPRESSO_BB_1114/board.c +++ b/boards/EA_LPCXPRESSO_BB_1114/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/EA_LPCXPRESSO_BB_1114/board.h b/boards/EA_LPCXPRESSO_BB_1114/board.h index be7805709..e95703db2 100644 --- a/boards/EA_LPCXPRESSO_BB_1114/board.h +++ b/boards/EA_LPCXPRESSO_BB_1114/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/EA_LPCXPRESSO_BB_1343/board.c b/boards/EA_LPCXPRESSO_BB_1343/board.c index 117bda619..097b15372 100644 --- a/boards/EA_LPCXPRESSO_BB_1343/board.c +++ b/boards/EA_LPCXPRESSO_BB_1343/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/EA_LPCXPRESSO_BB_1343/board.h b/boards/EA_LPCXPRESSO_BB_1343/board.h index dfcb1f3f9..51cee4645 100644 --- a/boards/EA_LPCXPRESSO_BB_1343/board.h +++ b/boards/EA_LPCXPRESSO_BB_1343/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/GENERIC_SPC563/board.c b/boards/GENERIC_SPC563/board.c index 8356f122d..310209c74 100644 --- a/boards/GENERIC_SPC563/board.c +++ b/boards/GENERIC_SPC563/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/GENERIC_SPC563/board.h b/boards/GENERIC_SPC563/board.h index 0c840175f..699bd37d4 100644 --- a/boards/GENERIC_SPC563/board.h +++ b/boards/GENERIC_SPC563/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_AVR_CAN/board.c b/boards/OLIMEX_AVR_CAN/board.c index 691dcbe13..de1af241c 100644 --- a/boards/OLIMEX_AVR_CAN/board.c +++ b/boards/OLIMEX_AVR_CAN/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_AVR_CAN/board.h b/boards/OLIMEX_AVR_CAN/board.h index 18a6d9904..b1d6038c3 100644 --- a/boards/OLIMEX_AVR_CAN/board.h +++ b/boards/OLIMEX_AVR_CAN/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_AVR_MT_128/board.c b/boards/OLIMEX_AVR_MT_128/board.c index 64229808d..b1fa460a9 100644 --- a/boards/OLIMEX_AVR_MT_128/board.c +++ b/boards/OLIMEX_AVR_MT_128/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_AVR_MT_128/board.h b/boards/OLIMEX_AVR_MT_128/board.h index 18dfd60b8..dfe6828bb 100644 --- a/boards/OLIMEX_AVR_MT_128/board.h +++ b/boards/OLIMEX_AVR_MT_128/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_LPC_P2148/board.c b/boards/OLIMEX_LPC_P2148/board.c index 4b9a2205d..6f528541f 100644 --- a/boards/OLIMEX_LPC_P2148/board.c +++ b/boards/OLIMEX_LPC_P2148/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_LPC_P2148/board.h b/boards/OLIMEX_LPC_P2148/board.h index 7a1ec7cf6..1878a01b8 100644 --- a/boards/OLIMEX_LPC_P2148/board.h +++ b/boards/OLIMEX_LPC_P2148/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_LPC_P2148/buzzer.c b/boards/OLIMEX_LPC_P2148/buzzer.c index 9d55c0ad5..3db013bca 100644 --- a/boards/OLIMEX_LPC_P2148/buzzer.c +++ b/boards/OLIMEX_LPC_P2148/buzzer.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_LPC_P2148/buzzer.h b/boards/OLIMEX_LPC_P2148/buzzer.h index fcfd1917c..4ced36d14 100644 --- a/boards/OLIMEX_LPC_P2148/buzzer.h +++ b/boards/OLIMEX_LPC_P2148/buzzer.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_MSP430_P1611/board.c b/boards/OLIMEX_MSP430_P1611/board.c index 405d0deb7..b1e525dfe 100644 --- a/boards/OLIMEX_MSP430_P1611/board.c +++ b/boards/OLIMEX_MSP430_P1611/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_MSP430_P1611/board.h b/boards/OLIMEX_MSP430_P1611/board.h index c445c5b6e..7f1189a3a 100644 --- a/boards/OLIMEX_MSP430_P1611/board.h +++ b/boards/OLIMEX_MSP430_P1611/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_SAM7_EX256/board.c b/boards/OLIMEX_SAM7_EX256/board.c index 5445739ed..31f28d3a3 100644 --- a/boards/OLIMEX_SAM7_EX256/board.c +++ b/boards/OLIMEX_SAM7_EX256/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_SAM7_EX256/board.h b/boards/OLIMEX_SAM7_EX256/board.h index 961fda9c0..fbad6c219 100644 --- a/boards/OLIMEX_SAM7_EX256/board.h +++ b/boards/OLIMEX_SAM7_EX256/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_SAM7_P256/board.c b/boards/OLIMEX_SAM7_P256/board.c index 2e11abafb..59ec35d4b 100644 --- a/boards/OLIMEX_SAM7_P256/board.c +++ b/boards/OLIMEX_SAM7_P256/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_SAM7_P256/board.h b/boards/OLIMEX_SAM7_P256/board.h index 65877652d..d56b8a2f0 100644 --- a/boards/OLIMEX_SAM7_P256/board.h +++ b/boards/OLIMEX_SAM7_P256/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_STM32_H103/board.c b/boards/OLIMEX_STM32_H103/board.c index 05faa0944..b8b98c05f 100644 --- a/boards/OLIMEX_STM32_H103/board.c +++ b/boards/OLIMEX_STM32_H103/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_STM32_H103/board.h b/boards/OLIMEX_STM32_H103/board.h index 0219d4fdd..af25d7cae 100644 --- a/boards/OLIMEX_STM32_H103/board.h +++ b/boards/OLIMEX_STM32_H103/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_STM32_P103/board.c b/boards/OLIMEX_STM32_P103/board.c index 05faa0944..b8b98c05f 100644 --- a/boards/OLIMEX_STM32_P103/board.c +++ b/boards/OLIMEX_STM32_P103/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_STM32_P103/board.h b/boards/OLIMEX_STM32_P103/board.h index cd9b9f6ba..337fc8ca0 100644 --- a/boards/OLIMEX_STM32_P103/board.h +++ b/boards/OLIMEX_STM32_P103/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_STM32_P107/board.c b/boards/OLIMEX_STM32_P107/board.c index e83f3e227..bb4015edf 100644 --- a/boards/OLIMEX_STM32_P107/board.c +++ b/boards/OLIMEX_STM32_P107/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/OLIMEX_STM32_P107/board.h b/boards/OLIMEX_STM32_P107/board.h index 61ea865e0..968721fbd 100644 --- a/boards/OLIMEX_STM32_P107/board.h +++ b/boards/OLIMEX_STM32_P107/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/RAISONANCE_REVA_STM8S/board.c b/boards/RAISONANCE_REVA_STM8S/board.c index 92fcc58a0..4aed0d6a6 100644 --- a/boards/RAISONANCE_REVA_STM8S/board.c +++ b/boards/RAISONANCE_REVA_STM8S/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/RAISONANCE_REVA_STM8S/board.h b/boards/RAISONANCE_REVA_STM8S/board.h index a3a508f5a..d26984520 100644 --- a/boards/RAISONANCE_REVA_STM8S/board.h +++ b/boards/RAISONANCE_REVA_STM8S/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM3210C_EVAL/board.c b/boards/ST_STM3210C_EVAL/board.c index ac1564257..c5441a877 100644 --- a/boards/ST_STM3210C_EVAL/board.c +++ b/boards/ST_STM3210C_EVAL/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM3210C_EVAL/board.h b/boards/ST_STM3210C_EVAL/board.h index b8833ac9f..e2d92bdd9 100644 --- a/boards/ST_STM3210C_EVAL/board.h +++ b/boards/ST_STM3210C_EVAL/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM32VL_DISCOVERY/board.c b/boards/ST_STM32VL_DISCOVERY/board.c index 05faa0944..b8b98c05f 100644 --- a/boards/ST_STM32VL_DISCOVERY/board.c +++ b/boards/ST_STM32VL_DISCOVERY/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM32VL_DISCOVERY/board.h b/boards/ST_STM32VL_DISCOVERY/board.h index 4b16fc43a..943a90c45 100644 --- a/boards/ST_STM32VL_DISCOVERY/board.h +++ b/boards/ST_STM32VL_DISCOVERY/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM8L_DISCOVERY/board.c b/boards/ST_STM8L_DISCOVERY/board.c index b46bf007d..91119d092 100644 --- a/boards/ST_STM8L_DISCOVERY/board.c +++ b/boards/ST_STM8L_DISCOVERY/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM8L_DISCOVERY/board.h b/boards/ST_STM8L_DISCOVERY/board.h index 4dfb28ca4..14a0d2476 100644 --- a/boards/ST_STM8L_DISCOVERY/board.h +++ b/boards/ST_STM8L_DISCOVERY/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM8S_DISCOVERY/board.c b/boards/ST_STM8S_DISCOVERY/board.c index 92fcc58a0..4aed0d6a6 100644 --- a/boards/ST_STM8S_DISCOVERY/board.c +++ b/boards/ST_STM8S_DISCOVERY/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/ST_STM8S_DISCOVERY/board.h b/boards/ST_STM8S_DISCOVERY/board.h index 38bebe6e8..28063e142 100644 --- a/boards/ST_STM8S_DISCOVERY/board.h +++ b/boards/ST_STM8S_DISCOVERY/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/simulator/board.c b/boards/simulator/board.c index 8f655ccd1..962b02f0e 100644 --- a/boards/simulator/board.c +++ b/boards/simulator/board.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/boards/simulator/board.h b/boards/simulator/board.h index 1b0513d1d..6cdb7eaf0 100644 --- a/boards/simulator/board.h +++ b/boards/simulator/board.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/ch.ld b/demos/ARM7-AT91SAM7S-FATFS-GCC/ch.ld index 50ab38952..b999dac9a 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index 4aade5bca..c48f97693 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c b/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c index 97898c9ce..ae5c59ae0 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/mcuconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/mcuconf.h index 27117bfc7..69d08f2c5 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-GCC/ch.ld b/demos/ARM7-AT91SAM7S-GCC/ch.ld index 277336359..e26268451 100644 --- a/demos/ARM7-AT91SAM7S-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7S-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-GCC/chconf.h b/demos/ARM7-AT91SAM7S-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-AT91SAM7S-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index b74a05529..af5658566 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-GCC/main.c b/demos/ARM7-AT91SAM7S-GCC/main.c index c49576c34..64ce7bf9f 100644 --- a/demos/ARM7-AT91SAM7S-GCC/main.c +++ b/demos/ARM7-AT91SAM7S-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7S-GCC/mcuconf.h b/demos/ARM7-AT91SAM7S-GCC/mcuconf.h index 519405ff1..ed715068b 100644 --- a/demos/ARM7-AT91SAM7S-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/ch.ld b/demos/ARM7-AT91SAM7X-FATFS-GCC/ch.ld index 50ab38952..b999dac9a 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index 4aade5bca..c48f97693 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c b/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c index d7cd3f40e..a5f2009b0 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/mcuconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/mcuconf.h index 7229a7e8a..b9916092b 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-GCC/ch.ld b/demos/ARM7-AT91SAM7X-GCC/ch.ld index 67fe8d223..9308935be 100644 --- a/demos/ARM7-AT91SAM7X-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7X-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-GCC/chconf.h b/demos/ARM7-AT91SAM7X-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-AT91SAM7X-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index b74a05529..af5658566 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-GCC/main.c b/demos/ARM7-AT91SAM7X-GCC/main.c index d42ebfe68..df12fbc3a 100644 --- a/demos/ARM7-AT91SAM7X-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-GCC/mcuconf.h b/demos/ARM7-AT91SAM7X-GCC/mcuconf.h index 519405ff1..ed715068b 100644 --- a/demos/ARM7-AT91SAM7X-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld b/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld index 67fe8d223..9308935be 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index a7ff720a7..90df768e1 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 36236ff2c..7bfe6a6c3 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h index 62d037e80..b90b447e2 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h index 99b4a7197..f30c8781c 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c index 517bfba03..d9b619e4d 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h index f52b9d08b..229ff6638 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c index 3c58e266a..7f3b93e59 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h index 0fe5d9473..c27942a63 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c index d8ff64965..77bebd3fc 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h index 519405ff1..ed715068b 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c index 1bea06de4..bc8984459 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h index 991ce117c..3530c995a 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/ch.ld b/demos/ARM7-AT91SAM7X-UIP-GCC/ch.ld index 67fe8d223..9308935be 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index 36236ff2c..7bfe6a6c3 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/main.c b/demos/ARM7-AT91SAM7X-UIP-GCC/main.c index 81ec5f89a..491d62abc 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/mcuconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/mcuconf.h index 519405ff1..ed715068b 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c index 4f43cef2a..14f73681a 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.h b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.h index e6f14822a..400d8c72b 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-FATFS-GCC/ch.ld b/demos/ARM7-LPC214x-FATFS-GCC/ch.ld index 8515eeac7..40683d14e 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/ch.ld +++ b/demos/ARM7-LPC214x-FATFS-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index 4aade5bca..c48f97693 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-FATFS-GCC/main.c b/demos/ARM7-LPC214x-FATFS-GCC/main.c index 1868bac05..63389e832 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/main.c +++ b/demos/ARM7-LPC214x-FATFS-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-FATFS-GCC/mcuconf.h b/demos/ARM7-LPC214x-FATFS-GCC/mcuconf.h index 9d785c9b6..6cb97d77c 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/mcuconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-G++/ch.ld b/demos/ARM7-LPC214x-G++/ch.ld index 8515eeac7..40683d14e 100644 --- a/demos/ARM7-LPC214x-G++/ch.ld +++ b/demos/ARM7-LPC214x-G++/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-G++/chconf.h b/demos/ARM7-LPC214x-G++/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-LPC214x-G++/chconf.h +++ b/demos/ARM7-LPC214x-G++/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index b74a05529..af5658566 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-G++/main.cpp b/demos/ARM7-LPC214x-G++/main.cpp index ca99c67ef..c5f0187ca 100644 --- a/demos/ARM7-LPC214x-G++/main.cpp +++ b/demos/ARM7-LPC214x-G++/main.cpp @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-G++/mcuconf.h b/demos/ARM7-LPC214x-G++/mcuconf.h index 9d785c9b6..6cb97d77c 100644 --- a/demos/ARM7-LPC214x-G++/mcuconf.h +++ b/demos/ARM7-LPC214x-G++/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-GCC/ch.ld b/demos/ARM7-LPC214x-GCC/ch.ld index 8515eeac7..40683d14e 100644 --- a/demos/ARM7-LPC214x-GCC/ch.ld +++ b/demos/ARM7-LPC214x-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index b74a05529..af5658566 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c index e4810d125..030a35375 100644 --- a/demos/ARM7-LPC214x-GCC/main.c +++ b/demos/ARM7-LPC214x-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARM7-LPC214x-GCC/mcuconf.h b/demos/ARM7-LPC214x-GCC/mcuconf.h index 9d785c9b6..6cb97d77c 100644 --- a/demos/ARM7-LPC214x-GCC/mcuconf.h +++ b/demos/ARM7-LPC214x-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld b/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld index 0eff7df98..de2e1862e 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 39b6f228d..7c0d62de8 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/main.c b/demos/ARMCM0-LPC1114-LPCXPRESSO/main.c index 83ea018a3..62ecafded 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/main.c +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h index b78d966e1..5980a5957 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld b/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld index 83028c619..781ec9435 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 39b6f228d..7c0d62de8 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/main.c b/demos/ARMCM3-LPC1343-LPCXPRESSO/main.c index 1b2dc1c1a..2511b5b3c 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/main.c +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h index 195eb6c6a..3c539ce7e 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld b/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld index 4ec9bdabd..253a71c1a 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld +++ b/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index 329ade9c5..cccace57c 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/main.c b/demos/ARMCM3-STM32F100-DISCOVERY/main.c index c4a222680..d638b5926 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/main.c +++ b/demos/ARMCM3-STM32F100-DISCOVERY/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index 73d2ee829..89a2d6c9b 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld b/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld index 44f494121..ae79ddd40 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index 4aade5bca..c48f97693 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c index ec6769c47..e44cd0307 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103/ch.ld b/demos/ARMCM3-STM32F103/ch.ld index 44f494121..ae79ddd40 100644 --- a/demos/ARMCM3-STM32F103/ch.ld +++ b/demos/ARMCM3-STM32F103/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index b74a05529..af5658566 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103/main.c b/demos/ARMCM3-STM32F103/main.c index 671124a42..d694a1cd1 100644 --- a/demos/ARMCM3-STM32F103/main.c +++ b/demos/ARMCM3-STM32F103/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F107/ch.ld b/demos/ARMCM3-STM32F107/ch.ld index 0595192db..d871c1039 100644 --- a/demos/ARMCM3-STM32F107/ch.ld +++ b/demos/ARMCM3-STM32F107/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F107/chconf.h b/demos/ARMCM3-STM32F107/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/ARMCM3-STM32F107/chconf.h +++ b/demos/ARMCM3-STM32F107/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h index b74a05529..af5658566 100644 --- a/demos/ARMCM3-STM32F107/halconf.h +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F107/main.c b/demos/ARMCM3-STM32F107/main.c index 418966941..2020423a6 100644 --- a/demos/ARMCM3-STM32F107/main.c +++ b/demos/ARMCM3-STM32F107/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h index 9ff306342..6361a4c0b 100644 --- a/demos/ARMCM3-STM32F107/mcuconf.h +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index c982a771d..644d792db 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 54ecc3c50..3bfbca462 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index f170a4c27..d039c6cf6 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index 85a8cc2a6..3267455e1 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c982a771d..644d792db 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 54ecc3c50..3bfbca462 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index 30be58416..5ef8fca02 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h index 3b3cdd050..464bde6c3 100644 --- a/demos/AVR-ATmega128-GCC/lcd.h +++ b/demos/AVR-ATmega128-GCC/lcd.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index e1cb2a9d6..0b26a9641 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index 85a8cc2a6..3267455e1 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/MSP430-MSP430x1611-GCC/chconf.h b/demos/MSP430-MSP430x1611-GCC/chconf.h index ce35b359d..603aa8473 100644 --- a/demos/MSP430-MSP430x1611-GCC/chconf.h +++ b/demos/MSP430-MSP430x1611-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index b74a05529..af5658566 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/MSP430-MSP430x1611-GCC/main.c b/demos/MSP430-MSP430x1611-GCC/main.c index 999ea8f49..6d1bd989d 100644 --- a/demos/MSP430-MSP430x1611-GCC/main.c +++ b/demos/MSP430-MSP430x1611-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/MSP430-MSP430x1611-GCC/mcuconf.h b/demos/MSP430-MSP430x1611-GCC/mcuconf.h index 72c180648..ff9b333e5 100644 --- a/demos/MSP430-MSP430x1611-GCC/mcuconf.h +++ b/demos/MSP430-MSP430x1611-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -26,7 +27,7 @@ */ /* - * HAL driver system settings. + * HAL driver system settings. */ #define MSP430_USE_CLOCK MSP430_CLOCK_SOURCE_XT2CLK diff --git a/demos/PPC-SPC563-GCC/ch.ld b/demos/PPC-SPC563-GCC/ch.ld index 5cea0b9b9..2e355c531 100644 --- a/demos/PPC-SPC563-GCC/ch.ld +++ b/demos/PPC-SPC563-GCC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/PPC-SPC563-GCC/chconf.h b/demos/PPC-SPC563-GCC/chconf.h index 3353391ca..04fa822cc 100644 --- a/demos/PPC-SPC563-GCC/chconf.h +++ b/demos/PPC-SPC563-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index d567abd9e..36d1f3f08 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/PPC-SPC563-GCC/main.c b/demos/PPC-SPC563-GCC/main.c index 3210716ae..a51b8d0b9 100644 --- a/demos/PPC-SPC563-GCC/main.c +++ b/demos/PPC-SPC563-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/Posix-GCC/chconf.h b/demos/Posix-GCC/chconf.h index 6b9da5975..acb041f00 100644 --- a/demos/Posix-GCC/chconf.h +++ b/demos/Posix-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 4d73d65cb..34daac121 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/Posix-GCC/main.c b/demos/Posix-GCC/main.c index 0ce59da9d..adfcf6925 100644 --- a/demos/Posix-GCC/main.c +++ b/demos/Posix-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/cosmic/vectors.c b/demos/STM8L-STM8L152-DISCOVERY-STVD/cosmic/vectors.c index bd7ed41b5..7fdb3f815 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/cosmic/vectors.c +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/cosmic/vectors.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h index 7e0ba6086..24f9bed32 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index b74a05529..af5658566 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c index 6245449cf..4582d0701 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/mcuconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/mcuconf.h index 27a71ee9c..076c91beb 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/mcuconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c b/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c index 494943416..f6a827965 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h index 7e0ba6086..24f9bed32 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index b74a05529..af5658566 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/main.c b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/main.c index 41f38ac80..796246948 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/main.c +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/mcuconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/mcuconf.h index 814143da2..2e244cbbf 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/mcuconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S208-RC/chconf.h b/demos/STM8S-STM8S208-RC/chconf.h index 7e0ba6086..24f9bed32 100644 --- a/demos/STM8S-STM8S208-RC/chconf.h +++ b/demos/STM8S-STM8S208-RC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index b74a05529..af5658566 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S208-RC/main.c b/demos/STM8S-STM8S208-RC/main.c index c676f05d5..89a9f78cd 100644 --- a/demos/STM8S-STM8S208-RC/main.c +++ b/demos/STM8S-STM8S208-RC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/STM8S-STM8S208-RC/mcuconf.h b/demos/STM8S-STM8S208-RC/mcuconf.h index 198106dec..ba8069b38 100644 --- a/demos/STM8S-STM8S208-RC/mcuconf.h +++ b/demos/STM8S-STM8S208-RC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index 6b9da5975..acb041f00 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 4d73d65cb..34daac121 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/Win32-MinGW/main.c b/demos/Win32-MinGW/main.c index 0830ab149..8540afed5 100644 --- a/demos/Win32-MinGW/main.c +++ b/demos/Win32-MinGW/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/docs/src/concepts.dox b/docs/src/concepts.dox index bcb6a5b97..f1047b6e0 100644 --- a/docs/src/concepts.dox +++ b/docs/src/concepts.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/docs/src/main.dox b/docs/src/main.dox index 76a39bff7..82b4ee243 100644 --- a/docs/src/main.dox +++ b/docs/src/main.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/ext/ext.dox b/ext/ext.dox index 4994f02de..1c3b8c001 100644 --- a/ext/ext.dox +++ b/ext/ext.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/adc.dox b/os/hal/dox/adc.dox index 4f1cf963d..f5b83532d 100644 --- a/os/hal/dox/adc.dox +++ b/os/hal/dox/adc.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/can.dox b/os/hal/dox/can.dox index 550cbc79c..f32630442 100644 --- a/os/hal/dox/can.dox +++ b/os/hal/dox/can.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/gpt.dox b/os/hal/dox/gpt.dox index 1cca2a689..203f7a647 100644 --- a/os/hal/dox/gpt.dox +++ b/os/hal/dox/gpt.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/hal.dox b/os/hal/dox/hal.dox index 02d09c0d8..d08f10bcd 100644 --- a/os/hal/dox/hal.dox +++ b/os/hal/dox/hal.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/i2c.dox b/os/hal/dox/i2c.dox index 151c7a66e..391fbb62e 100644 --- a/os/hal/dox/i2c.dox +++ b/os/hal/dox/i2c.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/mac.dox b/os/hal/dox/mac.dox index 903397749..01a89d825 100644 --- a/os/hal/dox/mac.dox +++ b/os/hal/dox/mac.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/mmc_spi.dox b/os/hal/dox/mmc_spi.dox index 9ccdeb2bc..480240c00 100644 --- a/os/hal/dox/mmc_spi.dox +++ b/os/hal/dox/mmc_spi.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/pal.dox b/os/hal/dox/pal.dox index 63e428377..5ffc763a8 100644 --- a/os/hal/dox/pal.dox +++ b/os/hal/dox/pal.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/pwm.dox b/os/hal/dox/pwm.dox index 1cb13056e..3f2bdfd71 100644 --- a/os/hal/dox/pwm.dox +++ b/os/hal/dox/pwm.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/serial.dox b/os/hal/dox/serial.dox index c2fae58f5..5b68f9c9c 100644 --- a/os/hal/dox/serial.dox +++ b/os/hal/dox/serial.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/serial_usb.dox b/os/hal/dox/serial_usb.dox index 4384a59f8..c477b5288 100644 --- a/os/hal/dox/serial_usb.dox +++ b/os/hal/dox/serial_usb.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/spi.dox b/os/hal/dox/spi.dox index 7c43fec6e..cd462b8ae 100644 --- a/os/hal/dox/spi.dox +++ b/os/hal/dox/spi.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/uart.dox b/os/hal/dox/uart.dox index 53339046d..fe7a31534 100644 --- a/os/hal/dox/uart.dox +++ b/os/hal/dox/uart.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index af34e1abd..ebf2042a0 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/hal.dox b/os/hal/hal.dox index 65c320d31..5bee98480 100644 --- a/os/hal/hal.dox +++ b/os/hal/hal.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h index b0d6d0938..1e3f6edc7 100644 --- a/os/hal/include/adc.h +++ b/os/hal/include/adc.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/can.h b/os/hal/include/can.h index d294f0b08..538284b3b 100644 --- a/os/hal/include/can.h +++ b/os/hal/include/can.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/gpt.h b/os/hal/include/gpt.h index c1ce72edf..c65cd7cee 100644 --- a/os/hal/include/gpt.h +++ b/os/hal/include/gpt.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h index 7cb3a873e..bd234a494 100644 --- a/os/hal/include/hal.h +++ b/os/hal/include/hal.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index 01d3739e8..5f8c971fd 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h index 81d8ea27f..ad3c7b4dc 100644 --- a/os/hal/include/mac.h +++ b/os/hal/include/mac.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h index 9f717ed39..6940ca479 100644 --- a/os/hal/include/mmc_spi.h +++ b/os/hal/include/mmc_spi.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h index e7a7f90c4..7a2041974 100644 --- a/os/hal/include/pal.h +++ b/os/hal/include/pal.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index 6570e9fdf..e63478ca3 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/serial.h b/os/hal/include/serial.h index 57240e78b..a8c3c1aca 100644 --- a/os/hal/include/serial.h +++ b/os/hal/include/serial.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index a220f7191..8e518238d 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h index 29ea01e4d..0974fb740 100644 --- a/os/hal/include/spi.h +++ b/os/hal/include/spi.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/uart.h b/os/hal/include/uart.h index 2ea69309f..148aa6877 100644 --- a/os/hal/include/uart.h +++ b/os/hal/include/uart.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index 9b8d863b1..b70ce4160 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/at91sam7.h b/os/hal/platforms/AT91SAM7/at91sam7.h index a34ab62d4..e62f6a5aa 100644 --- a/os/hal/platforms/AT91SAM7/at91sam7.h +++ b/os/hal/platforms/AT91SAM7/at91sam7.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/at91sam7_mii.c b/os/hal/platforms/AT91SAM7/at91sam7_mii.c index 54f1b8d57..707a373b9 100644 --- a/os/hal/platforms/AT91SAM7/at91sam7_mii.c +++ b/os/hal/platforms/AT91SAM7/at91sam7_mii.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/at91sam7_mii.h b/os/hal/platforms/AT91SAM7/at91sam7_mii.h index c417a0d15..897a5e584 100644 --- a/os/hal/platforms/AT91SAM7/at91sam7_mii.h +++ b/os/hal/platforms/AT91SAM7/at91sam7_mii.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/hal_lld.c b/os/hal/platforms/AT91SAM7/hal_lld.c index 40c355659..a95293e5c 100644 --- a/os/hal/platforms/AT91SAM7/hal_lld.c +++ b/os/hal/platforms/AT91SAM7/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/hal_lld.h b/os/hal/platforms/AT91SAM7/hal_lld.h index c033f13e8..e40cc533f 100644 --- a/os/hal/platforms/AT91SAM7/hal_lld.h +++ b/os/hal/platforms/AT91SAM7/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/mac_lld.c b/os/hal/platforms/AT91SAM7/mac_lld.c index 15529ac04..43055b94d 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.c +++ b/os/hal/platforms/AT91SAM7/mac_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/mac_lld.h b/os/hal/platforms/AT91SAM7/mac_lld.h index ed8fb1ee2..9f30e0426 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.h +++ b/os/hal/platforms/AT91SAM7/mac_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/pal_lld.c b/os/hal/platforms/AT91SAM7/pal_lld.c index 4b43cd8d6..0e2136da1 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.c +++ b/os/hal/platforms/AT91SAM7/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/pal_lld.h b/os/hal/platforms/AT91SAM7/pal_lld.h index afcc7c238..ebb22f2cb 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.h +++ b/os/hal/platforms/AT91SAM7/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/platform.dox b/os/hal/platforms/AT91SAM7/platform.dox index 4c87192f0..84f19fac5 100644 --- a/os/hal/platforms/AT91SAM7/platform.dox +++ b/os/hal/platforms/AT91SAM7/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/serial_lld.c b/os/hal/platforms/AT91SAM7/serial_lld.c index f34f2b6d8..eff24a804 100644 --- a/os/hal/platforms/AT91SAM7/serial_lld.c +++ b/os/hal/platforms/AT91SAM7/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -225,7 +226,7 @@ static void notify3(GenericQueue *qp) { /** * @brief USART0 interrupt handler. * - * @isr + * @isr */ CH_IRQ_HANDLER(USART0IrqHandler) { @@ -331,7 +332,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) { AIC_EnableIT(AT91C_ID_US1); } #endif - /* Note - no explicit start for SD3 (DBGU_UART) since it's not included + /* Note - no explicit start for SD3 (DBGU_UART) since it's not included in the AIC or PMC.*/ } usart_init(sdp, config); diff --git a/os/hal/platforms/AT91SAM7/serial_lld.h b/os/hal/platforms/AT91SAM7/serial_lld.h index 94aca128b..20b47562f 100644 --- a/os/hal/platforms/AT91SAM7/serial_lld.h +++ b/os/hal/platforms/AT91SAM7/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AT91SAM7/spi_lld.c b/os/hal/platforms/AT91SAM7/spi_lld.c index ec3853872..218793d1e 100644 --- a/os/hal/platforms/AT91SAM7/spi_lld.c +++ b/os/hal/platforms/AT91SAM7/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -55,7 +56,7 @@ SPIDriver SPID2; * somewhere. * @note This buffer size also limits the maximum transfer size, 512B, * for @p spiReceive() and @p spiIgnore(). @p spiSend() and - * @p spiExchange are not affected. + * @p spiExchange are not affected. */ static const uint16_t idle_buf[] = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, @@ -97,7 +98,7 @@ static const uint16_t idle_buf[] = { /*===========================================================================*/ /** - * @brief Initializes a SPI device. + * @brief Initializes a SPI device. */ static void spi_init(AT91PS_SPI spi) { @@ -116,7 +117,7 @@ static void spi_init(AT91PS_SPI spi) { __attribute__((noinline)) #endif /** - * @brief Shared interrupt handling code. + * @brief Shared interrupt handling code. * * @param[in] spip pointer to the @p SPIDriver object */ diff --git a/os/hal/platforms/AT91SAM7/spi_lld.h b/os/hal/platforms/AT91SAM7/spi_lld.h index ec0af3740..8949a1703 100644 --- a/os/hal/platforms/AT91SAM7/spi_lld.h +++ b/os/hal/platforms/AT91SAM7/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AVR/hal_lld.c b/os/hal/platforms/AVR/hal_lld.c index a3d3f4ab8..421401158 100644 --- a/os/hal/platforms/AVR/hal_lld.c +++ b/os/hal/platforms/AVR/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AVR/hal_lld.h b/os/hal/platforms/AVR/hal_lld.h index 647c2f142..c3d65f167 100644 --- a/os/hal/platforms/AVR/hal_lld.h +++ b/os/hal/platforms/AVR/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AVR/platform.dox b/os/hal/platforms/AVR/platform.dox index 9b497b724..bc29954b6 100644 --- a/os/hal/platforms/AVR/platform.dox +++ b/os/hal/platforms/AVR/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/AVR/serial_lld.c b/os/hal/platforms/AVR/serial_lld.c index f78abac18..bafca4537 100644 --- a/os/hal/platforms/AVR/serial_lld.c +++ b/os/hal/platforms/AVR/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -154,7 +155,7 @@ static void usart1_deinit(void) { /** * @brief USART0 RX interrupt handler. * - * @isr + * @isr */ CH_IRQ_HANDLER(USART0_RX_vect) { uint8_t sra; @@ -174,7 +175,7 @@ CH_IRQ_HANDLER(USART0_RX_vect) { /** * @brief USART0 TX interrupt handler. * - * @isr + * @isr */ CH_IRQ_HANDLER(USART0_UDRE_vect) { msg_t b; @@ -197,7 +198,7 @@ CH_IRQ_HANDLER(USART0_UDRE_vect) { /** * @brief USART1 RX interrupt handler. * - * @isr + * @isr */ CH_IRQ_HANDLER(USART1_RX_vect) { uint8_t sra; @@ -217,7 +218,7 @@ CH_IRQ_HANDLER(USART1_RX_vect) { /** * @brief USART1 TX interrupt handler. * - * @isr + * @isr */ CH_IRQ_HANDLER(USART1_UDRE_vect) { msg_t b; diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h index 4a2ff843a..7884045fd 100644 --- a/os/hal/platforms/AVR/serial_lld.h +++ b/os/hal/platforms/AVR/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/core_cm0.h b/os/hal/platforms/LPC11xx/core_cm0.h index af27881d4..662099a21 100644 --- a/os/hal/platforms/LPC11xx/core_cm0.h +++ b/os/hal/platforms/LPC11xx/core_cm0.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/gpt_lld.c b/os/hal/platforms/LPC11xx/gpt_lld.c index fa64db94c..df90ac630 100644 --- a/os/hal/platforms/LPC11xx/gpt_lld.c +++ b/os/hal/platforms/LPC11xx/gpt_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/gpt_lld.h b/os/hal/platforms/LPC11xx/gpt_lld.h index 1abc1572e..a1a516d6e 100644 --- a/os/hal/platforms/LPC11xx/gpt_lld.h +++ b/os/hal/platforms/LPC11xx/gpt_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/hal_lld.c b/os/hal/platforms/LPC11xx/hal_lld.c index 8bb79f866..89db29491 100644 --- a/os/hal/platforms/LPC11xx/hal_lld.c +++ b/os/hal/platforms/LPC11xx/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/hal_lld.h b/os/hal/platforms/LPC11xx/hal_lld.h index f94b058fd..267ce9105 100644 --- a/os/hal/platforms/LPC11xx/hal_lld.h +++ b/os/hal/platforms/LPC11xx/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/pal_lld.c b/os/hal/platforms/LPC11xx/pal_lld.c index c8d831a82..6ce6ba876 100644 --- a/os/hal/platforms/LPC11xx/pal_lld.c +++ b/os/hal/platforms/LPC11xx/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/pal_lld.h b/os/hal/platforms/LPC11xx/pal_lld.h index 4201f5114..d60b4ef71 100644 --- a/os/hal/platforms/LPC11xx/pal_lld.h +++ b/os/hal/platforms/LPC11xx/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/platform.dox b/os/hal/platforms/LPC11xx/platform.dox index 405ed8ee3..593a82fdf 100644 --- a/os/hal/platforms/LPC11xx/platform.dox +++ b/os/hal/platforms/LPC11xx/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/serial_lld.c b/os/hal/platforms/LPC11xx/serial_lld.c index ecd080eaf..269a5a8e5 100644 --- a/os/hal/platforms/LPC11xx/serial_lld.c +++ b/os/hal/platforms/LPC11xx/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/serial_lld.h b/os/hal/platforms/LPC11xx/serial_lld.h index a2e8acc4b..ffe9a8ae6 100644 --- a/os/hal/platforms/LPC11xx/serial_lld.h +++ b/os/hal/platforms/LPC11xx/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/spi_lld.c b/os/hal/platforms/LPC11xx/spi_lld.c index b165c42ee..5704b17f3 100644 --- a/os/hal/platforms/LPC11xx/spi_lld.c +++ b/os/hal/platforms/LPC11xx/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC11xx/spi_lld.h b/os/hal/platforms/LPC11xx/spi_lld.h index a99557b4a..47df7d94b 100644 --- a/os/hal/platforms/LPC11xx/spi_lld.h +++ b/os/hal/platforms/LPC11xx/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/core_cm3.h b/os/hal/platforms/LPC13xx/core_cm3.h index 5c75ec859..387221bc6 100644 --- a/os/hal/platforms/LPC13xx/core_cm3.h +++ b/os/hal/platforms/LPC13xx/core_cm3.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/gpt_lld.c b/os/hal/platforms/LPC13xx/gpt_lld.c index e6a112d61..7d6961889 100644 --- a/os/hal/platforms/LPC13xx/gpt_lld.c +++ b/os/hal/platforms/LPC13xx/gpt_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/gpt_lld.h b/os/hal/platforms/LPC13xx/gpt_lld.h index 9be8179c3..8ea7f375b 100644 --- a/os/hal/platforms/LPC13xx/gpt_lld.h +++ b/os/hal/platforms/LPC13xx/gpt_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/hal_lld.c b/os/hal/platforms/LPC13xx/hal_lld.c index 5babb8d2d..da09ebf43 100644 --- a/os/hal/platforms/LPC13xx/hal_lld.c +++ b/os/hal/platforms/LPC13xx/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/hal_lld.h b/os/hal/platforms/LPC13xx/hal_lld.h index ff7445df9..0f6b1f611 100644 --- a/os/hal/platforms/LPC13xx/hal_lld.h +++ b/os/hal/platforms/LPC13xx/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/pal_lld.c b/os/hal/platforms/LPC13xx/pal_lld.c index f80faaa24..6a66f1ead 100644 --- a/os/hal/platforms/LPC13xx/pal_lld.c +++ b/os/hal/platforms/LPC13xx/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/pal_lld.h b/os/hal/platforms/LPC13xx/pal_lld.h index 2c5a1d118..bbf4db0e8 100644 --- a/os/hal/platforms/LPC13xx/pal_lld.h +++ b/os/hal/platforms/LPC13xx/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/platform.dox b/os/hal/platforms/LPC13xx/platform.dox index 00715dd9f..00b3dd1ad 100644 --- a/os/hal/platforms/LPC13xx/platform.dox +++ b/os/hal/platforms/LPC13xx/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/serial_lld.c b/os/hal/platforms/LPC13xx/serial_lld.c index b0f53d97a..b4f7844c4 100644 --- a/os/hal/platforms/LPC13xx/serial_lld.c +++ b/os/hal/platforms/LPC13xx/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/serial_lld.h b/os/hal/platforms/LPC13xx/serial_lld.h index 3636f224a..e00f44de9 100644 --- a/os/hal/platforms/LPC13xx/serial_lld.h +++ b/os/hal/platforms/LPC13xx/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/spi_lld.c b/os/hal/platforms/LPC13xx/spi_lld.c index 0e186ccd8..ec207f19e 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.c +++ b/os/hal/platforms/LPC13xx/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC13xx/spi_lld.h b/os/hal/platforms/LPC13xx/spi_lld.h index a4479a425..b5f63f40b 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.h +++ b/os/hal/platforms/LPC13xx/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/hal_lld.c b/os/hal/platforms/LPC214x/hal_lld.c index 3f63e65c1..942b60777 100644 --- a/os/hal/platforms/LPC214x/hal_lld.c +++ b/os/hal/platforms/LPC214x/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/hal_lld.h b/os/hal/platforms/LPC214x/hal_lld.h index 54d91b881..70349ae30 100644 --- a/os/hal/platforms/LPC214x/hal_lld.h +++ b/os/hal/platforms/LPC214x/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/lpc214x.h b/os/hal/platforms/LPC214x/lpc214x.h index f2ddac376..b30996568 100644 --- a/os/hal/platforms/LPC214x/lpc214x.h +++ b/os/hal/platforms/LPC214x/lpc214x.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/pal_lld.c b/os/hal/platforms/LPC214x/pal_lld.c index 4d6f14fa9..2e503c631 100644 --- a/os/hal/platforms/LPC214x/pal_lld.c +++ b/os/hal/platforms/LPC214x/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/pal_lld.h b/os/hal/platforms/LPC214x/pal_lld.h index 8f9d3a457..424cb73f1 100644 --- a/os/hal/platforms/LPC214x/pal_lld.h +++ b/os/hal/platforms/LPC214x/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/platform.dox b/os/hal/platforms/LPC214x/platform.dox index 0c1835ba7..cfd9a4078 100644 --- a/os/hal/platforms/LPC214x/platform.dox +++ b/os/hal/platforms/LPC214x/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/serial_lld.c b/os/hal/platforms/LPC214x/serial_lld.c index cc6280d79..91c6d560a 100644 --- a/os/hal/platforms/LPC214x/serial_lld.c +++ b/os/hal/platforms/LPC214x/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/serial_lld.h b/os/hal/platforms/LPC214x/serial_lld.h index 4dac88f20..b51fb395d 100644 --- a/os/hal/platforms/LPC214x/serial_lld.h +++ b/os/hal/platforms/LPC214x/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/spi_lld.c b/os/hal/platforms/LPC214x/spi_lld.c index 808ede590..e59087b25 100644 --- a/os/hal/platforms/LPC214x/spi_lld.c +++ b/os/hal/platforms/LPC214x/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/spi_lld.h b/os/hal/platforms/LPC214x/spi_lld.h index f2d954e46..e6a76bd8f 100644 --- a/os/hal/platforms/LPC214x/spi_lld.h +++ b/os/hal/platforms/LPC214x/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -35,7 +36,7 @@ /*===========================================================================*/ /** - * @brief Hardware FIFO depth. + * @brief Hardware FIFO depth. */ #define LPC214x_SSP_FIFO_DEPTH 8 @@ -156,7 +157,7 @@ struct SPIDriver { */ SSP *ssp; /** - * @brief Number of bytes yet to be received. + * @brief Number of bytes yet to be received. */ uint32_t rxcnt; /** diff --git a/os/hal/platforms/LPC214x/vic.c b/os/hal/platforms/LPC214x/vic.c index f1b75aa80..d613f3af7 100644 --- a/os/hal/platforms/LPC214x/vic.c +++ b/os/hal/platforms/LPC214x/vic.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/LPC214x/vic.h b/os/hal/platforms/LPC214x/vic.h index c0fd3ea3e..a6184ce97 100644 --- a/os/hal/platforms/LPC214x/vic.h +++ b/os/hal/platforms/LPC214x/vic.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/MSP430/hal_lld.c b/os/hal/platforms/MSP430/hal_lld.c index 0de477f43..0d3de0632 100644 --- a/os/hal/platforms/MSP430/hal_lld.c +++ b/os/hal/platforms/MSP430/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/MSP430/hal_lld.h b/os/hal/platforms/MSP430/hal_lld.h index 8f9ae59af..c2c23342f 100644 --- a/os/hal/platforms/MSP430/hal_lld.h +++ b/os/hal/platforms/MSP430/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/MSP430/pal_lld.c b/os/hal/platforms/MSP430/pal_lld.c index 5ea89254e..073a6af93 100644 --- a/os/hal/platforms/MSP430/pal_lld.c +++ b/os/hal/platforms/MSP430/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/MSP430/pal_lld.h b/os/hal/platforms/MSP430/pal_lld.h index ce5d47dce..7741e8f12 100644 --- a/os/hal/platforms/MSP430/pal_lld.h +++ b/os/hal/platforms/MSP430/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/MSP430/platform.dox b/os/hal/platforms/MSP430/platform.dox index 25d263fa7..e326b90ef 100644 --- a/os/hal/platforms/MSP430/platform.dox +++ b/os/hal/platforms/MSP430/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/MSP430/serial_lld.c b/os/hal/platforms/MSP430/serial_lld.c index c6000d7a8..04a58a580 100644 --- a/os/hal/platforms/MSP430/serial_lld.c +++ b/os/hal/platforms/MSP430/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -174,7 +175,7 @@ static void usart1_deinit(void) { /** * @brief USART0 TX interrupt handler. * - * @isr + * @isr */ CH_IRQ_HANDLER(USART0TX_VECTOR) { msg_t b; diff --git a/os/hal/platforms/MSP430/serial_lld.h b/os/hal/platforms/MSP430/serial_lld.h index 42788abcf..9f965b2cd 100644 --- a/os/hal/platforms/MSP430/serial_lld.h +++ b/os/hal/platforms/MSP430/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/console.c b/os/hal/platforms/Posix/console.c index 737cf92bf..4f29b7900 100644 --- a/os/hal/platforms/Posix/console.c +++ b/os/hal/platforms/Posix/console.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/console.h b/os/hal/platforms/Posix/console.h index 3a30e6295..b803a5de7 100644 --- a/os/hal/platforms/Posix/console.h +++ b/os/hal/platforms/Posix/console.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/hal_lld.c b/os/hal/platforms/Posix/hal_lld.c index 6f1433586..1eb0af355 100644 --- a/os/hal/platforms/Posix/hal_lld.c +++ b/os/hal/platforms/Posix/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/hal_lld.h b/os/hal/platforms/Posix/hal_lld.h index 69892ce6f..192f7fefc 100644 --- a/os/hal/platforms/Posix/hal_lld.h +++ b/os/hal/platforms/Posix/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/pal_lld.c b/os/hal/platforms/Posix/pal_lld.c index 3dc664878..c3d88a8fb 100644 --- a/os/hal/platforms/Posix/pal_lld.c +++ b/os/hal/platforms/Posix/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/pal_lld.h b/os/hal/platforms/Posix/pal_lld.h index 3612e4498..edfa73c73 100644 --- a/os/hal/platforms/Posix/pal_lld.h +++ b/os/hal/platforms/Posix/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/serial_lld.c b/os/hal/platforms/Posix/serial_lld.c index 128f3e2fb..31be73825 100644 --- a/os/hal/platforms/Posix/serial_lld.c +++ b/os/hal/platforms/Posix/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Posix/serial_lld.h b/os/hal/platforms/Posix/serial_lld.h index 282b68314..c0a28b819 100644 --- a/os/hal/platforms/Posix/serial_lld.h +++ b/os/hal/platforms/Posix/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/SPC56x/hal_lld.c b/os/hal/platforms/SPC56x/hal_lld.c index 4d4a10c41..afb93b73d 100644 --- a/os/hal/platforms/SPC56x/hal_lld.c +++ b/os/hal/platforms/SPC56x/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/SPC56x/hal_lld.h b/os/hal/platforms/SPC56x/hal_lld.h index 13dc9a267..48b12b19d 100644 --- a/os/hal/platforms/SPC56x/hal_lld.h +++ b/os/hal/platforms/SPC56x/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/SPC56x/platform.dox b/os/hal/platforms/SPC56x/platform.dox index 397e92ad0..18e4eaeb9 100644 --- a/os/hal/platforms/SPC56x/platform.dox +++ b/os/hal/platforms/SPC56x/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/SPC56x/serial_lld.c b/os/hal/platforms/SPC56x/serial_lld.c index afb23086a..fa31a211e 100644 --- a/os/hal/platforms/SPC56x/serial_lld.c +++ b/os/hal/platforms/SPC56x/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/SPC56x/serial_lld.h b/os/hal/platforms/SPC56x/serial_lld.h index 510e3298e..9d4c1bead 100644 --- a/os/hal/platforms/SPC56x/serial_lld.h +++ b/os/hal/platforms/SPC56x/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/SPC56x/typedefs.h b/os/hal/platforms/SPC56x/typedefs.h index b9611bf2c..1ee9e1f10 100644 --- a/os/hal/platforms/SPC56x/typedefs.h +++ b/os/hal/platforms/SPC56x/typedefs.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index bbe8051d4..72574108f 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/adc_lld.h b/os/hal/platforms/STM32/adc_lld.h index 8f01607d8..6f93170ed 100644 --- a/os/hal/platforms/STM32/adc_lld.h +++ b/os/hal/platforms/STM32/adc_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/can_lld.c b/os/hal/platforms/STM32/can_lld.c index 594471482..e180a87cb 100644 --- a/os/hal/platforms/STM32/can_lld.c +++ b/os/hal/platforms/STM32/can_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/can_lld.h b/os/hal/platforms/STM32/can_lld.h index 2e82c45e3..a9a086e5b 100644 --- a/os/hal/platforms/STM32/can_lld.h +++ b/os/hal/platforms/STM32/can_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/core_cm3.h b/os/hal/platforms/STM32/core_cm3.h index 5c75ec859..387221bc6 100644 --- a/os/hal/platforms/STM32/core_cm3.h +++ b/os/hal/platforms/STM32/core_cm3.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/gpt_lld.c b/os/hal/platforms/STM32/gpt_lld.c index 1278400a1..0c84b6a0a 100644 --- a/os/hal/platforms/STM32/gpt_lld.c +++ b/os/hal/platforms/STM32/gpt_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/gpt_lld.h b/os/hal/platforms/STM32/gpt_lld.h index 1eb67318b..37836ddab 100644 --- a/os/hal/platforms/STM32/gpt_lld.h +++ b/os/hal/platforms/STM32/gpt_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index b2a7a0fe5..701ea8b50 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/hal_lld.h b/os/hal/platforms/STM32/hal_lld.h index 0abac770c..48669113d 100644 --- a/os/hal/platforms/STM32/hal_lld.h +++ b/os/hal/platforms/STM32/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/hal_lld_f100.h b/os/hal/platforms/STM32/hal_lld_f100.h index 1ce918079..571682e38 100644 --- a/os/hal/platforms/STM32/hal_lld_f100.h +++ b/os/hal/platforms/STM32/hal_lld_f100.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/hal_lld_f103.h b/os/hal/platforms/STM32/hal_lld_f103.h index 6ea53571a..d8f1bab9c 100644 --- a/os/hal/platforms/STM32/hal_lld_f103.h +++ b/os/hal/platforms/STM32/hal_lld_f103.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/hal_lld_f105_f107.h b/os/hal/platforms/STM32/hal_lld_f105_f107.h index b28f8c297..ce8147ae0 100644 --- a/os/hal/platforms/STM32/hal_lld_f105_f107.h +++ b/os/hal/platforms/STM32/hal_lld_f105_f107.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/pal_lld.c b/os/hal/platforms/STM32/pal_lld.c index f5421fc75..c56996db7 100644 --- a/os/hal/platforms/STM32/pal_lld.c +++ b/os/hal/platforms/STM32/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/pal_lld.h b/os/hal/platforms/STM32/pal_lld.h index a6d1236ae..0ecde182d 100644 --- a/os/hal/platforms/STM32/pal_lld.h +++ b/os/hal/platforms/STM32/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/platform.dox b/os/hal/platforms/STM32/platform.dox index cce82c6a2..b2d9583e4 100644 --- a/os/hal/platforms/STM32/platform.dox +++ b/os/hal/platforms/STM32/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 6a5b210df..7469c7fca 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index 5954a29b0..9e251eb78 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/serial_lld.c b/os/hal/platforms/STM32/serial_lld.c index b20c2a933..5aaa60de9 100644 --- a/os/hal/platforms/STM32/serial_lld.c +++ b/os/hal/platforms/STM32/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/serial_lld.h b/os/hal/platforms/STM32/serial_lld.h index d16e1923d..ceeccff67 100644 --- a/os/hal/platforms/STM32/serial_lld.h +++ b/os/hal/platforms/STM32/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index 53f0ae1c7..fccbf3329 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/spi_lld.h b/os/hal/platforms/STM32/spi_lld.h index 306540ed7..ca5a6d111 100644 --- a/os/hal/platforms/STM32/spi_lld.h +++ b/os/hal/platforms/STM32/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/stm32_dma.c b/os/hal/platforms/STM32/stm32_dma.c index e25e05ad1..be7833777 100644 --- a/os/hal/platforms/STM32/stm32_dma.c +++ b/os/hal/platforms/STM32/stm32_dma.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/stm32_dma.h b/os/hal/platforms/STM32/stm32_dma.h index 806f79c56..96e802f82 100644 --- a/os/hal/platforms/STM32/stm32_dma.h +++ b/os/hal/platforms/STM32/stm32_dma.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/stm32_usb.h b/os/hal/platforms/STM32/stm32_usb.h index 8bb0d8b95..51e7510c4 100644 --- a/os/hal/platforms/STM32/stm32_usb.h +++ b/os/hal/platforms/STM32/stm32_usb.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/uart_lld.c b/os/hal/platforms/STM32/uart_lld.c index 2f25f6c56..958c3da0f 100644 --- a/os/hal/platforms/STM32/uart_lld.c +++ b/os/hal/platforms/STM32/uart_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h index 8394d8421..0cd75a395 100644 --- a/os/hal/platforms/STM32/uart_lld.h +++ b/os/hal/platforms/STM32/uart_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c index 09a8d7975..331eb38c3 100644 --- a/os/hal/platforms/STM32/usb_lld.c +++ b/os/hal/platforms/STM32/usb_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 0a351f932..8cbbc8d6e 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/hal_lld.c b/os/hal/platforms/STM8L/hal_lld.c index 72cb830f3..e2f3c6a7b 100644 --- a/os/hal/platforms/STM8L/hal_lld.c +++ b/os/hal/platforms/STM8L/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/hal_lld.h b/os/hal/platforms/STM8L/hal_lld.h index 2e21988e7..159bd0c71 100644 --- a/os/hal/platforms/STM8L/hal_lld.h +++ b/os/hal/platforms/STM8L/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/hal_lld_stm8l_hd.h b/os/hal/platforms/STM8L/hal_lld_stm8l_hd.h index 9acad669b..efd3f187e 100644 --- a/os/hal/platforms/STM8L/hal_lld_stm8l_hd.h +++ b/os/hal/platforms/STM8L/hal_lld_stm8l_hd.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/hal_lld_stm8l_md.h b/os/hal/platforms/STM8L/hal_lld_stm8l_md.h index f1b1e89b8..e91035e36 100644 --- a/os/hal/platforms/STM8L/hal_lld_stm8l_md.h +++ b/os/hal/platforms/STM8L/hal_lld_stm8l_md.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/hal_lld_stm8l_mdp.h b/os/hal/platforms/STM8L/hal_lld_stm8l_mdp.h index f01c18af9..e08d62d8d 100644 --- a/os/hal/platforms/STM8L/hal_lld_stm8l_mdp.h +++ b/os/hal/platforms/STM8L/hal_lld_stm8l_mdp.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/pal_lld.c b/os/hal/platforms/STM8L/pal_lld.c index a91f380a4..e4c3001c6 100644 --- a/os/hal/platforms/STM8L/pal_lld.c +++ b/os/hal/platforms/STM8L/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/pal_lld.h b/os/hal/platforms/STM8L/pal_lld.h index 347fed85a..da698ea7a 100644 --- a/os/hal/platforms/STM8L/pal_lld.h +++ b/os/hal/platforms/STM8L/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/platform.dox b/os/hal/platforms/STM8L/platform.dox index ec0bf1cf7..0a5f1b614 100644 --- a/os/hal/platforms/STM8L/platform.dox +++ b/os/hal/platforms/STM8L/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/serial_lld.c b/os/hal/platforms/STM8L/serial_lld.c index 887dd4967..372a48bf4 100644 --- a/os/hal/platforms/STM8L/serial_lld.c +++ b/os/hal/platforms/STM8L/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8L/serial_lld.h b/os/hal/platforms/STM8L/serial_lld.h index c4943433a..ca0de3b6d 100644 --- a/os/hal/platforms/STM8L/serial_lld.h +++ b/os/hal/platforms/STM8L/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -144,7 +145,7 @@ typedef struct { #if STM8L_SERIAL_USE_USART1 || defined(__DOXYGEN__) /** - * @brief USART1 RX interrupt handler segment. + * @brief USART1 RX interrupt handler segment. */ #define _USART1_RECEIVE_ISR() { \ uint8_t sr = USART1->SR; \ @@ -159,7 +160,7 @@ typedef struct { } /** - * @brief USART1 TX interrupt handler segment. + * @brief USART1 TX interrupt handler segment. */ #define _USART1_TRANSMIT_ISR() { \ if (USART1->SR & USART_SR_TXE) { \ @@ -177,7 +178,7 @@ typedef struct { #if STM8L_SERIAL_USE_USART2 || defined(__DOXYGEN__) /** - * @brief USART2 RX interrupt handler segment. + * @brief USART2 RX interrupt handler segment. */ #define _USART2_RECEIVE_ISR() { \ uint8_t sr = USART2->SR; \ @@ -192,7 +193,7 @@ typedef struct { } /** - * @brief USART2 TX interrupt handler segment. + * @brief USART2 TX interrupt handler segment. */ #define _USART2_TRANSMIT_ISR() { \ if (USART2->SR & USART_SR_TXE) { \ @@ -210,7 +211,7 @@ typedef struct { #if STM8L_SERIAL_USE_USART3 || defined(__DOXYGEN__) /** - * @brief USART3 RX interrupt handler segment. + * @brief USART3 RX interrupt handler segment. */ #define _USART3_RECEIVE_ISR() { \ uint8_t sr = USART3->SR; \ @@ -225,7 +226,7 @@ typedef struct { } /** - * @brief USART3 TX interrupt handler segment. + * @brief USART3 TX interrupt handler segment. */ #define _USART3_TRANSMIT_ISR() { \ if (USART3->SR & USART_SR_TXE) { \ diff --git a/os/hal/platforms/STM8L/shared_isr.c b/os/hal/platforms/STM8L/shared_isr.c index e89e1f78c..2bbb1a70b 100644 --- a/os/hal/platforms/STM8L/shared_isr.c +++ b/os/hal/platforms/STM8L/shared_isr.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/hal_lld.c b/os/hal/platforms/STM8S/hal_lld.c index de32cfb44..75772a3af 100644 --- a/os/hal/platforms/STM8S/hal_lld.c +++ b/os/hal/platforms/STM8S/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/hal_lld.h b/os/hal/platforms/STM8S/hal_lld.h index 1db8a742c..a57da439a 100644 --- a/os/hal/platforms/STM8S/hal_lld.h +++ b/os/hal/platforms/STM8S/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -202,7 +203,7 @@ /** * @brief CPU clock. * @details On the STM8SS the CPU clock can be programmed to be a fraction of - * the system clock. + * the system clock. */ #define CPUCLK (SYSCLK / (1 << STM8S_CPU_DIVIDER)) diff --git a/os/hal/platforms/STM8S/pal_lld.c b/os/hal/platforms/STM8S/pal_lld.c index feb9c33cf..0a9b26657 100644 --- a/os/hal/platforms/STM8S/pal_lld.c +++ b/os/hal/platforms/STM8S/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/pal_lld.h b/os/hal/platforms/STM8S/pal_lld.h index 65f4584de..8bb1caae8 100644 --- a/os/hal/platforms/STM8S/pal_lld.h +++ b/os/hal/platforms/STM8S/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/platform.dox b/os/hal/platforms/STM8S/platform.dox index a8e356c6e..8ff654170 100644 --- a/os/hal/platforms/STM8S/platform.dox +++ b/os/hal/platforms/STM8S/platform.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/serial_lld.c b/os/hal/platforms/STM8S/serial_lld.c index d5bdb96f0..50a389ab4 100644 --- a/os/hal/platforms/STM8S/serial_lld.c +++ b/os/hal/platforms/STM8S/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -266,7 +267,7 @@ CH_IRQ_HANDLER(18) { /** * @brief IRQ 20 service routine. * - * @isr + * @isr */ CH_IRQ_HANDLER(20) { msg_t b; diff --git a/os/hal/platforms/STM8S/serial_lld.h b/os/hal/platforms/STM8S/serial_lld.h index 96ac08896..fa8777bd5 100644 --- a/os/hal/platforms/STM8S/serial_lld.h +++ b/os/hal/platforms/STM8S/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/spi_lld.c b/os/hal/platforms/STM8S/spi_lld.c index 436a94f2b..f9af72cde 100644 --- a/os/hal/platforms/STM8S/spi_lld.c +++ b/os/hal/platforms/STM8S/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/STM8S/spi_lld.h b/os/hal/platforms/STM8S/spi_lld.h index b81241fd0..48af021b0 100644 --- a/os/hal/platforms/STM8S/spi_lld.h +++ b/os/hal/platforms/STM8S/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -136,7 +137,7 @@ struct SPIDriver { #endif /* End of the mandatory fields.*/ /** - * @brief Number of bytes yet to be received. + * @brief Number of bytes yet to be received. */ uint16_t rxcnt; /** diff --git a/os/hal/platforms/Win32/console.c b/os/hal/platforms/Win32/console.c index 737cf92bf..4f29b7900 100644 --- a/os/hal/platforms/Win32/console.c +++ b/os/hal/platforms/Win32/console.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/console.h b/os/hal/platforms/Win32/console.h index 3a30e6295..b803a5de7 100644 --- a/os/hal/platforms/Win32/console.h +++ b/os/hal/platforms/Win32/console.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/hal_lld.c b/os/hal/platforms/Win32/hal_lld.c index a03d91998..24a11f51c 100644 --- a/os/hal/platforms/Win32/hal_lld.c +++ b/os/hal/platforms/Win32/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/hal_lld.h b/os/hal/platforms/Win32/hal_lld.h index 84696107b..fbeeaa61e 100644 --- a/os/hal/platforms/Win32/hal_lld.h +++ b/os/hal/platforms/Win32/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/pal_lld.c b/os/hal/platforms/Win32/pal_lld.c index 54ff76100..b2a83d77f 100644 --- a/os/hal/platforms/Win32/pal_lld.c +++ b/os/hal/platforms/Win32/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/pal_lld.h b/os/hal/platforms/Win32/pal_lld.h index b353f2a52..f89510f76 100644 --- a/os/hal/platforms/Win32/pal_lld.h +++ b/os/hal/platforms/Win32/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/serial_lld.c b/os/hal/platforms/Win32/serial_lld.c index bbfae160f..6b76ebbc7 100644 --- a/os/hal/platforms/Win32/serial_lld.c +++ b/os/hal/platforms/Win32/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/Win32/serial_lld.h b/os/hal/platforms/Win32/serial_lld.h index fd6bff34d..a853a507d 100644 --- a/os/hal/platforms/Win32/serial_lld.h +++ b/os/hal/platforms/Win32/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/platforms/platforms.dox b/os/hal/platforms/platforms.dox index aa25cbca4..fba310bed 100644 --- a/os/hal/platforms/platforms.dox +++ b/os/hal/platforms/platforms.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c index b70c46e1c..4843ca90b 100644 --- a/os/hal/src/adc.c +++ b/os/hal/src/adc.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/can.c b/os/hal/src/can.c index c240c9e44..f9a827c4e 100644 --- a/os/hal/src/can.c +++ b/os/hal/src/can.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/gpt.c b/os/hal/src/gpt.c index 5027079cf..e90a8911a 100644 --- a/os/hal/src/gpt.c +++ b/os/hal/src/gpt.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/hal.c b/os/hal/src/hal.c index d33dff30a..09b832fe2 100644 --- a/os/hal/src/hal.c +++ b/os/hal/src/hal.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index 2b5971b6f..86bfc16f6 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c index 0cf74a5c1..4d6a9b2cd 100644 --- a/os/hal/src/mac.c +++ b/os/hal/src/mac.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c index df429c8d3..e6dcf9287 100644 --- a/os/hal/src/mmc_spi.c +++ b/os/hal/src/mmc_spi.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/pal.c b/os/hal/src/pal.c index de12baef6..877b372c4 100644 --- a/os/hal/src/pal.c +++ b/os/hal/src/pal.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c index 40ad7428d..e510ba180 100644 --- a/os/hal/src/pwm.c +++ b/os/hal/src/pwm.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/serial.c b/os/hal/src/serial.c index aafedcc6b..414689aac 100644 --- a/os/hal/src/serial.c +++ b/os/hal/src/serial.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 6ed5d324c..b6ad10c13 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/spi.c b/os/hal/src/spi.c index 686006e0d..aaf0115eb 100644 --- a/os/hal/src/spi.c +++ b/os/hal/src/spi.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c index 2a9c6ce6f..05fdbb168 100644 --- a/os/hal/src/uart.c +++ b/os/hal/src/uart.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c index b82af84d8..484590f3b 100644 --- a/os/hal/src/usb.c +++ b/os/hal/src/usb.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/adc_lld.c b/os/hal/templates/adc_lld.c index 4a6acbee6..eea062160 100644 --- a/os/hal/templates/adc_lld.c +++ b/os/hal/templates/adc_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/adc_lld.h b/os/hal/templates/adc_lld.h index 1cfba2f72..5f04d221b 100644 --- a/os/hal/templates/adc_lld.h +++ b/os/hal/templates/adc_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/can_lld.c b/os/hal/templates/can_lld.c index 3662d2867..ae0ca9607 100644 --- a/os/hal/templates/can_lld.c +++ b/os/hal/templates/can_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/can_lld.h b/os/hal/templates/can_lld.h index 4817cdc7f..d07bd78cc 100644 --- a/os/hal/templates/can_lld.h +++ b/os/hal/templates/can_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/gpt_lld.c b/os/hal/templates/gpt_lld.c index edb6c5ba1..1ee010603 100644 --- a/os/hal/templates/gpt_lld.c +++ b/os/hal/templates/gpt_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/gpt_lld.h b/os/hal/templates/gpt_lld.h index 6f8d67d66..fa1e7e478 100644 --- a/os/hal/templates/gpt_lld.h +++ b/os/hal/templates/gpt_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/hal_lld.c b/os/hal/templates/hal_lld.c index c0e561337..aead6dc43 100644 --- a/os/hal/templates/hal_lld.c +++ b/os/hal/templates/hal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/hal_lld.h b/os/hal/templates/hal_lld.h index ad78ba56b..87d150376 100644 --- a/os/hal/templates/hal_lld.h +++ b/os/hal/templates/hal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index b65e25923..e2dc4c85e 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/i2c_lld.c b/os/hal/templates/i2c_lld.c index d41f693ab..efd491857 100644 --- a/os/hal/templates/i2c_lld.c +++ b/os/hal/templates/i2c_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/i2c_lld.h b/os/hal/templates/i2c_lld.h index ea2b1a61e..a54e99a39 100644 --- a/os/hal/templates/i2c_lld.h +++ b/os/hal/templates/i2c_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/mac_lld.c b/os/hal/templates/mac_lld.c index 8049f29ec..c6cc7825b 100644 --- a/os/hal/templates/mac_lld.c +++ b/os/hal/templates/mac_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/mac_lld.h b/os/hal/templates/mac_lld.h index f9b532009..e8abe2941 100644 --- a/os/hal/templates/mac_lld.h +++ b/os/hal/templates/mac_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/meta/driver.c b/os/hal/templates/meta/driver.c index 52d448126..c12103353 100644 --- a/os/hal/templates/meta/driver.c +++ b/os/hal/templates/meta/driver.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/meta/driver.h b/os/hal/templates/meta/driver.h index 1014e871c..b4b07170b 100644 --- a/os/hal/templates/meta/driver.h +++ b/os/hal/templates/meta/driver.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/meta/driver_lld.c b/os/hal/templates/meta/driver_lld.c index c548ccd8a..2cf87bf1f 100644 --- a/os/hal/templates/meta/driver_lld.c +++ b/os/hal/templates/meta/driver_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/meta/driver_lld.h b/os/hal/templates/meta/driver_lld.h index a30b54921..5af5a4174 100644 --- a/os/hal/templates/meta/driver_lld.h +++ b/os/hal/templates/meta/driver_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/pal_lld.c b/os/hal/templates/pal_lld.c index 583b39236..5314ef4b2 100644 --- a/os/hal/templates/pal_lld.c +++ b/os/hal/templates/pal_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/pal_lld.h b/os/hal/templates/pal_lld.h index d2e151018..8272b7c30 100644 --- a/os/hal/templates/pal_lld.h +++ b/os/hal/templates/pal_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c index 712ab5982..507ba1294 100644 --- a/os/hal/templates/pwm_lld.c +++ b/os/hal/templates/pwm_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/pwm_lld.h b/os/hal/templates/pwm_lld.h index bf0222981..bee00c073 100644 --- a/os/hal/templates/pwm_lld.h +++ b/os/hal/templates/pwm_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/serial_lld.c b/os/hal/templates/serial_lld.c index 406235767..8fe70f628 100644 --- a/os/hal/templates/serial_lld.c +++ b/os/hal/templates/serial_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/serial_lld.h b/os/hal/templates/serial_lld.h index 3c2e8a299..7d570c667 100644 --- a/os/hal/templates/serial_lld.h +++ b/os/hal/templates/serial_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/spi_lld.c b/os/hal/templates/spi_lld.c index 1235417c7..c6162d7e0 100644 --- a/os/hal/templates/spi_lld.c +++ b/os/hal/templates/spi_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/spi_lld.h b/os/hal/templates/spi_lld.h index 047f0756c..c261bb1d1 100644 --- a/os/hal/templates/spi_lld.h +++ b/os/hal/templates/spi_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -66,7 +67,7 @@ typedef void (*spicallback_t)(SPIDriver *spip); */ typedef struct { /** - * @brief Operation complete callback. + * @brief Operation complete callback. */ spicallback_t end_cb; /* End of the mandatory fields.*/ @@ -88,7 +89,7 @@ struct SPIDriver { const SPIConfig *config; #if SPI_USE_WAIT || defined(__DOXYGEN__) /** - * @brief Waiting thread. + * @brief Waiting thread. */ Thread *thread; #endif /* SPI_USE_WAIT */ diff --git a/os/hal/templates/uart_lld.c b/os/hal/templates/uart_lld.c index ab0abeb55..21708858b 100644 --- a/os/hal/templates/uart_lld.c +++ b/os/hal/templates/uart_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/uart_lld.h b/os/hal/templates/uart_lld.h index 8808d6589..ca55f0108 100644 --- a/os/hal/templates/uart_lld.h +++ b/os/hal/templates/uart_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/usb_lld.c b/os/hal/templates/usb_lld.c index 823946385..515fc5443 100644 --- a/os/hal/templates/usb_lld.c +++ b/os/hal/templates/usb_lld.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/hal/templates/usb_lld.h b/os/hal/templates/usb_lld.h index 5b235eaa4..225f3ab9f 100644 --- a/os/hal/templates/usb_lld.h +++ b/os/hal/templates/usb_lld.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index 405ebc894..f89406816 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chbsem.h b/os/kernel/include/chbsem.h index f259bb716..e0e1ca865 100644 --- a/os/kernel/include/chbsem.h +++ b/os/kernel/include/chbsem.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chcond.h b/os/kernel/include/chcond.h index 5a03ddd7f..072ae40ab 100644 --- a/os/kernel/include/chcond.h +++ b/os/kernel/include/chcond.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chdebug.h b/os/kernel/include/chdebug.h index e29b095e8..5d6b455fe 100644 --- a/os/kernel/include/chdebug.h +++ b/os/kernel/include/chdebug.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chdynamic.h b/os/kernel/include/chdynamic.h index 76de4ae09..790725493 100644 --- a/os/kernel/include/chdynamic.h +++ b/os/kernel/include/chdynamic.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h index d934340ab..e808caec3 100644 --- a/os/kernel/include/chevents.h +++ b/os/kernel/include/chevents.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chfiles.h b/os/kernel/include/chfiles.h index dbe5e0567..ff3f8274e 100644 --- a/os/kernel/include/chfiles.h +++ b/os/kernel/include/chfiles.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chheap.h b/os/kernel/include/chheap.h index 1c5ec5419..ed5fa252a 100644 --- a/os/kernel/include/chheap.h +++ b/os/kernel/include/chheap.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chinline.h b/os/kernel/include/chinline.h index f41c12cc2..d3ae4b7a4 100644 --- a/os/kernel/include/chinline.h +++ b/os/kernel/include/chinline.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chioch.h b/os/kernel/include/chioch.h index f5741fcec..02757c7e9 100644 --- a/os/kernel/include/chioch.h +++ b/os/kernel/include/chioch.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chlists.h b/os/kernel/include/chlists.h index a93ccedb4..4df139722 100644 --- a/os/kernel/include/chlists.h +++ b/os/kernel/include/chlists.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chmboxes.h b/os/kernel/include/chmboxes.h index fcd26597d..4a1706302 100644 --- a/os/kernel/include/chmboxes.h +++ b/os/kernel/include/chmboxes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 58cb318b2..bc0654a6d 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chmempools.h b/os/kernel/include/chmempools.h index 9dbe332c8..c53e17473 100644 --- a/os/kernel/include/chmempools.h +++ b/os/kernel/include/chmempools.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index b2e8ef51e..1803c719d 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chmtx.h b/os/kernel/include/chmtx.h index cb0e78001..9f2d5a0d3 100644 --- a/os/kernel/include/chmtx.h +++ b/os/kernel/include/chmtx.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index 8a00f404d..4b55e9c46 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h index f9185acb7..3e9cc5508 100644 --- a/os/kernel/include/chregistry.h +++ b/os/kernel/include/chregistry.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h index 5d3aee7a0..5dda6d00a 100644 --- a/os/kernel/include/chschd.h +++ b/os/kernel/include/chschd.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chsem.h b/os/kernel/include/chsem.h index efed15189..f33b294fa 100644 --- a/os/kernel/include/chsem.h +++ b/os/kernel/include/chsem.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chstreams.h b/os/kernel/include/chstreams.h index 7d85aa186..0bd763366 100644 --- a/os/kernel/include/chstreams.h +++ b/os/kernel/include/chstreams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h index 944aedc02..da13ed22f 100644 --- a/os/kernel/include/chsys.h +++ b/os/kernel/include/chsys.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index f6ed23d1d..df6fc329f 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h index a7667b92c..9203b974d 100644 --- a/os/kernel/include/chvt.h +++ b/os/kernel/include/chvt.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/kernel.dox b/os/kernel/kernel.dox index 2a9278620..b1fc4bc29 100644 --- a/os/kernel/kernel.dox +++ b/os/kernel/kernel.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -174,4 +175,4 @@ * @defgroup internals Internals * @ingroup kernel */ - \ No newline at end of file + diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c index a6534eabc..456fc454f 100644 --- a/os/kernel/src/chcond.c +++ b/os/kernel/src/chcond.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chdebug.c b/os/kernel/src/chdebug.c index 80323e183..be98cd40b 100644 --- a/os/kernel/src/chdebug.c +++ b/os/kernel/src/chdebug.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chdynamic.c b/os/kernel/src/chdynamic.c index 5f1fc3401..acd23c244 100644 --- a/os/kernel/src/chdynamic.c +++ b/os/kernel/src/chdynamic.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c index a64f59bdc..d74ad2dc4 100644 --- a/os/kernel/src/chevents.c +++ b/os/kernel/src/chevents.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index c655e3852..a04646bcf 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chlists.c b/os/kernel/src/chlists.c index 878f1360c..c3168eafe 100644 --- a/os/kernel/src/chlists.c +++ b/os/kernel/src/chlists.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chmboxes.c b/os/kernel/src/chmboxes.c index e0b6ca014..af6ee5ea8 100644 --- a/os/kernel/src/chmboxes.c +++ b/os/kernel/src/chmboxes.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chmemcore.c b/os/kernel/src/chmemcore.c index c28d150fa..d66ef5f1c 100644 --- a/os/kernel/src/chmemcore.c +++ b/os/kernel/src/chmemcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chmempools.c b/os/kernel/src/chmempools.c index 83e6366f4..38adc3d49 100644 --- a/os/kernel/src/chmempools.c +++ b/os/kernel/src/chmempools.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c index d4199bbb0..5002a892a 100644 --- a/os/kernel/src/chmsg.c +++ b/os/kernel/src/chmsg.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c index 826ef27fe..af2b7f347 100644 --- a/os/kernel/src/chmtx.c +++ b/os/kernel/src/chmtx.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index 8d459a7e8..05fbddfb9 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c index e95ad21a8..9eabe71c0 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 85e968904..210dbfdc1 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index 18ea9e996..3e0fcd0e8 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 0051985ba..db6521b87 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index a00b5d3db..234cd6ae1 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/src/chvt.c b/os/kernel/src/chvt.c index 016849186..b98396a3a 100644 --- a/os/kernel/src/chvt.c +++ b/os/kernel/src/chvt.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/templates/chconf.h b/os/kernel/templates/chconf.h index 3353391ca..04fa822cc 100644 --- a/os/kernel/templates/chconf.h +++ b/os/kernel/templates/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/templates/chcore.c b/os/kernel/templates/chcore.c index c2737b04a..74281f759 100644 --- a/os/kernel/templates/chcore.c +++ b/os/kernel/templates/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/templates/chcore.h b/os/kernel/templates/chcore.h index 69c37b24d..f190dfbe3 100644 --- a/os/kernel/templates/chcore.h +++ b/os/kernel/templates/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/kernel/templates/chtypes.h b/os/kernel/templates/chtypes.h index 9be581d33..8b25e598c 100644 --- a/os/kernel/templates/chtypes.h +++ b/os/kernel/templates/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -105,7 +106,7 @@ typedef int32_t cnt_t; * a pointer to a ROMCONST constant is compatible with a pointer * to a normal variable. It is just like the "const" keyword but * requires that the constant is placed in ROM if the architecture - * supports it. + * supports it. */ #define ROMCONST const diff --git a/os/ports/GCC/ARM/AT91SAM7/armparams.h b/os/ports/GCC/ARM/AT91SAM7/armparams.h index 8b53605ea..a40278032 100644 --- a/os/ports/GCC/ARM/AT91SAM7/armparams.h +++ b/os/ports/GCC/ARM/AT91SAM7/armparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/AT91SAM7/vectors.s b/os/ports/GCC/ARM/AT91SAM7/vectors.s index f27ecd0dd..f56f7df3b 100644 --- a/os/ports/GCC/ARM/AT91SAM7/vectors.s +++ b/os/ports/GCC/ARM/AT91SAM7/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/AT91SAM7/wfi.h b/os/ports/GCC/ARM/AT91SAM7/wfi.h index 76390d407..7a43ded99 100644 --- a/os/ports/GCC/ARM/AT91SAM7/wfi.h +++ b/os/ports/GCC/ARM/AT91SAM7/wfi.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/LPC214x/armparams.h b/os/ports/GCC/ARM/LPC214x/armparams.h index 5688fbab4..2b8e4cd50 100644 --- a/os/ports/GCC/ARM/LPC214x/armparams.h +++ b/os/ports/GCC/ARM/LPC214x/armparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/LPC214x/vectors.s b/os/ports/GCC/ARM/LPC214x/vectors.s index 6b0235c62..1d8711e72 100644 --- a/os/ports/GCC/ARM/LPC214x/vectors.s +++ b/os/ports/GCC/ARM/LPC214x/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/LPC214x/wfi.h b/os/ports/GCC/ARM/LPC214x/wfi.h index 1688c33f8..8b9a80889 100644 --- a/os/ports/GCC/ARM/LPC214x/wfi.h +++ b/os/ports/GCC/ARM/LPC214x/wfi.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/chcore.c b/os/ports/GCC/ARM/chcore.c index db4793f0e..d97ee2fa5 100644 --- a/os/ports/GCC/ARM/chcore.c +++ b/os/ports/GCC/ARM/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/chcore.h b/os/ports/GCC/ARM/chcore.h index 7e0e1e003..b67fb9c1b 100644 --- a/os/ports/GCC/ARM/chcore.h +++ b/os/ports/GCC/ARM/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/chcoreasm.s b/os/ports/GCC/ARM/chcoreasm.s index 22ffa2c40..41bd29a90 100644 --- a/os/ports/GCC/ARM/chcoreasm.s +++ b/os/ports/GCC/ARM/chcoreasm.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/chtypes.h b/os/ports/GCC/ARM/chtypes.h index ba906f4f1..0a3bf1fe3 100644 --- a/os/ports/GCC/ARM/chtypes.h +++ b/os/ports/GCC/ARM/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/crt0.s b/os/ports/GCC/ARM/crt0.s index b3a6aa392..fb410af52 100644 --- a/os/ports/GCC/ARM/crt0.s +++ b/os/ports/GCC/ARM/crt0.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARM/port.dox b/os/ports/GCC/ARM/port.dox index 2fe0f19c2..f264591f7 100644 --- a/os/ports/GCC/ARM/port.dox +++ b/os/ports/GCC/ARM/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/LPC11xx/cmparams.h b/os/ports/GCC/ARMCMx/LPC11xx/cmparams.h index 927a729e0..4016e6aa1 100644 --- a/os/ports/GCC/ARMCMx/LPC11xx/cmparams.h +++ b/os/ports/GCC/ARMCMx/LPC11xx/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/LPC11xx/vectors.c b/os/ports/GCC/ARMCMx/LPC11xx/vectors.c index 34b220807..63b343ea2 100644 --- a/os/ports/GCC/ARMCMx/LPC11xx/vectors.c +++ b/os/ports/GCC/ARMCMx/LPC11xx/vectors.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -81,7 +82,7 @@ extern void VectorBC(void); #endif /** - * @brief LPC11xx vectors table. + * @brief LPC11xx vectors table. */ #if !defined(__DOXYGEN__) __attribute__ ((section("vectors"))) @@ -106,7 +107,7 @@ void (*_vectors[])(void) = { * @details Any undefined exception vector points to this function by default. * This function simply stops the system into an infinite loop. * - * @notapi + * @notapi */ #if !defined(__DOXYGEN__) __attribute__ ((naked)) diff --git a/os/ports/GCC/ARMCMx/LPC13xx/cmparams.h b/os/ports/GCC/ARMCMx/LPC13xx/cmparams.h index fb08f181f..ee49e5de9 100644 --- a/os/ports/GCC/ARMCMx/LPC13xx/cmparams.h +++ b/os/ports/GCC/ARMCMx/LPC13xx/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/LPC13xx/vectors.c b/os/ports/GCC/ARMCMx/LPC13xx/vectors.c index 4602f3c1b..1e27c4fc8 100644 --- a/os/ports/GCC/ARMCMx/LPC13xx/vectors.c +++ b/os/ports/GCC/ARMCMx/LPC13xx/vectors.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -105,7 +106,7 @@ extern void Vector11C(void); #endif /** - * @brief LPC13xx vectors table. + * @brief LPC13xx vectors table. */ #if !defined(__DOXYGEN__) __attribute__ ((section("vectors"))) @@ -136,7 +137,7 @@ void (*_vectors[])(void) = { * @details Any undefined exception vector points to this function by default. * This function simply stops the system into an infinite loop. * - * @notapi + * @notapi */ #if !defined(__DOXYGEN__) __attribute__ ((naked)) diff --git a/os/ports/GCC/ARMCMx/STM32/cmparams.h b/os/ports/GCC/ARMCMx/STM32/cmparams.h index fe9f219e5..5b630dbb8 100644 --- a/os/ports/GCC/ARMCMx/STM32/cmparams.h +++ b/os/ports/GCC/ARMCMx/STM32/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/STM32/vectors.c b/os/ports/GCC/ARMCMx/STM32/vectors.c index 1ecbae7e4..0995e21d1 100644 --- a/os/ports/GCC/ARMCMx/STM32/vectors.c +++ b/os/ports/GCC/ARMCMx/STM32/vectors.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -130,7 +131,7 @@ extern void Vector14C(void); #endif /** - * @brief STM32 vectors table. + * @brief STM32 vectors table. */ #if !defined(__DOXYGEN__) __attribute__ ((section("vectors"))) @@ -172,7 +173,7 @@ void (*_vectors[])(void) = { * @details Any undefined exception vector points to this function by default. * This function simply stops the system into an infinite loop. * - * @notapi + * @notapi */ #if !defined(__DOXYGEN__) __attribute__ ((naked)) diff --git a/os/ports/GCC/ARMCMx/chcore.c b/os/ports/GCC/ARMCMx/chcore.c index 4bb0436cd..5b210b8fa 100644 --- a/os/ports/GCC/ARMCMx/chcore.c +++ b/os/ports/GCC/ARMCMx/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/chcore.h b/os/ports/GCC/ARMCMx/chcore.h index 3fe046a95..c58b7bb3a 100644 --- a/os/ports/GCC/ARMCMx/chcore.h +++ b/os/ports/GCC/ARMCMx/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -74,7 +75,7 @@ /** * @brief Disabled value for BASEPRI register. - * @note ARMv7-M architecture only. + * @note ARMv7-M architecture only. */ #define CORTEX_BASEPRI_DISABLED 0 @@ -171,7 +172,7 @@ * @note The default value is 64 in order to comply with EABI, reducing * the value to 32 can save some RAM space if you don't care about * binary compatibility with EABI compiled libraries. - * @note Allowed values are 32 or 64. + * @note Allowed values are 32 or 64. */ #ifndef CORTEX_STACK_ALIGNMENT #define CORTEX_STACK_ALIGNMENT 64 diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index f132697d5..553277bef 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 4cfd7de8a..1d3198a7f 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c index 6e3732a8d..c71102127 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/chcore_v7m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -29,7 +30,7 @@ #if !defined(CH_CURRP_REGISTER_CACHE) || defined(__DOXXYGEN__) /** - * @brief Internal context stacking. + * @brief Internal context stacking. */ #define PUSH_CONTEXT() { \ asm volatile ("push {r4, r5, r6, r7, r8, r9, r10, r11, lr}" \ @@ -100,7 +101,7 @@ void SVCallVector(void) { } /** - * @brief Reschedule verification and setup after an IRQ. + * @brief Reschedule verification and setup after an IRQ. */ void _port_irq_epilogue(void) { diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index 2a4838669..a7f02aece 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/chtypes.h b/os/ports/GCC/ARMCMx/chtypes.h index f4bf93c1c..938a736d0 100644 --- a/os/ports/GCC/ARMCMx/chtypes.h +++ b/os/ports/GCC/ARMCMx/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/crt0_v6m.s b/os/ports/GCC/ARMCMx/crt0_v6m.s index baaf6f32d..478625d42 100644 --- a/os/ports/GCC/ARMCMx/crt0_v6m.s +++ b/os/ports/GCC/ARMCMx/crt0_v6m.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/crt0_v7m.s b/os/ports/GCC/ARMCMx/crt0_v7m.s index 4e4a40631..c5f714a26 100644 --- a/os/ports/GCC/ARMCMx/crt0_v7m.s +++ b/os/ports/GCC/ARMCMx/crt0_v7m.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/nvic.c b/os/ports/GCC/ARMCMx/nvic.c index fb470c2e1..51e4280f2 100644 --- a/os/ports/GCC/ARMCMx/nvic.c +++ b/os/ports/GCC/ARMCMx/nvic.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/nvic.h b/os/ports/GCC/ARMCMx/nvic.h index bd5d0f31b..02f010c4a 100644 --- a/os/ports/GCC/ARMCMx/nvic.h +++ b/os/ports/GCC/ARMCMx/nvic.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/old/chcore_v7m.c b/os/ports/GCC/ARMCMx/old/chcore_v7m.c index c8b2f3af6..bd888cd01 100644 --- a/os/ports/GCC/ARMCMx/old/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/old/chcore_v7m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/old/chcore_v7m.h b/os/ports/GCC/ARMCMx/old/chcore_v7m.h index 480542db1..93e701202 100644 --- a/os/ports/GCC/ARMCMx/old/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/old/chcore_v7m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/ARMCMx/port.dox b/os/ports/GCC/ARMCMx/port.dox index 32b736434..27e321f21 100644 --- a/os/ports/GCC/ARMCMx/port.dox +++ b/os/ports/GCC/ARMCMx/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/AVR/chcore.c b/os/ports/GCC/AVR/chcore.c index 082b5fd79..166c0d1b1 100644 --- a/os/ports/GCC/AVR/chcore.c +++ b/os/ports/GCC/AVR/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/AVR/chcore.h b/os/ports/GCC/AVR/chcore.h index 7f15ba50e..4377c5047 100644 --- a/os/ports/GCC/AVR/chcore.h +++ b/os/ports/GCC/AVR/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/AVR/chtypes.h b/os/ports/GCC/AVR/chtypes.h index f180dfd4b..ceda147d5 100644 --- a/os/ports/GCC/AVR/chtypes.h +++ b/os/ports/GCC/AVR/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/AVR/port.dox b/os/ports/GCC/AVR/port.dox index 6187f399e..c8a506b70 100644 --- a/os/ports/GCC/AVR/port.dox +++ b/os/ports/GCC/AVR/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/MSP430/chcore.c b/os/ports/GCC/MSP430/chcore.c index d8b1a63de..d9192177d 100644 --- a/os/ports/GCC/MSP430/chcore.c +++ b/os/ports/GCC/MSP430/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/MSP430/chcore.h b/os/ports/GCC/MSP430/chcore.h index 35d9f71ef..5cb88ab3d 100644 --- a/os/ports/GCC/MSP430/chcore.h +++ b/os/ports/GCC/MSP430/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/MSP430/chtypes.h b/os/ports/GCC/MSP430/chtypes.h index 3798a14dc..acc55c418 100644 --- a/os/ports/GCC/MSP430/chtypes.h +++ b/os/ports/GCC/MSP430/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/MSP430/port.dox b/os/ports/GCC/MSP430/port.dox index fad67b3e5..502e8295a 100644 --- a/os/ports/GCC/MSP430/port.dox +++ b/os/ports/GCC/MSP430/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/SPC56x/ivor.s b/os/ports/GCC/PPC/SPC56x/ivor.s index 725098e09..7f470d26a 100644 --- a/os/ports/GCC/PPC/SPC56x/ivor.s +++ b/os/ports/GCC/PPC/SPC56x/ivor.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/SPC56x/vectors.s b/os/ports/GCC/PPC/SPC56x/vectors.s index f1d43796e..820c5a7f6 100644 --- a/os/ports/GCC/PPC/SPC56x/vectors.s +++ b/os/ports/GCC/PPC/SPC56x/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/chcore.c b/os/ports/GCC/PPC/chcore.c index 907652e6c..c68d5e07c 100644 --- a/os/ports/GCC/PPC/chcore.c +++ b/os/ports/GCC/PPC/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/chcore.h b/os/ports/GCC/PPC/chcore.h index 6f45d5a82..058379923 100644 --- a/os/ports/GCC/PPC/chcore.h +++ b/os/ports/GCC/PPC/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/chtypes.h b/os/ports/GCC/PPC/chtypes.h index f0be524b6..5b5de7e1a 100644 --- a/os/ports/GCC/PPC/chtypes.h +++ b/os/ports/GCC/PPC/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/crt0.s b/os/ports/GCC/PPC/crt0.s index 0a2697be8..fba20e4b0 100644 --- a/os/ports/GCC/PPC/crt0.s +++ b/os/ports/GCC/PPC/crt0.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/PPC/port.dox b/os/ports/GCC/PPC/port.dox index 70ba4784a..e5f9e3deb 100644 --- a/os/ports/GCC/PPC/port.dox +++ b/os/ports/GCC/PPC/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/SIMIA32/chcore.c b/os/ports/GCC/SIMIA32/chcore.c index e2531cd4e..58f079ef5 100644 --- a/os/ports/GCC/SIMIA32/chcore.c +++ b/os/ports/GCC/SIMIA32/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/SIMIA32/chcore.h b/os/ports/GCC/SIMIA32/chcore.h index 87403d90e..266cfd955 100644 --- a/os/ports/GCC/SIMIA32/chcore.h +++ b/os/ports/GCC/SIMIA32/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/GCC/SIMIA32/chtypes.h b/os/ports/GCC/SIMIA32/chtypes.h index 327de745a..b6e73fb96 100644 --- a/os/ports/GCC/SIMIA32/chtypes.h +++ b/os/ports/GCC/SIMIA32/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/LPC11xx/cmparams.h b/os/ports/IAR/ARMCMx/LPC11xx/cmparams.h index 644b8050d..2b66fbf4a 100644 --- a/os/ports/IAR/ARMCMx/LPC11xx/cmparams.h +++ b/os/ports/IAR/ARMCMx/LPC11xx/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/LPC11xx/vectors.s b/os/ports/IAR/ARMCMx/LPC11xx/vectors.s index 13e0eafb9..f57b2b5e4 100644 --- a/os/ports/IAR/ARMCMx/LPC11xx/vectors.s +++ b/os/ports/IAR/ARMCMx/LPC11xx/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/LPC13xx/cmparams.h b/os/ports/IAR/ARMCMx/LPC13xx/cmparams.h index 34177a6a9..1e970e72a 100644 --- a/os/ports/IAR/ARMCMx/LPC13xx/cmparams.h +++ b/os/ports/IAR/ARMCMx/LPC13xx/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/LPC13xx/vectors.s b/os/ports/IAR/ARMCMx/LPC13xx/vectors.s index 69e0c8add..8ad48d0dd 100644 --- a/os/ports/IAR/ARMCMx/LPC13xx/vectors.s +++ b/os/ports/IAR/ARMCMx/LPC13xx/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/STM32/cmparams.h b/os/ports/IAR/ARMCMx/STM32/cmparams.h index d75c3ca2c..3e18146c0 100644 --- a/os/ports/IAR/ARMCMx/STM32/cmparams.h +++ b/os/ports/IAR/ARMCMx/STM32/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/STM32/vectors.s b/os/ports/IAR/ARMCMx/STM32/vectors.s index 868741f4f..85c889267 100644 --- a/os/ports/IAR/ARMCMx/STM32/vectors.s +++ b/os/ports/IAR/ARMCMx/STM32/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcore.c b/os/ports/IAR/ARMCMx/chcore.c index 2f2122ae4..4c9cc08f9 100644 --- a/os/ports/IAR/ARMCMx/chcore.c +++ b/os/ports/IAR/ARMCMx/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcore.h b/os/ports/IAR/ARMCMx/chcore.h index 7644368be..3854de61e 100644 --- a/os/ports/IAR/ARMCMx/chcore.h +++ b/os/ports/IAR/ARMCMx/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.c b/os/ports/IAR/ARMCMx/chcore_v6m.c index 8549393e1..f04ff96d1 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.c +++ b/os/ports/IAR/ARMCMx/chcore_v6m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index e39d6c299..9e8d27ef7 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.c b/os/ports/IAR/ARMCMx/chcore_v7m.c index fe267b9e9..cef8b59a0 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.c +++ b/os/ports/IAR/ARMCMx/chcore_v7m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h index ad4abf25b..9c5d700ee 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.h +++ b/os/ports/IAR/ARMCMx/chcore_v7m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s index a0ddb42bc..ab40c509a 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v7m.s b/os/ports/IAR/ARMCMx/chcoreasm_v7m.s index 9273ce9f4..db580319e 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v7m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v7m.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/chtypes.h b/os/ports/IAR/ARMCMx/chtypes.h index 4020b95b5..f24bb6ffc 100644 --- a/os/ports/IAR/ARMCMx/chtypes.h +++ b/os/ports/IAR/ARMCMx/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/cstartup.s b/os/ports/IAR/ARMCMx/cstartup.s index 1421ea86e..677cd5248 100644 --- a/os/ports/IAR/ARMCMx/cstartup.s +++ b/os/ports/IAR/ARMCMx/cstartup.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/nvic.c b/os/ports/IAR/ARMCMx/nvic.c index 93dbd6ba4..690c4e488 100644 --- a/os/ports/IAR/ARMCMx/nvic.c +++ b/os/ports/IAR/ARMCMx/nvic.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/nvic.h b/os/ports/IAR/ARMCMx/nvic.h index 321a0ed7b..f424a854d 100644 --- a/os/ports/IAR/ARMCMx/nvic.h +++ b/os/ports/IAR/ARMCMx/nvic.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/IAR/ARMCMx/port.dox b/os/ports/IAR/ARMCMx/port.dox index 00d669726..22bd3cea3 100644 --- a/os/ports/IAR/ARMCMx/port.dox +++ b/os/ports/IAR/ARMCMx/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RC/STM8/chcore.c b/os/ports/RC/STM8/chcore.c index ed0103049..d7034e38a 100644 --- a/os/ports/RC/STM8/chcore.c +++ b/os/ports/RC/STM8/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RC/STM8/chcore.h b/os/ports/RC/STM8/chcore.h index 55c5d3ac0..ed10b564e 100644 --- a/os/ports/RC/STM8/chcore.h +++ b/os/ports/RC/STM8/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RC/STM8/chtypes.h b/os/ports/RC/STM8/chtypes.h index 4f2241b1f..74bd3ed9e 100644 --- a/os/ports/RC/STM8/chtypes.h +++ b/os/ports/RC/STM8/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RC/STM8/port.dox b/os/ports/RC/STM8/port.dox index 7a7d10788..dbcd69ee7 100644 --- a/os/ports/RC/STM8/port.dox +++ b/os/ports/RC/STM8/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/LPC11xx/cmparams.h b/os/ports/RVCT/ARMCMx/LPC11xx/cmparams.h index fec1ea3a2..7289af9e7 100644 --- a/os/ports/RVCT/ARMCMx/LPC11xx/cmparams.h +++ b/os/ports/RVCT/ARMCMx/LPC11xx/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/LPC11xx/vectors.s b/os/ports/RVCT/ARMCMx/LPC11xx/vectors.s index 91ee5ee18..798003e49 100644 --- a/os/ports/RVCT/ARMCMx/LPC11xx/vectors.s +++ b/os/ports/RVCT/ARMCMx/LPC11xx/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/LPC13xx/cmparams.h b/os/ports/RVCT/ARMCMx/LPC13xx/cmparams.h index d45565bbb..e484d7aad 100644 --- a/os/ports/RVCT/ARMCMx/LPC13xx/cmparams.h +++ b/os/ports/RVCT/ARMCMx/LPC13xx/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/LPC13xx/vectors.s b/os/ports/RVCT/ARMCMx/LPC13xx/vectors.s index f8a4d7f74..5290f1cd4 100644 --- a/os/ports/RVCT/ARMCMx/LPC13xx/vectors.s +++ b/os/ports/RVCT/ARMCMx/LPC13xx/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/STM32/cmparams.h b/os/ports/RVCT/ARMCMx/STM32/cmparams.h index 2c7a06d4a..73a3f2357 100644 --- a/os/ports/RVCT/ARMCMx/STM32/cmparams.h +++ b/os/ports/RVCT/ARMCMx/STM32/cmparams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/STM32/vectors.s b/os/ports/RVCT/ARMCMx/STM32/vectors.s index 1abf3cc1e..330f34bf8 100644 --- a/os/ports/RVCT/ARMCMx/STM32/vectors.s +++ b/os/ports/RVCT/ARMCMx/STM32/vectors.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcore.c b/os/ports/RVCT/ARMCMx/chcore.c index 627b4c812..fec6b2e1d 100644 --- a/os/ports/RVCT/ARMCMx/chcore.c +++ b/os/ports/RVCT/ARMCMx/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcore.h b/os/ports/RVCT/ARMCMx/chcore.h index a8c8d7496..aa8fe2483 100644 --- a/os/ports/RVCT/ARMCMx/chcore.h +++ b/os/ports/RVCT/ARMCMx/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.c b/os/ports/RVCT/ARMCMx/chcore_v6m.c index 94b348140..c0b2922d9 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.c +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index df2646c22..547ad9bf3 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.c b/os/ports/RVCT/ARMCMx/chcore_v7m.c index 84d1c97a1..7ed226255 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.c +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index 528144173..45f9843e3 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index 44691cd99..d3239575c 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s index 1e00ccea3..dda32eb18 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/chtypes.h b/os/ports/RVCT/ARMCMx/chtypes.h index af8d64eb8..8f681d7c2 100644 --- a/os/ports/RVCT/ARMCMx/chtypes.h +++ b/os/ports/RVCT/ARMCMx/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/cstartup.s b/os/ports/RVCT/ARMCMx/cstartup.s index d0a8104a8..95f2f0f48 100644 --- a/os/ports/RVCT/ARMCMx/cstartup.s +++ b/os/ports/RVCT/ARMCMx/cstartup.s @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/nvic.c b/os/ports/RVCT/ARMCMx/nvic.c index 568c4a23e..8656a288c 100644 --- a/os/ports/RVCT/ARMCMx/nvic.c +++ b/os/ports/RVCT/ARMCMx/nvic.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/nvic.h b/os/ports/RVCT/ARMCMx/nvic.h index 590deae24..a1fbe4ea5 100644 --- a/os/ports/RVCT/ARMCMx/nvic.h +++ b/os/ports/RVCT/ARMCMx/nvic.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/RVCT/ARMCMx/port.dox b/os/ports/RVCT/ARMCMx/port.dox index 0e65f8c2b..83793d5d4 100644 --- a/os/ports/RVCT/ARMCMx/port.dox +++ b/os/ports/RVCT/ARMCMx/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/cosmic/STM8/chcore.c b/os/ports/cosmic/STM8/chcore.c index 1c382cde6..c5f1de2d6 100644 --- a/os/ports/cosmic/STM8/chcore.c +++ b/os/ports/cosmic/STM8/chcore.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/cosmic/STM8/chcore.h b/os/ports/cosmic/STM8/chcore.h index f5fde8fb1..615116736 100644 --- a/os/ports/cosmic/STM8/chcore.h +++ b/os/ports/cosmic/STM8/chcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/cosmic/STM8/chtypes.h b/os/ports/cosmic/STM8/chtypes.h index 3fe35570d..440b2ed0f 100644 --- a/os/ports/cosmic/STM8/chtypes.h +++ b/os/ports/cosmic/STM8/chtypes.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/cosmic/STM8/port.dox b/os/ports/cosmic/STM8/port.dox index ec57658ae..80ae3fda5 100644 --- a/os/ports/cosmic/STM8/port.dox +++ b/os/ports/cosmic/STM8/port.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/ports/ports.dox b/os/ports/ports.dox index 8168fdbce..df9828ce6 100644 --- a/os/ports/ports.dox +++ b/os/ports/ports.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/ch.cpp b/os/various/ch.cpp index a3507868d..4c21904cb 100644 --- a/os/various/ch.cpp +++ b/os/various/ch.cpp @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/ch.hpp b/os/various/ch.hpp index 7bbd43c9f..487f03e75 100644 --- a/os/various/ch.hpp +++ b/os/various/ch.hpp @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/evtimer.c b/os/various/evtimer.c index 140d90ed0..6a7226b27 100644 --- a/os/various/evtimer.c +++ b/os/various/evtimer.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/evtimer.h b/os/various/evtimer.h index 3f675fffc..a753e8984 100644 --- a/os/various/evtimer.h +++ b/os/various/evtimer.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/memstreams.c b/os/various/memstreams.c index 9e6bd1e3a..b1edf1a45 100644 --- a/os/various/memstreams.c +++ b/os/various/memstreams.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/memstreams.h b/os/various/memstreams.h index 438b8ce00..53d8c567d 100644 --- a/os/various/memstreams.h +++ b/os/various/memstreams.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/mii.h b/os/various/mii.h index a808b16f8..e9f0eefc3 100644 --- a/os/various/mii.h +++ b/os/various/mii.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/shell.c b/os/various/shell.c index 8a0fd4d45..e3686c6cb 100644 --- a/os/various/shell.c +++ b/os/various/shell.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/shell.h b/os/various/shell.h index 821a2c985..9b3b70513 100644 --- a/os/various/shell.h +++ b/os/various/shell.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/syscalls.c b/os/various/syscalls.c index 2abe6dfde..b22765b80 100644 --- a/os/various/syscalls.c +++ b/os/various/syscalls.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/usb_cdc.h b/os/various/usb_cdc.h index ac15b847b..ab70ed833 100644 --- a/os/various/usb_cdc.h +++ b/os/various/usb_cdc.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/usb_msc.c b/os/various/usb_msc.c index 19d5ba8d6..22dee45d3 100644 --- a/os/various/usb_msc.c +++ b/os/various/usb_msc.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/usb_msc.h b/os/various/usb_msc.h index d62bb001d..d6e041553 100644 --- a/os/various/usb_msc.h +++ b/os/various/usb_msc.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/os/various/various.dox b/os/various/various.dox index 1a8130f4d..9ae895af4 100644 --- a/os/various/various.dox +++ b/os/various/various.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/coverage/chconf.h b/test/coverage/chconf.h index 617528316..b16d5d0d3 100644 --- a/test/coverage/chconf.h +++ b/test/coverage/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index a1e2190e8..a06bfaa23 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/coverage/main.c b/test/coverage/main.c index b6f1ee696..a2df0a409 100644 --- a/test/coverage/main.c +++ b/test/coverage/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/test.c b/test/test.c index 00b5858bc..f1df08390 100644 --- a/test/test.c +++ b/test/test.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/test.dox b/test/test.dox index beda6d0ea..296e2145e 100644 --- a/test/test.dox +++ b/test/test.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/test.h b/test/test.h index 987e361bf..31806fddb 100644 --- a/test/test.h +++ b/test/test.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testbmk.c b/test/testbmk.c index 7e7a714df..9c820b58a 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testbmk.h b/test/testbmk.h index 5dde9a60c..43d4f2a22 100644 --- a/test/testbmk.h +++ b/test/testbmk.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testdyn.c b/test/testdyn.c index 2035224a1..c5b523816 100644 --- a/test/testdyn.c +++ b/test/testdyn.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testdyn.h b/test/testdyn.h index efcd4dc1e..366202d62 100644 --- a/test/testdyn.h +++ b/test/testdyn.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testevt.c b/test/testevt.c index ccf0ed576..c0f5baa5a 100644 --- a/test/testevt.c +++ b/test/testevt.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testevt.h b/test/testevt.h index 687b16912..810257608 100644 --- a/test/testevt.h +++ b/test/testevt.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testheap.c b/test/testheap.c index 94fb87bb9..4b480a575 100644 --- a/test/testheap.c +++ b/test/testheap.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testheap.h b/test/testheap.h index d5ce66ce3..4515f8846 100644 --- a/test/testheap.h +++ b/test/testheap.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testmbox.c b/test/testmbox.c index eba54a0d0..90b081c3e 100644 --- a/test/testmbox.c +++ b/test/testmbox.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testmbox.h b/test/testmbox.h index fc75552a3..c57a52495 100644 --- a/test/testmbox.h +++ b/test/testmbox.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testmsg.c b/test/testmsg.c index 14b6d8186..0fadc8d98 100644 --- a/test/testmsg.c +++ b/test/testmsg.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testmsg.h b/test/testmsg.h index d7817d427..7193156bd 100644 --- a/test/testmsg.h +++ b/test/testmsg.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testmtx.c b/test/testmtx.c index 9ca9edc85..4112eb004 100644 --- a/test/testmtx.c +++ b/test/testmtx.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testmtx.h b/test/testmtx.h index cd7ddf497..3bfaba78f 100644 --- a/test/testmtx.h +++ b/test/testmtx.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testpools.c b/test/testpools.c index c503ecbda..6479f20ea 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testpools.h b/test/testpools.h index 5f526f1d6..a11ef4de7 100644 --- a/test/testpools.h +++ b/test/testpools.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testqueues.c b/test/testqueues.c index dd4d00fba..e30e12dcb 100644 --- a/test/testqueues.c +++ b/test/testqueues.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testqueues.h b/test/testqueues.h index 1f86fc763..ff9b6a618 100644 --- a/test/testqueues.h +++ b/test/testqueues.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testsem.c b/test/testsem.c index 25d87f3f1..75f4f1fcb 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testsem.h b/test/testsem.h index cfa3b6330..032c75436 100644 --- a/test/testsem.h +++ b/test/testsem.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testthd.c b/test/testthd.c index 8b0440248..83c2c4d4f 100644 --- a/test/testthd.c +++ b/test/testthd.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/test/testthd.h b/test/testthd.h index e355f63fb..5435cc02d 100644 --- a/test/testthd.h +++ b/test/testthd.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC11xx/IRQ_STORM/ch.ld b/testhal/LPC11xx/IRQ_STORM/ch.ld index 0eff7df98..de2e1862e 100644 --- a/testhal/LPC11xx/IRQ_STORM/ch.ld +++ b/testhal/LPC11xx/IRQ_STORM/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC11xx/IRQ_STORM/chconf.h b/testhal/LPC11xx/IRQ_STORM/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/LPC11xx/IRQ_STORM/chconf.h +++ b/testhal/LPC11xx/IRQ_STORM/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h index 70c240431..88085ea45 100644 --- a/testhal/LPC11xx/IRQ_STORM/halconf.h +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC11xx/IRQ_STORM/main.c b/testhal/LPC11xx/IRQ_STORM/main.c index 1fcec7268..7ced998ff 100644 --- a/testhal/LPC11xx/IRQ_STORM/main.c +++ b/testhal/LPC11xx/IRQ_STORM/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC11xx/IRQ_STORM/mcuconf.h b/testhal/LPC11xx/IRQ_STORM/mcuconf.h index 189e5f6b7..937dd38e6 100644 --- a/testhal/LPC11xx/IRQ_STORM/mcuconf.h +++ b/testhal/LPC11xx/IRQ_STORM/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC13xx/IRQ_STORM/ch.ld b/testhal/LPC13xx/IRQ_STORM/ch.ld index 83028c619..781ec9435 100644 --- a/testhal/LPC13xx/IRQ_STORM/ch.ld +++ b/testhal/LPC13xx/IRQ_STORM/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC13xx/IRQ_STORM/chconf.h b/testhal/LPC13xx/IRQ_STORM/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/LPC13xx/IRQ_STORM/chconf.h +++ b/testhal/LPC13xx/IRQ_STORM/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h index 70c240431..88085ea45 100644 --- a/testhal/LPC13xx/IRQ_STORM/halconf.h +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC13xx/IRQ_STORM/main.c b/testhal/LPC13xx/IRQ_STORM/main.c index 407ad92a5..9949c35f0 100644 --- a/testhal/LPC13xx/IRQ_STORM/main.c +++ b/testhal/LPC13xx/IRQ_STORM/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/LPC13xx/IRQ_STORM/mcuconf.h b/testhal/LPC13xx/IRQ_STORM/mcuconf.h index 195eb6c6a..3c539ce7e 100644 --- a/testhal/LPC13xx/IRQ_STORM/mcuconf.h +++ b/testhal/LPC13xx/IRQ_STORM/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/ADC/ch.ld b/testhal/STM32/ADC/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/ADC/ch.ld +++ b/testhal/STM32/ADC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/ADC/chconf.h b/testhal/STM32/ADC/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/ADC/chconf.h +++ b/testhal/STM32/ADC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index b3180dfe8..aa76f8bd4 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/ADC/main.c b/testhal/STM32/ADC/main.c index 6e765476b..f702ab8a7 100644 --- a/testhal/STM32/ADC/main.c +++ b/testhal/STM32/ADC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/CAN/ch.ld b/testhal/STM32/CAN/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/CAN/ch.ld +++ b/testhal/STM32/CAN/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/CAN/chconf.h b/testhal/STM32/CAN/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/CAN/chconf.h +++ b/testhal/STM32/CAN/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 2536b39d6..665572608 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/CAN/main.c b/testhal/STM32/CAN/main.c index 7fb08de10..c8879d6d4 100644 --- a/testhal/STM32/CAN/main.c +++ b/testhal/STM32/CAN/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -56,7 +57,7 @@ static msg_t can_rx(void *p) { } /* - * Transmitter thread. + * Transmitter thread. */ static WORKING_AREA(can_tx_wa, 256); static msg_t can_tx(void * p) { @@ -93,12 +94,12 @@ int main(void) { chSysInit(); /* - * Activates the CAN driver 1. + * Activates the CAN driver 1. */ canStart(&CAND1, &cancfg); /* - * Starting the transmitter and receiver threads. + * Starting the transmitter and receiver threads. */ chThdCreateStatic(can_rx_wa, sizeof(can_rx_wa), NORMALPRIO + 7, can_rx, NULL); chThdCreateStatic(can_tx_wa, sizeof(can_tx_wa), NORMALPRIO + 7, can_tx, NULL); diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/GPT/ch.ld b/testhal/STM32/GPT/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/GPT/ch.ld +++ b/testhal/STM32/GPT/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/GPT/chconf.h b/testhal/STM32/GPT/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/GPT/chconf.h +++ b/testhal/STM32/GPT/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h index ce33dc633..f804593b0 100644 --- a/testhal/STM32/GPT/halconf.h +++ b/testhal/STM32/GPT/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/GPT/main.c b/testhal/STM32/GPT/main.c index 636940584..57b2977d1 100644 --- a/testhal/STM32/GPT/main.c +++ b/testhal/STM32/GPT/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/GPT/mcuconf.h b/testhal/STM32/GPT/mcuconf.h index 6e869607a..32fbe68ef 100644 --- a/testhal/STM32/GPT/mcuconf.h +++ b/testhal/STM32/GPT/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/IRQ_STORM/ch.ld b/testhal/STM32/IRQ_STORM/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/IRQ_STORM/ch.ld +++ b/testhal/STM32/IRQ_STORM/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/IRQ_STORM/chconf.h b/testhal/STM32/IRQ_STORM/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/IRQ_STORM/chconf.h +++ b/testhal/STM32/IRQ_STORM/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h index 70c240431..88085ea45 100644 --- a/testhal/STM32/IRQ_STORM/halconf.h +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/IRQ_STORM/main.c b/testhal/STM32/IRQ_STORM/main.c index 71ff38440..4cdb7a193 100644 --- a/testhal/STM32/IRQ_STORM/main.c +++ b/testhal/STM32/IRQ_STORM/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/IRQ_STORM/mcuconf.h b/testhal/STM32/IRQ_STORM/mcuconf.h index 643a5f2a5..ebe2c0b1f 100644 --- a/testhal/STM32/IRQ_STORM/mcuconf.h +++ b/testhal/STM32/IRQ_STORM/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/PWM/ch.ld b/testhal/STM32/PWM/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/PWM/ch.ld +++ b/testhal/STM32/PWM/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/PWM/chconf.h b/testhal/STM32/PWM/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/PWM/chconf.h +++ b/testhal/STM32/PWM/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/PWM/halconf.h b/testhal/STM32/PWM/halconf.h index 35da89b41..437770851 100644 --- a/testhal/STM32/PWM/halconf.h +++ b/testhal/STM32/PWM/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/PWM/main.c b/testhal/STM32/PWM/main.c index 42a35170f..c42b15939 100644 --- a/testhal/STM32/PWM/main.c +++ b/testhal/STM32/PWM/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -99,7 +100,7 @@ int main(void) { chThdSleepMilliseconds(5000); /* - * Disables channel 0. + * Disables channel 0. */ pwmDisableChannel(&PWMD1, 0); diff --git a/testhal/STM32/PWM/mcuconf.h b/testhal/STM32/PWM/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/testhal/STM32/PWM/mcuconf.h +++ b/testhal/STM32/PWM/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/SPI/ch.ld b/testhal/STM32/SPI/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/SPI/ch.ld +++ b/testhal/STM32/SPI/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/SPI/chconf.h b/testhal/STM32/SPI/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/SPI/chconf.h +++ b/testhal/STM32/SPI/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index 33b2f5242..b5bf99b30 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/SPI/main.c b/testhal/STM32/SPI/main.c index e107cb7c7..e9807e93c 100644 --- a/testhal/STM32/SPI/main.c +++ b/testhal/STM32/SPI/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -41,7 +42,7 @@ static const SPIConfig ls_spicfg = { }; /* - * SPI TX and RX buffers. + * SPI TX and RX buffers. */ static uint8_t txbuf[512]; static uint8_t rxbuf[512]; @@ -103,7 +104,7 @@ int main(void) { chSysInit(); /* - * SPI1 I/O pins setup. + * SPI1 I/O pins setup. */ palSetPadMode(IOPORT1, 5, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* SCK. */ palSetPadMode(IOPORT1, 6, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* MISO.*/ @@ -112,13 +113,13 @@ int main(void) { palSetPad(IOPORT1, GPIOA_SPI1NSS); /* - * Prepare transmit pattern. + * Prepare transmit pattern. */ for (i = 0; i < sizeof(txbuf); i++) txbuf[i] = (uint8_t)i; /* - * Starting the transmitter and receiver threads. + * Starting the transmitter and receiver threads. */ chThdCreateStatic(spi_thread_1_wa, sizeof(spi_thread_1_wa), NORMALPRIO + 1, spi_thread_1, NULL); diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index c6eacdada..40e467270 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/UART/ch.ld b/testhal/STM32/UART/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/UART/ch.ld +++ b/testhal/STM32/UART/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/UART/chconf.h b/testhal/STM32/UART/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/UART/chconf.h +++ b/testhal/STM32/UART/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index 6b73cf62c..58e578f74 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/UART/main.c b/testhal/STM32/UART/main.c index f672cfb1a..924338a77 100644 --- a/testhal/STM32/UART/main.c +++ b/testhal/STM32/UART/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -38,7 +39,7 @@ static void ledoff(void *p) { /* * This callback is invoked when a transmission buffer has been completely - * read by the driver. + * read by the driver. */ static void txend1(UARTDriver *uartp) { @@ -47,7 +48,7 @@ static void txend1(UARTDriver *uartp) { } /* - * This callback is invoked when a transmission has phisically completed. + * This callback is invoked when a transmission has phisically completed. */ static void txend2(UARTDriver *uartp) { @@ -62,7 +63,7 @@ static void txend2(UARTDriver *uartp) { /* * This callback is invoked on a receive error, the errors mask is passed - * as parameter. + * as parameter. */ static void rxerr(UARTDriver *uartp, uartflags_t e) { @@ -72,7 +73,7 @@ static void rxerr(UARTDriver *uartp, uartflags_t e) { /* * This callback is invoked when a character is received but the application - * was not ready to receive it, the character is passed as parameter. + * was not ready to receive it, the character is passed as parameter. */ static void rxchar(UARTDriver *uartp, uint16_t c) { @@ -88,7 +89,7 @@ static void rxchar(UARTDriver *uartp, uint16_t c) { } /* - * This callback is invoked when a receive buffer has been completely written. + * This callback is invoked when a receive buffer has been completely written. */ static void rxend(UARTDriver *uartp) { @@ -96,7 +97,7 @@ static void rxend(UARTDriver *uartp) { } /* - * UART driver configuration structure. + * UART driver configuration structure. */ static UARTConfig uart_cfg_1 = { txend1, @@ -131,7 +132,7 @@ int main(void) { uartStart(&UARTD2, &uart_cfg_1); /* - * Starts the transmission, it will be handled entirely in background. + * Starts the transmission, it will be handled entirely in background. */ uartStartSend(&UARTD2, 13, "Starting...\r\n"); diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_CDC/ch.ld b/testhal/STM32/USB_CDC/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/USB_CDC/ch.ld +++ b/testhal/STM32/USB_CDC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_CDC/chconf.h b/testhal/STM32/USB_CDC/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/USB_CDC/chconf.h +++ b/testhal/STM32/USB_CDC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 1131041f3..e401453e0 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 6f4416364..23962c496 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_MSC/ch.ld b/testhal/STM32/USB_MSC/ch.ld index 44f494121..ae79ddd40 100644 --- a/testhal/STM32/USB_MSC/ch.ld +++ b/testhal/STM32/USB_MSC/ch.ld @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_MSC/chconf.h b/testhal/STM32/USB_MSC/chconf.h index 3353391ca..04fa822cc 100644 --- a/testhal/STM32/USB_MSC/chconf.h +++ b/testhal/STM32/USB_MSC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h index 2babf6832..523c1ad6a 100644 --- a/testhal/STM32/USB_MSC/halconf.h +++ b/testhal/STM32/USB_MSC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_MSC/main.c b/testhal/STM32/USB_MSC/main.c index e2eca2aa8..df5524a57 100644 --- a/testhal/STM32/USB_MSC/main.c +++ b/testhal/STM32/USB_MSC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM32/USB_MSC/mcuconf.h b/testhal/STM32/USB_MSC/mcuconf.h index ea7941a4f..2f50634ce 100644 --- a/testhal/STM32/USB_MSC/mcuconf.h +++ b/testhal/STM32/USB_MSC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM8S/SPI/cosmic/vectors.c b/testhal/STM8S/SPI/cosmic/vectors.c index 494943416..f6a827965 100644 --- a/testhal/STM8S/SPI/cosmic/vectors.c +++ b/testhal/STM8S/SPI/cosmic/vectors.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM8S/SPI/demo/chconf.h b/testhal/STM8S/SPI/demo/chconf.h index 7e0ba6086..24f9bed32 100644 --- a/testhal/STM8S/SPI/demo/chconf.h +++ b/testhal/STM8S/SPI/demo/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index 33b2f5242..b5bf99b30 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM8S/SPI/demo/main.c b/testhal/STM8S/SPI/demo/main.c index 9ea76bcf8..7114ac34f 100644 --- a/testhal/STM8S/SPI/demo/main.c +++ b/testhal/STM8S/SPI/demo/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/testhal/STM8S/SPI/demo/mcuconf.h b/testhal/STM8S/SPI/demo/mcuconf.h index 814143da2..2e244cbbf 100644 --- a/testhal/STM8S/SPI/demo/mcuconf.h +++ b/testhal/STM8S/SPI/demo/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From 34c2d747d216010589db37c0af865461c116883b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Mar 2011 07:27:06 +0000 Subject: Fixed bug 3224681. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2828 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/pal.c | 6 +++--- readme.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/os/hal/src/pal.c b/os/hal/src/pal.c index 877b372c4..534935a55 100644 --- a/os/hal/src/pal.c +++ b/os/hal/src/pal.c @@ -65,7 +65,7 @@ ioportmask_t palReadBus(IOBus *bus) { chDbgCheck((bus != NULL) && - (bus->offset > PAL_IOPORTS_WIDTH), "palReadBus"); + (bus->offset < PAL_IOPORTS_WIDTH), "palReadBus"); return palReadGroup(bus->portid, bus->mask, bus->offset); } @@ -90,7 +90,7 @@ ioportmask_t palReadBus(IOBus *bus) { void palWriteBus(IOBus *bus, ioportmask_t bits) { chDbgCheck((bus != NULL) && - (bus->offset > PAL_IOPORTS_WIDTH), "palWriteBus"); + (bus->offset < PAL_IOPORTS_WIDTH), "palWriteBus"); palWriteGroup(bus->portid, bus->mask, bus->offset, bits); } @@ -113,7 +113,7 @@ void palWriteBus(IOBus *bus, ioportmask_t bits) { void palSetBusMode(IOBus *bus, uint_fast8_t mode) { chDbgCheck((bus != NULL) && - (bus->offset > PAL_IOPORTS_WIDTH), "palSetBusMode"); + (bus->offset < PAL_IOPORTS_WIDTH), "palSetBusMode"); palSetGroupMode(bus->portid, bus->mask, mode); } diff --git a/readme.txt b/readme.txt index d1534bd9b..0dfc17233 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,7 @@ ***************************************************************************** *** 2.3.1 *** +- FIX: Fixed wrong chechs in PAL driver (bug 3224681)(backported to 2.2.3). - FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). -- cgit v1.2.3 From e738d5ec4adac410776c4e3c6bfd329678c4fd77 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Mar 2011 07:30:37 +0000 Subject: Typo. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2830 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 0dfc17233..677fbea6c 100644 --- a/readme.txt +++ b/readme.txt @@ -71,7 +71,7 @@ ***************************************************************************** *** 2.3.1 *** -- FIX: Fixed wrong chechs in PAL driver (bug 3224681)(backported to 2.2.3). +- FIX: Fixed wrong checks in PAL driver (bug 3224681)(backported to 2.2.3). - FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). -- cgit v1.2.3 From f8c1d7423ef255774eec34df8b6791032f8a0a05 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Mar 2011 12:07:03 +0000 Subject: Added IAR and Keil projects for STM32F107. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2831 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F107/iar/ch.ewp | 2171 +++++++++++++++++++++++++++++++++++++ demos/ARMCM3-STM32F107/iar/ch.eww | 10 + demos/ARMCM3-STM32F107/iar/ch.icf | 39 + demos/ARMCM3-STM32F107/main.c | 1 - 4 files changed, 2220 insertions(+), 1 deletion(-) create mode 100644 demos/ARMCM3-STM32F107/iar/ch.ewp create mode 100644 demos/ARMCM3-STM32F107/iar/ch.eww create mode 100644 demos/ARMCM3-STM32F107/iar/ch.icf diff --git a/demos/ARMCM3-STM32F107/iar/ch.ewp b/demos/ARMCM3-STM32F107/iar/ch.ewp new file mode 100644 index 000000000..df3095c33 --- /dev/null +++ b/demos/ARMCM3-STM32F107/iar/ch.ewp @@ -0,0 +1,2171 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 18 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 11 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 18 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 26 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 11 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + board + + $PROJ_DIR$\..\..\..\boards\OLIMEX_STM32_P107\board.c + + + $PROJ_DIR$\..\..\..\boards\OLIMEX_STM32_P107\board.h + + + + os + + hal + + include + + $PROJ_DIR$\..\..\..\os\hal\include\adc.h + + + $PROJ_DIR$\..\..\..\os\hal\include\can.h + + + $PROJ_DIR$\..\..\..\os\hal\include\gpt.h + + + $PROJ_DIR$\..\..\..\os\hal\include\hal.h + + + $PROJ_DIR$\..\..\..\os\hal\include\i2c.h + + + $PROJ_DIR$\..\..\..\os\hal\include\mac.h + + + $PROJ_DIR$\..\..\..\os\hal\include\mii.h + + + $PROJ_DIR$\..\..\..\os\hal\include\mmc_spi.h + + + $PROJ_DIR$\..\..\..\os\hal\include\pal.h + + + $PROJ_DIR$\..\..\..\os\hal\include\pwm.h + + + $PROJ_DIR$\..\..\..\os\hal\include\serial.h + + + $PROJ_DIR$\..\..\..\os\hal\include\serial_usb.h + + + $PROJ_DIR$\..\..\..\os\hal\include\spi.h + + + $PROJ_DIR$\..\..\..\os\hal\include\uart.h + + + $PROJ_DIR$\..\..\..\os\hal\include\usb.h + + + + src + + $PROJ_DIR$\..\..\..\os\hal\src\adc.c + + + $PROJ_DIR$\..\..\..\os\hal\src\can.c + + + $PROJ_DIR$\..\..\..\os\hal\src\gpt.c + + + $PROJ_DIR$\..\..\..\os\hal\src\hal.c + + + $PROJ_DIR$\..\..\..\os\hal\src\i2c.c + + + $PROJ_DIR$\..\..\..\os\hal\src\mac.c + + + $PROJ_DIR$\..\..\..\os\hal\src\mmc_spi.c + + + $PROJ_DIR$\..\..\..\os\hal\src\pal.c + + + $PROJ_DIR$\..\..\..\os\hal\src\pwm.c + + + $PROJ_DIR$\..\..\..\os\hal\src\serial.c + + + $PROJ_DIR$\..\..\..\os\hal\src\serial_usb.c + + + $PROJ_DIR$\..\..\..\os\hal\src\spi.c + + + $PROJ_DIR$\..\..\..\os\hal\src\uart.c + + + $PROJ_DIR$\..\..\..\os\hal\src\usb.c + + + + + kernel + + include + + $PROJ_DIR$\..\..\..\os\kernel\include\ch.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chcond.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chdebug.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chdynamic.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chevents.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chheap.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chinline.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chioch.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chlists.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmboxes.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmemcore.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmempools.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmsg.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmtx.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chqueues.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chregistry.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chschd.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chsem.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chstreams.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chsys.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chthreads.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chvt.h + + + + src + + $PROJ_DIR$\..\..\..\os\kernel\src\chcond.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chdebug.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chdynamic.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chevents.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chheap.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chlists.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmboxes.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmemcore.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmempools.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmsg.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmtx.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chqueues.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chregistry.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chschd.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chsem.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chsys.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chthreads.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chvt.c + + + + + platform + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\adc_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\adc_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\can_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\can_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\core_cm3.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld_f100.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld_f103.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld_f105_f107.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pal_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pal_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pwm_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pwm_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\serial_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\serial_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\spi_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\spi_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32_dma.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32_dma.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32f10x.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\uart_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\uart_lld.h + + + + port + + STM32 + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\STM32\cmparams.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\STM32\vectors.s + + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore.c + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore_v7m.c + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore_v7m.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcoreasm_v7m.s + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chtypes.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\cstartup.s + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\nvic.c + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\nvic.h + + + + + test + + $PROJ_DIR$\..\..\..\test\test.c + + + $PROJ_DIR$\..\..\..\test\test.h + + + $PROJ_DIR$\..\..\..\test\testbmk.c + + + $PROJ_DIR$\..\..\..\test\testbmk.h + + + $PROJ_DIR$\..\..\..\test\testdyn.c + + + $PROJ_DIR$\..\..\..\test\testdyn.h + + + $PROJ_DIR$\..\..\..\test\testevt.c + + + $PROJ_DIR$\..\..\..\test\testevt.h + + + $PROJ_DIR$\..\..\..\test\testheap.c + + + $PROJ_DIR$\..\..\..\test\testheap.h + + + $PROJ_DIR$\..\..\..\test\testmbox.c + + + $PROJ_DIR$\..\..\..\test\testmbox.h + + + $PROJ_DIR$\..\..\..\test\testmsg.c + + + $PROJ_DIR$\..\..\..\test\testmsg.h + + + $PROJ_DIR$\..\..\..\test\testmtx.c + + + $PROJ_DIR$\..\..\..\test\testmtx.h + + + $PROJ_DIR$\..\..\..\test\testpools.c + + + $PROJ_DIR$\..\..\..\test\testpools.h + + + $PROJ_DIR$\..\..\..\test\testqueues.c + + + $PROJ_DIR$\..\..\..\test\testqueues.h + + + $PROJ_DIR$\..\..\..\test\testsem.c + + + $PROJ_DIR$\..\..\..\test\testsem.h + + + $PROJ_DIR$\..\..\..\test\testthd.c + + + $PROJ_DIR$\..\..\..\test\testthd.h + + + + $PROJ_DIR$\..\chconf.h + + + $PROJ_DIR$\..\halconf.h + + + $PROJ_DIR$\..\main.c + + + $PROJ_DIR$\..\mcuconf.h + + + + diff --git a/demos/ARMCM3-STM32F107/iar/ch.eww b/demos/ARMCM3-STM32F107/iar/ch.eww new file mode 100644 index 000000000..f9b3b2000 --- /dev/null +++ b/demos/ARMCM3-STM32F107/iar/ch.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\ch.ewp + + + + + diff --git a/demos/ARMCM3-STM32F107/iar/ch.icf b/demos/ARMCM3-STM32F107/iar/ch.icf new file mode 100644 index 000000000..44efbcba3 --- /dev/null +++ b/demos/ARMCM3-STM32F107/iar/ch.icf @@ -0,0 +1,39 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x08000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0802FFFF; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x400; +define symbol __ICFEDIT_size_heap__ = 0x400; +/**** End of ICF editor section. ###ICF###*/ + +/* Size of the IRQ Stack (Main Stack).*/ +define symbol __ICFEDIT_size_irqstack__ = 0x400; + +define memory mem with size = 4G; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {section CSTACK}; +define block IRQSTACK with alignment = 8, size = __ICFEDIT_size_irqstack__ {}; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {}; +define block SYSHEAP with alignment = 8 {section SYSHEAP}; +define block DATABSS with alignment = 8 {readwrite, zeroinit}; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +keep { section .intvec }; + +place at address mem:__ICFEDIT_intvec_start__ {section .intvec}; +place in ROM_region {readonly}; +place at start of RAM_region {block IRQSTACK}; +place in RAM_region {block DATABSS, block HEAP}; +place in RAM_region {block SYSHEAP}; +place at end of RAM_region {block CSTACK}; diff --git a/demos/ARMCM3-STM32F107/main.c b/demos/ARMCM3-STM32F107/main.c index 2020423a6..c68df6de2 100644 --- a/demos/ARMCM3-STM32F107/main.c +++ b/demos/ARMCM3-STM32F107/main.c @@ -71,5 +71,4 @@ int main(void) { TestThread(&SD3); chThdSleepMilliseconds(500); } - return 0; } -- cgit v1.2.3 From 0653f7de9c9a1562a0a74b73510d26df563b2da3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Mar 2011 12:08:15 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2832 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F107/keil/ch.uvproj | 1070 +++++++++++++++++++++++++++++++++ readme.txt | 3 +- 2 files changed, 1072 insertions(+), 1 deletion(-) create mode 100644 demos/ARMCM3-STM32F107/keil/ch.uvproj diff --git a/demos/ARMCM3-STM32F107/keil/ch.uvproj b/demos/ARMCM3-STM32F107/keil/ch.uvproj new file mode 100644 index 000000000..71bb839e7 --- /dev/null +++ b/demos/ARMCM3-STM32F107/keil/ch.uvproj @@ -0,0 +1,1070 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + Demo + 0x4 + ARM-ADS + + + STM32F107VC + STMicroelectronics + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "STARTUP\ST\STM32F10x.s" ("STM32 Startup Code") + UL2CM3(-O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_CL -FS08000000 -FL040000) + 4889 + stm32f10x_lib.h + + + + + + + + + + SFD\ST\STM32F107x\STM32F107.sfr + 0 + + + + ST\STM32F10x\ + ST\STM32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + ch + 1 + 0 + 0 + 1 + 1 + .\lst\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + + + SARMCM3.DLL + + DARMSTM.DLL + -pSTM32F107VC + SARMCM3.DLL + + TARMSTM.DLL + -pSTM32F107VC + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + + + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + + 0 + 8 + + + + + + + + + + + + + + STLink\ST-LINKIII-KEIL.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4100 + + STLink\ST-LINKIII-KEIL.dll + "" () + + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x20010000 + 0x1 + + + + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + __heap_base__=Image$$RW_IRAM1$$ZI$$Limit __heap_end__=Image$$RW_IRAM2$$Base + + ..\;..\..\..\os\kernel\include;..\..\..\os\ports\RVCT\ARMCMx;..\..\..\os\ports\RVCT\ARMCMx\STM32;..\..\..\os\hal\include;..\..\..\os\hal\platforms\STM32;..\..\..\os\various;..\..\..\boards\OLIMEX_STM32_P107;..\..\..\test + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + + --cpreproc + + + ..\..\..\boards\OLIMEX_STM32_P107;..\..\..\os\ports\RVCT\ARMCMx\STM32 + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + board + + + board.c + 1 + ..\..\..\boards\OLIMEX_STM32_P107\board.c + + + board.h + 5 + ..\..\..\boards\OLIMEX_STM32_P107\board.h + + + + + port + + + cstartup.s + 2 + ..\..\..\os\ports\RVCT\ARMCMx\cstartup.s + + + vectors.s + 2 + ..\..\..\os\ports\RVCT\ARMCMx\STM32\vectors.s + + + chcoreasm_v7m.s + 2 + ..\..\..\os\ports\RVCT\ARMCMx\chcoreasm_v7m.s + + + chcore.c + 1 + ..\..\..\os\ports\RVCT\ARMCMx\chcore.c + + + chcore_v7m.c + 1 + ..\..\..\os\ports\RVCT\ARMCMx\chcore_v7m.c + + + nvic.c + 1 + ..\..\..\os\ports\RVCT\ARMCMx\nvic.c + + + chcore.h + 5 + ..\..\..\os\ports\RVCT\ARMCMx\chcore.h + + + chcore_v7m.h + 5 + ..\..\..\os\ports\RVCT\ARMCMx\chcore_v7m.h + + + chtypes.h + 5 + ..\..\..\os\ports\RVCT\ARMCMx\chtypes.h + + + nvic.h + 5 + ..\..\..\os\ports\RVCT\ARMCMx\nvic.h + + + + + kernel + + + chcond.c + 1 + ..\..\..\os\kernel\src\chcond.c + + + chdebug.c + 1 + ..\..\..\os\kernel\src\chdebug.c + + + chdynamic.c + 1 + ..\..\..\os\kernel\src\chdynamic.c + + + chevents.c + 1 + ..\..\..\os\kernel\src\chevents.c + + + chheap.c + 1 + ..\..\..\os\kernel\src\chheap.c + + + chlists.c + 1 + ..\..\..\os\kernel\src\chlists.c + + + chmboxes.c + 1 + ..\..\..\os\kernel\src\chmboxes.c + + + chmemcore.c + 1 + ..\..\..\os\kernel\src\chmemcore.c + + + chmempools.c + 1 + ..\..\..\os\kernel\src\chmempools.c + + + chmsg.c + 1 + ..\..\..\os\kernel\src\chmsg.c + + + chmtx.c + 1 + ..\..\..\os\kernel\src\chmtx.c + + + chqueues.c + 1 + ..\..\..\os\kernel\src\chqueues.c + + + chregistry.c + 1 + ..\..\..\os\kernel\src\chregistry.c + + + chschd.c + 1 + ..\..\..\os\kernel\src\chschd.c + + + chsem.c + 1 + ..\..\..\os\kernel\src\chsem.c + + + chsys.c + 1 + ..\..\..\os\kernel\src\chsys.c + + + chthreads.c + 1 + ..\..\..\os\kernel\src\chthreads.c + + + chvt.c + 1 + ..\..\..\os\kernel\src\chvt.c + + + ch.h + 5 + ..\..\..\os\kernel\include\ch.h + + + chbsem.h + 5 + ..\..\..\os\kernel\include\chbsem.h + + + chcond.h + 5 + ..\..\..\os\kernel\include\chcond.h + + + chdebug.h + 5 + ..\..\..\os\kernel\include\chdebug.h + + + chdynamic.h + 5 + ..\..\..\os\kernel\include\chdynamic.h + + + chevents.h + 5 + ..\..\..\os\kernel\include\chevents.h + + + chfiles.h + 5 + ..\..\..\os\kernel\include\chfiles.h + + + chheap.h + 5 + ..\..\..\os\kernel\include\chheap.h + + + chinline.h + 5 + ..\..\..\os\kernel\include\chinline.h + + + chioch.h + 5 + ..\..\..\os\kernel\include\chioch.h + + + chlists.h + 5 + ..\..\..\os\kernel\include\chlists.h + + + chmboxes.h + 5 + ..\..\..\os\kernel\include\chmboxes.h + + + chmemcore.h + 5 + ..\..\..\os\kernel\include\chmemcore.h + + + chmempools.h + 5 + ..\..\..\os\kernel\include\chmempools.h + + + chmsg.h + 5 + ..\..\..\os\kernel\include\chmsg.h + + + chmtx.h + 5 + ..\..\..\os\kernel\include\chmtx.h + + + chqueues.h + 5 + ..\..\..\os\kernel\include\chqueues.h + + + chregistry.h + 5 + ..\..\..\os\kernel\include\chregistry.h + + + chschd.h + 5 + ..\..\..\os\kernel\include\chschd.h + + + chsem.h + 5 + ..\..\..\os\kernel\include\chsem.h + + + chstreams.h + 5 + ..\..\..\os\kernel\include\chstreams.h + + + chsys.h + 5 + ..\..\..\os\kernel\include\chsys.h + + + chthreads.h + 5 + ..\..\..\os\kernel\include\chthreads.h + + + chvt.h + 5 + ..\..\..\os\kernel\include\chvt.h + + + + + hal + + + adc.c + 1 + ..\..\..\os\hal\src\adc.c + + + can.c + 1 + ..\..\..\os\hal\src\can.c + + + gpt.c + 1 + ..\..\..\os\hal\src\gpt.c + + + hal.c + 1 + ..\..\..\os\hal\src\hal.c + + + i2c.c + 1 + ..\..\..\os\hal\src\i2c.c + + + mac.c + 1 + ..\..\..\os\hal\src\mac.c + + + mmc_spi.c + 1 + ..\..\..\os\hal\src\mmc_spi.c + + + pal.c + 1 + ..\..\..\os\hal\src\pal.c + + + pwm.c + 1 + ..\..\..\os\hal\src\pwm.c + + + serial.c + 1 + ..\..\..\os\hal\src\serial.c + + + serial_usb.c + 1 + ..\..\..\os\hal\src\serial_usb.c + + + spi.c + 1 + ..\..\..\os\hal\src\spi.c + + + uart.c + 1 + ..\..\..\os\hal\src\uart.c + + + usb.c + 1 + ..\..\..\os\hal\src\usb.c + + + adc.h + 5 + ..\..\..\os\hal\include\adc.h + + + can.h + 5 + ..\..\..\os\hal\include\can.h + + + gpt.h + 5 + ..\..\..\os\hal\include\gpt.h + + + hal.h + 5 + ..\..\..\os\hal\include\hal.h + + + i2c.h + 5 + ..\..\..\os\hal\include\i2c.h + + + mac.h + 5 + ..\..\..\os\hal\include\mac.h + + + mii.h + 5 + ..\..\..\os\hal\include\mii.h + + + mmc_spi.h + 5 + ..\..\..\os\hal\include\mmc_spi.h + + + pal.h + 5 + ..\..\..\os\hal\include\pal.h + + + pwm.h + 5 + ..\..\..\os\hal\include\pwm.h + + + serial.h + 5 + ..\..\..\os\hal\include\serial.h + + + serial_usb.h + 5 + ..\..\..\os\hal\include\serial_usb.h + + + spi.h + 5 + ..\..\..\os\hal\include\spi.h + + + uart.h + 5 + ..\..\..\os\hal\include\uart.h + + + usb.h + 5 + ..\..\..\os\hal\include\usb.h + + + + + platform + + + adc_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\adc_lld.c + + + can_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\can_lld.c + + + hal_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\hal_lld.c + + + pal_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\pal_lld.c + + + pwm_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\pwm_lld.c + + + serial_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\serial_lld.c + + + spi_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\spi_lld.c + + + stm32_dma.c + 1 + ..\..\..\os\hal\platforms\STM32\stm32_dma.c + + + uart_lld.c + 1 + ..\..\..\os\hal\platforms\STM32\uart_lld.c + + + adc_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\adc_lld.h + + + can_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\can_lld.h + + + core_cm3.h + 5 + ..\..\..\os\hal\platforms\STM32\core_cm3.h + + + hal_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\hal_lld.h + + + hal_lld_f103.h + 5 + ..\..\..\os\hal\platforms\STM32\hal_lld_f103.h + + + pal_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\pal_lld.h + + + pwm_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\pwm_lld.h + + + serial_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\serial_lld.h + + + spi_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\spi_lld.h + + + stm32_dma.h + 5 + ..\..\..\os\hal\platforms\STM32\stm32_dma.h + + + stm32f10x.h + 5 + ..\..\..\os\hal\platforms\STM32\stm32f10x.h + + + uart_lld.h + 5 + ..\..\..\os\hal\platforms\STM32\uart_lld.h + + + + + test + + + test.c + 1 + ..\..\..\test\test.c + + + testbmk.c + 1 + ..\..\..\test\testbmk.c + + + testdyn.c + 1 + ..\..\..\test\testdyn.c + + + testevt.c + 1 + ..\..\..\test\testevt.c + + + testheap.c + 1 + ..\..\..\test\testheap.c + + + testmbox.c + 1 + ..\..\..\test\testmbox.c + + + testmsg.c + 1 + ..\..\..\test\testmsg.c + + + testmtx.c + 1 + ..\..\..\test\testmtx.c + + + testpools.c + 1 + ..\..\..\test\testpools.c + + + testqueues.c + 1 + ..\..\..\test\testqueues.c + + + testsem.c + 1 + ..\..\..\test\testsem.c + + + testthd.c + 1 + ..\..\..\test\testthd.c + + + test.h + 5 + ..\..\..\test\test.h + + + testbmk.h + 5 + ..\..\..\test\testbmk.h + + + testdyn.h + 5 + ..\..\..\test\testdyn.h + + + testevt.h + 5 + ..\..\..\test\testevt.h + + + testheap.h + 5 + ..\..\..\test\testheap.h + + + testmbox.h + 5 + ..\..\..\test\testmbox.h + + + testmsg.h + 5 + ..\..\..\test\testmsg.h + + + testmtx.h + 5 + ..\..\..\test\testmtx.h + + + testpools.h + 5 + ..\..\..\test\testpools.h + + + testqueues.h + 5 + ..\..\..\test\testqueues.h + + + testsem.h + 5 + ..\..\..\test\testsem.h + + + testthd.h + 5 + ..\..\..\test\testthd.h + + + + + demo + + + main.c + 1 + ..\main.c + + + + + + + +
diff --git a/readme.txt b/readme.txt index 677fbea6c..ea1ef41ee 100644 --- a/readme.txt +++ b/readme.txt @@ -81,7 +81,8 @@ - NEW: Improved setup packets handling in the USB driver through a specific callback. - OPT: Simplified Serial over USB driver configuration. -- CHANGE: Renamed the demo ARMCM3-STM32F107-GCC in ARMCM3-STM32F107. +- CHANGE: Renamed the demo ARMCM3-STM32F107-GCC in ARMCM3-STM32F107 and added + IAR and Keil projects. - CHANGE: Now the ARMCM3-STM32F107 demo targets the board Olimex STM32-P107 as default. - CHANGE: Removed all the prefixes from the structure/union field names -- cgit v1.2.3 From 84cc66dce9b5c8d0cfee1dcb5126f66a60c3f226 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Mar 2011 17:58:45 +0000 Subject: Fixed bugs 3226671 and 3226657. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2833 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore_v6m.c | 9 +-------- os/ports/GCC/ARMCMx/chcore_v6m.h | 25 +++++++++++++++++++++++-- os/ports/IAR/ARMCMx/chcore_v6m.h | 2 +- os/ports/RVCT/ARMCMx/chcore_v6m.h | 2 +- readme.txt | 4 ++++ 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index 553277bef..3574c620f 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -110,16 +110,9 @@ void _port_switch_from_isr(void) { #if !defined(__DOXYGEN__) __attribute__((naked)) #endif -void port_switch(Thread *ntp, Thread *otp) { +void _port_switch(Thread *ntp, Thread *otp) { register struct intctx *r13 asm ("r13"); - /* Stack overflow check, if enabled.*/ -#if CH_DBG_ENABLE_STACK_CHECK - if ((void *)(r13 - 1) < (void *)(otp + 1)) - asm volatile ("movs r0, #0 \n\t" - "b chDbgPanic"); -#endif /* CH_DBG_ENABLE_STACK_CHECK */ - PUSH_CONTEXT(r13); otp->p_ctx.r13 = r13; diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 1d3198a7f..0212fe6b3 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -82,7 +82,7 @@ struct intctx { * reduce this value to zero when compiling with optimizations. */ #ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#define IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -200,11 +200,32 @@ struct intctx { #define port_wait_for_interrupt() #endif +/** + * @brief Performs a context switch between two threads. + * @details This is the most critical code in any port, this function + * is responsible for the context switch between 2 threads. + * @note The implementation of this code affects directly the context + * switch performance so optimize here as much as you can. + * + * @param[in] ntp the thread to be switched in + * @param[in] otp the thread to be switched out + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define port_switch(ntp, otp) _port_switch(ntp, otp) +#else +#define port_switch(ntp, otp) { \ + register struct intctx *r13 asm ("r13"); \ + if ((void *)(r13 - 1) < (void *)(otp + 1)) \ + chDbgPanic("stack overflow"); \ + _port_switch(ntp, otp); \ +} +#endif + #ifdef __cplusplus extern "C" { #endif void port_halt(void); - void port_switch(Thread *ntp, Thread *otp); + void _port_switch(Thread *ntp, Thread *otp); void _port_irq_epilogue(regarm_t lr); void _port_switch_from_isr(void); void _port_thread_start(void); diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index 9e8d27ef7..a2d5ef577 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -82,7 +82,7 @@ struct intctx { * reduce this value to zero when compiling with optimizations. */ #ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#define IDLE_THREAD_STACK_SIZE 16 #endif /** diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 547ad9bf3..970fc3b8d 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -82,7 +82,7 @@ struct intctx { * reduce this value to zero when compiling with optimizations. */ #ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#define IDLE_THREAD_STACK_SIZE 16 #endif /** diff --git a/readme.txt b/readme.txt index ea1ef41ee..e19d8f9d8 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,10 @@ ***************************************************************************** *** 2.3.1 *** +- FIX: Fixed insufficient idle thread stack in Cortex-M0-GCC port (bug 3226671) + (backported to 2.2.3). +- FIX: Fixed stack checking in Cortex-M0-GCC port (bug 3226657)(backported + to 2.2.3). - FIX: Fixed wrong checks in PAL driver (bug 3224681)(backported to 2.2.3). - FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported -- cgit v1.2.3 From 9d812b5db3c21ff09e30a115c7643f7fec5492a3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Mar 2011 18:19:39 +0000 Subject: Added stack checking to the RVCT Cortex-Mx port. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2835 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/RVCT/ARMCMx/chcore_v6m.h | 9 +++++++++ os/ports/RVCT/ARMCMx/chcore_v7m.h | 11 ++++++++++- readme.txt | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 970fc3b8d..9c5e35b33 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -208,7 +208,16 @@ struct intctx { * @param[in] ntp the thread to be switched in * @param[in] otp the thread to be switched out */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) #define port_switch(ntp, otp) _port_switch(ntp, otp) +#else +#define port_switch(ntp, otp) { \ + struct intctx *r13 = (struct intctx *)__current_sp(); \ + if ((void *)(r13 - 1) < (void *)(otp + 1)) \ + chDbgPanic("stack overflow"); \ + _port_switch(ntp, otp); \ +} +#endif #ifdef __cplusplus extern "C" { diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index 45f9843e3..3a4cbe381 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -234,7 +234,16 @@ struct intctx { * @param[in] ntp the thread to be switched in * @param[in] otp the thread to be switched out */ -#define port_switch(ntp, otp) _port_switch(ntp, otp) +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define port_switch(ntp, otp) _port_switch(ntp, otp) +#else +#define port_switch(ntp, otp) { \ + struct intctx *r13 = (struct intctx *)__current_sp(); \ + if ((void *)(r13 - 1) < (void *)(otp + 1)) \ + chDbgPanic("stack overflow"); \ + _port_switch(ntp, otp); \ +} +#endif #ifdef __cplusplus extern "C" { diff --git a/readme.txt b/readme.txt index e19d8f9d8..a2201e6ba 100644 --- a/readme.txt +++ b/readme.txt @@ -79,6 +79,8 @@ - FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). +- NEW: Implemented stack checking in the Cortex-Mx RVCT port (backported + to 2.2.3). - NEW: Added support for PLL3 in STM32 HAL driver. Note, the format of the mcuconf.h file is changed for STM32F105/STM32F107 devices. - NEW: Added board files for the Olimex STM32-P107. -- cgit v1.2.3 From 506212845dd0644b2755191da1252380aababd24 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Mar 2011 13:12:41 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2839 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile | 3478 ++++++++++++++++++++------------------ docs/readme.txt | 6 +- docs/rsc/custom.css | 471 +++++- docs/rsc/footer.html | 7 +- docs/rsc/header.html | 41 +- docs/rsc/layout.xml | 36 +- docs/rsc/tabs.css | 102 -- os/hal/include/usb.h | 3 +- os/hal/platforms/STM32/pwm_lld.c | 16 +- os/various/usb_msc.c | 2 + readme.txt | 5 + test/testbmk.c | 16 +- test/testdyn.c | 20 +- test/testevt.c | 8 +- test/testheap.c | 4 +- test/testmbox.c | 4 +- test/testmsg.c | 4 +- test/testmtx.c | 16 +- test/testpools.c | 4 +- test/testqueues.c | 4 +- test/testsem.c | 8 +- test/testthd.c | 2 +- 22 files changed, 2315 insertions(+), 1942 deletions(-) delete mode 100644 docs/rsc/tabs.css diff --git a/docs/Doxyfile b/docs/Doxyfile index 82fbc181d..cec7e4b49 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -1,1691 +1,1787 @@ -# Doxyfile 1.6.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = ChibiOS/RT - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 2.3.1 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = "iclass=@par Function Class:\n This is an \ - I-Class API, this function can be \ - invoked from within a system lock zone by both \ - threads and interrupt handlers." \ - "sclass=@par Function Class:\n This is an \ - S-Class API, this function can be \ - invoked from within a system lock zone by threads \ - only." \ - "api=@par Function Class:\n Normal API, this \ - function can be invoked by regular system threads \ - but not from within a lock zone." \ - "notapi=@par Function Class:\n Not an API, this \ - function is for internal use only." \ - "isr=@par Function Class:\n Interrupt handler, \ - this function should not be directly invoked." \ - "init=@par Function Class:\n Initializer, this \ - function just initializes an object and can be \ - invoked before the kernel is initialized." \ - "special=@par Function Class:\n Special function, \ - this function has special requirements see the \ - notes." - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. Note that for custom extensions you also need to set -# FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = NO - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = ./rsc/layout.xml - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../docs/src \ - ../os/kernel \ - ../os/kernel/include \ - ../os/kernel/src \ - ../os/kernel/templates \ - ../os/ports \ - ../os/ports/GCC/ARM \ - ../os/ports/GCC/ARM\LPC214x \ - ../os/ports/GCC/ARM\AT91SAM7 \ - ../os/ports/GCC/ARMCMx \ - ../os/ports/GCC/ARMCMx/STM32 \ - ../os/ports/GCC/ARMCMx/LPC11xx \ - ../os/ports/GCC/ARMCMx/LPC13xx \ - ../os/ports/GCC/PPC \ - ../os/ports/GCC/AVR \ - ../os/ports/GCC/MSP430 \ - ../os/ports/IAR/ARMCMx \ - ../os/ports/IAR/ARMCMx/STM32 \ - ../os/ports/IAR/ARMCMx/LPC11xx \ - ../os/ports/IAR/ARMCMx/LPC13xx \ - ../os/ports/RVCT/ARMCMx \ - ../os/ports/RVCT/ARMCMx/STM32 \ - ../os/ports/RVCT/ARMCMx/LPC11xx \ - ../os/ports/RVCT/ARMCMx/LPC13xx \ - ../os/ports/cosmic/STM8 \ - ../os/ports/RC/STM8 \ - ../os/hal \ - ../os/hal/dox \ - ../os/hal/include \ - ../os/hal/src \ - ../os/hal/templates \ - ../os/hal/platforms \ - ../os/hal/platforms/AT91SAM7/platform.dox \ - ../os/hal/platforms/AVR/platform.dox \ - ../os/hal/platforms/LPC11xx/platform.dox \ - ../os/hal/platforms/LPC13xx/platform.dox \ - ../os/hal/platforms/LPC214x/platform.dox \ - ../os/hal/platforms/MSP430/platform.dox \ - ../os/hal/platforms/SPC56x/platform.dox \ - ../os/hal/platforms/STM32/platform.dox \ - ../os/hal/platforms/STM8L/platform.dox \ - ../os/hal/platforms/STM8S/platform.dox \ - ../os/various \ - ../test \ - ../ext/ext.dox - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.ddf \ - *.s - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = ../os/hal/platforms/STM32/stm32f10x.h \ - ../os/hal/platforms/STM8/stm8s.h \ - ../os/hal/platforms/STM8/stm8s_type.h \ - ../os/hal/platforms/LPC11xx/LPC11xx.h \ - ../os/hal/platforms/LPC11xx/system_LPC11xx.h \ - ../os/hal/platforms/LPC13xx/LPC13xx.h \ - ../os/hal/platforms/LPC13xx/system_LPC13xx.h - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = ./rsc - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = NO - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = ./rsc/header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = ./rsc/footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = ./rsc/custom.css - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = YES - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = ../ChibiOS_RT.chm - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = "\"C:/Program Files/HTML Help Workshop/hhc.exe\"" - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = __DOXYGEN__ \ - CH_USE_WAITEXIT=1 \ - CH_USE_SEMAPHORES=1 \ - CH_USE_SEMSW=1 \ - CH_USE_MUTEXES=1 \ - CH_USE_CONDVARS=1 \ - CH_USE_CONDVARS_TIMEOUT=1 \ - CH_USE_EVENTS=1 \ - CH_USE_EVENTS_TIMEOUT=1 \ - CH_USE_QUEUES=1 \ - CH_USE_MEMCORE=1 \ - CH_USE_HEAP=1 \ - CH_USE_MEMPOOLS=1 \ - CH_USE_MESSAGES=1 \ - CH_USE_MAILBOXES=1 \ - CH_USE_DYNAMIC=1 \ - CH_USE_REGISTRY=1 \ - CH_DBG_ENABLE_ASSERTS=1 \ - CH_DBG_ENABLE_CHECKS=1 \ - CH_DBG_ENABLE_TRACE=1 \ - CH_DBG_ENABLE_STACK_CHECK=1 \ - CH_DBG_FILL_THREADS=1 \ - CH_DBG_THREADS_PROFILING=1 \ - CH_USE_ROUNDROBIN=1 - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = NO - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 8 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = YES - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = NO - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = NO - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 20 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 3 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES +# Doxyfile 1.7.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = ChibiOS/RT + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 2.3.1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = NO + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 2 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = "iclass=@par Function Class:\n This is an \ + I-Class API, this function can be \ + invoked from within a system lock zone by both \ + threads and interrupt handlers." \ + "sclass=@par Function Class:\n This is an \ + S-Class API, this function can be \ + invoked from within a system lock zone by threads \ + only." \ + "api=@par Function Class:\n Normal API, this \ + function can be invoked by regular system threads \ + but not from within a lock zone." \ + "notapi=@par Function Class:\n Not an API, this \ + function is for internal use only." \ + "isr=@par Function Class:\n Interrupt handler, \ + this function should not be directly invoked." \ + "init=@par Function Class:\n Initializer, this \ + function just initializes an object and can be \ + invoked before the kernel is initialized." \ + "special=@par Function Class:\n Special function, \ + this function has special requirements see the \ + notes." + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = NO + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = ./rsc/layout.xml + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../docs/src \ + ../os/kernel \ + ../os/kernel/include \ + ../os/kernel/src \ + ../os/kernel/templates \ + ../os/ports \ + ../os/ports/GCC/ARM \ + ../os/ports/GCC/ARM\LPC214x \ + ../os/ports/GCC/ARM\AT91SAM7 \ + ../os/ports/GCC/ARMCMx \ + ../os/ports/GCC/ARMCMx/STM32 \ + ../os/ports/GCC/ARMCMx/LPC11xx \ + ../os/ports/GCC/ARMCMx/LPC13xx \ + ../os/ports/GCC/PPC \ + ../os/ports/GCC/AVR \ + ../os/ports/GCC/MSP430 \ + ../os/ports/IAR/ARMCMx \ + ../os/ports/IAR/ARMCMx/STM32 \ + ../os/ports/IAR/ARMCMx/LPC11xx \ + ../os/ports/IAR/ARMCMx/LPC13xx \ + ../os/ports/RVCT/ARMCMx \ + ../os/ports/RVCT/ARMCMx/STM32 \ + ../os/ports/RVCT/ARMCMx/LPC11xx \ + ../os/ports/RVCT/ARMCMx/LPC13xx \ + ../os/ports/cosmic/STM8 \ + ../os/ports/RC/STM8 \ + ../os/hal \ + ../os/hal/dox \ + ../os/hal/include \ + ../os/hal/src \ + ../os/hal/templates \ + ../os/hal/platforms \ + ../os/hal/platforms/AT91SAM7/platform.dox \ + ../os/hal/platforms/AVR/platform.dox \ + ../os/hal/platforms/LPC11xx/platform.dox \ + ../os/hal/platforms/LPC13xx/platform.dox \ + ../os/hal/platforms/LPC214x/platform.dox \ + ../os/hal/platforms/MSP430/platform.dox \ + ../os/hal/platforms/SPC56x/platform.dox \ + ../os/hal/platforms/STM32/platform.dox \ + ../os/hal/platforms/STM8L/platform.dox \ + ../os/hal/platforms/STM8S/platform.dox \ + ../os/various \ + ../test \ + ../ext/ext.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.ddf \ + *.s + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = ../os/hal/platforms/STM32/stm32f10x.h \ + ../os/hal/platforms/STM8/stm8s.h \ + ../os/hal/platforms/STM8/stm8s_type.h \ + ../os/hal/platforms/LPC11xx/LPC11xx.h \ + ../os/hal/platforms/LPC11xx/system_LPC11xx.h \ + ../os/hal/platforms/LPC13xx/LPC13xx.h \ + ../os/hal/platforms/LPC13xx/system_LPC13xx.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = ./rsc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = ./rsc/header.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = ./rsc/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ../ChibiOS_RT.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = "\"C:/Program Files/HTML Help Workshop/hhc.exe\"" + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [0,1..20]) +# that doxygen will group on one line in the generated HTML documentation. +# Note that a value of 0 will completely suppress the enum values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 8 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, svg, gif or svg. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 20 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 3 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/docs/readme.txt b/docs/readme.txt index e89c7161d..e50b98068 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -6,9 +6,9 @@ order to access directly the doxigen documentation. *** Documentation build procedure *** The following software must be installed: -- Doxygen 1.6.3 or later. -- Graphviz 2.21 or later. The ./bin directory must be specified in the path in - order to make Graphviz accessible by Doxygen. +- Doxygen 1.7.3 or later. +- Graphviz 2.26.3 or later. The ./bin directory must be specified in the path + in order to make Graphviz accessible by Doxygen. Build procedure: - Run Doxywizard. diff --git a/docs/rsc/custom.css b/docs/rsc/custom.css index 32a1f4dc3..4ac73ab1a 100644 --- a/docs/rsc/custom.css +++ b/docs/rsc/custom.css @@ -1,3 +1,5 @@ +/* The standard CSS for doxygen */ + body, table, div, p, dl { font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; font-size: 12px; @@ -6,7 +8,6 @@ body, table, div, p, dl { /* @group Heading Levels */ h1 { - text-align: center; font-size: 150%; } @@ -18,15 +19,52 @@ h3 { font-size: 100%; } +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + /* @end */ caption { font-weight: bold; } -div.qindex, div.navpath, div.navtab{ - background-color: #e8eef2; - border: 1px solid #84b0c7; +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; text-align: center; margin: 2px; padding: 2px; @@ -44,13 +82,13 @@ div.navtab { /* @group Link Styling */ a { - color: #153788; + color: #3D578C; font-weight: normal; text-decoration: none; } .contents a:visited { - color: #1b77c5; + color: #4665A2; } a:hover { @@ -63,9 +101,13 @@ a.qindex { a.qindexHL { font-weight: bold; - background-color: #6666cc; + background-color: #9CAFD4; color: #ffffff; - border: 1px double #9295C2; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; } a.el { @@ -76,9 +118,11 @@ a.elRef { } a.code { + color: #4665A2; } a.codeRef { + color: #4665A2; } /* @end */ @@ -93,10 +137,14 @@ dl.el { } pre.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; + border: 1px solid #C4CFE5; + background-color: #FBFCFD; padding: 4px 6px; margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; } div.ah { @@ -104,13 +152,22 @@ div.ah { font-weight: bold; color: #ffffff; margin-bottom: 3px; - margin-top: 3px + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); } div.groupHeader { margin-left: 16px; margin-top: 12px; - margin-bottom: 6px; font-weight: bold; } @@ -122,27 +179,32 @@ div.groupText { body { background: white; color: black; - margin-right: 20px; - margin-left: 20px; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; } td.indexkey { - background-color: #e8eef2; + background-color: #EBEFF6; font-weight: bold; - border: 1px solid #CCCCCC; + border: 1px solid #C4CFE5; margin: 2px 0px 2px 0; padding: 2px 10px; } td.indexvalue { - background-color: #e8eef2; - border: 1px solid #CCCCCC; + background-color: #EBEFF6; + border: 1px solid #C4CFE5; padding: 2px 10px; margin: 2px 0px; } tr.memlist { - background-color: #f0f0f0; + background-color: #EEF1F7; } p.formulaDsp { @@ -157,6 +219,27 @@ img.formulaInl { vertical-align: middle; } +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + /* @group Code Colorization */ span.keyword { @@ -205,6 +288,7 @@ span.vhdllogic { /* @end */ +/* .search { color: #003399; font-weight: bold; @@ -221,6 +305,7 @@ input.search { font-weight: normal; background-color: #e8eef2; } +*/ td.tiny { font-size: 75%; @@ -229,26 +314,35 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #84b0c7; + border: 1px solid #A3B4D7; } th.dirtab { - background: #e8eef2; + background: #EBEFF6; font-weight: bold; } hr { - height: 0; + height: 0px; border: none; - border-top: 1px solid #666; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; } /* @group Member Descriptions */ +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #FAFAFA; + background-color: #F9FAFC; border: none; margin: 4px; padding: 1px 0 0 8px; @@ -260,11 +354,16 @@ hr { } .memItemLeft, .memItemRight, .memTemplParams { - border-top: 1px solid #ccc; + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; } .memTemplParams { - color: #606060; + color: #4665A2; + white-space: nowrap; } /* @end */ @@ -275,14 +374,14 @@ hr { .memtemplate { font-size: 80%; - color: #606060; + color: #4665A2; font-weight: normal; - margin-left: 3px; + margin-left: 9px; } .memnav { - background-color: #e8eef2; - border: 1px solid #84b0c7; + background-color: #EBEFF6; + border: 1px solid #A3B4D7; text-align: center; margin: 2px; margin-right: 15px; @@ -291,39 +390,62 @@ hr { .memitem { padding: 0; + margin-bottom: 10px; } .memname { - white-space: nowrap; - font-weight: bold; -} - -.memproto, .memdoc { - border: 1px solid #84b0c7; + white-space: nowrap; + font-weight: bold; + margin-left: 6px; } .memproto { - padding: 0; - background-color: #d5e1e8; - font-weight: bold; - -webkit-border-top-left-radius: 8px; - -webkit-border-top-right-radius: 8px; - -moz-border-radius-topleft: 8px; - -moz-border-radius-topright: 8px; -} + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; -.memdoc { - padding: 2px 5px; - background-color: #eef3f5; - border-top-width: 0; - -webkit-border-bottom-left-radius: 8px; - -webkit-border-bottom-right-radius: 8px; - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; } -.memdoc p, .memdoc dl, .memdoc ul { - margin: 6px 0; +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); } .paramkey { @@ -342,6 +464,28 @@ hr { font-style: normal; } +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + /* @end */ /* @group Directory (tree) */ @@ -350,7 +494,7 @@ hr { .ftvtree { font-family: sans-serif; - margin: 0.5em; + margin: 0px; } /* these are for tree view when used as main index */ @@ -358,6 +502,7 @@ hr { .directory { font-size: 9pt; font-weight: bold; + margin: 5px; } .directory h3 { @@ -435,7 +580,221 @@ proper pixel height of your image. /* @end */ +div.dynheader { + margin-top: 8px; +} + address { font-style: normal; - color: #333; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; } + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0D000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectbrief +{ + font: 120% arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + diff --git a/docs/rsc/footer.html b/docs/rsc/footer.html index 08db8f4ed..a90299b83 100644 --- a/docs/rsc/footer.html +++ b/docs/rsc/footer.html @@ -1,4 +1,7 @@ -
-Generated on $datetime for $projectname by doxygen $doxygenversion
+ + + diff --git a/docs/rsc/header.html b/docs/rsc/header.html index f79857920..3af6e226b 100644 --- a/docs/rsc/header.html +++ b/docs/rsc/header.html @@ -1,17 +1,28 @@ - - + + + + $title - - - - - - - - - - - + + + + + + + + + +
+
+
ChibiOS/RT LogoChibiOS/RT

Architecture - Reference Manual - Guides
+ + + + +
+
ChibiOS/RT 2.3.1
+
-
\ No newline at end of file + diff --git a/docs/rsc/layout.xml b/docs/rsc/layout.xml index 4dc8961aa..4c98c929e 100644 --- a/docs/rsc/layout.xml +++ b/docs/rsc/layout.xml @@ -2,24 +2,24 @@ - - + + - - + + - + - - + + - - + + - - + + @@ -108,20 +108,20 @@ + + - - + + - - @@ -130,15 +130,14 @@ - - + @@ -152,10 +151,11 @@ + - + diff --git a/docs/rsc/tabs.css b/docs/rsc/tabs.css deleted file mode 100644 index 16b1be0d7..000000000 --- a/docs/rsc/tabs.css +++ /dev/null @@ -1,102 +0,0 @@ -/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ - -DIV.tabs -{ - float : left; - width : 100%; - background : url("tab_b.gif") repeat-x bottom; - margin-bottom : 4px; -} - -DIV.tabs UL -{ - margin : 0px; - padding-left : 10px; - list-style : none; -} - -DIV.tabs LI, DIV.tabs FORM -{ - display : inline; - margin : 0px; - padding : 0px; -} - -DIV.tabs FORM -{ - float : right; -} - -DIV.tabs A -{ - float : left; - background : url("tab_r.gif") no-repeat right top; - border-bottom : 1px solid #84B0C7; - font-size : 8px; - font-weight : bold; - text-decoration : none; -} - -DIV.tabs A:hover -{ - background-position: 100% -150px; -} - -DIV.tabs A:link, DIV.tabs A:visited, -DIV.tabs A:active, DIV.tabs A:hover -{ - color: #1A419D; -} - -DIV.tabs SPAN -{ - float : left; - display : block; - background : url("tab_l.gif") no-repeat left top; - padding : 5px 9px; - white-space : nowrap; -} - -DIV.tabs INPUT -{ - float : right; - display : inline; - font-size : 1em; -} - -DIV.tabs TD -{ - font-size : 8px; - font-weight : bold; - text-decoration : none; -} - - - -/* Commented Backslash Hack hides rule from IE5-Mac \*/ -DIV.tabs SPAN {float : none;} -/* End IE5-Mac hack */ - -DIV.tabs A:hover SPAN -{ - background-position: 0% -150px; -} - -DIV.tabs LI.current A -{ - background-position: 100% -150px; - border-width : 0px; -} - -DIV.tabs LI.current SPAN -{ - background-position: 0% -150px; - padding-bottom : 6px; -} - -DIV.navpath -{ - background : none; - border : none; - border-bottom : 1px solid #84B0C7; -} diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h index b70ce4160..c4cf68fe2 100644 --- a/os/hal/include/usb.h +++ b/os/hal/include/usb.h @@ -416,7 +416,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @brief Common ISR code, usb event callback. * * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number + * @param[in] evt USB event code * * @notapi */ @@ -429,7 +429,6 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, * @brief Common ISR code, SOF callback. * * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number * * @notapi */ diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 7469c7fca..ac41edbfd 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -111,7 +111,7 @@ static void serve_interrupt(PWMDriver *pwmp) { sr = pwmp->tim->SR; sr &= pwmp->tim->DIER; pwmp->tim->SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | - TIM_SR_CC4IF | TIM_SR_UIF); + TIM_SR_CC4IF | TIM_SR_UIF); if ((sr & TIM_SR_CC1IF) != 0) pwmp->config->channels[0].callback(pwmp); if ((sr & TIM_SR_CC2IF) != 0) @@ -354,13 +354,13 @@ void pwm_lld_start(PWMDriver *pwmp) { /* All channels configured in PWM1 mode with preload enabled and will stay that way until the driver is stopped.*/ pwmp->tim->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 | - TIM_CCMR1_OC1PE | - TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2 | - TIM_CCMR1_OC2PE; + TIM_CCMR1_OC1PE | + TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2 | + TIM_CCMR1_OC2PE; pwmp->tim->CCMR2 = TIM_CCMR2_OC3M_1 | TIM_CCMR2_OC3M_2 | - TIM_CCMR2_OC3PE | - TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4M_2 | - TIM_CCMR2_OC4PE; + TIM_CCMR2_OC3PE | + TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4M_2 | + TIM_CCMR2_OC4PE; } else { /* Driver re-configuration scenario, it must be stopped first.*/ @@ -444,7 +444,7 @@ void pwm_lld_stop(PWMDriver *pwmp) { pwmp->tim->BDTR = 0; pwmp->tim->DIER = 0; pwmp->tim->SR = 0; - pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ + pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ #if STM32_PWM_USE_TIM1 if (&PWMD1 == pwmp) { diff --git a/os/various/usb_msc.c b/os/various/usb_msc.c index 22dee45d3..d1eb6c9a7 100644 --- a/os/various/usb_msc.c +++ b/os/various/usb_msc.c @@ -299,3 +299,5 @@ stall_both: chSysUnlockFromIsr(); return; } + +/** @} */ diff --git a/readme.txt b/readme.txt index a2201e6ba..40e1fd6da 100644 --- a/readme.txt +++ b/readme.txt @@ -93,6 +93,11 @@ as default. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. +- CHANGE: Updated the documentation to use Doxygen 1.7.3 which produces a much + more readable output. Also modified the documentation layout to put functions + and variables ahead of everything else in the group pages. + Doxygen version below 1.7.3 cannot be used anymore because differences in + templates. *** 2.3.0 *** - FIX: Fixed race condition in CM0 ports, the fix also improves the diff --git a/test/testbmk.c b/test/testbmk.c index 9c820b58a..6c878f557 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -61,7 +61,7 @@ */ static Semaphore sem1; -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) static Mutex mtx1; #endif @@ -577,7 +577,7 @@ ROMCONST struct testcase testbmk11 = { bmk11_execute }; -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) /** * @page test_benchmarks_012 Mutexes lock/unlock performance * @@ -648,7 +648,7 @@ static void bmk13_execute(void) { test_print("--- Semaph: "); test_printn(sizeof(Semaphore)); test_println(" bytes"); -#if CH_USE_EVENTS +#if CH_USE_EVENTS || defined(__DOXYGEN__) test_print("--- EventS: "); test_printn(sizeof(EventSource)); test_println(" bytes"); @@ -656,22 +656,22 @@ static void bmk13_execute(void) { test_printn(sizeof(EventListener)); test_println(" bytes"); #endif -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) test_print("--- Mutex : "); test_printn(sizeof(Mutex)); test_println(" bytes"); #endif -#if CH_USE_CONDVARS +#if CH_USE_CONDVARS || defined(__DOXYGEN__) test_print("--- CondV.: "); test_printn(sizeof(CondVar)); test_println(" bytes"); #endif -#if CH_USE_QUEUES +#if CH_USE_QUEUES || defined(__DOXYGEN__) test_print("--- Queue : "); test_printn(sizeof(GenericQueue)); test_println(" bytes"); #endif -#if CH_USE_MAILBOXES +#if CH_USE_MAILBOXES || defined(__DOXYGEN__) test_print("--- MailB.: "); test_printn(sizeof(Mailbox)); test_println(" bytes"); @@ -701,7 +701,7 @@ ROMCONST struct testcase * ROMCONST patternbmk[] = { &testbmk9, &testbmk10, &testbmk11, -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) &testbmk12, #endif &testbmk13, diff --git a/test/testdyn.c b/test/testdyn.c index c5b523816..5657a8dc2 100644 --- a/test/testdyn.c +++ b/test/testdyn.c @@ -53,11 +53,11 @@ * @brief Dynamic thread APIs test header file */ -#if CH_USE_DYNAMIC -#if CH_USE_HEAP +#if CH_USE_DYNAMIC || defined(__DOXYGEN__) +#if CH_USE_HEAP || defined(__DOXYGEN__) static MemoryHeap heap1; #endif -#if CH_USE_MEMPOOLS +#if CH_USE_MEMPOOLS || defined(__DOXYGEN__) static MemoryPool mp1; #endif @@ -78,7 +78,7 @@ static msg_t thread(void *p) { return 0; } -#if CH_USE_HEAP +#if CH_USE_HEAP || defined(__DOXYGEN__) static void dyn1_setup(void) { chHeapInit(&heap1, test.buffer, sizeof(union test_buffers)); @@ -126,7 +126,7 @@ ROMCONST struct testcase testdyn1 = { }; #endif /* CH_USE_HEAP */ -#if CH_USE_MEMPOOLS +#if CH_USE_MEMPOOLS || defined(__DOXYGEN__) /** * @page test_dynamic_002 Threads creation from Memory Pool * @@ -182,7 +182,7 @@ ROMCONST struct testcase testdyn2 = { }; #endif /* CH_USE_MEMPOOLS */ -#if CH_USE_HEAP && CH_USE_REGISTRY +#if (CH_USE_HEAP && CH_USE_REGISTRY) || defined(__DOXYGEN__) /** * @page test_dynamic_003 Registry and References test * @@ -251,14 +251,14 @@ ROMCONST struct testcase testdyn3 = { * @brief Test sequence for dynamic APIs. */ ROMCONST struct testcase * ROMCONST patterndyn[] = { -#if CH_USE_DYNAMIC -#if CH_USE_HEAP +#if CH_USE_DYNAMIC || defined(__DOXYGEN__) +#if CH_USE_HEAP || defined(__DOXYGEN__) &testdyn1, #endif -#if CH_USE_MEMPOOLS +#if CH_USE_MEMPOOLS || defined(__DOXYGEN__) &testdyn2, #endif -#if CH_USE_HEAP && CH_USE_REGISTRY +#if (CH_USE_HEAP && CH_USE_REGISTRY) || defined(__DOXYGEN__) &testdyn3, #endif #endif diff --git a/test/testevt.c b/test/testevt.c index c0f5baa5a..4bdeb8fc9 100644 --- a/test/testevt.c +++ b/test/testevt.c @@ -51,7 +51,7 @@ * @brief Events test header file */ -#if CH_USE_EVENTS +#if CH_USE_EVENTS || defined(__DOXYGEN__) #define ALLOWED_DELAY MS2ST(5) @@ -232,7 +232,7 @@ ROMCONST struct testcase testevt2 = { evt2_execute }; -#if CH_USE_EVENTS_TIMEOUT +#if CH_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__) /** * @page test_events_003 Events timeout * @@ -285,10 +285,10 @@ ROMCONST struct testcase testevt3 = { * @brief Test sequence for events. */ ROMCONST struct testcase * ROMCONST patternevt[] = { -#if CH_USE_EVENTS +#if CH_USE_EVENTS || defined(__DOXYGEN__) &testevt1, &testevt2, -#if CH_USE_EVENTS_TIMEOUT +#if CH_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__) &testevt3, #endif #endif diff --git a/test/testheap.c b/test/testheap.c index 4b480a575..bfdcea1e6 100644 --- a/test/testheap.c +++ b/test/testheap.c @@ -48,7 +48,7 @@ * @brief Heap header file */ -#if CH_USE_HEAP +#if CH_USE_HEAP || defined(__DOXYGEN__) #define SIZE 16 @@ -156,7 +156,7 @@ ROMCONST struct testcase testheap1 = { * @brief Test sequence for heap. */ ROMCONST struct testcase * ROMCONST patternheap[] = { -#if CH_USE_HEAP +#if CH_USE_HEAP || defined(__DOXYGEN__) &testheap1, #endif NULL diff --git a/test/testmbox.c b/test/testmbox.c index 90b081c3e..8797536c6 100644 --- a/test/testmbox.c +++ b/test/testmbox.c @@ -51,7 +51,7 @@ * @brief Mailboxes header file */ -#if CH_USE_MAILBOXES +#if CH_USE_MAILBOXES || defined(__DOXYGEN__) #define ALLOWED_DELAY MS2ST(5) #define MB_SIZE 5 @@ -218,7 +218,7 @@ ROMCONST struct testcase testmbox1 = { * @brief Test sequence for mailboxes. */ ROMCONST struct testcase * ROMCONST patternmbox[] = { -#if CH_USE_MAILBOXES +#if CH_USE_MAILBOXES || defined(__DOXYGEN__) &testmbox1, #endif NULL diff --git a/test/testmsg.c b/test/testmsg.c index 0fadc8d98..54c049d44 100644 --- a/test/testmsg.c +++ b/test/testmsg.c @@ -49,7 +49,7 @@ * @brief Messages header file */ -#if CH_USE_MESSAGES +#if CH_USE_MESSAGES || defined(__DOXYGEN__) /** * @page test_msg_001 Messages Server loop @@ -105,7 +105,7 @@ ROMCONST struct testcase testmsg1 = { * @brief Test sequence for messages. */ ROMCONST struct testcase * ROMCONST patternmsg[] = { -#if CH_USE_MESSAGES +#if CH_USE_MESSAGES || defined(__DOXYGEN__) &testmsg1, #endif NULL diff --git a/test/testmtx.c b/test/testmtx.c index 4112eb004..08329a33b 100644 --- a/test/testmtx.c +++ b/test/testmtx.c @@ -60,7 +60,7 @@ * @brief Mutexes and CondVars test header file */ -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) #define ALLOWED_DELAY 5 @@ -71,7 +71,7 @@ */ static MUTEX_DECL(m1); static MUTEX_DECL(m2); -#if CH_USE_CONDVARS +#if CH_USE_CONDVARS || defined(__DOXYGEN__) static CONDVAR_DECL(c1); #endif @@ -120,7 +120,7 @@ ROMCONST struct testcase testmtx1 = { mtx1_execute }; -#if CH_DBG_THREADS_PROFILING +#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__) /** * @page test_mtx_002 Priority inheritance, simple case * @@ -467,7 +467,7 @@ ROMCONST struct testcase testmtx5 = { mtx5_execute }; -#if CH_USE_CONDVARS +#if CH_USE_CONDVARS || defined(__DOXYGEN__) /** * @page test_mtx_006 Condition Variable signal test * @@ -578,7 +578,7 @@ static msg_t thread11(void *p) { chMtxLock(&m2); chMtxLock(&m1); -#if CH_USE_CONDVARS_TIMEOUT +#if CH_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__) chCondWaitTimeout(&c1, TIME_INFINITE); #else chCondWait(&c1); @@ -622,15 +622,15 @@ ROMCONST struct testcase testmtx8 = { * @brief Test sequence for mutexes. */ ROMCONST struct testcase * ROMCONST patternmtx[] = { -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) &testmtx1, -#if CH_DBG_THREADS_PROFILING +#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__) &testmtx2, &testmtx3, #endif &testmtx4, &testmtx5, -#if CH_USE_CONDVARS +#if CH_USE_CONDVARS || defined(__DOXYGEN__) &testmtx6, &testmtx7, &testmtx8, diff --git a/test/testpools.c b/test/testpools.c index 6479f20ea..afdd37018 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -48,7 +48,7 @@ * @brief Memory Pools test header file */ -#if CH_USE_MEMPOOLS +#if CH_USE_MEMPOOLS || defined(__DOXYGEN__) static MEMORYPOOL_DECL(mp1, THD_WA_SIZE(THREADS_STACK_SIZE), NULL); @@ -104,7 +104,7 @@ ROMCONST struct testcase testpools1 = { * @brief Test sequence for pools. */ ROMCONST struct testcase * ROMCONST patternpools[] = { -#if CH_USE_MEMPOOLS +#if CH_USE_MEMPOOLS || defined(__DOXYGEN__) &testpools1, #endif NULL diff --git a/test/testqueues.c b/test/testqueues.c index e30e12dcb..55945761d 100644 --- a/test/testqueues.c +++ b/test/testqueues.c @@ -54,7 +54,7 @@ * @brief I/O Queues test header file */ -#if CH_USE_QUEUES +#if CH_USE_QUEUES || defined(__DOXYGEN__) #define TEST_QUEUES_SIZE 4 @@ -224,7 +224,7 @@ ROMCONST struct testcase testqueues2 = { * @brief Test sequence for queues. */ ROMCONST struct testcase * ROMCONST patternqueues[] = { -#if CH_USE_QUEUES +#if CH_USE_QUEUES || defined(__DOXYGEN__) &testqueues1, &testqueues2, #endif diff --git a/test/testsem.c b/test/testsem.c index 75f4f1fcb..009a5910f 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -51,7 +51,7 @@ * @brief Semaphores test header file */ -#if CH_USE_SEMAPHORES +#if CH_USE_SEMAPHORES || defined(__DOXYGEN__) #define ALLOWED_DELAY MS2ST(5) @@ -190,7 +190,7 @@ ROMCONST struct testcase testsem2 = { sem2_execute }; -#if CH_USE_SEMSW +#if CH_USE_SEMSW || defined(__DOXYGEN__) /** * @page test_sem_003 Atomic signal-wait test * @@ -292,10 +292,10 @@ ROMCONST struct testcase testsem4 = { * @brief Test sequence for semaphores. */ ROMCONST struct testcase * ROMCONST patternsem[] = { -#if CH_USE_SEMAPHORES +#if CH_USE_SEMAPHORES || defined(__DOXYGEN__) &testsem1, &testsem2, -#if CH_USE_SEMSW +#if CH_USE_SEMSW || defined(__DOXYGEN__) &testsem3, #endif &testsem4, diff --git a/test/testthd.c b/test/testthd.c index 83c2c4d4f..3433d2eb4 100644 --- a/test/testthd.c +++ b/test/testthd.c @@ -142,7 +142,7 @@ static void thd3_execute(void) { test_assert(4, chThdGetPriority() == prio, "unexpected priority level"); -#if CH_USE_MUTEXES +#if CH_USE_MUTEXES || defined(__DOXYGEN__) /* Simulates a priority boost situation (p_prio > p_realprio).*/ chSysLock(); chThdSelf()->p_prio += 2; -- cgit v1.2.3 From 8df3af0e145543f362077ba84487a0221d02ae1b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 24 Mar 2011 08:30:21 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2840 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile | 1787 --------------------------------------------- docs/Doxyfile_chm | 1787 +++++++++++++++++++++++++++++++++++++++++++++ docs/Doxyfile_html | 1787 +++++++++++++++++++++++++++++++++++++++++++++ docs/readme.txt | 7 +- docs/rsc/footer.html | 7 - docs/rsc/footer_chm.html | 4 + docs/rsc/footer_html.html | 7 + docs/rsc/header.html | 28 - docs/rsc/header_chm.html | 21 + docs/rsc/header_html.html | 28 + documentation.html | 2 +- readme.txt | 3 +- 12 files changed, 3638 insertions(+), 1830 deletions(-) delete mode 100644 docs/Doxyfile create mode 100644 docs/Doxyfile_chm create mode 100644 docs/Doxyfile_html delete mode 100644 docs/rsc/footer.html create mode 100644 docs/rsc/footer_chm.html create mode 100644 docs/rsc/footer_html.html delete mode 100644 docs/rsc/header.html create mode 100644 docs/rsc/header_chm.html create mode 100644 docs/rsc/header_html.html diff --git a/docs/Doxyfile b/docs/Doxyfile deleted file mode 100644 index cec7e4b49..000000000 --- a/docs/Doxyfile +++ /dev/null @@ -1,1787 +0,0 @@ -# Doxyfile 1.7.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = ChibiOS/RT - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 2.3.1 - -# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = "iclass=@par Function Class:\n This is an \ - I-Class API, this function can be \ - invoked from within a system lock zone by both \ - threads and interrupt handlers." \ - "sclass=@par Function Class:\n This is an \ - S-Class API, this function can be \ - invoked from within a system lock zone by threads \ - only." \ - "api=@par Function Class:\n Normal API, this \ - function can be invoked by regular system threads \ - but not from within a lock zone." \ - "notapi=@par Function Class:\n Not an API, this \ - function is for internal use only." \ - "isr=@par Function Class:\n Interrupt handler, \ - this function should not be directly invoked." \ - "init=@par Function Class:\n Initializer, this \ - function just initializes an object and can be \ - invoked before the kernel is initialized." \ - "special=@par Function Class:\n Special function, \ - this function has special requirements see the \ - notes." - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = NO - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = ./rsc/layout.xml - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../docs/src \ - ../os/kernel \ - ../os/kernel/include \ - ../os/kernel/src \ - ../os/kernel/templates \ - ../os/ports \ - ../os/ports/GCC/ARM \ - ../os/ports/GCC/ARM\LPC214x \ - ../os/ports/GCC/ARM\AT91SAM7 \ - ../os/ports/GCC/ARMCMx \ - ../os/ports/GCC/ARMCMx/STM32 \ - ../os/ports/GCC/ARMCMx/LPC11xx \ - ../os/ports/GCC/ARMCMx/LPC13xx \ - ../os/ports/GCC/PPC \ - ../os/ports/GCC/AVR \ - ../os/ports/GCC/MSP430 \ - ../os/ports/IAR/ARMCMx \ - ../os/ports/IAR/ARMCMx/STM32 \ - ../os/ports/IAR/ARMCMx/LPC11xx \ - ../os/ports/IAR/ARMCMx/LPC13xx \ - ../os/ports/RVCT/ARMCMx \ - ../os/ports/RVCT/ARMCMx/STM32 \ - ../os/ports/RVCT/ARMCMx/LPC11xx \ - ../os/ports/RVCT/ARMCMx/LPC13xx \ - ../os/ports/cosmic/STM8 \ - ../os/ports/RC/STM8 \ - ../os/hal \ - ../os/hal/dox \ - ../os/hal/include \ - ../os/hal/src \ - ../os/hal/templates \ - ../os/hal/platforms \ - ../os/hal/platforms/AT91SAM7/platform.dox \ - ../os/hal/platforms/AVR/platform.dox \ - ../os/hal/platforms/LPC11xx/platform.dox \ - ../os/hal/platforms/LPC13xx/platform.dox \ - ../os/hal/platforms/LPC214x/platform.dox \ - ../os/hal/platforms/MSP430/platform.dox \ - ../os/hal/platforms/SPC56x/platform.dox \ - ../os/hal/platforms/STM32/platform.dox \ - ../os/hal/platforms/STM8L/platform.dox \ - ../os/hal/platforms/STM8S/platform.dox \ - ../os/various \ - ../test \ - ../ext/ext.dox - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.ddf \ - *.s - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = ../os/hal/platforms/STM32/stm32f10x.h \ - ../os/hal/platforms/STM8/stm8s.h \ - ../os/hal/platforms/STM8/stm8s_type.h \ - ../os/hal/platforms/LPC11xx/LPC11xx.h \ - ../os/hal/platforms/LPC11xx/system_LPC11xx.h \ - ../os/hal/platforms/LPC13xx/LPC13xx.h \ - ../os/hal/platforms/LPC13xx/system_LPC13xx.h - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = ./rsc - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = NO - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = ./rsc/header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = ./rsc/footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = YES - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = ../ChibiOS_RT.chm - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = "\"C:/Program Files/HTML Help Workshop/hhc.exe\"" - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [0,1..20]) -# that doxygen will group on one line in the generated HTML documentation. -# Note that a value of 0 will completely suppress the enum values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing -# MathJax, but it is strongly recommended to install a local copy of MathJax -# before deployment. - -MATHJAX_RELPATH = http://www.mathjax.org/mathjax - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = __DOXYGEN__ - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = NO - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called Helvetica to the output -# directory and reference it in all dot files that doxygen generates. -# When you want a differently looking font you can specify the font name -# using DOT_FONTNAME. You need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 8 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = YES - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = NO - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = NO - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, svg, gif or svg. -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 20 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 3 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/docs/Doxyfile_chm b/docs/Doxyfile_chm new file mode 100644 index 000000000..83957f61b --- /dev/null +++ b/docs/Doxyfile_chm @@ -0,0 +1,1787 @@ +# Doxyfile 1.7.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = ChibiOS/RT + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 2.3.1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = NO + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 2 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = "iclass=@par Function Class:\n This is an \ + I-Class API, this function can be \ + invoked from within a system lock zone by both \ + threads and interrupt handlers." \ + "sclass=@par Function Class:\n This is an \ + S-Class API, this function can be \ + invoked from within a system lock zone by threads \ + only." \ + "api=@par Function Class:\n Normal API, this \ + function can be invoked by regular system threads \ + but not from within a lock zone." \ + "notapi=@par Function Class:\n Not an API, this \ + function is for internal use only." \ + "isr=@par Function Class:\n Interrupt handler, \ + this function should not be directly invoked." \ + "init=@par Function Class:\n Initializer, this \ + function just initializes an object and can be \ + invoked before the kernel is initialized." \ + "special=@par Function Class:\n Special function, \ + this function has special requirements see the \ + notes." + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = NO + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = ./rsc/layout.xml + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../docs/src \ + ../os/kernel \ + ../os/kernel/include \ + ../os/kernel/src \ + ../os/kernel/templates \ + ../os/ports \ + ../os/ports/GCC/ARM \ + ../os/ports/GCC/ARM\LPC214x \ + ../os/ports/GCC/ARM\AT91SAM7 \ + ../os/ports/GCC/ARMCMx \ + ../os/ports/GCC/ARMCMx/STM32 \ + ../os/ports/GCC/ARMCMx/LPC11xx \ + ../os/ports/GCC/ARMCMx/LPC13xx \ + ../os/ports/GCC/PPC \ + ../os/ports/GCC/AVR \ + ../os/ports/GCC/MSP430 \ + ../os/ports/IAR/ARMCMx \ + ../os/ports/IAR/ARMCMx/STM32 \ + ../os/ports/IAR/ARMCMx/LPC11xx \ + ../os/ports/IAR/ARMCMx/LPC13xx \ + ../os/ports/RVCT/ARMCMx \ + ../os/ports/RVCT/ARMCMx/STM32 \ + ../os/ports/RVCT/ARMCMx/LPC11xx \ + ../os/ports/RVCT/ARMCMx/LPC13xx \ + ../os/ports/cosmic/STM8 \ + ../os/ports/RC/STM8 \ + ../os/hal \ + ../os/hal/dox \ + ../os/hal/include \ + ../os/hal/src \ + ../os/hal/templates \ + ../os/hal/platforms \ + ../os/hal/platforms/AT91SAM7/platform.dox \ + ../os/hal/platforms/AVR/platform.dox \ + ../os/hal/platforms/LPC11xx/platform.dox \ + ../os/hal/platforms/LPC13xx/platform.dox \ + ../os/hal/platforms/LPC214x/platform.dox \ + ../os/hal/platforms/MSP430/platform.dox \ + ../os/hal/platforms/SPC56x/platform.dox \ + ../os/hal/platforms/STM32/platform.dox \ + ../os/hal/platforms/STM8L/platform.dox \ + ../os/hal/platforms/STM8S/platform.dox \ + ../os/various \ + ../test \ + ../ext/ext.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.ddf \ + *.s + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = ../os/hal/platforms/STM32/stm32f10x.h \ + ../os/hal/platforms/STM8/stm8s.h \ + ../os/hal/platforms/STM8/stm8s_type.h \ + ../os/hal/platforms/LPC11xx/LPC11xx.h \ + ../os/hal/platforms/LPC11xx/system_LPC11xx.h \ + ../os/hal/platforms/LPC13xx/LPC13xx.h \ + ../os/hal/platforms/LPC13xx/system_LPC13xx.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = ./rsc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = ./rsc/header_chm.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = ./rsc/footer_chm.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ../ChibiOS_RT.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = "\"C:/Program Files/HTML Help Workshop/hhc.exe\"" + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [0,1..20]) +# that doxygen will group on one line in the generated HTML documentation. +# Note that a value of 0 will completely suppress the enum values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 8 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, svg, gif or svg. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 20 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 3 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/docs/Doxyfile_html b/docs/Doxyfile_html new file mode 100644 index 000000000..8a6ca46a4 --- /dev/null +++ b/docs/Doxyfile_html @@ -0,0 +1,1787 @@ +# Doxyfile 1.7.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = ChibiOS/RT + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 2.3.1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = NO + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 2 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = "iclass=@par Function Class:\n This is an \ + I-Class API, this function can be \ + invoked from within a system lock zone by both \ + threads and interrupt handlers." \ + "sclass=@par Function Class:\n This is an \ + S-Class API, this function can be \ + invoked from within a system lock zone by threads \ + only." \ + "api=@par Function Class:\n Normal API, this \ + function can be invoked by regular system threads \ + but not from within a lock zone." \ + "notapi=@par Function Class:\n Not an API, this \ + function is for internal use only." \ + "isr=@par Function Class:\n Interrupt handler, \ + this function should not be directly invoked." \ + "init=@par Function Class:\n Initializer, this \ + function just initializes an object and can be \ + invoked before the kernel is initialized." \ + "special=@par Function Class:\n Special function, \ + this function has special requirements see the \ + notes." + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = NO + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = ./rsc/layout.xml + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../docs/src \ + ../os/kernel \ + ../os/kernel/include \ + ../os/kernel/src \ + ../os/kernel/templates \ + ../os/ports \ + ../os/ports/GCC/ARM \ + ../os/ports/GCC/ARM\LPC214x \ + ../os/ports/GCC/ARM\AT91SAM7 \ + ../os/ports/GCC/ARMCMx \ + ../os/ports/GCC/ARMCMx/STM32 \ + ../os/ports/GCC/ARMCMx/LPC11xx \ + ../os/ports/GCC/ARMCMx/LPC13xx \ + ../os/ports/GCC/PPC \ + ../os/ports/GCC/AVR \ + ../os/ports/GCC/MSP430 \ + ../os/ports/IAR/ARMCMx \ + ../os/ports/IAR/ARMCMx/STM32 \ + ../os/ports/IAR/ARMCMx/LPC11xx \ + ../os/ports/IAR/ARMCMx/LPC13xx \ + ../os/ports/RVCT/ARMCMx \ + ../os/ports/RVCT/ARMCMx/STM32 \ + ../os/ports/RVCT/ARMCMx/LPC11xx \ + ../os/ports/RVCT/ARMCMx/LPC13xx \ + ../os/ports/cosmic/STM8 \ + ../os/ports/RC/STM8 \ + ../os/hal \ + ../os/hal/dox \ + ../os/hal/include \ + ../os/hal/src \ + ../os/hal/templates \ + ../os/hal/platforms \ + ../os/hal/platforms/AT91SAM7/platform.dox \ + ../os/hal/platforms/AVR/platform.dox \ + ../os/hal/platforms/LPC11xx/platform.dox \ + ../os/hal/platforms/LPC13xx/platform.dox \ + ../os/hal/platforms/LPC214x/platform.dox \ + ../os/hal/platforms/MSP430/platform.dox \ + ../os/hal/platforms/SPC56x/platform.dox \ + ../os/hal/platforms/STM32/platform.dox \ + ../os/hal/platforms/STM8L/platform.dox \ + ../os/hal/platforms/STM8S/platform.dox \ + ../os/various \ + ../test \ + ../ext/ext.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.ddf \ + *.s + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = ../os/hal/platforms/STM32/stm32f10x.h \ + ../os/hal/platforms/STM8/stm8s.h \ + ../os/hal/platforms/STM8/stm8s_type.h \ + ../os/hal/platforms/LPC11xx/LPC11xx.h \ + ../os/hal/platforms/LPC11xx/system_LPC11xx.h \ + ../os/hal/platforms/LPC13xx/LPC13xx.h \ + ../os/hal/platforms/LPC13xx/system_LPC13xx.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = ./rsc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = ./rsc/header_html.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = ./rsc/footer_html.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ../ChibiOS_RT.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = "\"C:/Program Files/HTML Help Workshop/hhc.exe\"" + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [0,1..20]) +# that doxygen will group on one line in the generated HTML documentation. +# Note that a value of 0 will completely suppress the enum values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 8 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, svg, gif or svg. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 20 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 3 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/docs/readme.txt b/docs/readme.txt index e50b98068..23f14ef60 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -1,8 +1,3 @@ -*** Documentation access *** - -Open ./docs/index.html to open the start page or ./docs/html/index.html in -order to access directly the doxigen documentation. - *** Documentation build procedure *** The following software must be installed: @@ -12,5 +7,5 @@ The following software must be installed: Build procedure: - Run Doxywizard. -- Load ./docs/Doxyfile from Doxywizard. +- Load ./docs/Doxyfile_html or ./docs/Doxyfile_chm from Doxywizard. - Start. diff --git a/docs/rsc/footer.html b/docs/rsc/footer.html deleted file mode 100644 index a90299b83..000000000 --- a/docs/rsc/footer.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/docs/rsc/footer_chm.html b/docs/rsc/footer_chm.html new file mode 100644 index 000000000..6f8038e4f --- /dev/null +++ b/docs/rsc/footer_chm.html @@ -0,0 +1,4 @@ + + + diff --git a/docs/rsc/footer_html.html b/docs/rsc/footer_html.html new file mode 100644 index 000000000..a90299b83 --- /dev/null +++ b/docs/rsc/footer_html.html @@ -0,0 +1,7 @@ + + + + + diff --git a/docs/rsc/header.html b/docs/rsc/header.html deleted file mode 100644 index 3af6e226b..000000000 --- a/docs/rsc/header.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -$title - - - - - - - - - -
-
- - - - - - -
-
ChibiOS/RT 2.3.1
-
-
diff --git a/docs/rsc/header_chm.html b/docs/rsc/header_chm.html new file mode 100644 index 000000000..7900d8bf2 --- /dev/null +++ b/docs/rsc/header_chm.html @@ -0,0 +1,21 @@ + + + + +$title + + + + +
+
+ + + + + + +
+
ChibiOS/RT 2.3.1
+
+
diff --git a/docs/rsc/header_html.html b/docs/rsc/header_html.html new file mode 100644 index 000000000..3af6e226b --- /dev/null +++ b/docs/rsc/header_html.html @@ -0,0 +1,28 @@ + + + + +$title + + + + + + + + + +
+
+ + + + + + +
+
ChibiOS/RT 2.3.1
+
+
diff --git a/documentation.html b/documentation.html index 059a5a472..d9a44933d 100644 --- a/documentation.html +++ b/documentation.html @@ -1,7 +1,7 @@ - + diff --git a/readme.txt b/readme.txt index 40e1fd6da..cbe419915 100644 --- a/readme.txt +++ b/readme.txt @@ -97,7 +97,8 @@ more readable output. Also modified the documentation layout to put functions and variables ahead of everything else in the group pages. Doxygen version below 1.7.3 cannot be used anymore because differences in - templates. + templates. Note that now there are two Doxygen projects, one for generating + the CHM file the other for plain HTML. *** 2.3.0 *** - FIX: Fixed race condition in CM0 ports, the fix also improves the -- cgit v1.2.3 From 9611163a24154027913a9ba4b0596579f4dd04c8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Mar 2011 14:55:19 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2842 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/mii.h | 190 +++++++++++++++++++++++++++++++++++++++++++++++ os/hal/include/usb_cdc.h | 119 +++++++++++++++++++++++++++++ os/various/mii.h | 190 ----------------------------------------------- os/various/usb_cdc.h | 119 ----------------------------- os/various/usb_msc.c | 2 +- os/various/usb_msc.h | 2 +- 6 files changed, 311 insertions(+), 311 deletions(-) create mode 100644 os/hal/include/mii.h create mode 100644 os/hal/include/usb_cdc.h delete mode 100644 os/various/mii.h delete mode 100644 os/various/usb_cdc.h diff --git a/os/hal/include/mii.h b/os/hal/include/mii.h new file mode 100644 index 000000000..7199ee86d --- /dev/null +++ b/os/hal/include/mii.h @@ -0,0 +1,190 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * Parts of this file have been borrowed from the Linux include file + * linux/mii.h: + * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) + */ + +/*-* + * @file mii.h + * @brief MII Driver macros and structures. + * + * @addtogroup MII + * @{ + */ + +#ifndef _MII_H_ +#define _MII_H_ + +/* + * Generic MII registers. Note, not all registers are present on all PHY + * devices and some extra registers may be present. + */ +#define MII_BMCR 0x00 /**< Basic mode control register. */ +#define MII_BMSR 0x01 /**< Basic mode status register. */ +#define MII_PHYSID1 0x02 /**< PHYS ID 1. */ +#define MII_PHYSID2 0x03 /**< PHYS ID 2. */ +#define MII_ADVERTISE 0x04 /**< Advertisement control reg. */ +#define MII_LPA 0x05 /**< Link partner ability reg. */ +#define MII_EXPANSION 0x06 /**< Expansion register. */ +#define MII_CTRL1000 0x09 /**< 1000BASE-T control. */ +#define MII_STAT1000 0x0a /**< 1000BASE-T status. */ +#define MII_ESTATUS 0x0f /**< Extended Status. */ +#define MII_DCOUNTER 0x12 /**< Disconnect counter. */ +#define MII_FCSCOUNTER 0x13 /**< False carrier counter. */ +#define MII_NWAYTEST 0x14 /**< N-way auto-neg test reg. */ +#define MII_RERRCOUNTER 0x15 /**< Receive error counter. */ +#define MII_SREVISION 0x16 /**< Silicon revision. */ +#define MII_RESV1 0x17 /**< Reserved. */ +#define MII_LBRERROR 0x18 /**< Lpback, rx, bypass error. */ +#define MII_PHYADDR 0x19 /**< PHY address. */ +#define MII_RESV2 0x1a /**< Reserved. */ +#define MII_TPISTATUS 0x1b /**< TPI status for 10mbps. */ +#define MII_NCONFIG 0x1c /**< Network interface config. */ + +/* + * Basic mode control register. + */ +#define BMCR_RESV 0x003f /**< Unused. */ +#define BMCR_SPEED1000 0x0040 /**< MSB of Speed (1000). */ +#define BMCR_CTST 0x0080 /**< Collision test. */ +#define BMCR_FULLDPLX 0x0100 /**< Full duplex. */ +#define BMCR_ANRESTART 0x0200 /**< Auto negotiation restart. */ +#define BMCR_ISOLATE 0x0400 /**< Disconnect DP83840 from MII. */ +#define BMCR_PDOWN 0x0800 /**< Powerdown. */ +#define BMCR_ANENABLE 0x1000 /**< Enable auto negotiation. */ +#define BMCR_SPEED100 0x2000 /**< Select 100Mbps. */ +#define BMCR_LOOPBACK 0x4000 /**< TXD loopback bits. */ +#define BMCR_RESET 0x8000 /**< Reset. */ + +/* + * Basic mode status register. + */ +#define BMSR_ERCAP 0x0001 /**< Ext-reg capability. */ +#define BMSR_JCD 0x0002 /**< Jabber detected. */ +#define BMSR_LSTATUS 0x0004 /**< Link status. */ +#define BMSR_ANEGCAPABLE 0x0008 /**< Able to do auto-negotiation. */ +#define BMSR_RFAULT 0x0010 /**< Remote fault detected. */ +#define BMSR_ANEGCOMPLETE 0x0020 /**< Auto-negotiation complete. */ +#define BMSR_RESV 0x00c0 /**< Unused. */ +#define BMSR_ESTATEN 0x0100 /**< Extended Status in R15. */ +#define BMSR_100HALF2 0x0200 /**< Can do 100BASE-T2 HDX. */ +#define BMSR_100FULL2 0x0400 /**< Can do 100BASE-T2 FDX. */ +#define BMSR_10HALF 0x0800 /**< Can do 10mbps, half-duplex. */ +#define BMSR_10FULL 0x1000 /**< Can do 10mbps, full-duplex. */ +#define BMSR_100HALF 0x2000 /**< Can do 100mbps, half-duplex. */ +#define BMSR_100FULL 0x4000 /**< Can do 100mbps, full-duplex. */ +#define BMSR_100BASE4 0x8000 /**< Can do 100mbps, 4k packets. */ + +/* + * Advertisement control register. + */ +#define ADVERTISE_SLCT 0x001f /**< Selector bits. */ +#define ADVERTISE_CSMA 0x0001 /**< Only selector supported. */ +#define ADVERTISE_10HALF 0x0020 /**< Try for 10mbps half-duplex. */ +#define ADVERTISE_1000XFULL 0x0020 /**< Try for 1000BASE-X full-duplex.*/ +#define ADVERTISE_10FULL 0x0040 /**< Try for 10mbps full-duplex. */ +#define ADVERTISE_1000XHALF 0x0040 /**< Try for 1000BASE-X half-duplex.*/ +#define ADVERTISE_100HALF 0x0080 /**< Try for 100mbps half-duplex. */ +#define ADVERTISE_1000XPAUSE 0x0080 /**< Try for 1000BASE-X pause. */ +#define ADVERTISE_100FULL 0x0100 /**< Try for 100mbps full-duplex. */ +#define ADVERTISE_1000XPSE_ASYM 0x0100 /**< Try for 1000BASE-X asym pause. */ +#define ADVERTISE_100BASE4 0x0200 /**< Try for 100mbps 4k packets. */ +#define ADVERTISE_PAUSE_CAP 0x0400 /**< Try for pause. */ +#define ADVERTISE_PAUSE_ASYM 0x0800 /**< Try for asymetric pause. */ +#define ADVERTISE_RESV 0x1000 /**< Unused. */ +#define ADVERTISE_RFAULT 0x2000 /**< Say we can detect faults. */ +#define ADVERTISE_LPACK 0x4000 /**< Ack link partners response. */ +#define ADVERTISE_NPAGE 0x8000 /**< Next page bit. */ + +#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ + ADVERTISE_CSMA) +#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ + ADVERTISE_100HALF | ADVERTISE_100FULL) + +/* + * Link partner ability register. + */ +#define LPA_SLCT 0x001f /**< Same as advertise selector. */ +#define LPA_10HALF 0x0020 /**< Can do 10mbps half-duplex. */ +#define LPA_1000XFULL 0x0020 /**< Can do 1000BASE-X full-duplex. */ +#define LPA_10FULL 0x0040 /**< Can do 10mbps full-duplex. */ +#define LPA_1000XHALF 0x0040 /**< Can do 1000BASE-X half-duplex. */ +#define LPA_100HALF 0x0080 /**< Can do 100mbps half-duplex. */ +#define LPA_1000XPAUSE 0x0080 /**< Can do 1000BASE-X pause. */ +#define LPA_100FULL 0x0100 /**< Can do 100mbps full-duplex. */ +#define LPA_1000XPAUSE_ASYM 0x0100 /**< Can do 1000BASE-X pause asym. */ +#define LPA_100BASE4 0x0200 /**< Can do 100mbps 4k packets. */ +#define LPA_PAUSE_CAP 0x0400 /**< Can pause. */ +#define LPA_PAUSE_ASYM 0x0800 /**< Can pause asymetrically. */ +#define LPA_RESV 0x1000 /**< Unused. */ +#define LPA_RFAULT 0x2000 /**< Link partner faulted. */ +#define LPA_LPACK 0x4000 /**< Link partner acked us. */ +#define LPA_NPAGE 0x8000 /**< Next page bit. */ + +#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) +#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) + +/* + * Expansion register for auto-negotiation. + */ +#define EXPANSION_NWAY 0x0001 /**< Can do N-way auto-nego. */ +#define EXPANSION_LCWP 0x0002 /**< Got new RX page code word. */ +#define EXPANSION_ENABLENPAGE 0x0004 /**< This enables npage words. */ +#define EXPANSION_NPCAPABLE 0x0008 /**< Link partner supports npage. */ +#define EXPANSION_MFAULTS 0x0010 /**< Multiple faults detected. */ +#define EXPANSION_RESV 0xffe0 /**< Unused. */ + +#define ESTATUS_1000_TFULL 0x2000 /**< Can do 1000BT Full. */ +#define ESTATUS_1000_THALF 0x1000 /**< Can do 1000BT Half. */ + +/* + * N-way test register. + */ +#define NWAYTEST_RESV1 0x00ff /**< Unused. */ +#define NWAYTEST_LOOPBACK 0x0100 /**< Enable loopback for N-way. */ +#define NWAYTEST_RESV2 0xfe00 /**< Unused. */ + +/* + * 1000BASE-T Control register. + */ +#define ADVERTISE_1000FULL 0x0200 /**< Advertise 1000BASE-T full duplex.*/ +#define ADVERTISE_1000HALF 0x0100 /**< Advertise 1000BASE-T half duplex.*/ + +/* + * 1000BASE-T Status register. + */ +#define LPA_1000LOCALRXOK 0x2000 /**< Link partner local receiver status.*/ +#define LPA_1000REMRXOK 0x1000 /**< Link partner remote receiver status.*/ +#define LPA_1000FULL 0x0800 /**< Link partner 1000BASE-T full duplex.*/ +#define LPA_1000HALF 0x0400 /**< Link partner 1000BASE-T half duplex.*/ + +/* + * PHY identifiers. + */ +#define MII_DM9161_ID 0x0181b8a0 +#define MII_AM79C875_ID 0x00225540 +#define MII_KS8721_ID 0x00221610 + +#endif /* _MII_H_ */ + +/** @} */ diff --git a/os/hal/include/usb_cdc.h b/os/hal/include/usb_cdc.h new file mode 100644 index 000000000..a388f9f70 --- /dev/null +++ b/os/hal/include/usb_cdc.h @@ -0,0 +1,119 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/*-* + * @file usb_cdc.h + * @brief USB Communication Device Class support header. + * + * @addtogroup USB_CDC + * @{ + */ + +#ifndef _USB_CDC_H_ +#define _USB_CDC_H_ + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +#define CDC_SEND_ENCAPSULATED_COMMAND 0x00 +#define CDC_GET_ENCAPSULATED_RESPONSE 0x01 +#define CDC_SET_COMM_FEATURE 0x02 +#define CDC_GET_COMM_FEATURE 0x03 +#define CDC_CLEAR_COMM_FEATURE 0x04 +#define CDC_SET_AUX_LINE_STATE 0x10 +#define CDC_SET_HOOK_STATE 0x11 +#define CDC_PULSE_SETUP 0x12 +#define CDC_SEND_PULSE 0x13 +#define CDC_SET_PULSE_TIME 0x14 +#define CDC_RING_AUX_JACK 0x15 +#define CDC_SET_LINE_CODING 0x20 +#define CDC_GET_LINE_CODING 0x21 +#define CDC_SET_CONTROL_LINE_STATE 0x22 +#define CDC_SEND_BREAK 0x23 +#define CDC_SET_RINGER_PARMS 0x30 +#define CDC_GET_RINGER_PARMS 0x31 +#define CDC_SET_OPERATION_PARMS 0x32 +#define CDC_GET_OPERATION_PARMS 0x33 + +#define LC_STOP_1 0 +#define LC_STOP_1P5 1 +#define LC_STOP_2 2 + +#define LC_PARITY_NONE 0 +#define LC_PARITY_ODD 1 +#define LC_PARITY_EVEN 2 +#define LC_PARITY_MARK 3 +#define LC_PARITY_SPACE 4 + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief Endpoint number for bulk IN. + */ +#if !defined(DATA_REQUEST_EP) || defined(__DOXYGEN__) +#define DATA_REQUEST_EP 1 +#endif + +/** + * @brief Endpoint number for interrupt IN. + */ +#if !defined(INTERRUPT_REQUEST_EP) || defined(__DOXYGEN__) +#define INTERRUPT_REQUEST_EP 2 +#endif + +/** + * @brief Endpoint number for bulk OUT. + */ +#if !defined(DATA_AVAILABLE_EP) || defined(__DOXYGEN__) +#define DATA_AVAILABLE_EP 3 +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Type of Line Coding structure. + */ +typedef struct { + uint8_t dwDTERate[4]; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; +} cdc_linecoding_t; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#endif /* _USB_CDC_H_ */ + +/** @} */ diff --git a/os/various/mii.h b/os/various/mii.h deleted file mode 100644 index e9f0eefc3..000000000 --- a/os/various/mii.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * Parts of this file have been borrowed from the Linux include file - * linux/mii.h: - * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) - */ - -/** - * @file mii.h - * @brief MII Driver macros and structures. - * - * @addtogroup MII - * @{ - */ - -#ifndef _MII_H_ -#define _MII_H_ - -/* - * Generic MII registers. Note, not all registers are present on all PHY - * devices and some extra registers may be present. - */ -#define MII_BMCR 0x00 /**< Basic mode control register. */ -#define MII_BMSR 0x01 /**< Basic mode status register. */ -#define MII_PHYSID1 0x02 /**< PHYS ID 1. */ -#define MII_PHYSID2 0x03 /**< PHYS ID 2. */ -#define MII_ADVERTISE 0x04 /**< Advertisement control reg. */ -#define MII_LPA 0x05 /**< Link partner ability reg. */ -#define MII_EXPANSION 0x06 /**< Expansion register. */ -#define MII_CTRL1000 0x09 /**< 1000BASE-T control. */ -#define MII_STAT1000 0x0a /**< 1000BASE-T status. */ -#define MII_ESTATUS 0x0f /**< Extended Status. */ -#define MII_DCOUNTER 0x12 /**< Disconnect counter. */ -#define MII_FCSCOUNTER 0x13 /**< False carrier counter. */ -#define MII_NWAYTEST 0x14 /**< N-way auto-neg test reg. */ -#define MII_RERRCOUNTER 0x15 /**< Receive error counter. */ -#define MII_SREVISION 0x16 /**< Silicon revision. */ -#define MII_RESV1 0x17 /**< Reserved. */ -#define MII_LBRERROR 0x18 /**< Lpback, rx, bypass error. */ -#define MII_PHYADDR 0x19 /**< PHY address. */ -#define MII_RESV2 0x1a /**< Reserved. */ -#define MII_TPISTATUS 0x1b /**< TPI status for 10mbps. */ -#define MII_NCONFIG 0x1c /**< Network interface config. */ - -/* - * Basic mode control register. - */ -#define BMCR_RESV 0x003f /**< Unused. */ -#define BMCR_SPEED1000 0x0040 /**< MSB of Speed (1000). */ -#define BMCR_CTST 0x0080 /**< Collision test. */ -#define BMCR_FULLDPLX 0x0100 /**< Full duplex. */ -#define BMCR_ANRESTART 0x0200 /**< Auto negotiation restart. */ -#define BMCR_ISOLATE 0x0400 /**< Disconnect DP83840 from MII. */ -#define BMCR_PDOWN 0x0800 /**< Powerdown. */ -#define BMCR_ANENABLE 0x1000 /**< Enable auto negotiation. */ -#define BMCR_SPEED100 0x2000 /**< Select 100Mbps. */ -#define BMCR_LOOPBACK 0x4000 /**< TXD loopback bits. */ -#define BMCR_RESET 0x8000 /**< Reset. */ - -/* - * Basic mode status register. - */ -#define BMSR_ERCAP 0x0001 /**< Ext-reg capability. */ -#define BMSR_JCD 0x0002 /**< Jabber detected. */ -#define BMSR_LSTATUS 0x0004 /**< Link status. */ -#define BMSR_ANEGCAPABLE 0x0008 /**< Able to do auto-negotiation. */ -#define BMSR_RFAULT 0x0010 /**< Remote fault detected. */ -#define BMSR_ANEGCOMPLETE 0x0020 /**< Auto-negotiation complete. */ -#define BMSR_RESV 0x00c0 /**< Unused. */ -#define BMSR_ESTATEN 0x0100 /**< Extended Status in R15. */ -#define BMSR_100HALF2 0x0200 /**< Can do 100BASE-T2 HDX. */ -#define BMSR_100FULL2 0x0400 /**< Can do 100BASE-T2 FDX. */ -#define BMSR_10HALF 0x0800 /**< Can do 10mbps, half-duplex. */ -#define BMSR_10FULL 0x1000 /**< Can do 10mbps, full-duplex. */ -#define BMSR_100HALF 0x2000 /**< Can do 100mbps, half-duplex. */ -#define BMSR_100FULL 0x4000 /**< Can do 100mbps, full-duplex. */ -#define BMSR_100BASE4 0x8000 /**< Can do 100mbps, 4k packets. */ - -/* - * Advertisement control register. - */ -#define ADVERTISE_SLCT 0x001f /**< Selector bits. */ -#define ADVERTISE_CSMA 0x0001 /**< Only selector supported. */ -#define ADVERTISE_10HALF 0x0020 /**< Try for 10mbps half-duplex. */ -#define ADVERTISE_1000XFULL 0x0020 /**< Try for 1000BASE-X full-duplex.*/ -#define ADVERTISE_10FULL 0x0040 /**< Try for 10mbps full-duplex. */ -#define ADVERTISE_1000XHALF 0x0040 /**< Try for 1000BASE-X half-duplex.*/ -#define ADVERTISE_100HALF 0x0080 /**< Try for 100mbps half-duplex. */ -#define ADVERTISE_1000XPAUSE 0x0080 /**< Try for 1000BASE-X pause. */ -#define ADVERTISE_100FULL 0x0100 /**< Try for 100mbps full-duplex. */ -#define ADVERTISE_1000XPSE_ASYM 0x0100 /**< Try for 1000BASE-X asym pause. */ -#define ADVERTISE_100BASE4 0x0200 /**< Try for 100mbps 4k packets. */ -#define ADVERTISE_PAUSE_CAP 0x0400 /**< Try for pause. */ -#define ADVERTISE_PAUSE_ASYM 0x0800 /**< Try for asymetric pause. */ -#define ADVERTISE_RESV 0x1000 /**< Unused. */ -#define ADVERTISE_RFAULT 0x2000 /**< Say we can detect faults. */ -#define ADVERTISE_LPACK 0x4000 /**< Ack link partners response. */ -#define ADVERTISE_NPAGE 0x8000 /**< Next page bit. */ - -#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ - ADVERTISE_CSMA) -#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ - ADVERTISE_100HALF | ADVERTISE_100FULL) - -/* - * Link partner ability register. - */ -#define LPA_SLCT 0x001f /**< Same as advertise selector. */ -#define LPA_10HALF 0x0020 /**< Can do 10mbps half-duplex. */ -#define LPA_1000XFULL 0x0020 /**< Can do 1000BASE-X full-duplex. */ -#define LPA_10FULL 0x0040 /**< Can do 10mbps full-duplex. */ -#define LPA_1000XHALF 0x0040 /**< Can do 1000BASE-X half-duplex. */ -#define LPA_100HALF 0x0080 /**< Can do 100mbps half-duplex. */ -#define LPA_1000XPAUSE 0x0080 /**< Can do 1000BASE-X pause. */ -#define LPA_100FULL 0x0100 /**< Can do 100mbps full-duplex. */ -#define LPA_1000XPAUSE_ASYM 0x0100 /**< Can do 1000BASE-X pause asym. */ -#define LPA_100BASE4 0x0200 /**< Can do 100mbps 4k packets. */ -#define LPA_PAUSE_CAP 0x0400 /**< Can pause. */ -#define LPA_PAUSE_ASYM 0x0800 /**< Can pause asymetrically. */ -#define LPA_RESV 0x1000 /**< Unused. */ -#define LPA_RFAULT 0x2000 /**< Link partner faulted. */ -#define LPA_LPACK 0x4000 /**< Link partner acked us. */ -#define LPA_NPAGE 0x8000 /**< Next page bit. */ - -#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) -#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) - -/* - * Expansion register for auto-negotiation. - */ -#define EXPANSION_NWAY 0x0001 /**< Can do N-way auto-nego. */ -#define EXPANSION_LCWP 0x0002 /**< Got new RX page code word. */ -#define EXPANSION_ENABLENPAGE 0x0004 /**< This enables npage words. */ -#define EXPANSION_NPCAPABLE 0x0008 /**< Link partner supports npage. */ -#define EXPANSION_MFAULTS 0x0010 /**< Multiple faults detected. */ -#define EXPANSION_RESV 0xffe0 /**< Unused. */ - -#define ESTATUS_1000_TFULL 0x2000 /**< Can do 1000BT Full. */ -#define ESTATUS_1000_THALF 0x1000 /**< Can do 1000BT Half. */ - -/* - * N-way test register. - */ -#define NWAYTEST_RESV1 0x00ff /**< Unused. */ -#define NWAYTEST_LOOPBACK 0x0100 /**< Enable loopback for N-way. */ -#define NWAYTEST_RESV2 0xfe00 /**< Unused. */ - -/* - * 1000BASE-T Control register. - */ -#define ADVERTISE_1000FULL 0x0200 /**< Advertise 1000BASE-T full duplex.*/ -#define ADVERTISE_1000HALF 0x0100 /**< Advertise 1000BASE-T half duplex.*/ - -/* - * 1000BASE-T Status register. - */ -#define LPA_1000LOCALRXOK 0x2000 /**< Link partner local receiver status.*/ -#define LPA_1000REMRXOK 0x1000 /**< Link partner remote receiver status.*/ -#define LPA_1000FULL 0x0800 /**< Link partner 1000BASE-T full duplex.*/ -#define LPA_1000HALF 0x0400 /**< Link partner 1000BASE-T half duplex.*/ - -/* - * PHY identifiers. - */ -#define MII_DM9161_ID 0x0181b8a0 -#define MII_AM79C875_ID 0x00225540 -#define MII_KS8721_ID 0x00221610 - -#endif /* _MII_H_ */ - -/** @} */ diff --git a/os/various/usb_cdc.h b/os/various/usb_cdc.h deleted file mode 100644 index ab70ed833..000000000 --- a/os/various/usb_cdc.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file usb_cdc.h - * @brief USB Communication Device Class support header. - * - * @addtogroup USB_CDC - * @{ - */ - -#ifndef _USB_CDC_H_ -#define _USB_CDC_H_ - -/*===========================================================================*/ -/* Driver constants. */ -/*===========================================================================*/ - -#define CDC_SEND_ENCAPSULATED_COMMAND 0x00 -#define CDC_GET_ENCAPSULATED_RESPONSE 0x01 -#define CDC_SET_COMM_FEATURE 0x02 -#define CDC_GET_COMM_FEATURE 0x03 -#define CDC_CLEAR_COMM_FEATURE 0x04 -#define CDC_SET_AUX_LINE_STATE 0x10 -#define CDC_SET_HOOK_STATE 0x11 -#define CDC_PULSE_SETUP 0x12 -#define CDC_SEND_PULSE 0x13 -#define CDC_SET_PULSE_TIME 0x14 -#define CDC_RING_AUX_JACK 0x15 -#define CDC_SET_LINE_CODING 0x20 -#define CDC_GET_LINE_CODING 0x21 -#define CDC_SET_CONTROL_LINE_STATE 0x22 -#define CDC_SEND_BREAK 0x23 -#define CDC_SET_RINGER_PARMS 0x30 -#define CDC_GET_RINGER_PARMS 0x31 -#define CDC_SET_OPERATION_PARMS 0x32 -#define CDC_GET_OPERATION_PARMS 0x33 - -#define LC_STOP_1 0 -#define LC_STOP_1P5 1 -#define LC_STOP_2 2 - -#define LC_PARITY_NONE 0 -#define LC_PARITY_ODD 1 -#define LC_PARITY_EVEN 2 -#define LC_PARITY_MARK 3 -#define LC_PARITY_SPACE 4 - -/*===========================================================================*/ -/* Driver pre-compile time settings. */ -/*===========================================================================*/ - -/** - * @brief Endpoint number for bulk IN. - */ -#if !defined(DATA_REQUEST_EP) || defined(__DOXYGEN__) -#define DATA_REQUEST_EP 1 -#endif - -/** - * @brief Endpoint number for interrupt IN. - */ -#if !defined(INTERRUPT_REQUEST_EP) || defined(__DOXYGEN__) -#define INTERRUPT_REQUEST_EP 2 -#endif - -/** - * @brief Endpoint number for bulk OUT. - */ -#if !defined(DATA_AVAILABLE_EP) || defined(__DOXYGEN__) -#define DATA_AVAILABLE_EP 3 -#endif - -/*===========================================================================*/ -/* Derived constants and error checks. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver data structures and types. */ -/*===========================================================================*/ - -/** - * @brief Type of Line Coding structure. - */ -typedef struct { - uint8_t dwDTERate[4]; - uint8_t bCharFormat; - uint8_t bParityType; - uint8_t bDataBits; -} cdc_linecoding_t; - -/*===========================================================================*/ -/* Driver macros. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -#endif /* _USB_CDC_H_ */ - -/** @} */ diff --git a/os/various/usb_msc.c b/os/various/usb_msc.c index d1eb6c9a7..43a5ec23c 100644 --- a/os/various/usb_msc.c +++ b/os/various/usb_msc.c @@ -18,7 +18,7 @@ along with this program. If not, see . */ -/** +/*-* * @file usb_msc.c * @brief USB Mass Storage Class code. * diff --git a/os/various/usb_msc.h b/os/various/usb_msc.h index d6e041553..27ecc8af3 100644 --- a/os/various/usb_msc.h +++ b/os/various/usb_msc.h @@ -18,7 +18,7 @@ along with this program. If not, see . */ -/** +/*-* * @file usb_msc.h * @brief USB Mass Storage Class header. * -- cgit v1.2.3 From 6e6c6944fb7f82c837c34d6ab3be6bb3ba1a97f3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Mar 2011 15:13:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2843 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/rsc/footer_html.html | 15 ++++++++++----- docs/rsc/header_html.html | 17 +++++++++++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/docs/rsc/footer_html.html b/docs/rsc/footer_html.html index a90299b83..0b176f750 100644 --- a/docs/rsc/footer_html.html +++ b/docs/rsc/footer_html.html @@ -1,7 +1,12 @@ - - -
+ + +
diff --git a/docs/rsc/header_html.html b/docs/rsc/header_html.html index 3af6e226b..8e3887f51 100644 --- a/docs/rsc/header_html.html +++ b/docs/rsc/header_html.html @@ -18,9 +18,22 @@ $(document).ready(initResizable);
- + + -- cgit v1.2.3 From ff676aee33d4061e9d8186a15ad72c78fa1466a0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Mar 2011 15:32:56 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2848 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/adc.dox | 4 +- os/hal/dox/can.dox | 4 +- os/hal/dox/gpt.dox | 7 +- os/hal/dox/hal.dox | 21 ++-- os/hal/dox/i2c.dox | 5 +- os/hal/dox/icu.dox | 115 ++++++++++++++++++++ os/hal/dox/pwm.dox | 3 +- os/hal/dox/spi.dox | 6 +- os/hal/dox/uart.dox | 4 +- os/hal/dox/usb.dox | 4 +- os/hal/include/icu.h | 131 ++++++++++++++++++++++ os/hal/platforms/STM32/icu_lld.c | 221 +++++++++++++++++++++++++++++++++++++ os/hal/platforms/STM32/icu_lld.h | 230 +++++++++++++++++++++++++++++++++++++++ os/hal/src/icu.c | 151 +++++++++++++++++++++++++ os/hal/templates/icu_lld.c | 145 ++++++++++++++++++++++++ os/hal/templates/icu_lld.h | 136 +++++++++++++++++++++++ readme.txt | 2 + 17 files changed, 1162 insertions(+), 27 deletions(-) create mode 100644 os/hal/dox/icu.dox create mode 100644 os/hal/include/icu.h create mode 100644 os/hal/platforms/STM32/icu_lld.c create mode 100644 os/hal/platforms/STM32/icu_lld.h create mode 100644 os/hal/src/icu.c create mode 100644 os/hal/templates/icu_lld.c create mode 100644 os/hal/templates/icu_lld.h diff --git a/os/hal/dox/adc.dox b/os/hal/dox/adc.dox index f5b83532d..0d6770f64 100644 --- a/os/hal/dox/adc.dox +++ b/os/hal/dox/adc.dox @@ -21,8 +21,8 @@ /** * @defgroup ADC ADC Driver * @brief Generic ADC Driver. - * @details This module implements a generic ADC driver supporting a - * variety of buffer and conversion modes. + * @details This module implements a generic ADC (Analog to Digital Converter) + * driver supporting a variety of buffer and conversion modes. * @pre In order to use the ADC driver the @p HAL_USE_ADC option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/can.dox b/os/hal/dox/can.dox index f32630442..1a0c81c0d 100644 --- a/os/hal/dox/can.dox +++ b/os/hal/dox/can.dox @@ -21,8 +21,8 @@ /** * @defgroup CAN CAN Driver * @brief Generic CAN Driver. - * @details This module implements a generic CAN driver allowing the exchange - * of information at frame level. + * @details This module implements a generic CAN (Controller Area Network) + * driver allowing the exchange of information at frame level. * @pre In order to use the CAN driver the @p HAL_USE_CAN option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/gpt.dox b/os/hal/dox/gpt.dox index 203f7a647..d51ad6af3 100644 --- a/os/hal/dox/gpt.dox +++ b/os/hal/dox/gpt.dox @@ -21,9 +21,10 @@ /** * @defgroup GPT GPT Driver * @brief Generic GPT Driver. - * @details This module implements a generic timer driver. The timer can be - * programmed in order to trigger callbacks after a specified time - * period or continuously with a specified interval. + * @details This module implements a generic GPT (General Purpose Timer) + * driver. The timer can be programmed in order to trigger callbacks + * after a specified time period or continuously with a specified + * interval. * @pre In order to use the GPT driver the @p HAL_USE_GPT option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/hal.dox b/os/hal/dox/hal.dox index d08f10bcd..15b4401fb 100644 --- a/os/hal/dox/hal.dox +++ b/os/hal/dox/hal.dox @@ -20,16 +20,17 @@ /** * @defgroup HAL HAL Driver - * @brief Hardware Abstraction Layer. - * @details The HAL driver performs the system initialization and includes - * the platform support code shared by the other drivers. This driver does - * contain any API function except for a general initialization function - * @p halInit() that must be invoked before any HAL service can be used, - * usually the HAL initialization should be performed immediately before the - * kernel initialization.
- * Some HAL driver implementations also offer a custom early clock - * setum function that can be invoked before the C runtime initialization - * in order to accellerate the startup time. + * @brief Hardware Abstraction Layer. + * @details The HAL (Hardware Abstraction Layer) driver performs the system + * initialization and includes the platform support code shared by + * the other drivers. This driver does contain any API function + * except for a general initialization function @p halInit() that + * must be invoked before any HAL service can be used, usually the + * HAL initialization should be performed immediately before the + * kernel initialization.
+ * Some HAL driver implementations also offer a custom early clock + * setup function that can be invoked before the C runtime + * initialization in order to accelerate the startup time. * * @ingroup IO */ diff --git a/os/hal/dox/i2c.dox b/os/hal/dox/i2c.dox index 391fbb62e..1ffd2da47 100644 --- a/os/hal/dox/i2c.dox +++ b/os/hal/dox/i2c.dox @@ -20,8 +20,9 @@ /** * @defgroup I2C I2C Driver - * @brief Generic I2C Driver. - * @details This module implements a generic I2C driver. + * @brief Generic I2C Driver. + * @details This module implements a generic I2C (Inter-Integrated Circuit) + * driver. * @pre In order to use the I2C driver the @p HAL_USE_I2C option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/icu.dox b/os/hal/dox/icu.dox new file mode 100644 index 000000000..c90dc237d --- /dev/null +++ b/os/hal/dox/icu.dox @@ -0,0 +1,115 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @defgroup ICU ICU Driver + * @brief Generic ICU Driver. + * @details This module implements a generic ICU (Input Capture Unit) driver. + * @pre In order to use the ICU driver the @p HAL_USE_ICU option + * must be enabled in @p halconf.h. + * + * @section icu_1 Driver State Machine + * The driver implements a state machine internally, not all the driver + * functionalities can be used in any moment, any transition not explicitly + * shown in the following diagram has to be considered an error and shall + * be captured by an assertion (if enabled). + * @if LATEX_PDF + * @dot + digraph example { + size="5, 7"; + rankdir="LR"; + + node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"]; + edge [fontname=Sans, fontsize=8]; + + stop [label="ICU_STOP\nLow Power"]; + uninit [label="ICU_UNINIT", style="bold"]; + ready [label="ICU_READY\nClock Enabled"]; + waiting [label="ICU_WAITING"]; + active [label="ICU_ACTIVE"]; + idle [label="ICU_IDLE"]; + + uninit -> stop [label=" icuInit()", constraint=false]; + stop -> stop [label="\nicuStop()"]; + stop -> ready [label="\nicuStart()"]; + ready -> stop [label="\nicuStop()"]; + ready -> ready [label="\nicuStart()\nicuDisable()"]; + ready -> waiting [label="\nicuEnable()"]; + waiting -> active [label="\nStart Front"]; + waiting -> ready [label="\nicuDisable()"]; + active -> idle [label="\nStop Front\n>width_cb<"]; + active -> ready [label="\nicuDisable()\nicuDisableI()"]; + idle -> active [label="\nStart Front\n>period_cb<"]; + idle -> ready [label="\nicuDisable()\nicuDisableI()"]; + } + * @enddot + * @else + * @dot + digraph example { + rankdir="LR"; + + node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"]; + edge [fontname=Sans, fontsize=8]; + + stop [label="ICU_STOP\nLow Power"]; + uninit [label="ICU_UNINIT", style="bold"]; + ready [label="ICU_READY\nClock Enabled"]; + waiting [label="ICU_WAITING"]; + active [label="ICU_ACTIVE"]; + idle [label="ICU_IDLE"]; + + uninit -> stop [label=" icuInit()", constraint=false]; + stop -> stop [label="\nicuStop()"]; + stop -> ready [label="\nicuStart()"]; + ready -> stop [label="\nicuStop()"]; + ready -> ready [label="\nicuStart()\nicuDisable()"]; + ready -> waiting [label="\nicuEnable()"]; + waiting -> active [label="\nStart Front"]; + waiting -> ready [label="\nicuDisable()"]; + active -> idle [label="\nStop Front\n>width_cb<"]; + active -> ready [label="\nicuDisable()\nicuDisableI()"]; + idle -> active [label="\nStart Front\n>period_cb<"]; + idle -> ready [label="\nicuDisable()\nicuDisableI()"]; + } + * @enddot + * @endif + * + * @section icu_2 ICU Operations. + * This driver abstracts a generic Input Capture Unit composed of: + * - A clock prescaler. + * - A main up counter. + * - Two capture registers triggered by the rising and falling edges on + * the sampled input. + * . + * The ICU unit can be programmed to synchronize on the rising or falling + * edge of the sample input: + * - ICU_INPUT_ACTIVE_HIGH, a rising edge is the start signal. + * - ICU_INPUT_ACTIVE_LOW, a falling edge is the start signal. + * . + * After the activation the ICU unit can be in one of the following + * states at any time: + * - ICU_WAITING, waiting the first start signal. + * - ICU_ACTIVE, after a start signal. + * - ICU_IDLE, after a stop signal. + * . + * Callbacks are invoked when start or stop signals occur. + * + * @ingroup IO + */ diff --git a/os/hal/dox/pwm.dox b/os/hal/dox/pwm.dox index 3f2bdfd71..fbf61ca9f 100644 --- a/os/hal/dox/pwm.dox +++ b/os/hal/dox/pwm.dox @@ -21,7 +21,8 @@ /** * @defgroup PWM PWM Driver * @brief Generic PWM Driver. - * @details This module implements a generic PWM driver. + * @details This module implements a generic PWM (Pulse Width Modulation) + * driver. * @pre In order to use the PWM driver the @p HAL_USE_PWM option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/spi.dox b/os/hal/dox/spi.dox index cd462b8ae..047ff646e 100644 --- a/os/hal/dox/spi.dox +++ b/os/hal/dox/spi.dox @@ -21,9 +21,9 @@ /** * @defgroup SPI SPI Driver * @brief Generic SPI Driver. - * @details This module implements a generic SPI driver allowing bidirectional - * and monodirectional transfers, complex atomic transactions are - * supported as well. + * @details This module implements a generic SPI (Serial Peripheral Interface) + * driver allowing bidirectional and monodirectional transfers, + * complex atomic transactions are supported as well. * @pre In order to use the SPI driver the @p HAL_USE_SPI option * must be enabled in @p halconf.h. * diff --git a/os/hal/dox/uart.dox b/os/hal/dox/uart.dox index fe7a31534..7fea38dcb 100644 --- a/os/hal/dox/uart.dox +++ b/os/hal/dox/uart.dox @@ -21,8 +21,8 @@ /** * @defgroup UART UART Driver * @brief Generic UART Driver. - * @details This driver abstracts a generic UART peripheral, the API is - * designed to be: + * @details This driver abstracts a generic UART (Universal Asynchronous + * Receiver Transmitter) peripheral, the API is designed to be: * - Unbuffered and copy-less, transfers are always directly performed * from/to the application-level buffers without extra copy * operations. diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index ebf2042a0..62b3aaf12 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -21,8 +21,8 @@ /** * @defgroup USB USB Driver * @brief Generic USB Driver. - * @details This module implements a generic USB driver supporting device-mode - * operations. + * @details This module implements a generic USB (Universal Serial Bus) driver + * supporting device-mode operations. * @pre In order to use the USB driver the @p HAL_USE_USB option * must be enabled in @p halconf.h. * diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h new file mode 100644 index 000000000..1f4e58ece --- /dev/null +++ b/os/hal/include/icu.h @@ -0,0 +1,131 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file icu.h + * @brief ICU Driver macros and structures. + * + * @addtogroup ICU + * @{ + */ + +#ifndef _ICU_H_ +#define _ICU_H_ + +#if HAL_USE_ICU || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Driver state machine possible states. + */ +typedef enum { + ICU_UNINIT = 0, /**< Not initialized. */ + ICU_STOP = 1, /**< Stopped. */ + ICU_READY = 2, /**< Ready. */ + ICU_WAITING = 3, /**< Waiting first edge. */ + ICU_ACTIVE = 4, /**< Active cycle phase. */ + ICU_IDLE = 5, /**< Idle cycle phase. */ +} icustate_t; + +#include "icu_lld.h" + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/** + * @brief Enables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @iclass + */ +void icuEnableI(icup) icu_lld_enable(icup) + +/** + * @brief Disables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @iclass + */ +void icuDisableI(ICUDriver *icup) icu_lld_disable(icup) + +/** + * @brief Returns the width of the latest pulse. + * @details The pulse width is defined as number of ticks between the start + * edge and the stop edge. + * + * @param[in] icup pointer to the @p ICUDriver object + * @return The number of ticks. + * + * @iclass + */ +#define icuGetWidthI(icup) icu_lld_get_width(icup) + +/** + * @brief Returns the width of the latest cycle. + * @details The cycle width is defined as number of ticks between a start + * edge and the next start edge. + * + * @param[in] icup pointer to the @p ICUDriver object + * @return The number of ticks. + * + * @iclass + */ +#define icuGetPeriodI(icup) icu_lld_get_period(icup) + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void icuInit(void); + void icuObjectInit(ICUDriver *icup); + void icuStart(ICUDriver *icup, const ICUConfig *config); + void icuStop(ICUDriver *icup); + void icuEnableI(ICUDriver *icup); + void icuDisableI(ICUDriver *icup); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_ICU */ + +#endif /* _ICU_H_ */ + +/** @} */ diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c new file mode 100644 index 000000000..6877b2d72 --- /dev/null +++ b/os/hal/platforms/STM32/icu_lld.c @@ -0,0 +1,221 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32/icu_lld.c + * @brief STM32 ICU subsystem low level driver header. + * + * @addtogroup ICU + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_ICU || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/** + * @brief ICU1 driver identifier. + * @note The driver ICUD1 allocates the complex timer TIM1 when enabled. + */ +#if STM32_ICU_USE_TIM1 || defined(__DOXYGEN__) +ICUDriver ICUD1; +#endif + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +#if STM32_ICU_USE_TIM1 +/** + * @brief TIM1 update interrupt handler. + * @note It is assumed that this interrupt is only activated if the callback + * pointer is not equal to @p NULL in order to not perform an extra + * check in a potentially critical interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM1_UP_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + TIM1->SR = ~TIM_SR_UIF; + ICUD1.config->callback(&ICUD1); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief TIM1 compare interrupt handler. + * @note It is assumed that the various sources are only activated if the + * associated callback pointer is not equal to @p NULL in order to not + * perform an extra check in a potentially critical interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM1_CC_IRQHandler) { + uint16_t sr; + + CH_IRQ_PROLOGUE(); + + sr = TIM1->SR & TIM1->DIER; + TIM1->SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | TIM_SR_CC4IF); + if ((sr & TIM_SR_CC1IF) != 0) + ICUD1.config->channels[0].callback(&ICUD1); + if ((sr & TIM_SR_CC2IF) != 0) + ICUD1.config->channels[1].callback(&ICUD1); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_ICU_USE_TIM1 */ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level ICU driver initialization. + * + * @notapi + */ +void icu_lld_init(void) { + +#if STM32_ICU_USE_TIM1 + /* Driver initialization.*/ + icuObjectInit(&ICUD1); + ICUD1.tim = TIM1; +#endif +} + +/** + * @brief Configures and activates the ICU peripheral. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_start(ICUDriver *icup) { + + if (icup->state == ICU_STOP) { + /* Clock activation and timer reset.*/ +#if STM32_ICU_USE_TIM1 + if (&ICUD1 == icup) { + RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; + RCC->APB2RSTR = RCC_APB2RSTR_TIM1RST; + RCC->APB2RSTR = 0; + NVICEnableVector(TIM1_UP_IRQn, + CORTEX_PRIORITY_MASK(STM32_ICU_TIM1_IRQ_PRIORITY)); + NVICEnableVector(TIM1_CC_IRQn, + CORTEX_PRIORITY_MASK(STM32_ICU_TIM1_IRQ_PRIORITY)); + } +#endif + } + + /* Timer configuration, PWM input mode.*/ + icup->tim->CR1 = 0; /* Initially stopped. */ + icup->tim->CR2 = 0; + icup->tim->ARR = 0xFFFF; + icup->tim->PSC = icup->config->psc; /* Prescaler value. */ + icup->tim->DIER = 0; + /* CCMR1_CC1S = 01 = CH1 Input on TI1. + CCMR1_CC2S = 10 = CH2 Input on TI2.*/ + icup->tim->CCMR1 = TIM_CCMR1_CC1S_0 | + TIM_CCMR1_CC2S_1; + /* SMCR_TS = 101, input is TI1FP1. + SMCR_SMS = 100, reset on rising edge.*/ + icup->tim->SMCR = TIM_SMCR_TS_2 | TIM_SMCR_TS_0 | + TIM_SMCR_SMS_2. + /* The CCER settings depend on the selected trigger mode. + ICU_INPUT_ACTIVE_HIGH: Active on rising edge, idle on falling edge. + ICU_INPUT_ACTIVE_LOW: Active on falling edge, idle on rising edge.*/ + if (icup->config->mode == ICU_INPUT_ACTIVE_HIGH) + icup->tim->CCER = TIM_CCER_CC1E | + TIM_CCER_CC2E | TIM_CCER_CC2P; + else + icup->tim->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P + TIM_CCER_CC2E; +} + +/** + * @brief Deactivates the ICU peripheral. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_stop(ICUDriver *icup) { + + if (icup->state == ICU_READY) { + /* Clock deactivation.*/ + icup->tim->CR1 = 0; /* Timer disabled. */ + icup->tim->DIER = 0; /* All IRQs disabled. */ + +#if STM32_ICU_USE_TIM1 + if (&ICUD1 == icup) { + NVICDisableVector(TIM1_UP_IRQn); + RCC->APB2ENR &= ~RCC_APB2ENR_TIM1EN; + } +#endif + } +} + +/** + * @brief Enables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_enable(ICUDriver *icup) { + + icup->tim->SR = 0; /* Clear pending IRQs (if any). */ + icup->tim->DIER = TIM_DIER_CC1IE | TIM_DIER_CC2IE; + icup->tim->CR1 = TIM_CR1_URS | TIM_CR1_CEN; +} + +/** + * @brief Disables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_disable(ICUDriver *icup) { + + icup->tim->CR1 = 0; /* Initially stopped. */ + icup->tim->SR = 0; /* Clear pending IRQs (if any). */ + icup->tim->DIER = 0; /* Interrupts disabled. */ +} + +#endif /* HAL_USE_ICU */ + +/** @} */ diff --git a/os/hal/platforms/STM32/icu_lld.h b/os/hal/platforms/STM32/icu_lld.h new file mode 100644 index 000000000..78efa9765 --- /dev/null +++ b/os/hal/platforms/STM32/icu_lld.h @@ -0,0 +1,230 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32/icu_lld.h + * @brief STM32 ICU subsystem low level driver header. + * + * @addtogroup ICU + * @{ + */ + +#ifndef _ICU_LLD_H_ +#define _ICU_LLD_H_ + +#if HAL_USE_ICU || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief ICUD1 driver enable switch. + * @details If set to @p TRUE the support for ICUD1 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_ICU_USE_TIM1) || defined(__DOXYGEN__) +#define STM32_ICU_USE_TIM1 TRUE +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +#if STM32_ICU_USE_TIM1 && !STM32_HAS_TIM1 +#error "TIM1 not present in the selected device" +#endif + +#if STM32_ICU_USE_TIM2 && !STM32_HAS_TIM2 +#error "TIM2 not present in the selected device" +#endif + +#if STM32_ICU_USE_TIM3 && !STM32_HAS_TIM3 +#error "TIM3 not present in the selected device" +#endif + +#if STM32_ICU_USE_TIM4 && !STM32_HAS_TIM4 +#error "TIM4 not present in the selected device" +#endif + +#if STM32_ICU_USE_TIM5 && !STM32_HAS_TIM5 +#error "TIM5 not present in the selected device" +#endif + +#if !STM32_ICU_USE_TIM1 && !STM32_ICU_USE_TIM2 && \ + !STM32_ICU_USE_TIM3 && !STM32_ICU_USE_TIM4 && \ + !STM32_ICU_USE_TIM5 +#error "ICU driver activated but no TIM peripheral assigned" +#endif + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief ICU driver mode. + */ +typedef enum { + ICU_INPUT_ACTIVE_HIGH = 0, /**< Trigger on rising edge. */ + ICU_INPUT_ACTIVE_LOW = 1, /**< Trigger on falling edge. */ +} icumode_t; + +/** + * @brief ICU counter type. + */ +typedef uint16_t icucnt_t; + +/** + * @brief Type of a structure representing an ICU driver. + */ +typedef struct ICUDriver ICUDriver; + +/** + * @brief ICU notification callback type. + * + * @param[in] icup pointer to a @p ICUDriver object + */ +typedef void (*icucallback_t)(ICUDriver *icup); + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Driver mode. + */ + icumode_t mode; + /** + * @brief Callback for pulse width measurement. + */ + icucallback_t width_cb; + /** + * @brief Callback for cycle period measurement. + */ + icucallback_t period_cb; + /* End of the mandatory fields.*/ + /** + * @brief TIM PSC (pre-scaler) register initialization data. + */ + uint16_t psc; +} ICUConfig; + +/** + * @brief Structure representing an ICU driver. + */ +struct ICUDriver { + /** + * @brief Driver state. + */ + icustate_t state; + /** + * @brief Current configuration data. + */ + const ICUConfig *config; + /* End of the mandatory fields.*/ + /** + * @brief Pointer to the TIMx registers block. + */ + TIM_TypeDef *tim; +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + + +/** + * @brief Returns the width of the latest pulse. + * @details The pulse width is defined as number of ticks between the start + * edge and the stop edge. + * + * @param[in] icup pointer to the @p ICUDriver object + * @return The number of ticks. + * + * @notapi + */ +#define icu_lld_get_width(icup) ((icup)->tim->CCR2) + +/** + * @brief Returns the width of the latest cycle. + * @details The cycle width is defined as number of ticks between a start + * edge and the next start edge. + * + * @param[in] icup pointer to the @p ICUDriver object + * @return The number of ticks. + * + * @notapi + */ +#define icu_lld_get_period(icup) ((icup)->tim->CCR1) + +/** + * @brief ICU clock prescaler initialization utility. + * @note The real clock value is rounded to the lower valid value, please + * make sure that the source clock frequency is a multiple of the + * requested ICU clock frequency. + * @note The calculated value must fit into an unsigned 16 bits integer. + * + * @param[in] clksrc clock source frequency, depending on the target timer + * cell it can be one of: + * - STM32_TIMCLK1 + * - STM32_TIMCLK2 + * . + * Please refer to the STM32 HAL driver documentation + * and/or the STM32 Reference Manual for the right clock + * source. + * @param[in] icuclk ICU clock frequency in cycles + * @return The value to be stored in the @p psc field of the + * @p ICUConfig structure. + */ +#define ICU_COMPUTE_PSC(clksrc, icuclk) \ + ((uint16_t)(((clksrc) / (icuclk)) - 1)) + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#if STM32_ICU_USE_TIM1 && !defined(__DOXYGEN__) +extern ICUDriver ICUD1; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + void icu_lld_init(void); + void icu_lld_start(ICUDriver *icup); + void icu_lld_stop(ICUDriver *icup); + void icu_lld_enable(ICUDriver *icup); + void icu_lld_disable(ICUDriver *icup); + icucnt_t icu_lld_get_width(ICUDriver *icup); + icucnt_t icu_lld_get_period(ICUDriver *icup); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_ICU */ + +#endif /* _ICU_LLD_H_ */ + +/** @} */ diff --git a/os/hal/src/icu.c b/os/hal/src/icu.c new file mode 100644 index 000000000..3be67448e --- /dev/null +++ b/os/hal/src/icu.c @@ -0,0 +1,151 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file icu.c + * @brief ICU Driver code. + * + * @addtogroup ICU + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_ICU || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief ICU Driver initialization. + * @note This function is implicitly invoked by @p halInit(), there is + * no need to explicitly initialize the driver. + * + * @init + */ +void icuInit(void) { + + icu_lld_init(); +} + +/** + * @brief Initializes the standard part of a @p ICUDriver structure. + * + * @param[out] icup pointer to the @p ICUDriver object + * + * @init + */ +void icuObjectInit(ICUDriver *icup) { + + icup->state = ICU_STOP; + icup->config = NULL; +} + +/** + * @brief Configures and activates the ICU peripheral. + * + * @param[in] icup pointer to the @p ICUDriver object + * @param[in] config pointer to the @p ICUConfig object + * + * @api + */ +void icuStart(ICUDriver *icup, const ICUConfig *config) { + + chDbgCheck((icup != NULL) && (config != NULL), "icuStart"); + + chSysLock(); + chDbgAssert((icup->state == ICU_STOP) || (icup->state == ICU_READY), + "icuStart(), #1", "invalid state"); + icup->config = config; + icu_lld_start(icup); + icup->state = ICU_READY; + chSysUnlock(); +} + +/** + * @brief Deactivates the ICU peripheral. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @api + */ +void icuStop(ICUDriver *icup) { + + chDbgCheck(icup != NULL, "icuStop"); + + chSysLock(); + chDbgAssert((icup->state == ICU_STOP) || (icup->state == ICU_READY), + "icuStop(), #1", "invalid state"); + icu_lld_stop(icup); + icup->state = ICU_STOP; + chSysUnlock(); +} + +/** + * @brief Enables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @api + */ +void icuEnable(ICUDriver *icup) { + + chSysLock(); + chDbgAssert(icup->state == ICU_READY, "icuEnable(), #1", "invalid state"); + icu_lld_enable(icup); + icup->state = ICU_WAITING; + chSysUnlock(); +} + +/** + * @brief Disables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @api + */ +void icuDisable(ICUDriver *icup) { + + chSysLock(); + chDbgAssert((icup->state == ICU_READY) || (icup->state == ICU_WAITING) || + (icup->state == ICU_ACTIVE) || (icup->state == ICU_IDLE), + "icuDisable(), #1", "invalid state"); + icu_lld_disable(icup); + icup->state = ICU_READY; + chSysUnlock(); +} + +#endif /* HAL_USE_ICU */ + +/** @} */ diff --git a/os/hal/templates/icu_lld.c b/os/hal/templates/icu_lld.c new file mode 100644 index 000000000..3611c1baa --- /dev/null +++ b/os/hal/templates/icu_lld.c @@ -0,0 +1,145 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/icu_lld.c + * @brief ICU Driver subsystem low level driver source template. + * + * @addtogroup ICU + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_ICU || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level ICU driver initialization. + * + * @notapi + */ +void icu_lld_init(void) { + +} + +/** + * @brief Configures and activates the ICU peripheral. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_start(ICUDriver *icup) { + + if (icup->state == ICU_STOP) { + /* Clock activation.*/ + } + /* Configuration.*/ +} + +/** + * @brief Deactivates the ICU peripheral. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_stop(ICUDriver *icup) { + + if (icup->state == ICU_READY) { + /* Clock deactivation.*/ + + } +} + +/** + * @brief Enables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_enable(ICUDriver *icup) { + +} + +/** + * @brief Disables the input capture. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +void icu_lld_disable(ICUDriver *icup) { + +} + +/** + * @brief Returns the width of the latest pulse. + * @details The pulse width is defined as number of ticks between the start + * edge and the stop edge. + * + * @param[in] icup pointer to the @p ICUDriver object + * @return The number of ticks. + * + * @notapi + */ +icucnt_t icu_lld_get_width(icup) { + +} + +/** + * @brief Returns the width of the latest cycle. + * @details The cycle width is defined as number of ticks between a start + * edge and the next start edge. + * + * @param[in] icup pointer to the @p ICUDriver object + * @return The number of ticks. + * + * @notapi + */ +icucnt_t icu_lld_get_period(icup) { + +} + +#endif /* HAL_USE_ICU */ + +/** @} */ diff --git a/os/hal/templates/icu_lld.h b/os/hal/templates/icu_lld.h new file mode 100644 index 000000000..b0debb2b9 --- /dev/null +++ b/os/hal/templates/icu_lld.h @@ -0,0 +1,136 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/icu_lld.h + * @brief ICU Driver subsystem low level driver header template. + * + * @addtogroup ICU + * @{ + */ + +#ifndef _ICU_LLD_H_ +#define _ICU_LLD_H_ + +#if HAL_USE_ICU || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief ICU driver mode. + */ +typedef enum { + ICU_INPUT_ACTIVE_HIGH = 0, /**< Trigger on rising edge. */ + ICU_INPUT_ACTIVE_LOW = 1, /**< Trigger on falling edge. */ +} icumode_t; + +/** + * @brief ICU counter type. + */ +typedef uint16_t icucnt_t; + +/** + * @brief Type of a structure representing an ICU driver. + */ +typedef struct ICUDriver ICUDriver; + +/** + * @brief ICU notification callback type. + * + * @param[in] icup pointer to a @p ICUDriver object + */ +typedef void (*icucallback_t)(ICUDriver *icup); + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Driver mode. + */ + icumode_t mode; + /** + * @brief Callback for pulse width measurement. + */ + icucallback_t width_cb; + /** + * @brief Callback for cycle period measurement. + */ + icucallback_t period_cb; + /* End of the mandatory fields.*/ +} ICUConfig; + +/** + * @brief Structure representing an ICU driver. + */ +struct ICUDriver { + /** + * @brief Driver state. + */ + icustate_t state; + /** + * @brief Current configuration data. + */ + const ICUConfig *config; + /* End of the mandatory fields.*/ +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void icu_lld_init(void); + void icu_lld_start(ICUDriver *icup); + void icu_lld_stop(ICUDriver *icup); + void icu_lld_enable(ICUDriver *icup); + void icu_lld_disable(ICUDriver *icup); + icucnt_t icu_lld_get_width(ICUDriver *icup); + icucnt_t icu_lld_get_period(ICUDriver *icup); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_ICU */ + +#endif /* _ICU_LLD_H_ */ + +/** @} */ diff --git a/readme.txt b/readme.txt index cbe419915..8cfda4619 100644 --- a/readme.txt +++ b/readme.txt @@ -79,6 +79,8 @@ - FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). +- NEW: Added new ICU driver model, Input Capture Unit.. +- NEW: ICU driver implementation for STM32. - NEW: Implemented stack checking in the Cortex-Mx RVCT port (backported to 2.2.3). - NEW: Added support for PLL3 in STM32 HAL driver. Note, the format of the -- cgit v1.2.3 From 94d34da7f123be71a592f1f883a17fd3389fc803 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Mar 2011 18:01:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2849 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/icu.h | 4 ++-- os/hal/templates/icu_lld.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index 1f4e58ece..f13349760 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -72,7 +72,7 @@ typedef enum { * * @iclass */ -void icuEnableI(icup) icu_lld_enable(icup) +#define icuEnableI(icup) icu_lld_enable(icup) /** * @brief Disables the input capture. @@ -81,7 +81,7 @@ void icuEnableI(icup) icu_lld_enable(icup) * * @iclass */ -void icuDisableI(ICUDriver *icup) icu_lld_disable(icup) +#define icuDisableI(icup) icu_lld_disable(icup) /** * @brief Returns the width of the latest pulse. diff --git a/os/hal/templates/icu_lld.c b/os/hal/templates/icu_lld.c index 3611c1baa..23596bc97 100644 --- a/os/hal/templates/icu_lld.c +++ b/os/hal/templates/icu_lld.c @@ -122,7 +122,7 @@ void icu_lld_disable(ICUDriver *icup) { * * @notapi */ -icucnt_t icu_lld_get_width(icup) { +icucnt_t icu_lld_get_width(ICUDriver *icup) { } @@ -136,7 +136,7 @@ icucnt_t icu_lld_get_width(icup) { * * @notapi */ -icucnt_t icu_lld_get_period(icup) { +icucnt_t icu_lld_get_period(ICUDriver *icup) { } -- cgit v1.2.3 From f5ae2552307f20f3fa3d987591fa60576981ce3d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Mar 2011 14:51:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2850 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile_chm | 61 ++++++++-- docs/Doxyfile_html | 61 ++++++++-- docs/readme.txt | 2 +- docs/rsc/layout.xml | 20 ++-- os/hal/hal.mk | 1 + os/hal/include/hal.h | 1 + os/hal/platforms/STM32/gpt_lld.c | 20 ++-- os/hal/platforms/STM32/gpt_lld.h | 33 +++--- os/hal/platforms/STM32/icu_lld.c | 234 +++++++++++++++++++++++++++++++++---- os/hal/platforms/STM32/icu_lld.h | 92 ++++++++++++++- os/hal/platforms/STM32/platform.mk | 1 + os/hal/platforms/STM32/pwm_lld.c | 20 ++-- os/hal/platforms/STM32/pwm_lld.h | 30 ++--- os/hal/platforms/STM32/usb_lld.h | 3 + os/hal/templates/gpt_lld.h | 3 + os/hal/templates/icu_lld.h | 3 + os/hal/templates/usb_lld.h | 3 + os/kernel/include/chdebug.h | 2 +- os/kernel/include/chheap.h | 2 +- os/kernel/include/chmemcore.h | 2 +- os/kernel/include/chschd.h | 2 +- os/kernel/include/chvt.h | 2 +- os/kernel/src/chdebug.c | 2 +- os/kernel/src/chheap.c | 2 +- os/kernel/src/chmemcore.c | 2 +- os/kernel/src/chschd.c | 2 +- os/kernel/src/chsys.c | 10 +- os/kernel/src/chvt.c | 2 +- readme.txt | 4 +- testhal/STM32/PWM/halconf.h | 7 ++ testhal/STM32/PWM/mcuconf.h | 14 +++ todo.txt | 4 +- 32 files changed, 517 insertions(+), 130 deletions(-) diff --git a/docs/Doxyfile_chm b/docs/Doxyfile_chm index 83957f61b..be256da4e 100644 --- a/docs/Doxyfile_chm +++ b/docs/Doxyfile_chm @@ -1,4 +1,4 @@ -# Doxyfile 1.7.3 +# Doxyfile 1.7.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -33,7 +33,9 @@ PROJECT_NAME = ChibiOS/RT PROJECT_NUMBER = 2.3.1 -# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = @@ -304,6 +306,13 @@ DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct @@ -479,8 +488,11 @@ SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO @@ -924,7 +936,13 @@ HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a -# standard header. +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = ./rsc/header_chm.html @@ -943,6 +961,15 @@ HTML_FOOTER = ./rsc/footer_chm.html HTML_STYLESHEET = +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the stylesheet and background images # according to this color. Hue is specified as an angle on a colorwheel, @@ -1145,9 +1172,10 @@ ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [0,1..20]) -# that doxygen will group on one line in the generated HTML documentation. -# Note that a value of 0 will completely suppress the enum values from appearing in the overview section. +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 @@ -1206,7 +1234,8 @@ USE_MATHJAX = NO # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing # MathJax, but it is strongly recommended to install a local copy of MathJax # before deployment. @@ -1285,6 +1314,13 @@ EXTRA_PACKAGES = LATEX_HEADER = +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references @@ -1494,7 +1530,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. +# pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES @@ -1524,7 +1560,8 @@ PREDEFINED = __DOXYGEN__ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. EXPAND_AS_DEFINED = @@ -1717,7 +1754,7 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, svg, gif or svg. +# generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. DOT_IMAGE_FORMAT = png diff --git a/docs/Doxyfile_html b/docs/Doxyfile_html index 8a6ca46a4..fb83e9e23 100644 --- a/docs/Doxyfile_html +++ b/docs/Doxyfile_html @@ -1,4 +1,4 @@ -# Doxyfile 1.7.3 +# Doxyfile 1.7.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -33,7 +33,9 @@ PROJECT_NAME = ChibiOS/RT PROJECT_NUMBER = 2.3.1 -# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = @@ -304,6 +306,13 @@ DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct @@ -479,8 +488,11 @@ SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO @@ -924,7 +936,13 @@ HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a -# standard header. +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = ./rsc/header_html.html @@ -943,6 +961,15 @@ HTML_FOOTER = ./rsc/footer_html.html HTML_STYLESHEET = +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the stylesheet and background images # according to this color. Hue is specified as an angle on a colorwheel, @@ -1145,9 +1172,10 @@ ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [0,1..20]) -# that doxygen will group on one line in the generated HTML documentation. -# Note that a value of 0 will completely suppress the enum values from appearing in the overview section. +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 @@ -1206,7 +1234,8 @@ USE_MATHJAX = NO # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing # MathJax, but it is strongly recommended to install a local copy of MathJax # before deployment. @@ -1285,6 +1314,13 @@ EXTRA_PACKAGES = LATEX_HEADER = +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references @@ -1494,7 +1530,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. +# pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES @@ -1524,7 +1560,8 @@ PREDEFINED = __DOXYGEN__ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. EXPAND_AS_DEFINED = @@ -1717,7 +1754,7 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, svg, gif or svg. +# generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. DOT_IMAGE_FORMAT = png diff --git a/docs/readme.txt b/docs/readme.txt index 23f14ef60..9924d779f 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -1,7 +1,7 @@ *** Documentation build procedure *** The following software must be installed: -- Doxygen 1.7.3 or later. +- Doxygen 1.7.4 or later. - Graphviz 2.26.3 or later. The ./bin directory must be specified in the path in order to make Graphviz accessible by Doxygen. diff --git a/docs/rsc/layout.xml b/docs/rsc/layout.xml index 4c98c929e..0a24b84a0 100644 --- a/docs/rsc/layout.xml +++ b/docs/rsc/layout.xml @@ -24,7 +24,8 @@ - + + @@ -61,7 +62,6 @@ - @@ -78,7 +78,8 @@ - + + @@ -88,7 +89,6 @@ - @@ -100,7 +100,8 @@ - + + @@ -115,7 +116,6 @@ - @@ -128,8 +128,9 @@ - + + @@ -151,7 +152,6 @@ - @@ -173,12 +173,12 @@ - + + - diff --git a/os/hal/hal.mk b/os/hal/hal.mk index 49561ee8d..52b9fab81 100644 --- a/os/hal/hal.mk +++ b/os/hal/hal.mk @@ -5,6 +5,7 @@ HALSRC = ${CHIBIOS}/os/hal/src/hal.c \ ${CHIBIOS}/os/hal/src/can.c \ ${CHIBIOS}/os/hal/src/gpt.c \ ${CHIBIOS}/os/hal/src/i2c.c \ + ${CHIBIOS}/os/hal/src/icu.c \ ${CHIBIOS}/os/hal/src/mac.c \ ${CHIBIOS}/os/hal/src/pal.c \ ${CHIBIOS}/os/hal/src/pwm.c \ diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h index bd234a494..400aec17f 100644 --- a/os/hal/include/hal.h +++ b/os/hal/include/hal.h @@ -39,6 +39,7 @@ #include "can.h" #include "gpt.h" #include "i2c.h" +#include "icu.h" #include "mac.h" #include "pwm.h" #include "serial.h" diff --git a/os/hal/platforms/STM32/gpt_lld.c b/os/hal/platforms/STM32/gpt_lld.c index 0c84b6a0a..ffbfe475c 100644 --- a/os/hal/platforms/STM32/gpt_lld.c +++ b/os/hal/platforms/STM32/gpt_lld.c @@ -48,40 +48,40 @@ /*===========================================================================*/ /** - * @brief GPT1 driver identifier. - * @note The driver GPT1 allocates the complex timer TIM1 when enabled. + * @brief GPTD1 driver identifier. + * @note The driver GPTD1 allocates the complex timer TIM1 when enabled. */ #if STM32_GPT_USE_TIM1 || defined(__DOXYGEN__) GPTDriver GPTD1; #endif /** - * @brief GPT2 driver identifier. - * @note The driver GPT2 allocates the timer TIM2 when enabled. + * @brief GPTD2 driver identifier. + * @note The driver GPTD2 allocates the timer TIM2 when enabled. */ #if STM32_GPT_USE_TIM2 || defined(__DOXYGEN__) GPTDriver GPTD2; #endif /** - * @brief GPT3 driver identifier. - * @note The driver GPT3 allocates the timer TIM3 when enabled. + * @brief GPTD3 driver identifier. + * @note The driver GPTD3 allocates the timer TIM3 when enabled. */ #if STM32_GPT_USE_TIM3 || defined(__DOXYGEN__) GPTDriver GPTD3; #endif /** - * @brief GPT4 driver identifier. - * @note The driver GPT4 allocates the timer TIM4 when enabled. + * @brief GPTD4 driver identifier. + * @note The driver GPTD4 allocates the timer TIM4 when enabled. */ #if STM32_GPT_USE_TIM4 || defined(__DOXYGEN__) GPTDriver GPTD4; #endif /** - * @brief GPT5 driver identifier. - * @note The driver GPT5 allocates the timer TIM5 when enabled. + * @brief GPTD5 driver identifier. + * @note The driver GPTD5 allocates the timer TIM5 when enabled. */ #if STM32_GPT_USE_TIM5 || defined(__DOXYGEN__) GPTDriver GPTD5; diff --git a/os/hal/platforms/STM32/gpt_lld.h b/os/hal/platforms/STM32/gpt_lld.h index 37836ddab..2d7fd13f1 100644 --- a/os/hal/platforms/STM32/gpt_lld.h +++ b/os/hal/platforms/STM32/gpt_lld.h @@ -40,8 +40,8 @@ /*===========================================================================*/ /** - * @brief GPT1 driver enable switch. - * @details If set to @p TRUE the support for GPT1 is included. + * @brief GPTD1 driver enable switch. + * @details If set to @p TRUE the support for GPTD1 is included. * @note The default is @p TRUE. */ #if !defined(STM32_GPT_USE_TIM1) || defined(__DOXYGEN__) @@ -49,8 +49,8 @@ #endif /** - * @brief GPT2 driver enable switch. - * @details If set to @p TRUE the support for GPT2 is included. + * @brief GPTD2 driver enable switch. + * @details If set to @p TRUE the support for GPTD2 is included. * @note The default is @p TRUE. */ #if !defined(STM32_GPT_USE_TIM2) || defined(__DOXYGEN__) @@ -58,8 +58,8 @@ #endif /** - * @brief GPT3 driver enable switch. - * @details If set to @p TRUE the support for GPT3 is included. + * @brief GPTD3 driver enable switch. + * @details If set to @p TRUE the support for GPTD3 is included. * @note The default is @p TRUE. */ #if !defined(STM32_GPT_USE_TIM3) || defined(__DOXYGEN__) @@ -67,8 +67,8 @@ #endif /** - * @brief GPT4 driver enable switch. - * @details If set to @p TRUE the support for GPT4 is included. + * @brief GPTD4 driver enable switch. + * @details If set to @p TRUE the support for GPTD4 is included. * @note The default is @p TRUE. */ #if !defined(STM32_GPT_USE_TIM4) || defined(__DOXYGEN__) @@ -76,8 +76,8 @@ #endif /** - * @brief GPT5 driver enable switch. - * @details If set to @p TRUE the support for GPT5 is included. + * @brief GPTD5 driver enable switch. + * @details If set to @p TRUE the support for GPTD5 is included. * @note The default is @p TRUE. */ #if !defined(STM32_GPT_USE_TIM5) || defined(__DOXYGEN__) @@ -85,35 +85,35 @@ #endif /** - * @brief GPT1 interrupt priority level setting. + * @brief GPTD1 interrupt priority level setting. */ #if !defined(STM32_GPT_TIM1_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_GPT_TIM1_IRQ_PRIORITY 7 #endif /** - * @brief GPT2 interrupt priority level setting. + * @brief GPTD2 interrupt priority level setting. */ #if !defined(STM32_GPT_TIM2_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_GPT_TIM2_IRQ_PRIORITY 7 #endif /** - * @brief GPT3 interrupt priority level setting. + * @brief GPTD3 interrupt priority level setting. */ #if !defined(STM32_GPT_TIM3_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_GPT_TIM3_IRQ_PRIORITY 7 #endif /** - * @brief GPT4 interrupt priority level setting. + * @brief GPTD4 interrupt priority level setting. */ #if !defined(STM32_GPT_TIM4_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #endif /** - * @brief GPT5 interrupt priority level setting. + * @brief GPTD5 interrupt priority level setting. */ #if !defined(STM32_GPT_TIM5_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_GPT_TIM5_IRQ_PRIORITY 7 @@ -206,6 +206,9 @@ struct GPTDriver { * @brief Current configuration data. */ const GPTConfig *config; +#if defined(GPT_DRIVER_EXT_FIELDS) + GPT_DRIVER_EXT_FIELDS +#endif /* End of the mandatory fields.*/ /** * @brief Timer base clock. diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index 6877b2d72..04c2f6372 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -36,13 +36,45 @@ /*===========================================================================*/ /** - * @brief ICU1 driver identifier. + * @brief ICUD1 driver identifier. * @note The driver ICUD1 allocates the complex timer TIM1 when enabled. */ #if STM32_ICU_USE_TIM1 || defined(__DOXYGEN__) ICUDriver ICUD1; #endif +/** + * @brief ICUD2 driver identifier. + * @note The driver ICUD1 allocates the timer TIM2 when enabled. + */ +#if STM32_ICU_USE_TIM2 || defined(__DOXYGEN__) +ICUDriver ICUD2; +#endif + +/** + * @brief ICUD3 driver identifier. + * @note The driver ICUD1 allocates the timer TIM3 when enabled. + */ +#if STM32_ICU_USE_TIM3 || defined(__DOXYGEN__) +ICUDriver ICUD3; +#endif + +/** + * @brief ICUD4 driver identifier. + * @note The driver ICUD4 allocates the timer TIM4 when enabled. + */ +#if STM32_ICU_USE_TIM4 || defined(__DOXYGEN__) +ICUDriver ICUD4; +#endif + +/** + * @brief ICUD5 driver identifier. + * @note The driver ICUD5 allocates the timer TIM5 when enabled. + */ +#if STM32_ICU_USE_TIM5 || defined(__DOXYGEN__) +ICUDriver ICUD5; +#endif + /*===========================================================================*/ /* Driver local variables. */ /*===========================================================================*/ @@ -51,52 +83,120 @@ ICUDriver ICUD1; /* Driver local functions. */ /*===========================================================================*/ +/** + * @brief Shared IRQ handler. + * + * @param[in] icup pointer to the @p ICUDriver object + */ +static void icu_lld_serve_interrupt(ICUDriver *icup) { + uint16_t sr; + + sr = TIM1->SR & TIM1->DIER; + icup->tim->SR = 0; + if ((sr & TIM_SR_CC1IF) != 0) + icup->config->period_cb(icup); + if ((sr & TIM_SR_CC2IF) != 0) + icup->config->width_cb(icup); +} + /*===========================================================================*/ /* Driver interrupt handlers. */ /*===========================================================================*/ #if STM32_ICU_USE_TIM1 /** - * @brief TIM1 update interrupt handler. - * @note It is assumed that this interrupt is only activated if the callback - * pointer is not equal to @p NULL in order to not perform an extra - * check in a potentially critical interrupt handler. + * @brief TIM1 compare interrupt handler. + * @note It is assumed that the various sources are only activated if the + * associated callback pointer is not equal to @p NULL in order to not + * perform an extra check in a potentially critical interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM1_CC_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + icu_lld_serve_interrupt(&ICUD1); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_ICU_USE_TIM1 */ + +#if STM32_ICU_USE_TIM2 +/** + * @brief TIM2 compare interrupt handler. + * @note It is assumed that the various sources are only activated if the + * associated callback pointer is not equal to @p NULL in order to not + * perform an extra check in a potentially critical interrupt handler. * * @isr */ -CH_IRQ_HANDLER(TIM1_UP_IRQHandler) { +CH_IRQ_HANDLER(TIM2_IRQHandler) { CH_IRQ_PROLOGUE(); - TIM1->SR = ~TIM_SR_UIF; - ICUD1.config->callback(&ICUD1); + icu_lld_serve_interrupt(&ICUD2); CH_IRQ_EPILOGUE(); } +#endif /* STM32_ICU_USE_TIM2 */ +#if STM32_ICU_USE_TIM3 /** - * @brief TIM1 compare interrupt handler. + * @brief TIM3 compare interrupt handler. * @note It is assumed that the various sources are only activated if the * associated callback pointer is not equal to @p NULL in order to not * perform an extra check in a potentially critical interrupt handler. * * @isr */ -CH_IRQ_HANDLER(TIM1_CC_IRQHandler) { - uint16_t sr; +CH_IRQ_HANDLER(TIM3_IRQHandler) { CH_IRQ_PROLOGUE(); - sr = TIM1->SR & TIM1->DIER; - TIM1->SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | TIM_SR_CC4IF); - if ((sr & TIM_SR_CC1IF) != 0) - ICUD1.config->channels[0].callback(&ICUD1); - if ((sr & TIM_SR_CC2IF) != 0) - ICUD1.config->channels[1].callback(&ICUD1); + icu_lld_serve_interrupt(&ICUD3); CH_IRQ_EPILOGUE(); } -#endif /* STM32_ICU_USE_TIM1 */ +#endif /* STM32_ICU_USE_TIM3 */ + +#if STM32_ICU_USE_TIM4 +/** + * @brief TIM4 compare interrupt handler. + * @note It is assumed that the various sources are only activated if the + * associated callback pointer is not equal to @p NULL in order to not + * perform an extra check in a potentially critical interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM4_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + icu_lld_serve_interrupt(&ICUD4); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_ICU_USE_TIM4 */ + +#if STM32_ICU_USE_TIM5 +/** + * @brief TIM5 compare interrupt handler. + * @note It is assumed that the various sources are only activated if the + * associated callback pointer is not equal to @p NULL in order to not + * perform an extra check in a potentially critical interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(TIM5_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + icu_lld_serve_interrupt(&ICUD5); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_ICU_USE_TIM5 */ /*===========================================================================*/ /* Driver exported functions. */ @@ -114,6 +214,30 @@ void icu_lld_init(void) { icuObjectInit(&ICUD1); ICUD1.tim = TIM1; #endif + +#if STM32_ICU_USE_TIM2 + /* Driver initialization.*/ + icuObjectInit(&ICUD2); + ICUD2.tim = TIM2; +#endif + +#if STM32_ICU_USE_TIM3 + /* Driver initialization.*/ + icuObjectInit(&ICUD3); + ICUD3.tim = TIM3; +#endif + +#if STM32_ICU_USE_TIM4 + /* Driver initialization.*/ + icuObjectInit(&ICUD4); + ICUD4.tim = TIM4; +#endif + +#if STM32_ICU_USE_TIM5 + /* Driver initialization.*/ + icuObjectInit(&ICUD5); + ICUD5.tim = TIM5; +#endif } /** @@ -132,11 +256,46 @@ void icu_lld_start(ICUDriver *icup) { RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; RCC->APB2RSTR = RCC_APB2RSTR_TIM1RST; RCC->APB2RSTR = 0; - NVICEnableVector(TIM1_UP_IRQn, - CORTEX_PRIORITY_MASK(STM32_ICU_TIM1_IRQ_PRIORITY)); NVICEnableVector(TIM1_CC_IRQn, CORTEX_PRIORITY_MASK(STM32_ICU_TIM1_IRQ_PRIORITY)); } +#endif +#if STM32_ICU_USE_TIM2 + if (&ICUD2 == icup) { + RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM2RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM2_IRQn, + CORTEX_PRIORITY_MASK(STM32_ICU_TIM2_IRQ_PRIORITY)); + } +#endif +#if STM32_ICU_USE_TIM3 + if (&ICUD3 == icup) { + RCC->APB1ENR |= RCC_APB1ENR_TIM3EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM3RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM3_IRQn, + CORTEX_PRIORITY_MASK(STM32_ICU_TIM3_IRQ_PRIORITY)); + } +#endif +#if STM32_ICU_USE_TIM4 + if (&ICUD4 == icup) { + RCC->APB1ENR |= RCC_APB1ENR_TIM4EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM4RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM4_IRQn, + CORTEX_PRIORITY_MASK(STM32_ICU_TIM4_IRQ_PRIORITY)); + } +#endif + +#if STM32_ICU_USE_TIM5 + if (&ICUD5 == icup) { + RCC->APB1ENR |= RCC_APB1ENR_TIM5EN; + RCC->APB1RSTR = RCC_APB1RSTR_TIM5RST; + RCC->APB1RSTR = 0; + NVICEnableVector(TIM5_IRQn, + CORTEX_PRIORITY_MASK(STM32_ICU_TIM5_IRQ_PRIORITY)); + } #endif } @@ -153,7 +312,7 @@ void icu_lld_start(ICUDriver *icup) { /* SMCR_TS = 101, input is TI1FP1. SMCR_SMS = 100, reset on rising edge.*/ icup->tim->SMCR = TIM_SMCR_TS_2 | TIM_SMCR_TS_0 | - TIM_SMCR_SMS_2. + TIM_SMCR_SMS_2; /* The CCER settings depend on the selected trigger mode. ICU_INPUT_ACTIVE_HIGH: Active on rising edge, idle on falling edge. ICU_INPUT_ACTIVE_LOW: Active on falling edge, idle on rising edge.*/ @@ -161,7 +320,7 @@ void icu_lld_start(ICUDriver *icup) { icup->tim->CCER = TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC2P; else - icup->tim->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P + icup->tim->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P | TIM_CCER_CC2E; } @@ -181,11 +340,35 @@ void icu_lld_stop(ICUDriver *icup) { #if STM32_ICU_USE_TIM1 if (&ICUD1 == icup) { - NVICDisableVector(TIM1_UP_IRQn); + NVICDisableVector(TIM1_CC_IRQn); RCC->APB2ENR &= ~RCC_APB2ENR_TIM1EN; } #endif } +#if STM32_ICU_USE_TIM2 + if (&ICUD2 == icup) { + NVICDisableVector(TIM2_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM2EN; + } +#endif +#if STM32_ICU_USE_TIM3 + if (&ICUD3 == icup) { + NVICDisableVector(TIM3_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM3EN; + } +#endif +#if STM32_ICU_USE_TIM4 + if (&ICUD4 == icup) { + NVICDisableVector(TIM4_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM4EN; + } +#endif +#if STM32_ICU_USE_TIM5 + if (&ICUD5 == icup) { + NVICDisableVector(TIM5_IRQn); + RCC->APB1ENR &= ~RCC_APB1ENR_TIM5EN; + } +#endif } /** @@ -198,7 +381,10 @@ void icu_lld_stop(ICUDriver *icup) { void icu_lld_enable(ICUDriver *icup) { icup->tim->SR = 0; /* Clear pending IRQs (if any). */ - icup->tim->DIER = TIM_DIER_CC1IE | TIM_DIER_CC2IE; + if (icup->config->period_cb != NULL) + icup->tim->DIER |= TIM_DIER_CC1IE; + if (icup->config->width_cb != NULL) + icup->tim->DIER |= TIM_DIER_CC2IE; icup->tim->CR1 = TIM_CR1_URS | TIM_CR1_CEN; } diff --git a/os/hal/platforms/STM32/icu_lld.h b/os/hal/platforms/STM32/icu_lld.h index 78efa9765..758b9c352 100644 --- a/os/hal/platforms/STM32/icu_lld.h +++ b/os/hal/platforms/STM32/icu_lld.h @@ -48,6 +48,77 @@ #define STM32_ICU_USE_TIM1 TRUE #endif +/** + * @brief ICUD2 driver enable switch. + * @details If set to @p TRUE the support for ICUD2 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_ICU_USE_TIM2) || defined(__DOXYGEN__) +#define STM32_ICU_USE_TIM2 TRUE +#endif + +/** + * @brief ICUD3 driver enable switch. + * @details If set to @p TRUE the support for ICUD3 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_ICU_USE_TIM3) || defined(__DOXYGEN__) +#define STM32_ICU_USE_TIM3 TRUE +#endif + +/** + * @brief ICUD4 driver enable switch. + * @details If set to @p TRUE the support for ICUD4 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_ICU_USE_TIM4) || defined(__DOXYGEN__) +#define STM32_ICU_USE_TIM4 TRUE +#endif + +/** + * @brief ICUD5 driver enable switch. + * @details If set to @p TRUE the support for ICUD5 is included. + * @note The default is @p TRUE. + */ +#if !defined(STM32_ICU_USE_TIM5) || defined(__DOXYGEN__) +#define STM32_ICU_USE_TIM5 TRUE +#endif + +/** + * @brief ICUD1 interrupt priority level setting. + */ +#if !defined(STM32_ICU_TIM1_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#endif + +/** + * @brief ICUD2 interrupt priority level setting. + */ +#if !defined(STM32_ICU_TIM2_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#endif + +/** + * @brief ICUD3 interrupt priority level setting. + */ +#if !defined(STM32_ICU_TIM3_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#endif + +/** + * @brief ICUD4 interrupt priority level setting. + */ +#if !defined(STM32_ICU_TIM4_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#endif + +/** + * @brief ICUD5 interrupt priority level setting. + */ +#if !defined(STM32_ICU_TIM5_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#endif + /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ @@ -143,6 +214,9 @@ struct ICUDriver { * @brief Current configuration data. */ const ICUConfig *config; +#if defined(ICU_DRIVER_EXT_FIELDS) + ICU_DRIVER_EXT_FIELDS +#endif /* End of the mandatory fields.*/ /** * @brief Pointer to the TIMx registers block. @@ -209,6 +283,22 @@ struct ICUDriver { extern ICUDriver ICUD1; #endif +#if STM32_ICU_USE_TIM2 && !defined(__DOXYGEN__) +extern ICUDriver ICUD2; +#endif + +#if STM32_ICU_USE_TIM3 && !defined(__DOXYGEN__) +extern ICUDriver ICUD3; +#endif + +#if STM32_ICU_USE_TIM4 && !defined(__DOXYGEN__) +extern ICUDriver ICUD4; +#endif + +#if STM32_ICU_USE_TIM5 && !defined(__DOXYGEN__) +extern ICUDriver ICUD5; +#endif + #ifdef __cplusplus extern "C" { #endif @@ -217,8 +307,6 @@ extern "C" { void icu_lld_stop(ICUDriver *icup); void icu_lld_enable(ICUDriver *icup); void icu_lld_disable(ICUDriver *icup); - icucnt_t icu_lld_get_width(ICUDriver *icup); - icucnt_t icu_lld_get_period(ICUDriver *icup); #ifdef __cplusplus } #endif diff --git a/os/hal/platforms/STM32/platform.mk b/os/hal/platforms/STM32/platform.mk index 469b85c79..48e19ace6 100644 --- a/os/hal/platforms/STM32/platform.mk +++ b/os/hal/platforms/STM32/platform.mk @@ -3,6 +3,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32/hal_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/adc_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/can_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/gpt_lld.c \ + ${CHIBIOS}/os/hal/platforms/STM32/icu_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/pal_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/pwm_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/serial_lld.c \ diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index ac41edbfd..eaf83bd90 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -48,40 +48,40 @@ /*===========================================================================*/ /** - * @brief PWM1 driver identifier. - * @note The driver PWM1 allocates the complex timer TIM1 when enabled. + * @brief PWMD1 driver identifier. + * @note The driver PWMD1 allocates the complex timer TIM1 when enabled. */ #if STM32_PWM_USE_TIM1 || defined(__DOXYGEN__) PWMDriver PWMD1; #endif /** - * @brief PWM2 driver identifier. - * @note The driver PWM2 allocates the timer TIM2 when enabled. + * @brief PWMD2 driver identifier. + * @note The driver PWMD2 allocates the timer TIM2 when enabled. */ #if STM32_PWM_USE_TIM2 || defined(__DOXYGEN__) PWMDriver PWMD2; #endif /** - * @brief PWM3 driver identifier. - * @note The driver PWM3 allocates the timer TIM3 when enabled. + * @brief PWMD3 driver identifier. + * @note The driver PWMD3 allocates the timer TIM3 when enabled. */ #if STM32_PWM_USE_TIM3 || defined(__DOXYGEN__) PWMDriver PWMD3; #endif /** - * @brief PWM4 driver identifier. - * @note The driver PWM4 allocates the timer TIM4 when enabled. + * @brief PWMD4 driver identifier. + * @note The driver PWMD4 allocates the timer TIM4 when enabled. */ #if STM32_PWM_USE_TIM4 || defined(__DOXYGEN__) PWMDriver PWMD4; #endif /** - * @brief PWM5 driver identifier. - * @note The driver PWM5 allocates the timer TIM5 when enabled. + * @brief PWMD5 driver identifier. + * @note The driver PWMD5 allocates the timer TIM5 when enabled. */ #if STM32_PWM_USE_TIM5 || defined(__DOXYGEN__) PWMDriver PWMD5; diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index 9e251eb78..8c15a3c6f 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -45,8 +45,8 @@ /*===========================================================================*/ /** - * @brief PWM1 driver enable switch. - * @details If set to @p TRUE the support for PWM1 is included. + * @brief PWMD1 driver enable switch. + * @details If set to @p TRUE the support for PWMD1 is included. * @note The default is @p TRUE. */ #if !defined(STM32_PWM_USE_TIM1) || defined(__DOXYGEN__) @@ -54,8 +54,8 @@ #endif /** - * @brief PWM2 driver enable switch. - * @details If set to @p TRUE the support for PWM2 is included. + * @brief PWMD2 driver enable switch. + * @details If set to @p TRUE the support for PWMD2 is included. * @note The default is @p TRUE. */ #if !defined(STM32_PWM_USE_TIM2) || defined(__DOXYGEN__) @@ -63,8 +63,8 @@ #endif /** - * @brief PWM3 driver enable switch. - * @details If set to @p TRUE the support for PWM3 is included. + * @brief PWMD3 driver enable switch. + * @details If set to @p TRUE the support for PWMD3 is included. * @note The default is @p TRUE. */ #if !defined(STM32_PWM_USE_TIM3) || defined(__DOXYGEN__) @@ -72,8 +72,8 @@ #endif /** - * @brief PWM4 driver enable switch. - * @details If set to @p TRUE the support for PWM4 is included. + * @brief PWMD4 driver enable switch. + * @details If set to @p TRUE the support for PWMD4 is included. * @note The default is @p TRUE. */ #if !defined(STM32_PWM_USE_TIM4) || defined(__DOXYGEN__) @@ -81,8 +81,8 @@ #endif /** - * @brief PWM5 driver enable switch. - * @details If set to @p TRUE the support for PWM5 is included. + * @brief PWMD5 driver enable switch. + * @details If set to @p TRUE the support for PWMD5 is included. * @note The default is @p TRUE. */ #if !defined(STM32_PWM_USE_TIM5) || defined(__DOXYGEN__) @@ -90,35 +90,35 @@ #endif /** - * @brief PWM1 interrupt priority level setting. + * @brief PWMD1 interrupt priority level setting. */ #if !defined(STM32_PWM_TIM1_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_PWM_TIM1_IRQ_PRIORITY 7 #endif /** - * @brief PWM2 interrupt priority level setting. + * @brief PWMD2 interrupt priority level setting. */ #if !defined(STM32_PWM_TIM2_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_PWM_TIM2_IRQ_PRIORITY 7 #endif /** - * @brief PWM3 interrupt priority level setting. + * @brief PWMD3 interrupt priority level setting. */ #if !defined(STM32_PWM_TIM3_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_PWM_TIM3_IRQ_PRIORITY 7 #endif /** - * @brief PWM4 interrupt priority level setting. + * @brief PWMD4 interrupt priority level setting. */ #if !defined(STM32_PWM_TIM4_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_PWM_TIM4_IRQ_PRIORITY 7 #endif /** - * @brief PWM5 interrupt priority level setting. + * @brief PWMD5 interrupt priority level setting. */ #if !defined(STM32_PWM_TIM5_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_PWM_TIM5_IRQ_PRIORITY 7 diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h index 8cbbc8d6e..9b5e9dad2 100644 --- a/os/hal/platforms/STM32/usb_lld.h +++ b/os/hal/platforms/STM32/usb_lld.h @@ -290,6 +290,9 @@ struct USBDriver { * @brief Current USB device configuration. */ uint8_t configuration; +#if defined(USB_DRIVER_EXT_FIELDS) + USB_DRIVER_EXT_FIELDS +#endif /* End of the mandatory fields.*/ /** * @brief Pointer to the next address in the packet memory. diff --git a/os/hal/templates/gpt_lld.h b/os/hal/templates/gpt_lld.h index fa1e7e478..4053c9b7a 100644 --- a/os/hal/templates/gpt_lld.h +++ b/os/hal/templates/gpt_lld.h @@ -100,6 +100,9 @@ struct GPTDriver { * @brief Current configuration data. */ const GPTConfig *config; +#if defined(GPT_DRIVER_EXT_FIELDS) + GPT_DRIVER_EXT_FIELDS +#endif /* End of the mandatory fields.*/ }; diff --git a/os/hal/templates/icu_lld.h b/os/hal/templates/icu_lld.h index b0debb2b9..68ec93df6 100644 --- a/os/hal/templates/icu_lld.h +++ b/os/hal/templates/icu_lld.h @@ -104,6 +104,9 @@ struct ICUDriver { * @brief Current configuration data. */ const ICUConfig *config; +#if defined(ICU_DRIVER_EXT_FIELDS) + ICU_DRIVER_EXT_FIELDS +#endif /* End of the mandatory fields.*/ }; diff --git a/os/hal/templates/usb_lld.h b/os/hal/templates/usb_lld.h index 225f3ab9f..5a41c1c05 100644 --- a/os/hal/templates/usb_lld.h +++ b/os/hal/templates/usb_lld.h @@ -212,6 +212,9 @@ struct USBDriver { * @brief Current USB device configuration. */ uint8_t configuration; +#if defined(USB_DRIVER_EXT_FIELDS) + USB_DRIVER_EXT_FIELDS +#endif /* End of the mandatory fields.*/ }; diff --git a/os/kernel/include/chdebug.h b/os/kernel/include/chdebug.h index 5d6b455fe..471da5532 100644 --- a/os/kernel/include/chdebug.h +++ b/os/kernel/include/chdebug.h @@ -151,7 +151,7 @@ extern "C" { #endif #if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__) extern TraceBuffer trace_buffer; - void trace_init(void); + void _trace_init(void); void chDbgTrace(Thread *otp); #endif #if CH_DBG_ENABLE_ASSERTS || CH_DBG_ENABLE_CHECKS || CH_DBG_ENABLE_STACK_CHECK diff --git a/os/kernel/include/chheap.h b/os/kernel/include/chheap.h index ed5fa252a..eb642cd18 100644 --- a/os/kernel/include/chheap.h +++ b/os/kernel/include/chheap.h @@ -75,7 +75,7 @@ struct memory_heap { #ifdef __cplusplus extern "C" { #endif - void heap_init(void); + void _heap_init(void); void chHeapInit(MemoryHeap *heapp, void *buf, size_t size); void *chHeapAlloc(MemoryHeap *heapp, size_t size); void chHeapFree(void *p); diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index bc0654a6d..cf608c4e8 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -67,7 +67,7 @@ typedef void *(*memgetfunc_t)(size_t size); #ifdef __cplusplus extern "C" { #endif - void core_init(void); + void _core_init(void); void *chCoreAlloc(size_t size); void *chCoreAllocI(size_t size); size_t chCoreStatus(void); diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h index 5dda6d00a..1cd8e0664 100644 --- a/os/kernel/include/chschd.h +++ b/os/kernel/include/chschd.h @@ -127,7 +127,7 @@ register Thread *currp asm(CH_CURRP_REGISTER_CACHE); #ifdef __cplusplus extern "C" { #endif - void scheduler_init(void); + void _scheduler_init(void); #if !defined(PORT_OPTIMIZED_READYI) Thread *chSchReadyI(Thread *tp); #endif diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h index 9203b974d..e75e966d5 100644 --- a/os/kernel/include/chvt.h +++ b/os/kernel/include/chvt.h @@ -121,7 +121,7 @@ extern VTList vtlist; #ifdef __cplusplus extern "C" { #endif - void vt_init(void); + void _vt_init(void); void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par); void chVTResetI(VirtualTimer *vtp); bool_t chTimeIsWithin(systime_t start, systime_t end); diff --git a/os/kernel/src/chdebug.c b/os/kernel/src/chdebug.c index be98cd40b..3c3c34c70 100644 --- a/os/kernel/src/chdebug.c +++ b/os/kernel/src/chdebug.c @@ -46,7 +46,7 @@ TraceBuffer trace_buffer; * @brief Trace circular buffer subsystem initialization. * @note Internal use only. */ -void trace_init(void) { +void _trace_init(void) { trace_buffer.tb_size = TRACE_BUFFER_SIZE; trace_buffer.tb_ptr = &trace_buffer.tb_buffer[0]; diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index a04646bcf..bcfca9b77 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -65,7 +65,7 @@ static MemoryHeap default_heap; * * @notapi */ -void heap_init(void) { +void _heap_init(void) { default_heap.h_provider = chCoreAlloc; default_heap.h_free.h.u.next = (union heap_header *)NULL; default_heap.h_free.h.size = 0; diff --git a/os/kernel/src/chmemcore.c b/os/kernel/src/chmemcore.c index d66ef5f1c..311d170c5 100644 --- a/os/kernel/src/chmemcore.c +++ b/os/kernel/src/chmemcore.c @@ -56,7 +56,7 @@ static uint8_t *endmem; * * @notapi */ -void core_init(void) { +void _core_init(void) { #if CH_MEMCORE_SIZE == 0 extern uint8_t __heap_base__[]; extern uint8_t __heap_end__[]; diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 210dbfdc1..54e7918b1 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -45,7 +45,7 @@ ReadyList rlist; * * @notapi */ -void scheduler_init(void) { +void _scheduler_init(void) { queue_init(&rlist.r_queue); rlist.r_prio = NOPRIO; diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index db6521b87..29f4bdc7e 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -76,16 +76,16 @@ void chSysInit(void) { static Thread mainthread; port_init(); - scheduler_init(); - vt_init(); + _scheduler_init(); + _vt_init(); #if CH_USE_MEMCORE - core_init(); + _core_init(); #endif #if CH_USE_HEAP - heap_init(); + _heap_init(); #endif #if CH_DBG_ENABLE_TRACE - trace_init(); + _trace_init(); #endif /* Now this instructions flow becomes the main thread.*/ diff --git a/os/kernel/src/chvt.c b/os/kernel/src/chvt.c index b98396a3a..4674c728e 100644 --- a/os/kernel/src/chvt.c +++ b/os/kernel/src/chvt.c @@ -40,7 +40,7 @@ VTList vtlist; * * @notapi */ -void vt_init(void) { +void _vt_init(void) { vtlist.vt_next = vtlist.vt_prev = (void *)&vtlist; vtlist.vt_time = (systime_t)-1; diff --git a/readme.txt b/readme.txt index 8cfda4619..ddc7c35f1 100644 --- a/readme.txt +++ b/readme.txt @@ -95,10 +95,10 @@ as default. - CHANGE: Removed all the prefixes from the structure/union field names in the HAL subsystem. -- CHANGE: Updated the documentation to use Doxygen 1.7.3 which produces a much +- CHANGE: Updated the documentation to use Doxygen 1.7.4 which produces a much more readable output. Also modified the documentation layout to put functions and variables ahead of everything else in the group pages. - Doxygen version below 1.7.3 cannot be used anymore because differences in + Doxygen version below 1.7.4 cannot be used anymore because differences in templates. Note that now there are two Doxygen projects, one for generating the CHM file the other for plain HTML. diff --git a/testhal/STM32/PWM/halconf.h b/testhal/STM32/PWM/halconf.h index 437770851..8d87b73cb 100644 --- a/testhal/STM32/PWM/halconf.h +++ b/testhal/STM32/PWM/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/PWM/mcuconf.h b/testhal/STM32/PWM/mcuconf.h index 2f50634ce..17929817f 100644 --- a/testhal/STM32/PWM/mcuconf.h +++ b/testhal/STM32/PWM/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 TRUE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/todo.txt b/todo.txt index 4931ceed7..294c33498 100644 --- a/todo.txt +++ b/todo.txt @@ -18,7 +18,7 @@ Within 2.3.x (hopefully) * Swap TIME_IMMEDIATE and TIME_INFINITE values. * Improvements to the message passing mechanism in order to allow "delayed, out of order, responses". -* New device driver models: GPT. +* New device driver models: GPT, ICU. X GPT implementation and long duration "IRQ storm" stress test applications for all the supported critical platforms. - Add UART4 support to the STM32 UART driver (CL line only, HD has a nasty @@ -40,7 +40,7 @@ X File System infrastructure. X Transactional flash file system implementation. X I2C device driver class support and at least one implementation. X Shared DMA channels support in the STM32/STM8L HALs. -X RAM ISR vectors support in the STM32 HAL. +? RAM ISR vectors support in the STM32 HAL. - New device driver models: Clock, Systick, RTC, WDG, DAC, Power Monitor. Later but within 2.x.x -- cgit v1.2.3 From ef96358ee82e3e21d9b8d2e00b8038c817d779d0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Mar 2011 18:11:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2851 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/rsc/footer_html.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/rsc/footer_html.html b/docs/rsc/footer_html.html index 0b176f750..d6f2fa429 100644 --- a/docs/rsc/footer_html.html +++ b/docs/rsc/footer_html.html @@ -8,5 +8,17 @@ + + + + -- cgit v1.2.3 From 8cdc7bd8f3987116d89c0a9d1a624127f8652ac0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Mar 2011 18:19:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2852 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/adc.dox | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/hal/dox/adc.dox b/os/hal/dox/adc.dox index 0d6770f64..bb8ff014f 100644 --- a/os/hal/dox/adc.dox +++ b/os/hal/dox/adc.dox @@ -54,7 +54,7 @@ active -> ready [label="\nadcStopConversion()\nsync return"]; active -> active [label="\nasync callback (half buffer)\nasync callback (full buffer circular)\n>acg_endcb<"]; active -> complete [label="\nasync callback (full buffer)\n>acg_endcb<"]; - complete -> active [label="\nadcStartConversionI()\nthen\ncallback return()"]; + complete -> active [label="\nadcStartConversionI()\nthen\ncallback return"]; complete -> ready [label="\ncallback return"]; } * @enddot @@ -80,7 +80,7 @@ active -> ready [label="\nadcStopConversion()\nsync return"]; active -> active [label="\nasync callback (half buffer)\nasync callback (full buffer circular)\n>acg_endcb<"]; active -> complete [label="\nasync callback (full buffer)\n>acg_endcb<"]; - complete -> active [label="\nadcStartConversionI()\nthen\ncallback return()"]; + complete -> active [label="\nadcStartConversionI()\nthen\ncallback return"]; complete -> ready [label="\ncallback return"]; } * @enddot -- cgit v1.2.3 From a58a524d4c7e58d03a0fa3698f09fb17985a70bc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 31 Mar 2011 10:21:52 +0000 Subject: Improvements to the PWM driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2853 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/pwm.h | 107 +++++++++++++++++++++++++++++---- os/hal/platforms/STM32/gpt_lld.c | 1 + os/hal/platforms/STM32/pwm_lld.c | 76 ++++++++++++++++++------ os/hal/platforms/STM32/pwm_lld.h | 124 ++++++++------------------------------- os/hal/src/pwm.c | 43 +++++++++++++- os/hal/templates/pwm_lld.c | 35 +++++++---- os/hal/templates/pwm_lld.h | 81 ++++++++----------------- readme.txt | 9 ++- testhal/STM32/PWM/main.c | 40 ++++++------- 9 files changed, 289 insertions(+), 227 deletions(-) diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index e63478ca3..7181054e4 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -57,13 +57,16 @@ typedef enum { } pwmstate_t; /** - * @brief PWM logic mode. + * @brief Type of a structure representing a PWM driver. */ -typedef enum { - PWM_OUTPUT_DISABLED = 0, /**< Output not driven, callback only. */ - PWM_OUTPUT_ACTIVE_HIGH = 1, /**< Idle is logic level 0. */ - PWM_OUTPUT_ACTIVE_LOW = 2 /**< Idle is logic level 1. */ -} pwmmode_t; +typedef struct PWMDriver PWMDriver; + +/** + * @brief PWM notification callback type. + * + * @param[in] pwmp pointer to a @p PWMDriver object + */ +typedef void (*pwmcallback_t)(PWMDriver *pwmp); #include "pwm_lld.h" @@ -71,13 +74,87 @@ typedef enum { /* Driver macros. */ /*===========================================================================*/ +/** + * @brief Converts from fraction to pulse width. + * @note Be careful with rounding errors, this is integer math not magic. + * You can specify tenths of thousandth but make sure you have the + * proper hardware resolution by carefully choosing the clock source + * and prescaler settings, see @p PWM_COMPUTE_PSC. + * + * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] denominator denominator of the fraction + * @param[in] numerator numerator of the fraction + * @return The pulse width to be passed to @p pwmEnableChannel(). + * + * @api + */ +#define PWM_FRACTION_TO_WIDTH(pwmp, denominator, numerator) \ + ((uint16_t)((((uint32_t)(pwmp)->period) * \ + (uint32_t)(numerator)) / (uint32_t)(denominator))) + +/** + * @brief Converts from degrees to pulse width. + * @note Be careful with rounding errors, this is integer math not magic. + * You can specify hundredths of degrees but make sure you have the + * proper hardware resolution by carefully choosing the clock source + * and prescaler settings, see @p PWM_COMPUTE_PSC. + * + * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] degrees degrees as an integer between 0 and 36000 + * @return The pulse width to be passed to @p pwmEnableChannel(). + * + * @api + */ +#define PWM_DEGREES_TO_WIDTH(pwmp, degrees) \ + PWM_FRACTION_TO_WIDTH(pwmp, 36000, degrees) + +/** + * @brief Converts from percentage to pulse width. + * @note Be careful with rounding errors, this is integer math not magic. + * You can specify tenths of thousandth but make sure you have the + * proper hardware resolution by carefully choosing the clock source + * and prescaler settings, see @p PWM_COMPUTE_PSC. + * + * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] percentage percentage as an integer between 0 and 10000 + * @return The pulse width to be passed to @p pwmEnableChannel(). + * + * @api + */ +#define PWM_PERCENTAGE_TO_WIDTH(pwmp, percentage) \ + PWM_FRACTION_TO_WIDTH(pwmp, 10000, percentage) + +/** + * @brief Changes the period the PWM peripheral. + * @details This function changes the period of a PWM unit that has already + * been activated using @p pwmStart(). + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The PWM unit period is changed to the new value. + * @post Any active channel is disabled by this function and must be + * activated explicitly using @p pwmEnableChannel(). + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). + * + * @param[in] pwmp pointer to a @p PWMDriver object + * + * @iclass + */ +#define pwmChangePeriodI(pwmp, period) { \ + (pwmp)->period = (period); \ + pwm_lld_change_period(pwmp, period); \ +} + /** * @brief Enables a PWM channel. - * @details Programs (or reprograms) a PWM channel. - * @note This function has to be invoked from a lock zone. + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is active using the specified configuration. + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] channel PWM channel identifier + * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) * @param[in] width PWM pulse width as clock pulses number * * @iclass @@ -86,13 +163,16 @@ typedef enum { pwm_lld_enable_channel(pwmp, channel, width) /** - * @brief Disables a PWM channel. - * @details The channel is disabled and its output line returned to the + * @brief Disables a PWM channel. + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is disabled and its output line returned to the * idle state. - * @note This function has to be invoked from a lock zone. + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] channel PWM channel identifier + * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) * * @iclass */ @@ -110,6 +190,7 @@ extern "C" { void pwmObjectInit(PWMDriver *pwmp); void pwmStart(PWMDriver *pwmp, const PWMConfig *config); void pwmStop(PWMDriver *pwmp); + void pwmChangePeriod(PWMDriver *pwmp, pwmcnt_t period); void pwmEnableChannel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width); diff --git a/os/hal/platforms/STM32/gpt_lld.c b/os/hal/platforms/STM32/gpt_lld.c index ffbfe475c..8419cad68 100644 --- a/os/hal/platforms/STM32/gpt_lld.c +++ b/os/hal/platforms/STM32/gpt_lld.c @@ -325,6 +325,7 @@ void gpt_lld_stop(GPTDriver *gptp) { if (gptp->state == GPT_READY) { gptp->tim->CR1 = 0; /* Timer disabled. */ gptp->tim->DIER = 0; /* All IRQs disabled. */ + gptp->tim->SR = 0; /* Clear eventual pending IRQs. */ #if STM32_GPT_USE_TIM1 if (&GPTD1 == gptp) { diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index eaf83bd90..6b05b66aa 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -289,12 +289,15 @@ void pwm_lld_init(void) { /** * @brief Configures and activates the PWM peripheral. + * @note Starting a driver that is already in the @p PWM_READY state + * disables all the active channels. * * @param[in] pwmp pointer to a @p PWMDriver object * * @notapi */ void pwm_lld_start(PWMDriver *pwmp) { + uint32_t clock, psc; uint16_t ccer; /* Reset channels.*/ @@ -311,6 +314,7 @@ void pwm_lld_start(PWMDriver *pwmp) { CORTEX_PRIORITY_MASK(STM32_PWM_TIM1_IRQ_PRIORITY)); NVICEnableVector(TIM1_CC_IRQn, CORTEX_PRIORITY_MASK(STM32_PWM_TIM1_IRQ_PRIORITY)); + clock = STM32_TIMCLK2; } #endif #if STM32_PWM_USE_TIM2 @@ -320,6 +324,7 @@ void pwm_lld_start(PWMDriver *pwmp) { RCC->APB1RSTR = 0; NVICEnableVector(TIM2_IRQn, CORTEX_PRIORITY_MASK(STM32_PWM_TIM2_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif #if STM32_PWM_USE_TIM3 @@ -329,6 +334,7 @@ void pwm_lld_start(PWMDriver *pwmp) { RCC->APB1RSTR = 0; NVICEnableVector(TIM3_IRQn, CORTEX_PRIORITY_MASK(STM32_PWM_TIM3_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif #if STM32_PWM_USE_TIM4 @@ -338,6 +344,7 @@ void pwm_lld_start(PWMDriver *pwmp) { RCC->APB1RSTR = 0; NVICEnableVector(TIM4_IRQn, CORTEX_PRIORITY_MASK(STM32_PWM_TIM4_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif @@ -348,6 +355,7 @@ void pwm_lld_start(PWMDriver *pwmp) { RCC->APB1RSTR = 0; NVICEnableVector(TIM5_IRQn, CORTEX_PRIORITY_MASK(STM32_PWM_TIM5_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif @@ -364,21 +372,26 @@ void pwm_lld_start(PWMDriver *pwmp) { } else { /* Driver re-configuration scenario, it must be stopped first.*/ - /* Really required ?????????? */ - pwmp->tim->CR1 = 0; /* Timer stopped. */ - pwmp->tim->CR2 = 0; /* Timer stopped. */ - pwmp->tim->SMCR = 0; /* Slave mode disabled. */ + pwmp->enabled_channels = 0; /* All channels disabled. */ + pwmp->tim->CR1 = 0; /* Timer disabled. */ + pwmp->tim->DIER = 0; /* All IRQs disabled. */ + pwmp->tim->SR = 0; /* Clear eventual pending IRQs. */ pwmp->tim->CCR1 = 0; /* Comparator 1 disabled. */ pwmp->tim->CCR2 = 0; /* Comparator 2 disabled. */ pwmp->tim->CCR3 = 0; /* Comparator 3 disabled. */ pwmp->tim->CCR4 = 0; /* Comparator 4 disabled. */ - pwmp->tim->CNT = 0; + pwmp->tim->CNT = 0; /* Counter reset to zero. */ } /* Timer configuration.*/ + psc = (clock / pwmp->config->frequency) - 1; + chDbgAssert((psc <= 0xFFFF) && + ((psc + 1) * pwmp->config->frequency) == clock, + "pwm_lld_start(), #1", "invalid frequency"); + pwmp->tim->PSC = (uint16_t)psc; + pwmp->tim->ARR = (uint16_t)(pwmp->period - 1); pwmp->tim->CR2 = pwmp->config->cr2; - pwmp->tim->PSC = pwmp->config->psc; - pwmp->tim->ARR = pwmp->config->arr; + /* Output enables and polarities setup.*/ ccer = 0; switch (pwmp->config->channels[0].mode) { @@ -434,17 +447,9 @@ void pwm_lld_stop(PWMDriver *pwmp) { /* If in ready state then disables the PWM clock.*/ if (pwmp->state == PWM_READY) { pwmp->enabled_channels = 0; /* All channels disabled. */ - pwmp->tim->CR1 = 0; - pwmp->tim->CR2 = 0; - pwmp->tim->CCER = 0; /* Outputs disabled. */ - pwmp->tim->CCR1 = 0; /* Comparator 1 disabled. */ - pwmp->tim->CCR2 = 0; /* Comparator 2 disabled. */ - pwmp->tim->CCR3 = 0; /* Comparator 3 disabled. */ - pwmp->tim->CCR4 = 0; /* Comparator 4 disabled. */ - pwmp->tim->BDTR = 0; - pwmp->tim->DIER = 0; - pwmp->tim->SR = 0; - pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ + pwmp->tim->CR1 = 0; /* Timer disabled. */ + pwmp->tim->DIER = 0; /* All IRQs disabled. */ + pwmp->tim->SR = 0; /* Clear eventual pending IRQs. */ #if STM32_PWM_USE_TIM1 if (&PWMD1 == pwmp) { @@ -480,8 +485,39 @@ void pwm_lld_stop(PWMDriver *pwmp) { } } +/** + * @brief Changes the period the PWM peripheral. + * @details This function changes the period of a PWM unit that has already + * been activated using @p pwmStart(). + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The PWM unit period is changed to the new value. + * @post Any active channel is disabled by this function and must be + * activated explicitly using @p pwmEnableChannel(). + * @note The function has effect at the next cycle start. + * + * @param[in] pwmp pointer to a @p PWMDriver object + * + * @api + */ +void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period) { + + pwmp->enabled_channels = 0; /* All channels disabled. */ + pwmp->tim->DIER &= ~(TIM_DIER_CC1IE | + TIM_DIER_CC2IE | + TIM_DIER_CC3IE | + TIM_DIER_CC4IE); /* Channels sources disabled. */ + pwmp->tim->SR = ~(TIM_SR_CC1IF | + TIM_SR_CC1IF | + TIM_SR_CC1IF | + TIM_SR_CC1IF); /* Clears eventual pending IRQs. */ + pwmp->tim->ARR = (uint16_t)(period - 1); +} + /** * @brief Enables a PWM channel. + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is active using the specified configuration. + * @note The function has effect at the next cycle start. * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) @@ -508,8 +544,10 @@ void pwm_lld_enable_channel(PWMDriver *pwmp, /** * @brief Disables a PWM channel. - * @details The channel is disabled and its output line returned to the + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is disabled and its output line returned to the * idle state. + * @note The function has effect at the next cycle start. * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index 8c15a3c6f..d8e1754c9 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -169,16 +169,13 @@ typedef uint8_t pwmchannel_t; typedef uint16_t pwmcnt_t; /** - * @brief Type of a structure representing an PWM driver. + * @brief PWM logic mode. */ -typedef struct PWMDriver PWMDriver; - -/** - * @brief PWM notification callback type. - * - * @param[in] pwmp pointer to a @p PWMDriver object - */ -typedef void (*pwmcallback_t)(PWMDriver *pwmp); +typedef enum { + PWM_OUTPUT_DISABLED = 0, /**< Output not driven, callback only. */ + PWM_OUTPUT_ACTIVE_HIGH = 1, /**< Idle is logic level 0. */ + PWM_OUTPUT_ACTIVE_LOW = 2 /**< Idle is logic level 1. */ +} pwmmode_t; /** * @brief PWM driver channel configuration structure. @@ -201,6 +198,18 @@ typedef struct { * @brief PWM driver configuration structure. */ typedef struct { + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + uint32_t frequency; + /** + * @brief PWM period in ticks. + * @note The low level can use assertions in order to catch invalid + * period specifications. + */ + pwmcnt_t period; /** * @brief Periodic callback pointer. * @note This callback is invoked on PWM counter reset. If set to @@ -212,14 +221,6 @@ typedef struct { */ PWMChannelConfig channels[PWM_CHANNELS]; /* End of the mandatory fields.*/ - /** - * @brief TIM PSC (pre-scaler) register initialization data. - */ - uint16_t psc; - /** - * @brief TIM ARR (auto-reload) register initialization data. - */ - uint16_t arr; /** * @brief TIM CR2 register initialization data. * @note The value of this field should normally be equal to zero. @@ -239,6 +240,10 @@ struct PWMDriver { * @brief Current driver configuration data. */ const PWMConfig *config; + /** + * @brief Current PWM period in ticks. + */ + pwmcnt_t period; #if defined(PWM_DRIVER_EXT_FIELDS) PWM_DRIVER_EXT_FIELDS #endif @@ -257,90 +262,6 @@ struct PWMDriver { /* Driver macros. */ /*===========================================================================*/ -/** - * @brief PWM clock prescaler initialization utility. - * @note The real clock value is rounded to the lower valid value, please - * make sure that the source clock frequency is a multiple of the - * requested PWM clock frequency. - * @note The calculated value must fit into an unsigned 16 bits integer. - * - * @param[in] clksrc clock source frequency, depending on the target timer - * cell it can be one of: - * - STM32_TIMCLK1 - * - STM32_TIMCLK2 - * . - * Please refer to the STM32 HAL driver documentation - * and/or the STM32 Reference Manual for the right clock - * source. - * @param[in] pwmclk PWM clock frequency in cycles - * @return The value to be stored in the @p psc field of the - * @p PWMConfig structure. - */ -#define PWM_COMPUTE_PSC(clksrc, pwmclk) \ - ((uint16_t)(((clksrc) / (pwmclk)) - 1)) - -/** - * @brief PWM cycle period initialization utility. - * @note The calculated value must fit into an unsigned 16 bits integer. - * - * @param[in] pwmclk PWM clock frequency in cycles - * @param[in] pwmperiod PWM cycle period in nanoseconds - * @return The value to be stored in the @p arr field of the - * @p PWMConfig structure. - */ -#define PWM_COMPUTE_ARR(pwmclk, pwmperiod) \ - ((uint16_t)(((pwmclk) / (1000000000 / (pwmperiod))) - 1)) - -/** - * @brief Converts from fraction to pulse width. - * @note Be careful with rounding errors, this is integer math not magic. - * You can specify tenths of thousandth but make sure you have the - * proper hardware resolution by carefully choosing the clock source - * and prescaler settings, see @p PWM_COMPUTE_PSC. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] numerator numerator of the fraction - * @param[in] denominator percentage as an integer between 0 and numerator - * @return The pulse width to be passed to @p pwmEnableChannel(). - * - * @api - */ -#define PWM_FRACTION_TO_WIDTH(pwmp, numerator, denominator) \ - ((uint16_t)((((uint32_t)(pwmp)->config->arr + 1UL) * \ - (uint32_t)(denominator)) / (uint32_t)(numerator))) - -/** - * @brief Converts from degrees to pulse width. - * @note Be careful with rounding errors, this is integer math not magic. - * You can specify hundredths of degrees but make sure you have the - * proper hardware resolution by carefully choosing the clock source - * and prescaler settings, see @p PWM_COMPUTE_PSC. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] degrees degrees as an integer between 0 and 36000 - * @return The pulse width to be passed to @p pwmEnableChannel(). - * - * @api - */ -#define PWM_DEGREES_TO_WIDTH(pwmp, degrees) \ - PWM_FRACTION_TO_WIDTH(pwmp, 36000, degrees) - -/** - * @brief Converts from percentage to pulse width. - * @note Be careful with rounding errors, this is integer math not magic. - * You can specify tenths of thousandth but make sure you have the - * proper hardware resolution by carefully choosing the clock source - * and prescaler settings, see @p PWM_COMPUTE_PSC. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] percentage percentage as an integer between 0 and 10000 - * @return The pulse width to be passed to @p pwmEnableChannel(). - * - * @api - */ -#define PWM_PERCENTAGE_TO_WIDTH(pwmp, percentage) \ - PWM_FRACTION_TO_WIDTH(pwmp, 10000, percentage) - /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -371,6 +292,7 @@ extern "C" { void pwm_lld_init(void); void pwm_lld_start(PWMDriver *pwmp); void pwm_lld_stop(PWMDriver *pwmp); + void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period); void pwm_lld_enable_channel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width); diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c index e510ba180..eaa49bc56 100644 --- a/os/hal/src/pwm.c +++ b/os/hal/src/pwm.c @@ -77,6 +77,8 @@ void pwmObjectInit(PWMDriver *pwmp) { /** * @brief Configures and activates the PWM peripheral. + * @note Starting a driver that is already in the @p PWM_READY state + * disables all the active channels. * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] config pointer to a @p PWMConfig object @@ -91,6 +93,7 @@ void pwmStart(PWMDriver *pwmp, const PWMConfig *config) { chDbgAssert((pwmp->state == PWM_STOP) || (pwmp->state == PWM_READY), "pwmStart(), #1", "invalid state"); pwmp->config = config; + pwmp->period = config->period; pwm_lld_start(pwmp); pwmp->state = PWM_READY; chSysUnlock(); @@ -115,9 +118,41 @@ void pwmStop(PWMDriver *pwmp) { chSysUnlock(); } +/** + * @brief Changes the period the PWM peripheral. + * @details This function changes the period of a PWM unit that has already + * been activated using @p pwmStart(). + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The PWM unit period is changed to the new value. + * @post Any active channel is disabled by this function and must be + * activated explicitly using @p pwmEnableChannel(). + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). + * + * @param[in] pwmp pointer to a @p PWMDriver object + * + * @api + */ +void pwmChangePeriod(PWMDriver *pwmp, pwmcnt_t period) { + + chDbgCheck(pwmp != NULL, "pwmChangePeriod"); + + chSysLock(); + chDbgAssert(pwmp->state == PWM_READY, + "pwmChangePeriod(), #1", "invalid state"); + pwmp->period = period; + pwm_lld_change_period(pwmp, period); + chSysUnlock(); +} + /** * @brief Enables a PWM channel. - * @details Programs (or reprograms) a PWM channel. + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is active using the specified configuration. + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) @@ -141,8 +176,12 @@ void pwmEnableChannel(PWMDriver *pwmp, /** * @brief Disables a PWM channel. - * @details The channel is disabled and its output line returned to the + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is disabled and its output line returned to the * idle state. + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c index 507ba1294..295b0dcb4 100644 --- a/os/hal/templates/pwm_lld.c +++ b/os/hal/templates/pwm_lld.c @@ -87,23 +87,32 @@ void pwm_lld_stop(PWMDriver *pwmp) { } /** - * @brief Determines whatever the PWM channel is already enabled. + * @brief Changes the period the PWM peripheral. + * @details This function changes the period of a PWM unit that has already + * been activated using @p pwmStart(). + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The PWM unit period is changed to the new value. + * @post Any active channel is disabled by this function and must be + * activated explicitly using @p pwmEnableChannel(). + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * - * @param[in] pwmp pointer to the @p PWMDriver object - * @param[in] channel PWM channel identifier - * @return The PWM channel status. - * @retval FALSE the channel is not enabled. - * @retval TRUE the channel is enabled. + * @param[in] pwmp pointer to a @p PWMDriver object * - * @notapi + * @api */ -bool_t pwm_lld_is_enabled(PWMDriver *pwmp, pwmchannel_t channel) { +void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period) { - return FALSE; } /** * @brief Enables a PWM channel. + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is active using the specified configuration. + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) @@ -119,11 +128,17 @@ void pwm_lld_enable_channel(PWMDriver *pwmp, /** * @brief Disables a PWM channel. - * @details The channel is disabled and its output line returned to the + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The channel is disabled and its output line returned to the * idle state. + * @note Depending on the hardware implementation this function has + * effect starting on the next cycle (recommended implementation) + * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1) + * + * @notapi */ void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) { diff --git a/os/hal/templates/pwm_lld.h b/os/hal/templates/pwm_lld.h index bee00c073..9ef7a9853 100644 --- a/os/hal/templates/pwm_lld.h +++ b/os/hal/templates/pwm_lld.h @@ -65,16 +65,13 @@ typedef uint8_t pwmchannel_t; typedef uint16_t pwmcnt_t; /** - * @brief Type of a structure representing an PWM driver. + * @brief PWM logic mode. */ -typedef struct PWMDriver PWMDriver; - -/** - * @brief PWM notification callback type. - * - * @param[in] pwmp pointer to a @p PWMDriver object - */ -typedef void (*pwmcallback_t)(PWMDriver *pwmp); +typedef enum { + PWM_OUTPUT_DISABLED = 0, /**< Output not driven, callback only. */ + PWM_OUTPUT_ACTIVE_HIGH = 1, /**< Idle is logic level 0. */ + PWM_OUTPUT_ACTIVE_LOW = 2 /**< Idle is logic level 1. */ +} pwmmode_t; /** * @brief PWM driver channel configuration structure. @@ -101,6 +98,18 @@ typedef struct { * architecture dependent, fields. */ typedef struct { + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + uint32_t frequency; + /** + * @brief PWM period in ticks. + * @note The low level can use assertions in order to catch invalid + * period specifications. + */ + pwmcnt_t period; /** * @brief Periodic callback pointer. * @note This callback is invoked on PWM counter reset. If set to @@ -128,6 +137,10 @@ struct PWMDriver { * @brief Current configuration data. */ const PWMConfig *config; + /** + * @brief Current PWM period in ticks. + */ + pwmcnt_t period; #if defined(PWM_DRIVER_EXT_FIELDS) PWM_DRIVER_EXT_FIELDS #endif @@ -138,54 +151,6 @@ struct PWMDriver { /* Driver macros. */ /*===========================================================================*/ -/** - * @brief Converts from fraction to pulse width. - * @note Be careful with rounding errors, this is integer math not magic. - * You can specify tenths of thousandth but make sure you have the - * proper hardware resolution by carefully choosing the clock source - * and prescaler settings, see @p PWM_COMPUTE_PSC. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] numerator numerator of the fraction - * @param[in] denominator percentage as an integer between 0 and numerator - * @return The pulse width to be passed to @p pwmEnableChannel(). - * - * @api - */ -#define PWM_FRACTION_TO_WIDTH(pwmp, numerator, denominator) 0 - -/** - * @brief Converts from degrees to pulse width. - * @note Be careful with rounding errors, this is integer math not magic. - * You can specify hundredths of degrees but make sure you have the - * proper hardware resolution by carefully choosing the clock source - * and prescaler settings, see @p PWM_COMPUTE_PSC. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] degrees degrees as an integer between 0 and 36000 - * @return The pulse width to be passed to @p pwmEnableChannel(). - * - * @api - */ -#define PWM_DEGREES_TO_WIDTH(pwmp, degrees) \ - PWM_FRACTION_TO_WIDTH(pwmp, 36000, degrees) - -/** - * @brief Converts from percentage to pulse width. - * @note Be careful with rounding errors, this is integer math not magic. - * You can specify tenths of thousandth but make sure you have the - * proper hardware resolution by carefully choosing the clock source - * and prescaler settings, see @p PWM_COMPUTE_PSC. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] percentage percentage as an integer between 0 and 10000 - * @return The pulse width to be passed to @p pwmEnableChannel(). - * - * @api - */ -#define PWM_PERCENTAGE_TO_WIDTH(pwmp, percentage) \ - PWM_FRACTION_TO_WIDTH(pwmp, 10000, percentage) - /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -196,7 +161,7 @@ extern "C" { void pwm_lld_init(void); void pwm_lld_start(PWMDriver *pwmp); void pwm_lld_stop(PWMDriver *pwmp); - bool_t pwm_lld_is_enabled(PWMDriver *pwmp, pwmchannel_t channel); + void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period); void pwm_lld_enable_channel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width); diff --git a/readme.txt b/readme.txt index ddc7c35f1..b0c085811 100644 --- a/readme.txt +++ b/readme.txt @@ -79,7 +79,14 @@ - FIX: Fixed wrong checks in I/O Queues (bug 3219197)(backported to 2.2.3). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410)(backported to 2.2.3). -- NEW: Added new ICU driver model, Input Capture Unit.. +- NEW: Improvements to the PWM driver model: + - Easier configuration similar to the GPT driver initializations, macros + are no more required. + - Added a new function that allows to change the PWM period on the fly, + even from within callbacks. Formerly it was required to stop and restart + the driver. + - Improved driver documentation. +- NEW: Added new ICU driver model, Input Capture Unit. - NEW: ICU driver implementation for STM32. - NEW: Implemented stack checking in the Cortex-Mx RVCT port (backported to 2.2.3). diff --git a/testhal/STM32/PWM/main.c b/testhal/STM32/PWM/main.c index c42b15939..ef08b792c 100644 --- a/testhal/STM32/PWM/main.c +++ b/testhal/STM32/PWM/main.c @@ -21,33 +21,21 @@ #include "ch.h" #include "hal.h" -/* - * Red LEDs blinker thread, times are in milliseconds. - */ -static WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { - - (void)arg; - while (TRUE) { - palClearPad(IOPORT3, GPIOC_LED); - chThdSleepMilliseconds(500); - palSetPad(IOPORT3, GPIOC_LED); - chThdSleepMilliseconds(500); - } - return 0; -} - static void pwmpcb(PWMDriver *pwmp) { (void)pwmp; + palSetPad(IOPORT3, GPIOC_LED); } static void pwmc1cb(PWMDriver *pwmp) { (void)pwmp; + palClearPad(IOPORT3, GPIOC_LED); } static PWMConfig pwmcfg = { + 10000, /* 10KHz PWM clock frequency. */ + 10000, /* Initial PWM period 1S. */ pwmpcb, { {PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb}, @@ -55,8 +43,6 @@ static PWMConfig pwmcfg = { {PWM_OUTPUT_DISABLED, NULL}, {PWM_OUTPUT_DISABLED, NULL} }, - PWM_COMPUTE_PSC(STM32_TIMCLK1, 10000), /* 10KHz PWM clock frequency. */ - PWM_COMPUTE_ARR(10000, 1000000), /* PWM period 1S. */ 0 }; @@ -76,9 +62,9 @@ int main(void) { chSysInit(); /* - * Creates the blinker thread. + * LED initially off. */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + palSetPad(IOPORT3, GPIOC_LED); /* * Initializes the PWM driver 1. @@ -88,9 +74,9 @@ int main(void) { chThdSleepMilliseconds(2000); /* - * Starts the channel 0 using 50% duty cycle. + * Starts the channel 0 using 25% duty cycle. */ - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500)); chThdSleepMilliseconds(5000); /* @@ -99,11 +85,19 @@ int main(void) { pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500)); chThdSleepMilliseconds(5000); + /* + * Changes PWM period to half second and duty cycle to 50%. + */ + pwmChangePeriod(&PWMD1, 5000); + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); + chThdSleepMilliseconds(5000); + /* * Disables channel 0. */ pwmDisableChannel(&PWMD1, 0); - + pwmStop(&PWMD1); + palSetPad(IOPORT3, GPIOC_LED); /* * Normal main() thread activity, in this demo it does nothing. -- cgit v1.2.3 From 91e4dee81eef472b69d7b5fe321d8c16b4a0ac59 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 31 Mar 2011 12:35:42 +0000 Subject: Generic improvements to the GPT driver organization. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2854 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY/main.c | 6 +++--- os/hal/include/gpt.h | 12 ++++++++++++ os/hal/platforms/LPC11xx/gpt_lld.h | 16 ---------------- os/hal/platforms/LPC13xx/gpt_lld.h | 12 ------------ os/hal/platforms/STM32/gpt_lld.h | 12 ------------ 5 files changed, 15 insertions(+), 43 deletions(-) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/main.c b/demos/ARMCM3-STM32F100-DISCOVERY/main.c index d638b5926..bc7e5f632 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/main.c +++ b/demos/ARMCM3-STM32F100-DISCOVERY/main.c @@ -63,6 +63,8 @@ static const ADCConversionGroup adcgrpcfg = { * the active state is a logic one. */ static PWMConfig pwmcfg = { + 10000, /* 10KHz PWM clock frequency. */ + 10000, /* PWM period 1S (in ticks). */ pwmpcb, { {PWM_OUTPUT_DISABLED, NULL}, @@ -71,8 +73,6 @@ static PWMConfig pwmcfg = { {PWM_OUTPUT_ACTIVE_HIGH, NULL} }, /* HW dependent part.*/ - PWM_COMPUTE_PSC(STM32_TIMCLK1, 10000), /* 10KHz PWM clock frequency. */ - PWM_COMPUTE_ARR(10000, 1000000000), /* PWM period 1S (in nS). */ 0 }; @@ -115,7 +115,7 @@ void adccb(ADCDriver *adcp, adcsample_t *buffer, size_t n) { (void) buffer; (void) n; /* Note, only in the ADC_COMPLETE state because the ADC driver fires an intermediate callback when the buffer is half full.*/ - if (adcp->ad_state == ADC_COMPLETE) { + if (adcp->state == ADC_COMPLETE) { adcsample_t avg_ch1, avg_ch2; /* Calculates the average values from the ADC samples.*/ diff --git a/os/hal/include/gpt.h b/os/hal/include/gpt.h index c65cd7cee..5bb385078 100644 --- a/os/hal/include/gpt.h +++ b/os/hal/include/gpt.h @@ -58,6 +58,18 @@ typedef enum { GPT_ONESHOT = 4 /**< Active in one shot mode. */ } gptstate_t; +/** + * @brief Type of a structure representing a GPT driver. + */ +typedef struct GPTDriver GPTDriver; + +/** + * @brief GPT notification callback type. + * + * @param[in] gptp pointer to a @p GPTDriver object + */ +typedef void (*gptcallback_t)(GPTDriver *gptp); + #include "gpt_lld.h" /*===========================================================================*/ diff --git a/os/hal/platforms/LPC11xx/gpt_lld.h b/os/hal/platforms/LPC11xx/gpt_lld.h index a1a516d6e..1aa1e3b90 100644 --- a/os/hal/platforms/LPC11xx/gpt_lld.h +++ b/os/hal/platforms/LPC11xx/gpt_lld.h @@ -126,18 +126,6 @@ typedef uint32_t gptfreq_t; */ typedef uint32_t gptcnt_t; -/** - * @brief Type of a structure representing a GPT driver. - */ -typedef struct GPTDriver GPTDriver; - -/** - * @brief GPT notification callback type. - * - * @param[in] gptp pointer to a @p GPTDriver object - */ -typedef void (*gptcallback_t)(GPTDriver *gptp); - /** * @brief Driver configuration structure. * @note It could be empty on some architectures. @@ -170,10 +158,6 @@ struct GPTDriver { */ const GPTConfig *config; /* End of the mandatory fields.*/ - /** - * @brief Timer base clock. - */ - uint32_t clock; /** * @brief Pointer to the CTxxBy registers block. */ diff --git a/os/hal/platforms/LPC13xx/gpt_lld.h b/os/hal/platforms/LPC13xx/gpt_lld.h index 8ea7f375b..e4a53224b 100644 --- a/os/hal/platforms/LPC13xx/gpt_lld.h +++ b/os/hal/platforms/LPC13xx/gpt_lld.h @@ -126,18 +126,6 @@ typedef uint32_t gptfreq_t; */ typedef uint32_t gptcnt_t; -/** - * @brief Type of a structure representing a GPT driver. - */ -typedef struct GPTDriver GPTDriver; - -/** - * @brief GPT notification callback type. - * - * @param[in] gptp pointer to a @p GPTDriver object - */ -typedef void (*gptcallback_t)(GPTDriver *gptp); - /** * @brief Driver configuration structure. * @note It could be empty on some architectures. diff --git a/os/hal/platforms/STM32/gpt_lld.h b/os/hal/platforms/STM32/gpt_lld.h index 2d7fd13f1..cf749077f 100644 --- a/os/hal/platforms/STM32/gpt_lld.h +++ b/os/hal/platforms/STM32/gpt_lld.h @@ -163,18 +163,6 @@ typedef uint32_t gptfreq_t; */ typedef uint16_t gptcnt_t; -/** - * @brief Type of a structure representing a GPT driver. - */ -typedef struct GPTDriver GPTDriver; - -/** - * @brief GPT notification callback type. - * - * @param[in] gptp pointer to a @p GPTDriver object - */ -typedef void (*gptcallback_t)(GPTDriver *gptp); - /** * @brief Driver configuration structure. * @note It could be empty on some architectures. -- cgit v1.2.3 From a0baaface35fec7ecab6f78e66de35c6e1187857 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 31 Mar 2011 18:21:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2855 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/icu.h | 12 ++++++++++++ os/hal/platforms/STM32/icu_lld.c | 27 ++++++++++++++++++++++----- os/hal/platforms/STM32/icu_lld.h | 25 ++++++++++--------------- os/hal/templates/icu_lld.h | 21 ++++++++++----------- 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index f13349760..26fc120ad 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -59,6 +59,18 @@ typedef enum { ICU_IDLE = 5, /**< Idle cycle phase. */ } icustate_t; +/** + * @brief Type of a structure representing an ICU driver. + */ +typedef struct ICUDriver ICUDriver; + +/** + * @brief ICU notification callback type. + * + * @param[in] icup pointer to a @p ICUDriver object + */ +typedef void (*icucallback_t)(ICUDriver *icup); + #include "icu_lld.h" /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index 04c2f6372..d59027e4f 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -248,6 +248,7 @@ void icu_lld_init(void) { * @notapi */ void icu_lld_start(ICUDriver *icup) { + uint32_t clock, psc; if (icup->state == ICU_STOP) { /* Clock activation and timer reset.*/ @@ -258,6 +259,7 @@ void icu_lld_start(ICUDriver *icup) { RCC->APB2RSTR = 0; NVICEnableVector(TIM1_CC_IRQn, CORTEX_PRIORITY_MASK(STM32_ICU_TIM1_IRQ_PRIORITY)); + clock = STM32_TIMCLK2; } #endif #if STM32_ICU_USE_TIM2 @@ -267,6 +269,7 @@ void icu_lld_start(ICUDriver *icup) { RCC->APB1RSTR = 0; NVICEnableVector(TIM2_IRQn, CORTEX_PRIORITY_MASK(STM32_ICU_TIM2_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif #if STM32_ICU_USE_TIM3 @@ -276,6 +279,7 @@ void icu_lld_start(ICUDriver *icup) { RCC->APB1RSTR = 0; NVICEnableVector(TIM3_IRQn, CORTEX_PRIORITY_MASK(STM32_ICU_TIM3_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif #if STM32_ICU_USE_TIM4 @@ -285,6 +289,7 @@ void icu_lld_start(ICUDriver *icup) { RCC->APB1RSTR = 0; NVICEnableVector(TIM4_IRQn, CORTEX_PRIORITY_MASK(STM32_ICU_TIM4_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif @@ -295,16 +300,28 @@ void icu_lld_start(ICUDriver *icup) { RCC->APB1RSTR = 0; NVICEnableVector(TIM5_IRQn, CORTEX_PRIORITY_MASK(STM32_ICU_TIM5_IRQ_PRIORITY)); + clock = STM32_TIMCLK1; } #endif } + else { + /* Driver re-configuration scenario, it must be stopped first.*/ + icup->tim->CR1 = 0; /* Timer disabled. */ + icup->tim->DIER = 0; /* All IRQs disabled. */ + icup->tim->SR = 0; /* Clear eventual pending IRQs. */ + icup->tim->CCR1 = 0; /* Comparator 1 disabled. */ + icup->tim->CCR2 = 0; /* Comparator 2 disabled. */ + icup->tim->CNT = 0; /* Counter reset to zero. */ + } - /* Timer configuration, PWM input mode.*/ - icup->tim->CR1 = 0; /* Initially stopped. */ - icup->tim->CR2 = 0; + /* Timer configuration.*/ + psc = (clock / icup->config->frequency) - 1; + chDbgAssert((psc <= 0xFFFF) && + ((psc + 1) * icup->config->frequency) == clock, + "icu_lld_start(), #1", "invalid frequency"); + icup->tim->PSC = (uint16_t)psc; icup->tim->ARR = 0xFFFF; - icup->tim->PSC = icup->config->psc; /* Prescaler value. */ - icup->tim->DIER = 0; + /* CCMR1_CC1S = 01 = CH1 Input on TI1. CCMR1_CC2S = 10 = CH2 Input on TI2.*/ icup->tim->CCMR1 = TIM_CCMR1_CC1S_0 | diff --git a/os/hal/platforms/STM32/icu_lld.h b/os/hal/platforms/STM32/icu_lld.h index 758b9c352..437390d52 100644 --- a/os/hal/platforms/STM32/icu_lld.h +++ b/os/hal/platforms/STM32/icu_lld.h @@ -162,21 +162,14 @@ typedef enum { } icumode_t; /** - * @brief ICU counter type. - */ -typedef uint16_t icucnt_t; - -/** - * @brief Type of a structure representing an ICU driver. + * @brief ICU frequency type. */ -typedef struct ICUDriver ICUDriver; +typedef uint32_t icufreq_t; /** - * @brief ICU notification callback type. - * - * @param[in] icup pointer to a @p ICUDriver object + * @brief ICU counter type. */ -typedef void (*icucallback_t)(ICUDriver *icup); +typedef uint16_t icucnt_t; /** * @brief Driver configuration structure. @@ -187,6 +180,12 @@ typedef struct { * @brief Driver mode. */ icumode_t mode; + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + icufreq_t frequency; /** * @brief Callback for pulse width measurement. */ @@ -196,10 +195,6 @@ typedef struct { */ icucallback_t period_cb; /* End of the mandatory fields.*/ - /** - * @brief TIM PSC (pre-scaler) register initialization data. - */ - uint16_t psc; } ICUConfig; /** diff --git a/os/hal/templates/icu_lld.h b/os/hal/templates/icu_lld.h index 68ec93df6..34549b76e 100644 --- a/os/hal/templates/icu_lld.h +++ b/os/hal/templates/icu_lld.h @@ -56,21 +56,14 @@ typedef enum { } icumode_t; /** - * @brief ICU counter type. - */ -typedef uint16_t icucnt_t; - -/** - * @brief Type of a structure representing an ICU driver. + * @brief ICU frequency type. */ -typedef struct ICUDriver ICUDriver; +typedef uint32_t icufreq_t; /** - * @brief ICU notification callback type. - * - * @param[in] icup pointer to a @p ICUDriver object + * @brief ICU counter type. */ -typedef void (*icucallback_t)(ICUDriver *icup); +typedef uint16_t icucnt_t; /** * @brief Driver configuration structure. @@ -81,6 +74,12 @@ typedef struct { * @brief Driver mode. */ icumode_t mode; + /** + * @brief Timer clock in Hz. + * @note The low level can use assertions in order to catch invalid + * frequency specifications. + */ + icufreq_t frequency; /** * @brief Callback for pulse width measurement. */ -- cgit v1.2.3 From beab954a35b7c6be13b8c5af58c7cd52b5888abc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 31 Mar 2011 18:29:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2856 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/icu_lld.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index d59027e4f..5d3bb284d 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -354,6 +354,7 @@ void icu_lld_stop(ICUDriver *icup) { /* Clock deactivation.*/ icup->tim->CR1 = 0; /* Timer disabled. */ icup->tim->DIER = 0; /* All IRQs disabled. */ + icup->tim->SR = 0; /* Clear eventual pending IRQs. */ #if STM32_ICU_USE_TIM1 if (&ICUD1 == icup) { -- cgit v1.2.3 From 0b0fb6f88f6851842e89f19129b0dc535f41dcbc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 08:45:34 +0000 Subject: ICU driver functional. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2857 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/icu.h | 4 ++-- os/hal/platforms/STM32/icu_lld.c | 14 ++++++++++---- os/hal/platforms/STM32/icu_lld.h | 27 ++------------------------- os/hal/src/hal.c | 3 +++ testhal/STM32/PWM/main.c | 23 +++++++++++++++++++++++ testhal/STM32/PWM/mcuconf.h | 4 ++-- testhal/STM32/PWM/readme.txt | 6 ++++-- 7 files changed, 46 insertions(+), 35 deletions(-) diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index 26fc120ad..b51345c4d 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -130,8 +130,8 @@ extern "C" { void icuObjectInit(ICUDriver *icup); void icuStart(ICUDriver *icup, const ICUConfig *config); void icuStop(ICUDriver *icup); - void icuEnableI(ICUDriver *icup); - void icuDisableI(ICUDriver *icup); + void icuEnable(ICUDriver *icup); + void icuDisable(ICUDriver *icup); #ifdef __cplusplus } #endif diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index 5d3bb284d..f950a5eb6 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -91,12 +91,18 @@ ICUDriver ICUD5; static void icu_lld_serve_interrupt(ICUDriver *icup) { uint16_t sr; - sr = TIM1->SR & TIM1->DIER; + sr = icup->tim->SR & icup->tim->DIER; icup->tim->SR = 0; - if ((sr & TIM_SR_CC1IF) != 0) - icup->config->period_cb(icup); - if ((sr & TIM_SR_CC2IF) != 0) + if ((sr & TIM_SR_CC1IF) != 0) { + icustate_t previous_state = icup->state; + icup->state = ICU_ACTIVE; + if (previous_state != ICU_WAITING) + icup->config->period_cb(icup); + } + if ((sr & TIM_SR_CC2IF) != 0) { + icup->state = ICU_IDLE; icup->config->width_cb(icup); + } } /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/icu_lld.h b/os/hal/platforms/STM32/icu_lld.h index 437390d52..b98b8bf86 100644 --- a/os/hal/platforms/STM32/icu_lld.h +++ b/os/hal/platforms/STM32/icu_lld.h @@ -223,7 +223,6 @@ struct ICUDriver { /* Driver macros. */ /*===========================================================================*/ - /** * @brief Returns the width of the latest pulse. * @details The pulse width is defined as number of ticks between the start @@ -234,7 +233,7 @@ struct ICUDriver { * * @notapi */ -#define icu_lld_get_width(icup) ((icup)->tim->CCR2) +#define icu_lld_get_width(icup) ((icup)->tim->CCR2 + 1) /** * @brief Returns the width of the latest cycle. @@ -246,29 +245,7 @@ struct ICUDriver { * * @notapi */ -#define icu_lld_get_period(icup) ((icup)->tim->CCR1) - -/** - * @brief ICU clock prescaler initialization utility. - * @note The real clock value is rounded to the lower valid value, please - * make sure that the source clock frequency is a multiple of the - * requested ICU clock frequency. - * @note The calculated value must fit into an unsigned 16 bits integer. - * - * @param[in] clksrc clock source frequency, depending on the target timer - * cell it can be one of: - * - STM32_TIMCLK1 - * - STM32_TIMCLK2 - * . - * Please refer to the STM32 HAL driver documentation - * and/or the STM32 Reference Manual for the right clock - * source. - * @param[in] icuclk ICU clock frequency in cycles - * @return The value to be stored in the @p psc field of the - * @p ICUConfig structure. - */ -#define ICU_COMPUTE_PSC(clksrc, icuclk) \ - ((uint16_t)(((clksrc) / (icuclk)) - 1)) +#define icu_lld_get_period(icup) ((icup)->tim->CCR1 + 1) /*===========================================================================*/ /* External declarations. */ diff --git a/os/hal/src/hal.c b/os/hal/src/hal.c index 09b832fe2..8555b44bb 100644 --- a/os/hal/src/hal.c +++ b/os/hal/src/hal.c @@ -73,6 +73,9 @@ void halInit(void) { #if HAL_USE_I2C || defined(__DOXYGEN__) i2cInit(); #endif +#if HAL_USE_ICU || defined(__DOXYGEN__) + icuInit(); +#endif #if HAL_USE_MAC || defined(__DOXYGEN__) macInit(); #endif diff --git a/testhal/STM32/PWM/main.c b/testhal/STM32/PWM/main.c index ef08b792c..c89b71988 100644 --- a/testhal/STM32/PWM/main.c +++ b/testhal/STM32/PWM/main.c @@ -46,6 +46,25 @@ static PWMConfig pwmcfg = { 0 }; +icucnt_t last_width, last_period; + +static void icuwidthcb(ICUDriver *icup) { + + last_width = icuGetWidthI(icup); +} + +static void icuperiodcb(ICUDriver *icup) { + + last_period = icuGetPeriodI(icup); +} + +static ICUConfig icucfg = { + ICU_INPUT_ACTIVE_HIGH, + 10000, /* 10KHz ICU clock frequency. */ + icuwidthcb, + icuperiodcb +}; + /* * Application entry point. */ @@ -71,6 +90,8 @@ int main(void) { */ pwmStart(&PWMD1, &pwmcfg); palSetPadMode(IOPORT1, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL); + icuStart(&ICUD4, &icucfg); + icuEnable(&ICUD4); chThdSleepMilliseconds(2000); /* @@ -97,6 +118,8 @@ int main(void) { */ pwmDisableChannel(&PWMD1, 0); pwmStop(&PWMD1); + icuDisable(&ICUD4); + icuStop(&ICUD4); palSetPad(IOPORT3, GPIOC_LED); /* diff --git a/testhal/STM32/PWM/mcuconf.h b/testhal/STM32/PWM/mcuconf.h index 17929817f..bd96de17b 100644 --- a/testhal/STM32/PWM/mcuconf.h +++ b/testhal/STM32/PWM/mcuconf.h @@ -78,9 +78,9 @@ * ICU driver system settings. */ #define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 TRUE +#define STM32_ICU_USE_TIM2 FALSE #define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM4 TRUE #define STM32_ICU_USE_TIM5 FALSE #define STM32_ICU_TIM1_IRQ_PRIORITY 7 #define STM32_ICU_TIM2_IRQ_PRIORITY 7 diff --git a/testhal/STM32/PWM/readme.txt b/testhal/STM32/PWM/readme.txt index 4c3fdf2fa..97476205d 100644 --- a/testhal/STM32/PWM/readme.txt +++ b/testhal/STM32/PWM/readme.txt @@ -1,5 +1,5 @@ ***************************************************************************** -** ChibiOS/RT HAL - PWM driver demo for STM32. ** +** ChibiOS/RT HAL - PWM/ICU driver demo for STM32. ** ***************************************************************************** ** TARGET ** @@ -8,7 +8,9 @@ The demo will on an Olimex STM32-P103 board. ** The Demo ** -The application demonstrates the use of the STM32 PWM driver. +The application demonstrates the use of the STM32 PWM and ICU drivers. Pins +PA8 and PB6 must be connected in order to trigger the ICU input with the +PWM output. The ICU unit will measure the generated PWM. ** Build Procedure ** -- cgit v1.2.3 From 90a05a12abe23cc6e0998119d5b460b862871337 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 08:50:09 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2858 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/PWM-ICU/Makefile | 204 ++++++++++++++++ testhal/STM32/PWM-ICU/ch.ld | 114 +++++++++ testhal/STM32/PWM-ICU/chconf.h | 508 +++++++++++++++++++++++++++++++++++++++ testhal/STM32/PWM-ICU/halconf.h | 288 ++++++++++++++++++++++ testhal/STM32/PWM-ICU/main.c | 132 ++++++++++ testhal/STM32/PWM-ICU/mcuconf.h | 157 ++++++++++++ testhal/STM32/PWM-ICU/readme.txt | 28 +++ testhal/STM32/PWM/Makefile | 204 ---------------- testhal/STM32/PWM/ch.ld | 114 --------- testhal/STM32/PWM/chconf.h | 508 --------------------------------------- testhal/STM32/PWM/halconf.h | 288 ---------------------- testhal/STM32/PWM/main.c | 132 ---------- testhal/STM32/PWM/mcuconf.h | 157 ------------ testhal/STM32/PWM/readme.txt | 28 --- 14 files changed, 1431 insertions(+), 1431 deletions(-) create mode 100644 testhal/STM32/PWM-ICU/Makefile create mode 100644 testhal/STM32/PWM-ICU/ch.ld create mode 100644 testhal/STM32/PWM-ICU/chconf.h create mode 100644 testhal/STM32/PWM-ICU/halconf.h create mode 100644 testhal/STM32/PWM-ICU/main.c create mode 100644 testhal/STM32/PWM-ICU/mcuconf.h create mode 100644 testhal/STM32/PWM-ICU/readme.txt delete mode 100644 testhal/STM32/PWM/Makefile delete mode 100644 testhal/STM32/PWM/ch.ld delete mode 100644 testhal/STM32/PWM/chconf.h delete mode 100644 testhal/STM32/PWM/halconf.h delete mode 100644 testhal/STM32/PWM/main.c delete mode 100644 testhal/STM32/PWM/mcuconf.h delete mode 100644 testhal/STM32/PWM/readme.txt diff --git a/testhal/STM32/PWM-ICU/Makefile b/testhal/STM32/PWM-ICU/Makefile new file mode 100644 index 000000000..a5c76f1c8 --- /dev/null +++ b/testhal/STM32/PWM-ICU/Makefile @@ -0,0 +1,204 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +#include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARM/rules.mk diff --git a/testhal/STM32/PWM-ICU/ch.ld b/testhal/STM32/PWM-ICU/ch.ld new file mode 100644 index 000000000..ae79ddd40 --- /dev/null +++ b/testhal/STM32/PWM-ICU/ch.ld @@ -0,0 +1,114 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/STM32/PWM-ICU/chconf.h b/testhal/STM32/PWM-ICU/chconf.h new file mode 100644 index 000000000..04fa822cc --- /dev/null +++ b/testhal/STM32/PWM-ICU/chconf.h @@ -0,0 +1,508 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/PWM-ICU/halconf.h b/testhal/STM32/PWM-ICU/halconf.h new file mode 100644 index 000000000..8d87b73cb --- /dev/null +++ b/testhal/STM32/PWM-ICU/halconf.h @@ -0,0 +1,288 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/PWM-ICU/main.c b/testhal/STM32/PWM-ICU/main.c new file mode 100644 index 000000000..c89b71988 --- /dev/null +++ b/testhal/STM32/PWM-ICU/main.c @@ -0,0 +1,132 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" + +static void pwmpcb(PWMDriver *pwmp) { + + (void)pwmp; + palSetPad(IOPORT3, GPIOC_LED); +} + +static void pwmc1cb(PWMDriver *pwmp) { + + (void)pwmp; + palClearPad(IOPORT3, GPIOC_LED); +} + +static PWMConfig pwmcfg = { + 10000, /* 10KHz PWM clock frequency. */ + 10000, /* Initial PWM period 1S. */ + pwmpcb, + { + {PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0 +}; + +icucnt_t last_width, last_period; + +static void icuwidthcb(ICUDriver *icup) { + + last_width = icuGetWidthI(icup); +} + +static void icuperiodcb(ICUDriver *icup) { + + last_period = icuGetPeriodI(icup); +} + +static ICUConfig icucfg = { + ICU_INPUT_ACTIVE_HIGH, + 10000, /* 10KHz ICU clock frequency. */ + icuwidthcb, + icuperiodcb +}; + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * LED initially off. + */ + palSetPad(IOPORT3, GPIOC_LED); + + /* + * Initializes the PWM driver 1. + */ + pwmStart(&PWMD1, &pwmcfg); + palSetPadMode(IOPORT1, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL); + icuStart(&ICUD4, &icucfg); + icuEnable(&ICUD4); + chThdSleepMilliseconds(2000); + + /* + * Starts the channel 0 using 25% duty cycle. + */ + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500)); + chThdSleepMilliseconds(5000); + + /* + * Changes the channel 0 to 75% duty cycle. + */ + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500)); + chThdSleepMilliseconds(5000); + + /* + * Changes PWM period to half second and duty cycle to 50%. + */ + pwmChangePeriod(&PWMD1, 5000); + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); + chThdSleepMilliseconds(5000); + + /* + * Disables channel 0. + */ + pwmDisableChannel(&PWMD1, 0); + pwmStop(&PWMD1); + icuDisable(&ICUD4); + icuStop(&ICUD4); + palSetPad(IOPORT3, GPIOC_LED); + + /* + * Normal main() thread activity, in this demo it does nothing. + */ + while (TRUE) { + chThdSleepMilliseconds(500); + } + return 0; +} diff --git a/testhal/STM32/PWM-ICU/mcuconf.h b/testhal/STM32/PWM-ICU/mcuconf.h new file mode 100644 index 000000000..bd96de17b --- /dev/null +++ b/testhal/STM32/PWM-ICU/mcuconf.h @@ -0,0 +1,157 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/PWM-ICU/readme.txt b/testhal/STM32/PWM-ICU/readme.txt new file mode 100644 index 000000000..97476205d --- /dev/null +++ b/testhal/STM32/PWM-ICU/readme.txt @@ -0,0 +1,28 @@ +***************************************************************************** +** ChibiOS/RT HAL - PWM/ICU driver demo for STM32. ** +***************************************************************************** + +** TARGET ** + +The demo will on an Olimex STM32-P103 board. + +** The Demo ** + +The application demonstrates the use of the STM32 PWM and ICU drivers. Pins +PA8 and PB6 must be connected in order to trigger the ICU input with the +PWM output. The ICU unit will measure the generated PWM. + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com diff --git a/testhal/STM32/PWM/Makefile b/testhal/STM32/PWM/Makefile deleted file mode 100644 index a5c76f1c8..000000000 --- a/testhal/STM32/PWM/Makefile +++ /dev/null @@ -1,204 +0,0 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable register caching optimization (read documentation). -ifeq ($(USE_CURRP_CACHING),) - USE_CURRP_CACHING = no -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Enable this if you really want to use the STM FWLib. -ifeq ($(USE_FWLIB),) - USE_FWLIB = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Define linker script file here -LDSCRIPT= ch.ld - -# Imported source files -CHIBIOS = ../../.. -include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk -include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk -include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk -include $(CHIBIOS)/os/kernel/kernel.mk -#include $(CHIBIOS)/test/test.mk - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(PORTSRC) \ - $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(CHIBIOS)/os/various/evtimer.c \ - $(CHIBIOS)/os/various/syscalls.c \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = $(PORTASM) - -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m3 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -OD = $(TRGT)objdump -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of default section -# - -# List all default C defines here, like -D_DEBUG=1 -DDEFS = - -# List all default ASM defines here, like -D_DEBUG=1 -DADEFS = - -# List all default directories to look for include files here -DINCDIR = - -# List the default directory to look for the libraries here -DLIBDIR = - -# List all default libraries here -DLIBS = - -# -# End of default section -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# -# End of user defines -############################################################################## - -ifeq ($(USE_FWLIB),yes) - include $(CHIBIOS)/ext/stm32lib/stm32lib.mk - CSRC += $(STM32SRC) - INCDIR += $(STM32INC) - USE_OPT += -DUSE_STDPERIPH_DRIVER -endif - -include $(CHIBIOS)/os/ports/GCC/ARM/rules.mk diff --git a/testhal/STM32/PWM/ch.ld b/testhal/STM32/PWM/ch.ld deleted file mode 100644 index ae79ddd40..000000000 --- a/testhal/STM32/PWM/ch.ld +++ /dev/null @@ -1,114 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F103 memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; -__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; - -MEMORY -{ - flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 20k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -SECTIONS -{ - . = 0; - - .text : ALIGN(16) SUBALIGN(16) - { - _text = .; - KEEP(*(vectors)) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ctors : - { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); - } > flash - - .dtors : - { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); - } > flash - - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .data : - { - _data = .; - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - _edata = .; - } > ram AT > flash - - .bss : - { - _bss_start = .; - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - _bss_end = .; - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/STM32/PWM/chconf.h b/testhal/STM32/PWM/chconf.h deleted file mode 100644 index 04fa822cc..000000000 --- a/testhal/STM32/PWM/chconf.h +++ /dev/null @@ -1,508 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/* Kernel parameters. */ -/*===========================================================================*/ - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) -#define CH_FREQUENCY 1000 -#endif - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - */ -#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) -#define CH_TIME_QUANTUM 20 -#endif - -/** - * @brief Nested locks. - * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() - * operations is allowed.
- * For performance and code size reasons the recommended setting - * is to leave this option disabled.
- * You may use this option if you need to merge ChibiOS/RT with - * external libraries that require nested lock/unlock operations. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) -#define CH_USE_NESTED_LOCKS FALSE -#endif - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. - */ -#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) -#define CH_MEMCORE_SIZE 0 -#endif - -/*===========================================================================*/ -/* Performance options. */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) -#define CH_OPTIMIZE_SPEED TRUE -#endif - -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - -/*===========================================================================*/ -/* Subsystem options. */ -/*===========================================================================*/ - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) -#define CH_USE_REGISTRY TRUE -#endif - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) -#define CH_USE_WAITEXIT TRUE -#endif - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES TRUE -#endif - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES_PRIORITY FALSE -#endif - -/** - * @brief Atomic semaphore API. - * @details If enabled then the semaphores the @p chSemSignalWait() API - * is included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) -#define CH_USE_SEMSW TRUE -#endif - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) -#define CH_USE_MUTEXES TRUE -#endif - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MUTEXES. - */ -#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS TRUE -#endif - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_CONDVARS. - */ -#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS_TIMEOUT TRUE -#endif - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) -#define CH_USE_EVENTS TRUE -#endif - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_EVENTS. - */ -#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_EVENTS_TIMEOUT TRUE -#endif - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES TRUE -#endif - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_MESSAGES. - */ -#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES_PRIORITY FALSE -#endif - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) -#define CH_USE_MAILBOXES TRUE -#endif - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) -#define CH_USE_QUEUES TRUE -#endif - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) -#define CH_USE_MEMCORE TRUE -#endif - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or - * @p CH_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) -#define CH_USE_HEAP TRUE -#endif - -/** - * @brief C-runtime allocator. - * @details If enabled the the heap allocator APIs just wrap the C-runtime - * @p malloc() and @p free() functions. - * - * @note The default is @p FALSE. - * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the - * appropriate documentation. - */ -#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) -#define CH_USE_MALLOC_HEAP FALSE -#endif - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) -#define CH_USE_MEMPOOLS TRUE -#endif - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_WAITEXIT. - * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. - */ -#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) -#define CH_USE_DYNAMIC TRUE -#endif - -/*===========================================================================*/ -/* Debug options. */ -/*===========================================================================*/ - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_CHECKS FALSE -#endif - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_ASSERTS FALSE -#endif - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_TRACE FALSE -#endif - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_STACK_CHECK FALSE -#endif - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) -#define CH_DBG_FILL_THREADS FALSE -#endif - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p Thread structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p TRUE. - * @note This debug option is defaulted to TRUE because it is required by - * some test cases into the test suite. - */ -#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) -#define CH_DBG_THREADS_PROFILING TRUE -#endif - -/*===========================================================================*/ -/* Kernel hooks. */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p Thread structure. - */ -#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) -#define THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ -#endif - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitily from all - * the threads creation APIs. - */ -#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} -#endif - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} -#endif - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) -#define IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} -#endif - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_TICK_EVENT_HOOK() { \ - /* System tick event code here.*/ \ -} -#endif - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_HALT_HOOK() { \ - /* System halt code here.*/ \ -} -#endif - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/testhal/STM32/PWM/halconf.h b/testhal/STM32/PWM/halconf.h deleted file mode 100644 index 8d87b73cb..000000000 --- a/testhal/STM32/PWM/halconf.h +++ /dev/null @@ -1,288 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM TRUE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Block size for MMC transfers. - */ -#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) -#define MMC_SECTOR_SIZE 512 -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/** - * @brief Number of positive insertion queries before generating the - * insertion event. - */ -#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) -#define MMC_POLLING_INTERVAL 10 -#endif - -/** - * @brief Interval, in milliseconds, between insertion queries. - */ -#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) -#define MMC_POLLING_DELAY 10 -#endif - -/** - * @brief Uses the SPI polled API for small data transfers. - * @details Polled transfers usually improve performance because it - * saves two context switches and interrupt servicing. Note - * that this option has no effect on large transfers which - * are always performed using DMAs/IRQs. - */ -#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) -#define MMC_USE_SPI_POLLING TRUE -#endif - -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/testhal/STM32/PWM/main.c b/testhal/STM32/PWM/main.c deleted file mode 100644 index c89b71988..000000000 --- a/testhal/STM32/PWM/main.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" - -static void pwmpcb(PWMDriver *pwmp) { - - (void)pwmp; - palSetPad(IOPORT3, GPIOC_LED); -} - -static void pwmc1cb(PWMDriver *pwmp) { - - (void)pwmp; - palClearPad(IOPORT3, GPIOC_LED); -} - -static PWMConfig pwmcfg = { - 10000, /* 10KHz PWM clock frequency. */ - 10000, /* Initial PWM period 1S. */ - pwmpcb, - { - {PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb}, - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL} - }, - 0 -}; - -icucnt_t last_width, last_period; - -static void icuwidthcb(ICUDriver *icup) { - - last_width = icuGetWidthI(icup); -} - -static void icuperiodcb(ICUDriver *icup) { - - last_period = icuGetPeriodI(icup); -} - -static ICUConfig icucfg = { - ICU_INPUT_ACTIVE_HIGH, - 10000, /* 10KHz ICU clock frequency. */ - icuwidthcb, - icuperiodcb -}; - -/* - * Application entry point. - */ -int main(void) { - - /* - * System initializations. - * - HAL initialization, this also initializes the configured device drivers - * and performs the board-specific initializations. - * - Kernel initialization, the main() function becomes a thread and the - * RTOS is active. - */ - halInit(); - chSysInit(); - - /* - * LED initially off. - */ - palSetPad(IOPORT3, GPIOC_LED); - - /* - * Initializes the PWM driver 1. - */ - pwmStart(&PWMD1, &pwmcfg); - palSetPadMode(IOPORT1, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL); - icuStart(&ICUD4, &icucfg); - icuEnable(&ICUD4); - chThdSleepMilliseconds(2000); - - /* - * Starts the channel 0 using 25% duty cycle. - */ - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500)); - chThdSleepMilliseconds(5000); - - /* - * Changes the channel 0 to 75% duty cycle. - */ - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500)); - chThdSleepMilliseconds(5000); - - /* - * Changes PWM period to half second and duty cycle to 50%. - */ - pwmChangePeriod(&PWMD1, 5000); - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); - chThdSleepMilliseconds(5000); - - /* - * Disables channel 0. - */ - pwmDisableChannel(&PWMD1, 0); - pwmStop(&PWMD1); - icuDisable(&ICUD4); - icuStop(&ICUD4); - palSetPad(IOPORT3, GPIOC_LED); - - /* - * Normal main() thread activity, in this demo it does nothing. - */ - while (TRUE) { - chThdSleepMilliseconds(500); - } - return 0; -} diff --git a/testhal/STM32/PWM/mcuconf.h b/testhal/STM32/PWM/mcuconf.h deleted file mode 100644 index bd96de17b..000000000 --- a/testhal/STM32/PWM/mcuconf.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * STM32 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -/* - * HAL driver system settings. - */ -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_USBPRE STM32_USBPRE_DIV1P5 -#define STM32_MCO STM32_MCO_NOCLOCK - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 -#define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 TRUE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 TRUE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_TIM1 TRUE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 TRUE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 TRUE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/PWM/readme.txt b/testhal/STM32/PWM/readme.txt deleted file mode 100644 index 97476205d..000000000 --- a/testhal/STM32/PWM/readme.txt +++ /dev/null @@ -1,28 +0,0 @@ -***************************************************************************** -** ChibiOS/RT HAL - PWM/ICU driver demo for STM32. ** -***************************************************************************** - -** TARGET ** - -The demo will on an Olimex STM32-P103 board. - -** The Demo ** - -The application demonstrates the use of the STM32 PWM and ICU drivers. Pins -PA8 and PB6 must be connected in order to trigger the ICU input with the -PWM output. The ICU unit will measure the generated PWM. - -** Build Procedure ** - -The demo has been tested by using the free Codesourcery GCC-based toolchain -and YAGARTO. -Just modify the TRGT line in the makefile in order to use different GCC ports. - -** Notes ** - -Some files used by the demo are not part of ChibiOS/RT but are copyright of -ST Microelectronics and are licensed under a different license. -Also note that not all the files present in the ST library are distribited -with ChibiOS/RT, you can find the whole library on the ST web site: - - http://www.st.com -- cgit v1.2.3 From be4c72c7a3e9e11a23ad5d6de709957adffa06ff Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 09:11:35 +0000 Subject: Updated the various STM32 mcuconf.h files with the ICU settings. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2859 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F103/mcuconf.h | 14 ++++++++++++++ demos/ARMCM3-STM32F107/mcuconf.h | 22 ++++++++++++++++++++++ testhal/STM32/ADC/mcuconf.h | 14 ++++++++++++++ testhal/STM32/CAN/mcuconf.h | 14 ++++++++++++++ testhal/STM32/GPT/mcuconf.h | 14 ++++++++++++++ testhal/STM32/IRQ_STORM/mcuconf.h | 14 ++++++++++++++ testhal/STM32/SPI/mcuconf.h | 14 ++++++++++++++ testhal/STM32/UART/mcuconf.h | 14 ++++++++++++++ testhal/STM32/USB_CDC/mcuconf.h | 14 ++++++++++++++ testhal/STM32/USB_MSC/mcuconf.h | 14 ++++++++++++++ 12 files changed, 176 insertions(+) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index 89a2d6c9b..fcbfa6948 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -73,6 +73,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h index 6361a4c0b..bff96c226 100644 --- a/demos/ARMCM3-STM32F107/mcuconf.h +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -81,6 +81,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ @@ -140,3 +154,11 @@ #define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() #define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/GPT/mcuconf.h b/testhal/STM32/GPT/mcuconf.h index 32fbe68ef..90a7e9fc7 100644 --- a/testhal/STM32/GPT/mcuconf.h +++ b/testhal/STM32/GPT/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/IRQ_STORM/mcuconf.h b/testhal/STM32/IRQ_STORM/mcuconf.h index ebe2c0b1f..52ca1d806 100644 --- a/testhal/STM32/IRQ_STORM/mcuconf.h +++ b/testhal/STM32/IRQ_STORM/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index 40e467270..cd2052da7 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ diff --git a/testhal/STM32/USB_MSC/mcuconf.h b/testhal/STM32/USB_MSC/mcuconf.h index 2f50634ce..bd96de17b 100644 --- a/testhal/STM32/USB_MSC/mcuconf.h +++ b/testhal/STM32/USB_MSC/mcuconf.h @@ -74,6 +74,20 @@ #define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7 +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + /* * PWM driver system settings. */ -- cgit v1.2.3 From 875a7d8f4151039f4c47b05c0d4f196575b8d109 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 09:31:28 +0000 Subject: Shared ISR code moved in icu.h. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2860 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/icu.h | 26 ++++++++++++++++++++++++++ os/hal/platforms/STM32/icu_lld.c | 14 ++++---------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index b51345c4d..8a89281ae 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -119,6 +119,32 @@ typedef void (*icucallback_t)(ICUDriver *icup); */ #define icuGetPeriodI(icup) icu_lld_get_period(icup) +/** + * @brief Common ISR code, ICU width event. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +#define _icu_isr_invoke_width_cb(usbp) { \ + (icup)->state = ICU_IDLE; \ + (icup)->config->width_cb(icup); \ +} + +/** + * @brief Common ISR code, ICU period event. + * + * @param[in] icup pointer to the @p ICUDriver object + * + * @notapi + */ +#define _icu_isr_invoke_period_cb(usbp) { \ + icustate_t previous_state = (icup)->state; \ + (icup)->state = ICU_ACTIVE; \ + if (previous_state != ICU_WAITING) \ + (icup)->config->period_cb(icup); \ +} + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index f950a5eb6..ae3287ef9 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -93,16 +93,10 @@ static void icu_lld_serve_interrupt(ICUDriver *icup) { sr = icup->tim->SR & icup->tim->DIER; icup->tim->SR = 0; - if ((sr & TIM_SR_CC1IF) != 0) { - icustate_t previous_state = icup->state; - icup->state = ICU_ACTIVE; - if (previous_state != ICU_WAITING) - icup->config->period_cb(icup); - } - if ((sr & TIM_SR_CC2IF) != 0) { - icup->state = ICU_IDLE; - icup->config->width_cb(icup); - } + if ((sr & TIM_SR_CC1IF) != 0) + _icu_isr_invoke_period_cb(icup); + if ((sr & TIM_SR_CC2IF) != 0) + _icu_isr_invoke_width_cb(icup); } /*===========================================================================*/ -- cgit v1.2.3 From d8420eb83a4b843ad23d0fbe77fea36272adc525 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 13:06:44 +0000 Subject: Added advanced mode and BTRD handling to the STM32 PWM driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2861 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY/main.c | 3 ++ demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 1 + demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 1 + demos/ARMCM3-STM32F103/mcuconf.h | 1 + demos/ARMCM3-STM32F107/mcuconf.h | 1 + os/hal/platforms/STM32/pwm_lld.c | 42 +++++++++++++-- os/hal/platforms/STM32/pwm_lld.h | 83 ++++++++++++++++++++++++++---- readme.txt | 1 + testhal/STM32/ADC/mcuconf.h | 1 + testhal/STM32/CAN/mcuconf.h | 1 + testhal/STM32/GPT/mcuconf.h | 1 + testhal/STM32/IRQ_STORM/mcuconf.h | 1 + testhal/STM32/PWM-ICU/main.c | 3 ++ testhal/STM32/PWM-ICU/mcuconf.h | 1 + testhal/STM32/SPI/mcuconf.h | 1 + testhal/STM32/UART/mcuconf.h | 1 + testhal/STM32/USB_CDC/mcuconf.h | 1 + testhal/STM32/USB_MSC/mcuconf.h | 1 + 18 files changed, 131 insertions(+), 14 deletions(-) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/main.c b/demos/ARMCM3-STM32F100-DISCOVERY/main.c index bc7e5f632..ff9c4ec70 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/main.c +++ b/demos/ARMCM3-STM32F100-DISCOVERY/main.c @@ -73,7 +73,10 @@ static PWMConfig pwmcfg = { {PWM_OUTPUT_ACTIVE_HIGH, NULL} }, /* HW dependent part.*/ + 0, +#if STM32_PWM_USE_ADVANCED 0 +#endif }; /* diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index fcbfa6948..9bc43776c 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -90,6 +90,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED FALSE #define STM32_PWM_USE_TIM1 FALSE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 TRUE diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h index bff96c226..613541da4 100644 --- a/demos/ARMCM3-STM32F107/mcuconf.h +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -98,6 +98,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 6b05b66aa..2f125b345 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -394,7 +394,7 @@ void pwm_lld_start(PWMDriver *pwmp) { /* Output enables and polarities setup.*/ ccer = 0; - switch (pwmp->config->channels[0].mode) { + switch (pwmp->config->channels[0].mode & PWM_OUTPUT_MASK) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC1P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -402,7 +402,7 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - switch (pwmp->config->channels[1].mode) { + switch (pwmp->config->channels[1].mode & PWM_OUTPUT_MASK) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC2P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -410,7 +410,7 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - switch (pwmp->config->channels[2].mode) { + switch (pwmp->config->channels[2].mode & PWM_OUTPUT_MASK) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC3P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -418,7 +418,7 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } - switch (pwmp->config->channels[3].mode) { + switch (pwmp->config->channels[3].mode & PWM_OUTPUT_MASK) { case PWM_OUTPUT_ACTIVE_LOW: ccer |= TIM_CCER_CC4P; case PWM_OUTPUT_ACTIVE_HIGH: @@ -426,11 +426,44 @@ void pwm_lld_start(PWMDriver *pwmp) { default: ; } +#if STM32_PWM_USE_ADVANCED + if (&PWMD1 == pwmp) { + switch (pwmp->config->channels[0].mode & PWM_COMPLEMENTARY_OUTPUT_MASK) { + case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW: + ccer |= TIM_CCER_CC1NP; + case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH: + ccer |= TIM_CCER_CC1NE; + default: + ; + } + switch (pwmp->config->channels[1].mode & PWM_COMPLEMENTARY_OUTPUT_MASK) { + case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW: + ccer |= TIM_CCER_CC2NP; + case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH: + ccer |= TIM_CCER_CC2NE; + default: + ; + } + switch (pwmp->config->channels[2].mode & PWM_COMPLEMENTARY_OUTPUT_MASK) { + case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW: + ccer |= TIM_CCER_CC3NP; + case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH: + ccer |= TIM_CCER_CC3NE; + default: + ; + } + } +#endif /* STM32_PWM_USE_ADVANCED*/ + pwmp->tim->CCER = ccer; pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ pwmp->tim->SR = 0; /* Clear pending IRQs. */ pwmp->tim->DIER = pwmp->config->callback == NULL ? 0 : TIM_DIER_UIE; +#if STM32_PWM_USE_ADVANCED + pwmp->tim->BDTR = pwmp->config->bdtr | TIM_BDTR_MOE; +#else pwmp->tim->BDTR = TIM_BDTR_MOE; +#endif /* Timer configured and started.*/ pwmp->tim->CR1 = TIM_CR1_ARPE | TIM_CR1_URS | TIM_CR1_CEN; } @@ -450,6 +483,7 @@ void pwm_lld_stop(PWMDriver *pwmp) { pwmp->tim->CR1 = 0; /* Timer disabled. */ pwmp->tim->DIER = 0; /* All IRQs disabled. */ pwmp->tim->SR = 0; /* Clear eventual pending IRQs. */ + pwmp->tim->BDTR = 0; #if STM32_PWM_USE_TIM1 if (&PWMD1 == pwmp) { diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index d8e1754c9..e36b6f1f6 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -38,12 +38,68 @@ /** * @brief Number of PWM channels per PWM driver. */ -#define PWM_CHANNELS 4 +#define PWM_CHANNELS 4 + +/** + * @brief Standard output modes mask. + */ +#define PWM_OUTPUT_MASK 0x07 + +/** + * @brief Output not driven, callback only. + */ +#define PWM_OUTPUT_DISABLED 0x00 + +/** + * @brief Positive PWM logic, active is logic level one. + */ +#define PWM_OUTPUT_ACTIVE_HIGH 0x01 + +/** + * @brief Inverse PWM logic, active is logic level zero. + */ +#define PWM_OUTPUT_ACTIVE_LOW 0x02 + +/** + * @brief Complementary output modes mask. + */ +#define PWM_COMPLEMENTARY_OUTPUT_MASK 0x70 + +/** + * @brief Complementary output not driven. + */ +#define PWM_COMPLEMENTARY_OUTPUT_DISABLED 0x00 + +/** + * @brief Complementary output, active is logic level one. + * @note This setting is only available if the configuration option + * @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced + * timers TIM1 and TIM8. + */ +#define PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH 0x10 + +/** + * @brief Complementary output, active is logic level zero. + * @note This setting is only available if the configuration option + * @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced + * timers TIM1 and TIM8. + */ +#define PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW 0x20 /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief If advanced timer features switch. + * @details If set to @p TRUE the advanced features for TIM1 and TIM8 are + * enabled. + * @note The default is @p TRUE. + */ +#if !defined(STM32_PWM_USE_ADVANCED) || defined(__DOXYGEN__) +#define STM32_PWM_USE_ADVANCED TRUE +#endif + /** * @brief PWMD1 driver enable switch. * @details If set to @p TRUE the support for PWMD1 is included. @@ -154,10 +210,19 @@ #error "PWM driver activated but no TIM peripheral assigned" #endif +#if STM32_PWM_USE_ADVANCED && !STM32_PWM_USE_TIM1 +#error "advanced mode selected but no advanced timer assigned" +#endif + /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief PWM mode type. + */ +typedef uint32_t pwmmode_t; + /** * @brief PWM channel type. */ @@ -168,15 +233,6 @@ typedef uint8_t pwmchannel_t; */ typedef uint16_t pwmcnt_t; -/** - * @brief PWM logic mode. - */ -typedef enum { - PWM_OUTPUT_DISABLED = 0, /**< Output not driven, callback only. */ - PWM_OUTPUT_ACTIVE_HIGH = 1, /**< Idle is logic level 0. */ - PWM_OUTPUT_ACTIVE_LOW = 2 /**< Idle is logic level 1. */ -} pwmmode_t; - /** * @brief PWM driver channel configuration structure. */ @@ -226,6 +282,13 @@ typedef struct { * @note The value of this field should normally be equal to zero. */ uint16_t cr2; +#if STM32_PWM_USE_ADVANCED || defined(__DOXYGEN__) + /** + * @brief TIM BDTR (break & dead-time) register initialization data. + * @note The value of this field should normally be equal to zero. + */ \ + uint16_t bdtr; +#endif } PWMConfig; /** diff --git a/readme.txt b/readme.txt index b0c085811..775279bbb 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,7 @@ even from within callbacks. Formerly it was required to stop and restart the driver. - Improved driver documentation. +- NEW: Added advanced mode to the STM32 PWM driver (TIM1 only). - NEW: Added new ICU driver model, Input Capture Unit. - NEW: ICU driver implementation for STM32. - NEW: Implemented stack checking in the Cortex-Mx RVCT port (backported diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/GPT/mcuconf.h b/testhal/STM32/GPT/mcuconf.h index 90a7e9fc7..c7dc8742c 100644 --- a/testhal/STM32/GPT/mcuconf.h +++ b/testhal/STM32/GPT/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 FALSE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/IRQ_STORM/mcuconf.h b/testhal/STM32/IRQ_STORM/mcuconf.h index 52ca1d806..d27660a12 100644 --- a/testhal/STM32/IRQ_STORM/mcuconf.h +++ b/testhal/STM32/IRQ_STORM/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 FALSE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/PWM-ICU/main.c b/testhal/STM32/PWM-ICU/main.c index c89b71988..3f7b6423e 100644 --- a/testhal/STM32/PWM-ICU/main.c +++ b/testhal/STM32/PWM-ICU/main.c @@ -43,7 +43,10 @@ static PWMConfig pwmcfg = { {PWM_OUTPUT_DISABLED, NULL}, {PWM_OUTPUT_DISABLED, NULL} }, + 0, +#if STM32_PWM_USE_ADVANCED 0 +#endif }; icucnt_t last_width, last_period; diff --git a/testhal/STM32/PWM-ICU/mcuconf.h b/testhal/STM32/PWM-ICU/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/testhal/STM32/PWM-ICU/mcuconf.h +++ b/testhal/STM32/PWM-ICU/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index cd2052da7..d1f919486 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE diff --git a/testhal/STM32/USB_MSC/mcuconf.h b/testhal/STM32/USB_MSC/mcuconf.h index bd96de17b..94e9c5d15 100644 --- a/testhal/STM32/USB_MSC/mcuconf.h +++ b/testhal/STM32/USB_MSC/mcuconf.h @@ -91,6 +91,7 @@ /* * PWM driver system settings. */ +#define STM32_PWM_USE_ADVANCED TRUE #define STM32_PWM_USE_TIM1 TRUE #define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE -- cgit v1.2.3 From 01b0220ffa200db034b0be6b0f464ec3344e3c15 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 13:14:47 +0000 Subject: Documentation related fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2862 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/icu.h | 4 ++-- os/hal/include/pwm.h | 1 + os/hal/platforms/STM32/pwm_lld.c | 1 + os/hal/src/pwm.c | 1 + os/hal/templates/pwm_lld.c | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h index 8a89281ae..38fed2788 100644 --- a/os/hal/include/icu.h +++ b/os/hal/include/icu.h @@ -126,7 +126,7 @@ typedef void (*icucallback_t)(ICUDriver *icup); * * @notapi */ -#define _icu_isr_invoke_width_cb(usbp) { \ +#define _icu_isr_invoke_width_cb(icup) { \ (icup)->state = ICU_IDLE; \ (icup)->config->width_cb(icup); \ } @@ -138,7 +138,7 @@ typedef void (*icucallback_t)(ICUDriver *icup); * * @notapi */ -#define _icu_isr_invoke_period_cb(usbp) { \ +#define _icu_isr_invoke_period_cb(icup) { \ icustate_t previous_state = (icup)->state; \ (icup)->state = ICU_ACTIVE; \ if (previous_state != ICU_WAITING) \ diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index 7181054e4..76c2e1674 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -137,6 +137,7 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp); * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] period new cycle time in ticks * * @iclass */ diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 2f125b345..15d54b4fd 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -530,6 +530,7 @@ void pwm_lld_stop(PWMDriver *pwmp) { * @note The function has effect at the next cycle start. * * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] period new cycle time in ticks * * @api */ diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c index eaa49bc56..ed80ec24b 100644 --- a/os/hal/src/pwm.c +++ b/os/hal/src/pwm.c @@ -131,6 +131,7 @@ void pwmStop(PWMDriver *pwmp) { * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] period new cycle time in ticks * * @api */ diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c index 295b0dcb4..2cd92422f 100644 --- a/os/hal/templates/pwm_lld.c +++ b/os/hal/templates/pwm_lld.c @@ -99,6 +99,7 @@ void pwm_lld_stop(PWMDriver *pwmp) { * or immediately (fallback implementation). * * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] period new cycle time in ticks * * @api */ -- cgit v1.2.3 From cf15276df33e24a72eedf38af97dde3f3404fce2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 Apr 2011 13:21:02 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2863 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/pwm.h | 20 ++++++++++++++++++++ os/hal/platforms/STM32/pwm_lld.h | 26 +++++--------------------- os/hal/templates/pwm_lld.h | 14 +++++--------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index 76c2e1674..72430f1aa 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -35,6 +35,26 @@ /* Driver constants. */ /*===========================================================================*/ +/** + * @brief Standard output modes mask. + */ +#define PWM_OUTPUT_MASK 0x0F + +/** + * @brief Output not driven, callback only. + */ +#define PWM_OUTPUT_DISABLED 0x00 + +/** + * @brief Positive PWM logic, active is logic level one. + */ +#define PWM_OUTPUT_ACTIVE_HIGH 0x01 + +/** + * @brief Inverse PWM logic, active is logic level zero. + */ +#define PWM_OUTPUT_ACTIVE_LOW 0x02 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index e36b6f1f6..3d0d9d79c 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -40,38 +40,21 @@ */ #define PWM_CHANNELS 4 -/** - * @brief Standard output modes mask. - */ -#define PWM_OUTPUT_MASK 0x07 - -/** - * @brief Output not driven, callback only. - */ -#define PWM_OUTPUT_DISABLED 0x00 - -/** - * @brief Positive PWM logic, active is logic level one. - */ -#define PWM_OUTPUT_ACTIVE_HIGH 0x01 - -/** - * @brief Inverse PWM logic, active is logic level zero. - */ -#define PWM_OUTPUT_ACTIVE_LOW 0x02 - /** * @brief Complementary output modes mask. + * @note This is an STM32-specific setting. */ -#define PWM_COMPLEMENTARY_OUTPUT_MASK 0x70 +#define PWM_COMPLEMENTARY_OUTPUT_MASK 0xF0 /** * @brief Complementary output not driven. + * @note This is an STM32-specific setting. */ #define PWM_COMPLEMENTARY_OUTPUT_DISABLED 0x00 /** * @brief Complementary output, active is logic level one. + * @note This is an STM32-specific setting. * @note This setting is only available if the configuration option * @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced * timers TIM1 and TIM8. @@ -80,6 +63,7 @@ /** * @brief Complementary output, active is logic level zero. + * @note This is an STM32-specific setting. * @note This setting is only available if the configuration option * @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced * timers TIM1 and TIM8. diff --git a/os/hal/templates/pwm_lld.h b/os/hal/templates/pwm_lld.h index 9ef7a9853..c34694951 100644 --- a/os/hal/templates/pwm_lld.h +++ b/os/hal/templates/pwm_lld.h @@ -54,6 +54,11 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief PWM mode type. + */ +typedef uint32_t pwmmode_t; + /** * @brief PWM channel type. */ @@ -64,15 +69,6 @@ typedef uint8_t pwmchannel_t; */ typedef uint16_t pwmcnt_t; -/** - * @brief PWM logic mode. - */ -typedef enum { - PWM_OUTPUT_DISABLED = 0, /**< Output not driven, callback only. */ - PWM_OUTPUT_ACTIVE_HIGH = 1, /**< Idle is logic level 0. */ - PWM_OUTPUT_ACTIVE_LOW = 2 /**< Idle is logic level 1. */ -} pwmmode_t; - /** * @brief PWM driver channel configuration structure. * @note Some architectures may not be able to support the channel mode -- cgit v1.2.3 From 8d2e166f09025f1cdb36f4ac09260dc66f29e598 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Apr 2011 19:15:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2866 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/hal.dox | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/hal/hal.dox b/os/hal/hal.dox index 5bee98480..6ed44eacc 100644 --- a/os/hal/hal.dox +++ b/os/hal/hal.dox @@ -51,14 +51,17 @@ * @subsection hal_device_driver_diagram Diagram * @dot digraph example { + graph [size="5, 7", pad="1.5, 0"]; node [shape=rectangle, fontname=Helvetica, fontsize=8, fixedsize="true", width="2.0", height="0.4"]; edge [fontname=Helvetica, fontsize=8]; + app [label="Application"]; hld [label="High Level Driver"]; lld [label="Low Level Driver"]; hw [label="Microcontroller Hardware"]; hal_lld [label="HAL shared low level code"]; + app->hld; hld->lld; lld-> hw; -- cgit v1.2.3 From c4fec713d238a4396ee5693c986e3d25a74082e5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 3 Apr 2011 11:29:27 +0000 Subject: Improvements to the PAL drivers. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2867 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/pal.h | 25 ++++++++++--------------- os/hal/platforms/AT91SAM7/pal_lld.h | 21 +++++++-------------- os/hal/platforms/LPC214x/pal_lld.h | 13 +++++-------- os/hal/platforms/MSP430/pal_lld.h | 4 +--- os/hal/platforms/Posix/pal_lld.h | 9 ++++----- os/hal/platforms/STM32/pal_lld.h | 7 +++---- os/hal/platforms/STM8L/pal_lld.h | 5 ++--- os/hal/platforms/STM8S/pal_lld.h | 5 ++--- os/hal/platforms/Win32/pal_lld.h | 9 ++++----- readme.txt | 2 ++ 10 files changed, 40 insertions(+), 60 deletions(-) diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h index 7a2041974..e9d0e31d8 100644 --- a/os/hal/include/pal.h +++ b/os/hal/include/pal.h @@ -263,9 +263,8 @@ typedef struct { * @api */ #if !defined(pal_lld_setport) || defined(__DOXYGEN__) -#define palSetPort(port, bits) { \ - palWritePort(port, palReadLatch(port) | (bits)); \ -} +#define palSetPort(port, bits) \ + palWritePort(port, palReadLatch(port) | (bits)) #else #define palSetPort(port, bits) pal_lld_setport(port, bits) #endif @@ -286,9 +285,8 @@ typedef struct { * @api */ #if !defined(pal_lld_clearport) || defined(__DOXYGEN__) -#define palClearPort(port, bits) { \ - palWritePort(port, palReadLatch(port) & ~(bits)); \ -} +#define palClearPort(port, bits) \ + palWritePort(port, palReadLatch(port) & ~(bits)) #else #define palClearPort(port, bits) pal_lld_clearport(port, bits) #endif @@ -309,9 +307,8 @@ typedef struct { * @api */ #if !defined(pal_lld_toggleport) || defined(__DOXYGEN__) -#define palTogglePort(port, bits) { \ - palWritePort(port, palReadLatch(port) ^ (bits)); \ -} +#define palTogglePort(port, bits) \ + palWritePort(port, palReadLatch(port) ^ (bits)) #else #define palTogglePort(port, bits) pal_lld_toggleport(port, bits) #endif @@ -347,10 +344,9 @@ typedef struct { * @api */ #if !defined(pal_lld_writegroup) || defined(__DOXYGEN__) -#define palWriteGroup(port, mask, offset, bits) { \ +#define palWriteGroup(port, mask, offset, bits) \ palWritePort(port, (palReadLatch(port) & ~((mask) << (offset))) | \ - (((bits) & (mask)) << (offset))); \ -} + (((bits) & (mask)) << (offset))) #else #define palWriteGroup(port, mask, offset, bits) \ pal_lld_writegroup(port, mask, offset, bits) @@ -416,10 +412,9 @@ typedef struct { * @api */ #if !defined(pal_lld_writepad) || defined(__DOXYGEN__) -#define palWritePad(port, pad, bit) { \ +#define palWritePad(port, pad, bit) \ palWritePort(port, (palReadLatch(port) & ~PAL_PORT_BIT(pad)) | \ - (((bit) & 1) << pad)); \ -} + (((bit) & 1) << pad)) #else #define palWritePad(port, pad, bit) pal_lld_writepad(port, pad, bit) #endif diff --git a/os/hal/platforms/AT91SAM7/pal_lld.h b/os/hal/platforms/AT91SAM7/pal_lld.h index ebb22f2cb..9c5796a40 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.h +++ b/os/hal/platforms/AT91SAM7/pal_lld.h @@ -155,9 +155,7 @@ typedef AT91PS_PIO ioportid_t; * * @notapi */ -#define pal_lld_writeport(port, bits) { \ - (port)->PIO_ODSR = (bits); \ -} +#define pal_lld_writeport(port, bits) ((port)->PIO_ODSR = (bits)) /** * @brief Sets a bits mask on a I/O port. @@ -169,9 +167,7 @@ typedef AT91PS_PIO ioportid_t; * * @notapi */ -#define pal_lld_setport(port, bits) { \ - (port)->PIO_SODR = (bits); \ -} +#define pal_lld_setport(port, bits) ((port)->PIO_SODR = (bits)) /** * @brief Clears a bits mask on a I/O port. @@ -183,9 +179,7 @@ typedef AT91PS_PIO ioportid_t; * * @notapi */ -#define pal_lld_clearport(port, bits) { \ - (port)->PIO_CODR = (bits); \ -} +#define pal_lld_clearport(port, bits) ((port)->PIO_CODR = (bits)) /** * @brief Writes a group of bits. @@ -201,11 +195,10 @@ typedef AT91PS_PIO ioportid_t; * * @notapi */ -#define pal_lld_writegroup(port, mask, offset, bits) { \ - (port)->PIO_OWER = (mask) << (offset); \ - (port)->PIO_ODSR = (bits) << (offset); \ - (port)->PIO_OWDR = (mask) << (offset); \ -} +#define pal_lld_writegroup(port, mask, offset, bits) \ + ((port)->PIO_OWER = (mask) << (offset), \ + (port)->PIO_ODSR = (bits) << (offset), \ + (port)->PIO_OWDR = (mask) << (offset)) /** * @brief Pads group mode setup. diff --git a/os/hal/platforms/LPC214x/pal_lld.h b/os/hal/platforms/LPC214x/pal_lld.h index 424cb73f1..1a45cd6a9 100644 --- a/os/hal/platforms/LPC214x/pal_lld.h +++ b/os/hal/platforms/LPC214x/pal_lld.h @@ -194,11 +194,10 @@ typedef FIO * ioportid_t; * * @notapi */ -#define pal_lld_writegroup(port, mask, offset, bits) { \ - (port)->FIO_MASK = ~((mask) << (offset)); \ - (port)->FIO_PIN = (bits) << (offset); \ - (port)->FIO_MASK = 0; \ -} +#define pal_lld_writegroup(port, mask, offset, bits) \ + ((port)->FIO_MASK = ~((mask) << (offset)), \ + (port)->FIO_PIN = (bits) << (offset), \ + (port)->FIO_MASK = 0) /** * @brief Pads group mode setup. @@ -236,9 +235,7 @@ typedef FIO * ioportid_t; * * @notapi */ -#define pal_lld_lpc214x_set_direction(port, dir) { \ - (port)->FIO_DIR = (dir); \ -} +#define pal_lld_lpc214x_set_direction(port, dir) ((port)->FIO_DIR = (dir)) extern const PALConfig pal_default_config; diff --git a/os/hal/platforms/MSP430/pal_lld.h b/os/hal/platforms/MSP430/pal_lld.h index 7741e8f12..31ee669a0 100644 --- a/os/hal/platforms/MSP430/pal_lld.h +++ b/os/hal/platforms/MSP430/pal_lld.h @@ -255,9 +255,7 @@ typedef msp430_ioport_t *ioportid_t; * * @notapi */ -#define pal_lld_writeport(port, bits) { \ - (port)->iop_common.out.reg_p = (bits); \ -} +#define pal_lld_writeport(port, bits) ((port)->iop_common.out.reg_p = (bits)) /** * @brief Pads group mode setup. diff --git a/os/hal/platforms/Posix/pal_lld.h b/os/hal/platforms/Posix/pal_lld.h index edfa73c73..1984c06f0 100644 --- a/os/hal/platforms/Posix/pal_lld.h +++ b/os/hal/platforms/Posix/pal_lld.h @@ -129,10 +129,9 @@ typedef sim_vio_port_t *ioportid_t; * * @param[in] config architecture-dependent ports configuration */ -#define pal_lld_init(config) { \ - vio_port_1 = (config)->VP1Data; \ - vio_port_2 = (config)->VP2Data; \ -} +#define pal_lld_init(config) \ + (vio_port_1 = (config)->VP1Data, \ + vio_port_2 = (config)->VP2Data) /** * @brief Reads the physical I/O port states. @@ -178,7 +177,7 @@ typedef sim_vio_port_t *ioportid_t; * @param[in] mask group mask * @param[in] mode group mode */ -#define pal_lld_setgroupmode(port, mask, mode) \ +#define pal_lld_setgroupmode(port, mask, mode) \ _pal_lld_setgroupmode(port, mask, mode) #if !defined(__DOXYGEN__) diff --git a/os/hal/platforms/STM32/pal_lld.h b/os/hal/platforms/STM32/pal_lld.h index 0ecde182d..2919c91f6 100644 --- a/os/hal/platforms/STM32/pal_lld.h +++ b/os/hal/platforms/STM32/pal_lld.h @@ -279,10 +279,9 @@ typedef GPIO_TypeDef * ioportid_t; * * @notapi */ -#define pal_lld_writegroup(port, mask, offset, bits) { \ - (port)->BSRR = ((~(bits) & (mask)) << (16 + (offset))) | \ - (((bits) & (mask)) << (offset)); \ -} +#define pal_lld_writegroup(port, mask, offset, bits) \ + ((port)->BSRR = ((~(bits) & (mask)) << (16 + (offset))) | \ + (((bits) & (mask)) << (offset))) /** * @brief Pads group mode setup. diff --git a/os/hal/platforms/STM8L/pal_lld.h b/os/hal/platforms/STM8L/pal_lld.h index da698ea7a..f42973218 100644 --- a/os/hal/platforms/STM8L/pal_lld.h +++ b/os/hal/platforms/STM8L/pal_lld.h @@ -175,7 +175,7 @@ typedef GPIO_TypeDef *ioportid_t; * * @notapi */ -#define pal_lld_init(config) *IOPORTS = *(config) +#define pal_lld_init(config) (*IOPORTS = *(config)) /** * @brief Reads the physical I/O port states. @@ -215,7 +215,6 @@ typedef GPIO_TypeDef *ioportid_t; */ #define pal_lld_writeport(port, bits) ((port)->ODR = (bits)) - /** * @brief Pads group mode setup. * @details This function programs a pads group belonging to the same port @@ -231,7 +230,7 @@ typedef GPIO_TypeDef *ioportid_t; * @notapi */ #define pal_lld_setgroupmode(port, mask, mode) \ - _pal_lld_setgroupmode(port, mask, mode) + _pal_lld_setgroupmode(port, mask, mode) extern ROMCONST PALConfig pal_default_config; diff --git a/os/hal/platforms/STM8S/pal_lld.h b/os/hal/platforms/STM8S/pal_lld.h index 8bb1caae8..ef69d1379 100644 --- a/os/hal/platforms/STM8S/pal_lld.h +++ b/os/hal/platforms/STM8S/pal_lld.h @@ -160,7 +160,7 @@ typedef GPIO_TypeDef *ioportid_t; * * @notapi */ -#define pal_lld_init(config) *IOPORTS = *(config) +#define pal_lld_init(config) (*IOPORTS = *(config)) /** * @brief Reads the physical I/O port states. @@ -200,7 +200,6 @@ typedef GPIO_TypeDef *ioportid_t; */ #define pal_lld_writeport(port, bits) ((port)->ODR = (bits)) - /** * @brief Pads group mode setup. * @details This function programs a pads group belonging to the same port @@ -216,7 +215,7 @@ typedef GPIO_TypeDef *ioportid_t; * @notapi */ #define pal_lld_setgroupmode(port, mask, mode) \ - _pal_lld_setgroupmode(port, mask, mode) + _pal_lld_setgroupmode(port, mask, mode) extern ROMCONST PALConfig pal_default_config; diff --git a/os/hal/platforms/Win32/pal_lld.h b/os/hal/platforms/Win32/pal_lld.h index f89510f76..a1c84b13a 100644 --- a/os/hal/platforms/Win32/pal_lld.h +++ b/os/hal/platforms/Win32/pal_lld.h @@ -129,10 +129,9 @@ typedef sim_vio_port_t *ioportid_t; * * @param[in] config architecture-dependent ports configuration */ -#define pal_lld_init(config) { \ - vio_port_1 = (config)->VP1Data; \ - vio_port_2 = (config)->VP2Data; \ -} +#define pal_lld_init(config) \ + (vio_port_1 = (config)->VP1Data, \ + vio_port_2 = (config)->VP2Data) /** * @brief Reads the physical I/O port states. @@ -178,7 +177,7 @@ typedef sim_vio_port_t *ioportid_t; * @param[in] mask group mask * @param[in] mode group mode */ -#define pal_lld_setgroupmode(port, mask, mode) \ +#define pal_lld_setgroupmode(port, mask, mode) \ _pal_lld_setgroupmode(port, mask, mode) #if !defined(__DOXYGEN__) diff --git a/readme.txt b/readme.txt index 775279bbb..8f7ab034b 100644 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,8 @@ - NEW: Added board files for the Olimex STM32-P107. - NEW: Improved setup packets handling in the USB driver through a specific callback. +- NEW: Improvements to the PAL driver and various implementation in order + to make them more parenthesis friendly. - OPT: Simplified Serial over USB driver configuration. - CHANGE: Renamed the demo ARMCM3-STM32F107-GCC in ARMCM3-STM32F107 and added IAR and Keil projects. -- cgit v1.2.3 From ad009f46d58f4f555cd412aa2f2a267da01db4e0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 5 Apr 2011 18:21:00 +0000 Subject: STM32 PWM driver optimization, changed the behavior of pwmChangePeriod(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2869 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile_chm | 2 +- docs/Doxyfile_html | 2 +- os/hal/include/pwm.h | 8 ++---- os/hal/platforms/STM32/pwm_lld.c | 59 +++++++--------------------------------- os/hal/platforms/STM32/pwm_lld.h | 24 ++++++++++++---- os/hal/src/pwm.c | 11 +++----- os/hal/templates/pwm_lld.c | 11 ++++---- os/kernel/include/ch.h | 4 +-- readme.txt | 5 ++++ testhal/STM32/PWM-ICU/main.c | 22 +++++++++------ 10 files changed, 64 insertions(+), 84 deletions(-) diff --git a/docs/Doxyfile_chm b/docs/Doxyfile_chm index be256da4e..30610aa3b 100644 --- a/docs/Doxyfile_chm +++ b/docs/Doxyfile_chm @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.1 +PROJECT_NUMBER = 2.3.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/docs/Doxyfile_html b/docs/Doxyfile_html index fb83e9e23..42fadd49d 100644 --- a/docs/Doxyfile_html +++ b/docs/Doxyfile_html @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.1 +PROJECT_NUMBER = 2.3.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index 72430f1aa..2ffd3599c 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -150,11 +150,9 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp); * been activated using @p pwmStart(). * @pre The PWM unit must have been activated using @p pwmStart(). * @post The PWM unit period is changed to the new value. - * @post Any active channel is disabled by this function and must be - * activated explicitly using @p pwmEnableChannel(). - * @note Depending on the hardware implementation this function has - * effect starting on the next cycle (recommended implementation) - * or immediately (fallback implementation). + * @note If a period is specified that is shorter than the pulse width + * programmed in one of the channels then the behavior is not + * guaranteed. * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] period new cycle time in ticks diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 15d54b4fd..bb6dad8f2 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -254,35 +254,30 @@ void pwm_lld_init(void) { #if STM32_PWM_USE_TIM1 /* Driver initialization.*/ pwmObjectInit(&PWMD1); - PWMD1.enabled_channels = 0; PWMD1.tim = TIM1; #endif #if STM32_PWM_USE_TIM2 /* Driver initialization.*/ pwmObjectInit(&PWMD2); - PWMD2.enabled_channels = 0; PWMD2.tim = TIM2; #endif #if STM32_PWM_USE_TIM3 /* Driver initialization.*/ pwmObjectInit(&PWMD3); - PWMD3.enabled_channels = 0; PWMD3.tim = TIM3; #endif #if STM32_PWM_USE_TIM4 /* Driver initialization.*/ pwmObjectInit(&PWMD4); - PWMD4.enabled_channels = 0; PWMD4.tim = TIM4; #endif #if STM32_PWM_USE_TIM5 /* Driver initialization.*/ pwmObjectInit(&PWMD5); - PWMD5.enabled_channels = 0; PWMD5.tim = TIM5; #endif } @@ -300,9 +295,6 @@ void pwm_lld_start(PWMDriver *pwmp) { uint32_t clock, psc; uint16_t ccer; - /* Reset channels.*/ - pwmp->enabled_channels = 0; /* All channels disabled. */ - if (pwmp->state == PWM_STOP) { /* Clock activation and timer reset.*/ #if STM32_PWM_USE_TIM1 @@ -372,7 +364,6 @@ void pwm_lld_start(PWMDriver *pwmp) { } else { /* Driver re-configuration scenario, it must be stopped first.*/ - pwmp->enabled_channels = 0; /* All channels disabled. */ pwmp->tim->CR1 = 0; /* Timer disabled. */ pwmp->tim->DIER = 0; /* All IRQs disabled. */ pwmp->tim->SR = 0; /* Clear eventual pending IRQs. */ @@ -457,8 +448,8 @@ void pwm_lld_start(PWMDriver *pwmp) { pwmp->tim->CCER = ccer; pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ - pwmp->tim->SR = 0; /* Clear pending IRQs. */ pwmp->tim->DIER = pwmp->config->callback == NULL ? 0 : TIM_DIER_UIE; + pwmp->tim->SR = 0; /* Clear pending IRQs. */ #if STM32_PWM_USE_ADVANCED pwmp->tim->BDTR = pwmp->config->bdtr | TIM_BDTR_MOE; #else @@ -479,7 +470,6 @@ void pwm_lld_stop(PWMDriver *pwmp) { /* If in ready state then disables the PWM clock.*/ if (pwmp->state == PWM_READY) { - pwmp->enabled_channels = 0; /* All channels disabled. */ pwmp->tim->CR1 = 0; /* Timer disabled. */ pwmp->tim->DIER = 0; /* All IRQs disabled. */ pwmp->tim->SR = 0; /* Clear eventual pending IRQs. */ @@ -519,35 +509,6 @@ void pwm_lld_stop(PWMDriver *pwmp) { } } -/** - * @brief Changes the period the PWM peripheral. - * @details This function changes the period of a PWM unit that has already - * been activated using @p pwmStart(). - * @pre The PWM unit must have been activated using @p pwmStart(). - * @post The PWM unit period is changed to the new value. - * @post Any active channel is disabled by this function and must be - * activated explicitly using @p pwmEnableChannel(). - * @note The function has effect at the next cycle start. - * - * @param[in] pwmp pointer to a @p PWMDriver object - * @param[in] period new cycle time in ticks - * - * @api - */ -void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period) { - - pwmp->enabled_channels = 0; /* All channels disabled. */ - pwmp->tim->DIER &= ~(TIM_DIER_CC1IE | - TIM_DIER_CC2IE | - TIM_DIER_CC3IE | - TIM_DIER_CC4IE); /* Channels sources disabled. */ - pwmp->tim->SR = ~(TIM_SR_CC1IF | - TIM_SR_CC1IF | - TIM_SR_CC1IF | - TIM_SR_CC1IF); /* Clears eventual pending IRQs. */ - pwmp->tim->ARR = (uint16_t)(period - 1); -} - /** * @brief Enables a PWM channel. * @pre The PWM unit must have been activated using @p pwmStart(). @@ -565,14 +526,15 @@ void pwm_lld_enable_channel(PWMDriver *pwmp, pwmcnt_t width) { *(&pwmp->tim->CCR1 + (channel * 2)) = width; /* New duty cycle. */ - if ((pwmp->enabled_channels & (1 << channel)) == 0) { - /* The channel is not enabled yet.*/ - pwmp->enabled_channels |= (1 << channel); - /* If there is a callback associated to the channel then the proper - interrupt is cleared and enabled.*/ - if (pwmp->config->channels[channel].callback) { - pwmp->tim->SR = ~(2 << channel); - pwmp->tim->DIER |= (2 << channel); + /* If there is a callback defined for the channel then the associated + interrupt must be enabled.*/ + if (pwmp->config->channels[channel].callback != NULL) { + uint32_t dier = pwmp->tim->DIER; + /* If the IRQ is not already enabled care must be taken to clear it, + it is probably already pending because the timer is running.*/ + if ((dier & (2 << channel)) == 0) { + pwmp->tim->DIER = dier | (2 << channel); + pwmp->tim->SR = ~(2 << channel); } } } @@ -593,7 +555,6 @@ void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) { *(&pwmp->tim->CCR1 + (channel * 2)) = 0; pwmp->tim->DIER &= ~(2 << channel); - pwmp->enabled_channels &= ~(1 << channel); } #endif /* HAL_USE_PWM */ diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index 3d0d9d79c..2b3ce7183 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -295,10 +295,6 @@ struct PWMDriver { PWM_DRIVER_EXT_FIELDS #endif /* End of the mandatory fields.*/ - /** - * @brief Bit mask of the enabled channels. - */ - uint32_t enabled_channels; /** * @brief Pointer to the TIMx registers block. */ @@ -309,6 +305,25 @@ struct PWMDriver { /* Driver macros. */ /*===========================================================================*/ +/** + * @brief Changes the period the PWM peripheral. + * @details This function changes the period of a PWM unit that has already + * been activated using @p pwmStart(). + * @pre The PWM unit must have been activated using @p pwmStart(). + * @post The PWM unit period is changed to the new value. + * @note The function has effect at the next cycle start. + * @note If a period is specified that is shorter than the pulse width + * programmed in one of the channels then the behavior is not + * guaranteed. + * + * @param[in] pwmp pointer to a @p PWMDriver object + * @param[in] period new cycle time in ticks + * + * @notapi + */ +#define pwm_lld_change_period(pwmp, period) \ + ((pwmp)->tim->ARR = (uint16_t)((period) - 1)) + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -339,7 +354,6 @@ extern "C" { void pwm_lld_init(void); void pwm_lld_start(PWMDriver *pwmp); void pwm_lld_stop(PWMDriver *pwmp); - void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period); void pwm_lld_enable_channel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width); diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c index ed80ec24b..e7dd6b64c 100644 --- a/os/hal/src/pwm.c +++ b/os/hal/src/pwm.c @@ -124,11 +124,9 @@ void pwmStop(PWMDriver *pwmp) { * been activated using @p pwmStart(). * @pre The PWM unit must have been activated using @p pwmStart(). * @post The PWM unit period is changed to the new value. - * @post Any active channel is disabled by this function and must be - * activated explicitly using @p pwmEnableChannel(). - * @note Depending on the hardware implementation this function has - * effect starting on the next cycle (recommended implementation) - * or immediately (fallback implementation). + * @note If a period is specified that is shorter than the pulse width + * programmed in one of the channels then the behavior is not + * guaranteed. * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] period new cycle time in ticks @@ -142,8 +140,7 @@ void pwmChangePeriod(PWMDriver *pwmp, pwmcnt_t period) { chSysLock(); chDbgAssert(pwmp->state == PWM_READY, "pwmChangePeriod(), #1", "invalid state"); - pwmp->period = period; - pwm_lld_change_period(pwmp, period); + pwmChangePeriodI(pwmp, period); chSysUnlock(); } diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c index 2cd92422f..67683d120 100644 --- a/os/hal/templates/pwm_lld.c +++ b/os/hal/templates/pwm_lld.c @@ -92,16 +92,15 @@ void pwm_lld_stop(PWMDriver *pwmp) { * been activated using @p pwmStart(). * @pre The PWM unit must have been activated using @p pwmStart(). * @post The PWM unit period is changed to the new value. - * @post Any active channel is disabled by this function and must be - * activated explicitly using @p pwmEnableChannel(). - * @note Depending on the hardware implementation this function has - * effect starting on the next cycle (recommended implementation) - * or immediately (fallback implementation). + * @note The function has effect at the next cycle start. + * @note If a period is specified that is shorter than the pulse width + * programmed in one of the channels then the behavior is not + * guaranteed. * * @param[in] pwmp pointer to a @p PWMDriver object * @param[in] period new cycle time in ticks * - * @api + * @notapi */ void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period) { diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index f89406816..be461e291 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -40,7 +40,7 @@ /** * @brief Kernel version string. */ -#define CH_KERNEL_VERSION "2.3.1unstable" +#define CH_KERNEL_VERSION "2.3.2unstable" /** * @brief Kernel version major number. @@ -55,7 +55,7 @@ /** * @brief Kernel version patch number. */ -#define CH_KERNEL_PATCH 1 +#define CH_KERNEL_PATCH 2 /* * Common values. diff --git a/readme.txt b/readme.txt index 8f7ab034b..2c5bc3bcc 100644 --- a/readme.txt +++ b/readme.txt @@ -70,6 +70,11 @@ *** Releases *** ***************************************************************************** +*** 2.3.2 *** +- OPT: STM32 PWM driver implementation simplified. +- CHANGE: Now pwmChangePeriod() does not implicitly disable the active + PWM channels. + *** 2.3.1 *** - FIX: Fixed insufficient idle thread stack in Cortex-M0-GCC port (bug 3226671) (backported to 2.2.3). diff --git a/testhal/STM32/PWM-ICU/main.c b/testhal/STM32/PWM-ICU/main.c index 3f7b6423e..1fd56c33a 100644 --- a/testhal/STM32/PWM-ICU/main.c +++ b/testhal/STM32/PWM-ICU/main.c @@ -89,7 +89,7 @@ int main(void) { palSetPad(IOPORT3, GPIOC_LED); /* - * Initializes the PWM driver 1. + * Initializes the PWM driver 1 and ICU driver 4. */ pwmStart(&PWMD1, &pwmcfg); palSetPadMode(IOPORT1, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL); @@ -98,26 +98,32 @@ int main(void) { chThdSleepMilliseconds(2000); /* - * Starts the channel 0 using 25% duty cycle. + * Starts the PWM channel 0 using 75% duty cycle. */ - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500)); + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500)); chThdSleepMilliseconds(5000); /* - * Changes the channel 0 to 75% duty cycle. + * Changes the PWM channel 0 to 50% duty cycle. */ - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500)); + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); + chThdSleepMilliseconds(5000); + + /* + * Changes the PWM channel 0 to 25% duty cycle. + */ + pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500)); chThdSleepMilliseconds(5000); /* - * Changes PWM period to half second and duty cycle to 50%. + * Changes PWM period to half second the duty cycle becomes 50% + * implicitly. */ pwmChangePeriod(&PWMD1, 5000); - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); chThdSleepMilliseconds(5000); /* - * Disables channel 0. + * Disables channel 0 and stops the drivers. */ pwmDisableChannel(&PWMD1, 0); pwmStop(&PWMD1); -- cgit v1.2.3 From de877486efb49378065f769ff423eef19ceb12e6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 9 Apr 2011 15:10:15 +0000 Subject: Fixed bug 3276379. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2872 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/serial_usb.c | 39 ++++++------ os/kernel/include/chsem.h | 2 +- os/kernel/src/chsem.c | 25 ++++---- readme.txt | 6 ++ test/testsem.c | 4 +- testhal/STM32/USB_CDC/Makefile | 2 +- testhal/STM32/USB_CDC/halconf.h | 2 +- testhal/STM32/USB_CDC/main.c | 134 +++++++++++++++++++++++++++++++--------- 8 files changed, 146 insertions(+), 68 deletions(-) diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index b6ad10c13..bc2c39426 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -59,44 +59,44 @@ static cdc_linecoding_t linecoding = { static size_t writes(void *ip, const uint8_t *bp, size_t n) { - return chOQWriteTimeout(&((SerialDriver *)ip)->oqueue, bp, + return chOQWriteTimeout(&((SerialUSBDriver *)ip)->oqueue, bp, n, TIME_INFINITE); } static size_t reads(void *ip, uint8_t *bp, size_t n) { - return chIQReadTimeout(&((SerialDriver *)ip)->iqueue, bp, + return chIQReadTimeout(&((SerialUSBDriver *)ip)->iqueue, bp, n, TIME_INFINITE); } static bool_t putwouldblock(void *ip) { - return chOQIsFullI(&((SerialDriver *)ip)->oqueue); + return chOQIsFullI(&((SerialUSBDriver *)ip)->oqueue); } static bool_t getwouldblock(void *ip) { - return chIQIsEmptyI(&((SerialDriver *)ip)->iqueue); + return chIQIsEmptyI(&((SerialUSBDriver *)ip)->iqueue); } static msg_t putt(void *ip, uint8_t b, systime_t timeout) { - return chOQPutTimeout(&((SerialDriver *)ip)->oqueue, b, timeout); + return chOQPutTimeout(&((SerialUSBDriver *)ip)->oqueue, b, timeout); } static msg_t gett(void *ip, systime_t timeout) { - return chIQGetTimeout(&((SerialDriver *)ip)->iqueue, timeout); + return chIQGetTimeout(&((SerialUSBDriver *)ip)->iqueue, timeout); } static size_t writet(void *ip, const uint8_t *bp, size_t n, systime_t time) { - return chOQWriteTimeout(&((SerialDriver *)ip)->oqueue, bp, n, time); + return chOQWriteTimeout(&((SerialUSBDriver *)ip)->oqueue, bp, n, time); } static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) { - return chIQReadTimeout(&((SerialDriver *)ip)->iqueue, bp, n, time); + return chIQReadTimeout(&((SerialUSBDriver *)ip)->iqueue, bp, n, time); } static ioflags_t getflags(void *ip) { @@ -124,7 +124,7 @@ static void inotify(GenericQueue *qp) { sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; - chSemSetCounterI(&sdup->iqueue.q_sem, n); + chSemAddCounterI(&sdup->iqueue.q_sem, n); chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); } } @@ -135,15 +135,16 @@ static void inotify(GenericQueue *qp) { */ static void onotify(GenericQueue *qp) { SerialUSBDriver *sdup = (SerialUSBDriver *)qp->q_rdptr; - size_t n; + size_t w, n; /* If there is any data in the output queue then it is sent within a single packet and the queue is emptied.*/ - n = usbWritePacketI(sdup->config->usbp, DATA_REQUEST_EP, - sdup->oqueue.q_buffer, chOQGetFullI(&sdup->oqueue)); - if (n != USB_ENDPOINT_BUSY) { + n = chOQGetFullI(&sdup->oqueue); + w = usbWritePacketI(sdup->config->usbp, DATA_REQUEST_EP, + sdup->oqueue.q_buffer, n); + if (w != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; - chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); + chSemAddCounterI(&sdup->oqueue.q_sem, n); chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); } } @@ -276,17 +277,17 @@ bool_t sduRequestsHook(USBDriver *usbp) { */ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { SerialUSBDriver *sdup = usbp->param; - size_t n; + size_t n, w; chSysLockFromIsr(); /* If there is any data in the output queue then it is sent within a single packet and the queue is emptied.*/ n = chOQGetFullI(&sdup->oqueue); if (n > 0) { - n = usbWritePacketI(usbp, ep, sdup->oqueue.q_buffer, n); - if (n != USB_ENDPOINT_BUSY) { + w = usbWritePacketI(usbp, ep, sdup->oqueue.q_buffer, n); + if (w != USB_ENDPOINT_BUSY) { sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; - chSemSetCounterI(&sdup->oqueue.q_sem, SERIAL_USB_BUFFERS_SIZE); + chSemAddCounterI(&sdup->oqueue.q_sem, n); chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); } } @@ -314,7 +315,7 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) { SERIAL_USB_BUFFERS_SIZE); if (n != USB_ENDPOINT_BUSY) { sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; - chSemSetCounterI(&sdup->iqueue.q_sem, n); + chSemAddCounterI(&sdup->iqueue.q_sem, n); chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); } } diff --git a/os/kernel/include/chsem.h b/os/kernel/include/chsem.h index f33b294fa..04e079466 100644 --- a/os/kernel/include/chsem.h +++ b/os/kernel/include/chsem.h @@ -52,7 +52,7 @@ extern "C" { msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time); void chSemSignal(Semaphore *sp); void chSemSignalI(Semaphore *sp); - void chSemSetCounterI(Semaphore *sp, cnt_t n); + void chSemAddCounterI(Semaphore *sp, cnt_t n); #if CH_USE_SEMSW msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw); #endif diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index 3e0fcd0e8..c22a568ea 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -313,35 +313,32 @@ void chSemSignalI(Semaphore *sp) { } /** - * @brief Sets the semaphore counter to the specified value. - * @post After invoking this function all the threads waiting on the - * semaphore, if any, are released and the semaphore counter is set - * to the specified, non negative, value. + * @brief Adds the specified value to the semaphore counter. * @post This function does not reschedule so a call to a rescheduling * function must be performed before unlocking the kernel. Note that * interrupt handlers always reschedule on exit so an explicit * reschedule must not be performed in ISRs. * * @param[in] sp pointer to a @p Semaphore structure - * @param[in] n the new value of the semaphore counter. The value must - * be non-negative. + * @param[in] n value to be added to the semaphore counter. The value + * must be positive. * * @iclass */ -void chSemSetCounterI(Semaphore *sp, cnt_t n) { - cnt_t cnt; +void chSemAddCounterI(Semaphore *sp, cnt_t n) { - chDbgCheck((sp != NULL) && (n >= 0), "chSemSetCounterI"); + chDbgCheck((sp != NULL) && (n > 0), "chSemAddCounterI"); chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || ((sp->s_cnt < 0) && notempty(&sp->s_queue)), - "chSemSetCounterI(), #1", + "chSemAddCounterI(), #1", "inconsistent semaphore"); - cnt = sp->s_cnt; - sp->s_cnt = n; - while (++cnt <= 0) - chSchReadyI(lifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_OK; + while (n > 0) { + if (++sp->s_cnt <= 0) + chSchReadyI(fifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_OK; + n--; + } } #if CH_USE_SEMSW diff --git a/readme.txt b/readme.txt index 2c5bc3bcc..3a464c3b1 100644 --- a/readme.txt +++ b/readme.txt @@ -71,9 +71,15 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed spurious characters generated by Serial over USB driver (bug + 3276379). - OPT: STM32 PWM driver implementation simplified. - CHANGE: Now pwmChangePeriod() does not implicitly disable the active PWM channels. +- CHANGE: Renamed the chSemSetCounterI() function to chSemAddCounterI() and + changed its behavior. +- CHANGE: Modified the STM32 USB-CDC test demo to spawn a shell over the USB + serial connection. *** 2.3.1 *** - FIX: Fixed insufficient idle thread stack in Cortex-M0-GCC port (bug 3226671) diff --git a/test/testsem.c b/test/testsem.c index 009a5910f..6a6a622ef 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -104,9 +104,9 @@ static void sem1_execute(void) { test_assert_sequence(1, "ABCDE"); #endif threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+5, thread1, "A"); - chSemSetCounterI(&sem1, 2); + chSemAddCounterI(&sem1, 2); test_wait_threads(); - test_assert(2, chSemGetCounterI(&sem1) == 2, "invalid counter"); + test_assert(2, chSemGetCounterI(&sem1) == 1, "invalid counter"); } ROMCONST struct testcase testsem1 = { diff --git a/testhal/STM32/USB_CDC/Makefile b/testhal/STM32/USB_CDC/Makefile index 9ae1a088e..16b23cc48 100644 --- a/testhal/STM32/USB_CDC/Makefile +++ b/testhal/STM32/USB_CDC/Makefile @@ -72,7 +72,7 @@ CSRC = $(PORTSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ - $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/shell.c \ $(CHIBIOS)/os/various/syscalls.c \ main.c diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index e401453e0..91ea7a5f2 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -94,7 +94,7 @@ * @brief Enables the SERIAL subsystem. */ #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE +#define HAL_USE_SERIAL FALSE #endif /** diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 23962c496..6d8994c8d 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -18,11 +18,15 @@ along with this program. If not, see . */ +#include +#include + #include "ch.h" #include "hal.h" #include "test.h" #include "usb_cdc.h" +#include "shell.h" /*===========================================================================*/ /* USB related stuff. */ @@ -305,6 +309,97 @@ static const SerialUSBConfig serusbcfg = { } }; +/*===========================================================================*/ +/* Command line related. */ +/*===========================================================================*/ + +#define SHELL_WA_SIZE THD_WA_SIZE(2048) +#define TEST_WA_SIZE THD_WA_SIZE(256) + +static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) { + size_t n, size; + char buf[52]; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: mem"); + return; + } + n = chHeapStatus(NULL, &size); + siprintf(buf, "core free memory : %u bytes", chCoreStatus()); + shellPrintLine(chp, buf); + siprintf(buf, "heap fragments : %u", n); + shellPrintLine(chp, buf); + siprintf(buf, "heap free total : %u bytes", size); + shellPrintLine(chp, buf); +} + +static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { + static const char *states[] = { + "READY", + "CURRENT", + "SUSPENDED", + "WTSEM", + "WTMTX", + "WTCOND", + "SLEEPING", + "WTEXIT", + "WTOREVT", + "WTANDEVT", + "SNDMSGQ", + "SNDMSG", + "WTMSG", + "FINAL" + }; + Thread *tp; + char buf[60]; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: threads"); + return; + } + shellPrintLine(chp, " addr stack prio refs state time"); + tp = chRegFirstThread(); + do { + siprintf(buf, "%8lx %8lx %4u %4i %9s %u", + (uint32_t)tp, (uint32_t)tp->p_ctx.r13, + (unsigned int)tp->p_prio, tp->p_refs - 1, + states[tp->p_state], (unsigned int)tp->p_time); + shellPrintLine(chp, buf); + tp = chRegNextThread(tp); + } while (tp != NULL); +} + +static void cmd_test(BaseChannel *chp, int argc, char *argv[]) { + Thread *tp; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: test"); + return; + } + tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(), + TestThread, chp); + if (tp == NULL) { + shellPrintLine(chp, "out of memory"); + return; + } + chThdWait(tp); +} + +static const ShellCommand commands[] = { + {"mem", cmd_mem}, + {"threads", cmd_threads}, + {"test", cmd_test}, + {NULL, NULL} +}; + +static const ShellConfig shell_cfg1 = { + (BaseChannel *)&SDU1, + commands +}; + /*===========================================================================*/ /* Generic code. */ /*===========================================================================*/ @@ -324,31 +419,11 @@ static msg_t Thread1(void *arg) { } } -/* - * USB CDC loopback thread. - */ -static WORKING_AREA(waThread2, 256); -static msg_t Thread2(void *arg) { - SerialUSBDriver *sdup = arg; - EventListener el; - - chEvtRegisterMask(chIOGetEventSource(&SDU1), &el, 1); - while (TRUE) { - chEvtWaitAny(ALL_EVENTS); - if (chOQIsEmptyI(&SDU1.oqueue)) { - uint8_t buffer[0x40]; - size_t n = chIQReadTimeout(&sdup->iqueue, buffer, - sizeof(buffer), TIME_IMMEDIATE); - if (n > 0) - chOQWriteTimeout(&sdup->oqueue, buffer, n, TIME_IMMEDIATE); - } - } -} - /* * Application entry point. */ int main(void) { + Thread *shelltp = NULL; /* * System initializations. @@ -368,27 +443,26 @@ int main(void) { palClearPad(GPIOC, GPIOC_USB_DISC); /* - * Activates the serial driver 2 using the driver default configuration. + * Shell manager initialization. */ - sdStart(&SD2, NULL); + shellInit(); /* * Creates the blinker thread. */ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - /* - * Creates the USB CDC loopback thread. - */ - chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, &SDU1); - /* * Normal main() thread activity, in this demo it does nothing except * sleeping in a loop and check the button state. */ while (TRUE) { - if (palReadPad(IOPORT1, GPIOA_BUTTON)) - TestThread(&SD2); + if (!shelltp && (SDU1.config->usbp->state == USB_ACTIVE)) + shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); + else if (chThdTerminated(shelltp)) { + chThdRelease(shelltp); /* Recovers memory of the previous shell. */ + shelltp = NULL; /* Triggers spawning of a new shell. */ + } chThdSleepMilliseconds(1000); } } -- cgit v1.2.3 From 8bfbb8d4d9943609a396273813d3063ede47d202 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 10 Apr 2011 09:52:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2873 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/main.c | 1 + demos/ARM7-AT91SAM7X-FATFS-GCC/main.c | 1 + demos/ARMCM3-STM32F103-FATFS-GCC/main.c | 1 + demos/PPC-SPC563-GCC/main.c | 1 + 4 files changed, 4 insertions(+) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c b/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c index ae5c59ae0..5eb6d8033 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/main.c @@ -143,6 +143,7 @@ static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { "WTEXIT", "WTOREVT", "WTANDEVT", + "SNDMSGQ", "SNDMSG", "WTMSG", "FINAL" diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c b/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c index a5f2009b0..ec69be25c 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c @@ -143,6 +143,7 @@ static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { "WTEXIT", "WTOREVT", "WTANDEVT", + "SNDMSGQ", "SNDMSG", "WTMSG", "FINAL" diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c index e44cd0307..a5bfb13a8 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c @@ -132,6 +132,7 @@ static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { "WTEXIT", "WTOREVT", "WTANDEVT", + "SNDMSGQ", "SNDMSG", "WTMSG", "FINAL" diff --git a/demos/PPC-SPC563-GCC/main.c b/demos/PPC-SPC563-GCC/main.c index a51b8d0b9..b0eac06ab 100644 --- a/demos/PPC-SPC563-GCC/main.c +++ b/demos/PPC-SPC563-GCC/main.c @@ -58,6 +58,7 @@ static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { "WTEXIT", "WTOREVT", "WTANDEVT", + "SNDMSGQ", "SNDMSG", "WTMSG", "FINAL" -- cgit v1.2.3 From 618a978da8f1b570236914e034fb91aa980b9ffc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 10 Apr 2011 16:45:41 +0000 Subject: Added DMA sharing in the STM32 HAL. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2874 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 10 +- demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 10 +- demos/ARMCM3-STM32F103/mcuconf.h | 10 +- demos/ARMCM3-STM32F107/mcuconf.h | 10 +- os/hal/platforms/STM32/adc_lld.c | 47 ++-- os/hal/platforms/STM32/adc_lld.h | 10 +- os/hal/platforms/STM32/hal_lld.c | 2 +- os/hal/platforms/STM32/spi_lld.c | 155 ++++--------- os/hal/platforms/STM32/spi_lld.h | 32 +-- os/hal/platforms/STM32/stm32_dma.c | 361 ++++++++++++++++++++++++++--- os/hal/platforms/STM32/stm32_dma.h | 45 ++-- os/hal/platforms/STM32/uart_lld.c | 236 +++++-------------- os/hal/platforms/STM32/uart_lld.h | 26 +-- readme.txt | 3 + testhal/STM32/ADC/mcuconf.h | 10 +- testhal/STM32/CAN/mcuconf.h | 10 +- testhal/STM32/GPT/mcuconf.h | 10 +- testhal/STM32/IRQ_STORM/mcuconf.h | 10 +- testhal/STM32/PWM-ICU/mcuconf.h | 10 +- testhal/STM32/SPI/mcuconf.h | 10 +- testhal/STM32/UART/mcuconf.h | 10 +- testhal/STM32/USB_CDC/mcuconf.h | 10 +- testhal/STM32/USB_MSC/mcuconf.h | 10 +- 23 files changed, 563 insertions(+), 484 deletions(-) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index 9bc43776c..5b3a5c785 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -51,7 +51,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -128,9 +128,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -144,9 +142,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h index 613541da4..fbebae6db 100644 --- a/demos/ARMCM3-STM32F107/mcuconf.h +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -59,7 +59,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -136,9 +136,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -152,9 +150,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index 72574108f..8a8027e55 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -48,39 +48,35 @@ ADCDriver ADCD1; /* Driver local functions. */ /*===========================================================================*/ -/*===========================================================================*/ -/* Driver interrupt handlers. */ -/*===========================================================================*/ - -#if STM32_ADC_USE_ADC1 || defined(__DOXYGEN__) /** - * @brief ADC1 DMA interrupt handler (channel 1). + * @brief Shared ADC DMA ISR service routine. * - * @isr + * @param[in] adcp pointer to the @p ADCDriver object + * @param[in] flags pre-shifted content of the ISR register */ -CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) { - uint32_t isr; - - CH_IRQ_PROLOGUE(); +static void adc_lld_serve_rx_interrupt(ADCDriver *adcp, uint32_t flags) { - isr = STM32_DMA1->ISR; - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_1); - if ((isr & DMA_ISR_TEIF1) != 0) { - /* DMA error processing.*/ - STM32_ADC1_DMA_ERROR_HOOK(); + /* DMA errors handling.*/ +#if defined(STM32_ADC_DMA_ERROR_HOOK) + if ((flags & DMA_ISR_TEIF1) != 0) { + STM32_ADC_DMA_ERROR_HOOK(spip); } - if ((isr & DMA_ISR_HTIF1) != 0) { +#else + (void)flags; +#endif + if ((flags & DMA_ISR_HTIF1) != 0) { /* Half transfer processing.*/ - _adc_isr_half_code(&ADCD1); + _adc_isr_half_code(adcp); } - if ((isr & DMA_ISR_TCIF1) != 0) { + if ((flags & DMA_ISR_TCIF1) != 0) { /* Transfer complete processing.*/ - _adc_isr_full_code(&ADCD1); + _adc_isr_full_code(adcp); } - - CH_IRQ_EPILOGUE(); } -#endif + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ /*===========================================================================*/ /* Driver exported functions. */ @@ -136,7 +132,8 @@ void adc_lld_start(ADCDriver *adcp) { if (adcp->state == ADC_STOP) { #if STM32_ADC_USE_ADC1 if (&ADCD1 == adcp) { - dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_1, + (stm32_dmaisr_t)adc_lld_serve_rx_interrupt, (void *)adcp); NVICEnableVector(DMA1_Channel1_IRQn, CORTEX_PRIORITY_MASK(STM32_ADC_ADC1_IRQ_PRIORITY)); dmaChannelSetPeripheral(adcp->dmachp, &ADC1->DR); @@ -167,7 +164,7 @@ void adc_lld_stop(ADCDriver *adcp) { ADC1->CR1 = 0; ADC1->CR2 = 0; NVICDisableVector(DMA1_Channel1_IRQn); - dmaDisable(DMA1_ID); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_1); RCC->APB2ENR &= ~RCC_APB2ENR_ADC1EN; } #endif diff --git a/os/hal/platforms/STM32/adc_lld.h b/os/hal/platforms/STM32/adc_lld.h index 6f93170ed..3cc34735f 100644 --- a/os/hal/platforms/STM32/adc_lld.h +++ b/os/hal/platforms/STM32/adc_lld.h @@ -94,12 +94,12 @@ #endif /** - * @brief ADC1 DMA error hook. + * @brief ADC DMA error hook. * @note The default action for DMA errors is a system halt because DMA * error can only happen because programming errors. */ -#if !defined(STM32_ADC1_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_ADC1_DMA_ERROR_HOOK() chSysHalt() +#if !defined(STM32_ADC_DMA_ERROR_HOOK) || defined(__DOXYGEN__) +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() #endif /*===========================================================================*/ @@ -114,6 +114,10 @@ #error "ADC driver activated but no ADC peripheral assigned" #endif +#if !defined(STM32_DMA_REQUIRED) +#define STM32_DMA_REQUIRED +#endif + /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 701ea8b50..784c159be 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -71,7 +71,7 @@ void hal_lld_init(void) { SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk; -#if HAL_USE_ADC || HAL_USE_SPI || HAL_USE_UART +#if defined(STM32_DMA_REQUIRED) dmaInit(); #endif } diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index fccbf3329..72db75857 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -82,11 +82,21 @@ static uint16_t dummyrx; } /** - * @brief Shared end-of-transfer service routine. + * @brief Shared end-of-rx service routine. * * @param[in] spip pointer to the @p SPIDriver object + * @param[in] flags pre-shifted content of the ISR register */ -static void serve_interrupt(SPIDriver *spip) { +static void spi_lld_serve_rx_interrupt(SPIDriver *spip, uint32_t flags) { + + /* DMA errors handling.*/ +#if defined(STM32_SPI_DMA_ERROR_HOOK) + if ((flags & DMA_ISR_TEIF1) != 0) { + STM32_SPI_DMA_ERROR_HOOK(spip); + } +#else + (void)flags; +#endif /* Stop everything.*/ dma_stop(spip); @@ -96,114 +106,28 @@ static void serve_interrupt(SPIDriver *spip) { _spi_isr_code(spip); } -/*===========================================================================*/ -/* Driver interrupt handlers. */ -/*===========================================================================*/ - -#if STM32_SPI_USE_SPI1 || defined(__DOXYGEN__) /** - * @brief SPI1 RX DMA interrupt handler (channel 2). + * @brief Shared end-of-tx service routine. * - * @isr + * @param[in] spip pointer to the @p SPIDriver object + * @param[in] flags pre-shifted content of the ISR register */ -CH_IRQ_HANDLER(DMA1_Ch2_IRQHandler) { - - CH_IRQ_PROLOGUE(); +static void spi_lld_serve_tx_interrupt(SPIDriver *spip, uint32_t flags) { - if ((STM32_DMA1->ISR & DMA_ISR_TEIF2) != 0) { - STM32_SPI_SPI1_DMA_ERROR_HOOK(); + /* DMA errors handling.*/ +#if defined(STM32_SPI_DMA_ERROR_HOOK) + if ((flags & DMA_ISR_TEIF1) != 0) { + STM32_SPI_DMA_ERROR_HOOK(spip); } - serve_interrupt(&SPID1); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_2); - - CH_IRQ_EPILOGUE(); -} - -/** - * @brief SPI1 TX DMA interrupt handler (channel 3). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch3_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - STM32_SPI_SPI1_DMA_ERROR_HOOK(); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_3); - - CH_IRQ_EPILOGUE(); -} +#else + (void)spip; + (void)flags; #endif - -#if STM32_SPI_USE_SPI2 || defined(__DOXYGEN__) -/** - * @brief SPI2 RX DMA interrupt handler (channel 4). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch4_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - if ((STM32_DMA1->ISR & DMA_ISR_TEIF4) != 0) { - STM32_SPI_SPI2_DMA_ERROR_HOOK(); - } - serve_interrupt(&SPID2); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_4); - - CH_IRQ_EPILOGUE(); } -/** - * @brief SPI2 TX DMA interrupt handler (channel 5). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch5_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - STM32_SPI_SPI2_DMA_ERROR_HOOK(); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_5); - - CH_IRQ_EPILOGUE(); -} -#endif - -#if STM32_SPI_USE_SPI3 || defined(__DOXYGEN__) -/** - * @brief SPI3 RX DMA interrupt handler (DMA2, channel 1). - * - * @isr - */ -CH_IRQ_HANDLER(DMA2_Ch1_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - if ((STM32_DMA2->ISR & DMA_ISR_TEIF1) != 0) { - STM32_SPI_SPI3_DMA_ERROR_HOOK(); - } - serve_interrupt(&SPID3); - dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_1); - - CH_IRQ_EPILOGUE(); -} - -/** - * @brief SPI3 TX DMA2 interrupt handler (DMA2, channel 2). - * - * @isr - */ -CH_IRQ_HANDLER(DMA2_Ch2_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - STM32_SPI_SPI3_DMA_ERROR_HOOK(); - dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_2); - - CH_IRQ_EPILOGUE(); -} -#endif +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ /*===========================================================================*/ /* Driver exported functions. */ @@ -256,7 +180,11 @@ void spi_lld_start(SPIDriver *spip) { if (spip->state == SPI_STOP) { #if STM32_SPI_USE_SPI1 if (&SPID1 == spip) { - dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_2, + (stm32_dmaisr_t)spi_lld_serve_rx_interrupt, (void *)spip); + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_3, + (stm32_dmaisr_t)spi_lld_serve_tx_interrupt, (void *)spip); NVICEnableVector(DMA1_Channel2_IRQn, CORTEX_PRIORITY_MASK(STM32_SPI_SPI1_IRQ_PRIORITY)); NVICEnableVector(DMA1_Channel3_IRQn, @@ -266,7 +194,11 @@ void spi_lld_start(SPIDriver *spip) { #endif #if STM32_SPI_USE_SPI2 if (&SPID2 == spip) { - dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_4, + (stm32_dmaisr_t)spi_lld_serve_rx_interrupt, (void *)spip); + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_5, + (stm32_dmaisr_t)spi_lld_serve_tx_interrupt, (void *)spip); NVICEnableVector(DMA1_Channel4_IRQn, CORTEX_PRIORITY_MASK(STM32_SPI_SPI2_IRQ_PRIORITY)); NVICEnableVector(DMA1_Channel5_IRQn, @@ -276,7 +208,11 @@ void spi_lld_start(SPIDriver *spip) { #endif #if STM32_SPI_USE_SPI3 if (&SPID3 == spip) { - dmaEnable(DMA2_ID); /* NOTE: Must be enabled before the IRQs.*/ + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA2_ID, STM32_DMA_CHANNEL_1, + (stm32_dmaisr_t)spi_lld_serve_rx_interrupt, (void *)spip); + dmaAllocate(STM32_DMA2_ID, STM32_DMA_CHANNEL_2, + (stm32_dmaisr_t)spi_lld_serve_tx_interrupt, (void *)spip); NVICEnableVector(DMA2_Channel1_IRQn, CORTEX_PRIORITY_MASK(STM32_SPI_SPI3_IRQ_PRIORITY)); NVICEnableVector(DMA2_Channel2_IRQn, @@ -324,7 +260,8 @@ void spi_lld_stop(SPIDriver *spip) { if (&SPID1 == spip) { NVICDisableVector(DMA1_Channel2_IRQn); NVICDisableVector(DMA1_Channel3_IRQn); - dmaDisable(DMA1_ID); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_2); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_3); RCC->APB2ENR &= ~RCC_APB2ENR_SPI1EN; } #endif @@ -332,7 +269,8 @@ void spi_lld_stop(SPIDriver *spip) { if (&SPID2 == spip) { NVICDisableVector(DMA1_Channel4_IRQn); NVICDisableVector(DMA1_Channel5_IRQn); - dmaDisable(DMA1_ID); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_4); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_5); RCC->APB1ENR &= ~RCC_APB1ENR_SPI2EN; } #endif @@ -340,7 +278,8 @@ void spi_lld_stop(SPIDriver *spip) { if (&SPID3 == spip) { NVICDisableVector(DMA2_Channel1_IRQn); NVICDisableVector(DMA2_Channel2_IRQn); - dmaDisable(DMA2_ID); + dmaRelease(STM32_DMA2_ID, STM32_DMA_CHANNEL_1); + dmaRelease(STM32_DMA2_ID, STM32_DMA_CHANNEL_2); RCC->APB1ENR &= ~RCC_APB1ENR_SPI3EN; } #endif diff --git a/os/hal/platforms/STM32/spi_lld.h b/os/hal/platforms/STM32/spi_lld.h index ca5a6d111..49e03e38c 100644 --- a/os/hal/platforms/STM32/spi_lld.h +++ b/os/hal/platforms/STM32/spi_lld.h @@ -118,30 +118,12 @@ #endif /** - * @brief SPI1 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. + * @brief SPI DMA error hook. + * @note The default action for DMA errors is a system halt because DMA + * error can only happen because programming errors. */ -#if !defined(STM32_SPI_SPI1_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#endif - -/** - * @brief SPI2 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. - */ -#if !defined(STM32_SPI_SPI2_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#endif - -/** - * @brief SPI3 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA error - * can only happen because programming errors. - */ -#if !defined(STM32_SPI_SPI3_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#if !defined(STM32_SPI_DMA_ERROR_HOOK) || defined(__DOXYGEN__) +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() #endif /*===========================================================================*/ @@ -164,6 +146,10 @@ #error "SPI driver activated but no SPI peripheral assigned" #endif +#if !defined(STM32_DMA_REQUIRED) +#define STM32_DMA_REQUIRED +#endif + /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/stm32_dma.c b/os/hal/platforms/STM32/stm32_dma.c index be7833777..023f2fdd3 100644 --- a/os/hal/platforms/STM32/stm32_dma.c +++ b/os/hal/platforms/STM32/stm32_dma.c @@ -23,23 +23,43 @@ * @brief STM32 DMA helper driver code. * * @addtogroup STM32_DMA + * @details DMA sharing helper driver. In the STM32 the DMA channels are a + * shared resource, this driver allows to allocate and free DMA + * channels at runtime in order to allow all the other device + * drivers to coordinate the access to the resource. + * @note The DMA ISR handlers are all declared into this module because + * sharing, the various device drivers can associate a callback to + * IRSs when allocating channels. * @{ */ #include "ch.h" #include "hal.h" +#if defined(STM32_DMA_REQUIRED) || defined(__DOXYGEN__) + /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ /*===========================================================================*/ -/* Driver local variables. */ +/* Driver local variables and types. */ /*===========================================================================*/ -static cnt_t dmacnt1; +/** + * @brief DMA ISR redirector type. + */ +typedef struct { + stm32_dmaisr_t dmaisrfunc; + void *dmaisrparam; +} dma_isr_redir_t; + +static uint32_t dmamsk1; +static dma_isr_redir_t dma1[7]; + #if STM32_HAS_DMA2 -static cnt_t dmacnt2; +static uint32_t dmamsk2; +static dma_isr_redir_t dma2[5]; #endif /*===========================================================================*/ @@ -50,6 +70,224 @@ static cnt_t dmacnt2; /* Driver interrupt handlers. */ /*===========================================================================*/ +/** + * @brief DMA1 channel 1 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_1 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_1); + if (dma1[0].dmaisrfunc) + dma1[0].dmaisrfunc(dma1[0].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA1 channel 2 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch2_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_2 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_2); + if (dma1[1].dmaisrfunc) + dma1[1].dmaisrfunc(dma1[1].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA1 channel 3 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch3_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_3 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_3); + if (dma1[2].dmaisrfunc) + dma1[2].dmaisrfunc(dma1[2].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA1 channel 4 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch4_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_4 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_4); + if (dma1[3].dmaisrfunc) + dma1[3].dmaisrfunc(dma1[3].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA1 channel 5 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch5_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_5 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_5); + if (dma1[4].dmaisrfunc) + dma1[4].dmaisrfunc(dma1[4].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA1 channel 6 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch6_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_6 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_6); + if (dma1[5].dmaisrfunc) + dma1[5].dmaisrfunc(dma1[5].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA1 channel 7 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA1_Ch7_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA1->ISR >> (STM32_DMA_CHANNEL_7 * 4); + dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_7); + if (dma1[6].dmaisrfunc) + dma1[6].dmaisrfunc(dma1[6].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +#if STM32_HAS_DMA2 || defined(__DOXYGEN__) +/** + * @brief DMA2 channel 1 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA2_Ch1_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_1 * 4); + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_1); + if (dma2[0].dmaisrfunc) + dma2[0].dmaisrfunc(dma2[0].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA2 channel 2 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA2_Ch2_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_2 * 4); + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_2); + if (dma2[1].dmaisrfunc) + dma2[1].dmaisrfunc(dma2[1].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA2 channel 3 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA2_Ch3_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_3 * 4); + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_3); + if (dma2[2].dmaisrfunc) + dma2[2].dmaisrfunc(dma2[2].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA2 channel 4 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA2_Ch4_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_4 * 4); + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + if (dma2[3].dmaisrfunc) + dma2[3].dmaisrfunc(dma2[3].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} + +/** + * @brief DMA2 channel 5 shared interrupt handler. + * + * @isr + */ +CH_IRQ_HANDLER(DMA2_Ch5_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_5 * 4); + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_5); + if (dma2[4].dmaisrfunc) + dma2[4].dmaisrfunc(dma2[4].dmaisrparam, isr); + + CH_IRQ_EPILOGUE(); +} +#endif /* STM32_HAS_DMA2 */ + /*===========================================================================*/ /* Driver exported functions. */ /*===========================================================================*/ @@ -62,66 +300,135 @@ static cnt_t dmacnt2; void dmaInit(void) { int i; - dmacnt1 = 0; - for (i = STM32_DMA_CHANNEL_7; i >= STM32_DMA_CHANNEL_1; i--) + dmamsk1 = 0; + for (i = STM32_DMA_CHANNEL_7; i >= STM32_DMA_CHANNEL_1; i--) { dmaDisableChannel(STM32_DMA1, i); + dma1[i].dmaisrfunc = NULL; + } STM32_DMA1->IFCR = 0xFFFFFFFF; #if STM32_HAS_DMA2 - dmacnt2 = 0; - for (i = STM32_DMA_CHANNEL_5; i >= STM32_DMA_CHANNEL_1; i--) + dmamsk2 = 0; + for (i = STM32_DMA_CHANNEL_5; i >= STM32_DMA_CHANNEL_1; i--) { dmaDisableChannel(STM32_DMA2, i); + dma2[i].dmaisrfunc = NULL; + } STM32_DMA1->IFCR = 0xFFFFFFFF; #endif } /** - * @brief Enables the specified DMA controller clock. + * @brief Allocates a DMA channel. + * @details The channel is allocated and, if required, the DMA clock enabled. + * Trying to allocate a channel already allocated is an illegal + * operation and is trapped if assertions are enabled. + * @pre The channel must not be already in use. + * @post The channel is allocated and the default ISR handler redirected + * to the specified function. + * @post The channel must be freed using @p dmaRelease() before it can + * be reused with another peripheral. + * @note This function can be invoked in both ISR or thread context. * - * @param[in] dma the DMA controller id + * @param[in] dma DMA controller id + * @param[in] channel requested channel id + * @param[in] func handling function pointer, can be @p NULL + * @param[in] param a parameter to be passed to the handling function + * @return The operation status. + * @retval FALSE operation successfully allocated. + * @retval TRUE the channel was already in use. * - * @api + * @special */ -void dmaEnable(uint32_t dma) { +void dmaAllocate(uint32_t dma, uint32_t channel, + stm32_dmaisr_t func, void *param) { + chDbgCheck(func != NULL, "dmaAllocate"); + +#if STM32_HAS_DMA2 switch (dma) { - case DMA1_ID: - if (dmacnt1++ == 0) { + case STM32_DMA1_ID: +#else + (void)dma; +#endif + /* Check if the channel is already taken.*/ + chDbgAssert((dmamsk1 & (1 << channel)) == 0, + "dmaAllocate(), #1", "already allocated"); + + /* If the DMA unit was idle then the clock is enabled.*/ + if (dmamsk1 == 0) { RCC->AHBENR |= RCC_AHBENR_DMA1EN; DMA1->IFCR = 0x0FFFFFFF; } - break; + + dmamsk1 |= 1 << channel; + dma1[channel].dmaisrfunc = func; + dma1[channel].dmaisrparam = param; #if STM32_HAS_DMA2 - case DMA2_ID: - if (dmacnt2++ == 0) { + break; + case STM32_DMA2_ID: + /* Check if the channel is already taken.*/ + chDbgAssert((dmamsk2 & (1 << channel)) == 0, + "dmaAllocate(), #2", "already allocated"); + + /* If the DMA unit was idle then the clock is enabled.*/ + if (dmamsk1 == 0) { RCC->AHBENR |= RCC_AHBENR_DMA2EN; DMA2->IFCR = 0x0FFFFFFF; } + + dmamsk2 |= 1 << channel; + dma2[channel].dmaisrfunc = func; + dma2[channel].dmaisrparam = param; break; -#endif } +#endif } /** - * @brief Disables the specified DMA controller clock. + * @brief Releases a DMA channel. + * @details The channel is freed and, if required, the DMA clock disabled. + * Trying to release a unallocated channel is an illegal operation + * and is trapped if assertions are enabled. + * @pre The channel must have been allocated using @p dmaRequest(). + * @post The channel is again available. + * @note This function can be invoked in both ISR or thread context. * - * @param[in] dma the DMA controller id + * @param[in] dma DMA controller id + * @param[in] channel requested channel id * - * @api + * @special */ -void dmaDisable(uint32_t dma) { +void dmaRelease(uint32_t dma, uint32_t channel) { +#if STM32_HAS_DMA2 switch (dma) { - case DMA1_ID: - if (--dmacnt1 == 0) + case STM32_DMA1_ID: +#else + (void)dma; +#endif + /* Check if the channel is not taken.*/ + chDbgAssert((dmamsk1 & (1 << channel)) != 0, + "dmaRelease(), #1", "not allocated"); + + dma1[channel].dmaisrfunc = NULL; + dmamsk1 &= ~(1 << channel); + if (dmamsk1 == 0) RCC->AHBENR &= ~RCC_AHBENR_DMA1EN; - break; #if STM32_HAS_DMA2 - case DMA2_ID: - if (--dmacnt2 == 0) + break; + case STM32_DMA2_ID: + /* Check if the channel is not taken.*/ + chDbgAssert((dmamsk2 & (1 << channel)) != 0, + "dmaRelease(), #2", "not allocated"); + + dma2[channel].dmaisrfunc = NULL; + dmamsk2 &= ~(1 << channel); + if (dmamsk2 == 0) RCC->AHBENR &= ~RCC_AHBENR_DMA2EN; break; -#endif } +#endif } +#endif /* STM32_DMA_REQUIRED */ + /** @} */ diff --git a/os/hal/platforms/STM32/stm32_dma.h b/os/hal/platforms/STM32/stm32_dma.h index 96e802f82..66a2f8c69 100644 --- a/os/hal/platforms/STM32/stm32_dma.h +++ b/os/hal/platforms/STM32/stm32_dma.h @@ -36,11 +36,11 @@ /*===========================================================================*/ /** @brief DMA1 identifier.*/ -#define DMA1_ID 0 +#define STM32_DMA1_ID 0 /** @brief DMA2 identifier.*/ #if STM32_HAS_DMA2 || defined(__DOXYGEN__) -#define DMA2_ID 1 +#define STM32_DMA2_ID 1 #endif /*===========================================================================*/ @@ -56,7 +56,7 @@ /*===========================================================================*/ /** - * @brief STM32 DMA channel memory structure. + * @brief STM32 DMA channel memory structure type. */ typedef struct { volatile uint32_t CCR; @@ -67,7 +67,7 @@ typedef struct { } stm32_dma_channel_t; /** - * @brief STM32 DMA subsystem memory structure. + * @brief STM32 DMA subsystem memory structure type. * @note This structure has been redefined here because it is convenient to * have the channels organized as an array, the ST header does not * do that. @@ -78,6 +78,14 @@ typedef struct { stm32_dma_channel_t channels[7]; } stm32_dma_t; +/** + * @brief STM32 DMA ISR function type. + * + * @param[in] p parameter for the registered function + * @param[in] flags pre-shifted content of the ISR register + */ +typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags); + /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ @@ -128,11 +136,12 @@ typedef struct { /** * @brief Associates a peripheral data register to a DMA channel. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmachp dmachp to a stm32_dma_channel_t structure * @param[in] cpar value to be written in the CPAR register * - * @api + * @special */ #define dmaChannelSetPeripheral(dmachp, cpar) { \ (dmachp)->CPAR = (uint32_t)(cpar); \ @@ -143,13 +152,14 @@ typedef struct { * @note This macro does not change the CPAR register because that register * value does not change frequently, it usually points to a peripheral * data register. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmachp dmachp to a stm32_dma_channel_t structure * @param[in] cndtr value to be written in the CNDTR register * @param[in] cmar value to be written in the CMAR register * @param[in] ccr value to be written in the CCR register * - * @api + * @special */ #define dmaChannelSetup(dmachp, cndtr, cmar, ccr) { \ (dmachp)->CNDTR = (uint32_t)(cndtr); \ @@ -159,10 +169,11 @@ typedef struct { /** * @brief DMA channel enable by channel pointer. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmachp dmachp to a stm32_dma_channel_t structure * - * @api + * @special */ #define dmaChannelEnable(dmachp) { \ (dmachp)->CCR |= DMA_CCR1_EN; \ @@ -171,10 +182,11 @@ typedef struct { /** * @brief DMA channel disable by channel pointer. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmachp dmachp to a stm32_dma_channel_t structure * - * @api + * @special */ #define dmaChannelDisable(dmachp) { \ (dmachp)->CCR = 0; \ @@ -187,6 +199,7 @@ typedef struct { * data register. * @note Channels are numbered from 0 to 6, use the appropriate macro * as parameter. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmap pointer to a stm32_dma_t structure * @param[in] ch channel number @@ -194,7 +207,7 @@ typedef struct { * @param[in] cmar value to be written in the CMAR register * @param[in] ccr value to be written in the CCR register * - * @api + * @special */ #define dmaSetupChannel(dmap, ch, cndtr, cmar, ccr) { \ dmaChannelSetup(&(dmap)->channels[ch], (cndtr), (cmar), (ccr)); \ @@ -204,11 +217,12 @@ typedef struct { * @brief DMA channel enable by channel ID. * @note Channels are numbered from 0 to 6, use the appropriate macro * as parameter. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmap pointer to a stm32_dma_t structure * @param[in] ch channel number * - * @api + * @special */ #define dmaEnableChannel(dmap, ch) { \ dmaChannelEnable(&(dmap)->channels[ch]); \ @@ -218,11 +232,12 @@ typedef struct { * @brief DMA channel disable by channel ID. * @note Channels are numbered from 0 to 6, use the appropriate macro * as parameter. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmap pointer to a stm32_dma_t structure * @param[in] ch channel number * - * @api + * @special */ #define dmaDisableChannel(dmap, ch) { \ dmaChannelDisable(&(dmap)->channels[ch]); \ @@ -234,11 +249,12 @@ typedef struct { * withdraw all the pending interrupt bits from the ISR register. * @note Channels are numbered from 0 to 6, use the appropriate macro * as parameter. + * @note This function can be invoked in both ISR or thread context. * * @param[in] dmap pointer to a stm32_dma_t structure * @param[in] ch channel number * - * @api + * @special */ #define dmaClearChannel(dmap, ch){ \ (dmap)->IFCR = 1 << ((ch) * 4); \ @@ -252,8 +268,9 @@ typedef struct { extern "C" { #endif void dmaInit(void); - void dmaEnable(uint32_t dma); - void dmaDisable(uint32_t dma); + void dmaAllocate(uint32_t dma, uint32_t channel, + stm32_dmaisr_t func, void *param); + void dmaRelease(uint32_t dma, uint32_t channel); #ifdef __cplusplus } #endif diff --git a/os/hal/platforms/STM32/uart_lld.c b/os/hal/platforms/STM32/uart_lld.c index 958c3da0f..e2f306302 100644 --- a/os/hal/platforms/STM32/uart_lld.c +++ b/os/hal/platforms/STM32/uart_lld.c @@ -164,17 +164,38 @@ static void usart_start(UARTDriver *uartp) { * @brief RX DMA common service routine. * * @param[in] uartp pointer to the @p UARTDriver object + * @param[in] flags pre-shifted content of the ISR register */ -static void serve_rx_end_irq(UARTDriver *uartp) { +static void uart_lld_serve_rx_end_irq(UARTDriver *uartp, uint32_t flags) { - uartp->rxstate = UART_RX_COMPLETE; - if (uartp->config->rxend_cb != NULL) - uartp->config->rxend_cb(uartp); - /* If the callback didn't explicitly change state then the receiver - automatically returns to the idle state.*/ - if (uartp->rxstate == UART_RX_COMPLETE) { - uartp->rxstate = UART_RX_IDLE; - set_rx_idle_loop(uartp); + /* DMA errors handling.*/ +#if defined(STM32_UART_DMA_ERROR_HOOK) + if ((flags & DMA_ISR_TEIF1) != 0) { + STM32_UART_DMA_ERROR_HOOK(uartp); + } +#else + (void)flags; +#endif + + if (uartp->rxstate == UART_RX_IDLE) { + /* Receiver in idle state, a callback is generated, if enabled, for each + received character and then the driver stays in the same state.*/ + if (uartp->config->rxchar_cb != NULL) + uartp->config->rxchar_cb(uartp, uartp->rxbuf); + } + else { + /* Receiver in active state, a callback is generated, if enabled, after + a completed transfer.*/ + dmaDisableChannel(uartp->dmap, uartp->dmarx); + uartp->rxstate = UART_RX_COMPLETE; + if (uartp->config->rxend_cb != NULL) + uartp->config->rxend_cb(uartp); + /* If the callback didn't explicitly change state then the receiver + automatically returns to the idle state.*/ + if (uartp->rxstate == UART_RX_COMPLETE) { + uartp->rxstate = UART_RX_IDLE; + set_rx_idle_loop(uartp); + } } } @@ -182,9 +203,20 @@ static void serve_rx_end_irq(UARTDriver *uartp) { * @brief TX DMA common service routine. * * @param[in] uartp pointer to the @p UARTDriver object + * @param[in] flags pre-shifted content of the ISR register */ -static void serve_tx_end_irq(UARTDriver *uartp) { +static void uart_lld_serve_tx_end_irq(UARTDriver *uartp, uint32_t flags) { + /* DMA errors handling.*/ +#if defined(STM32_UART_DMA_ERROR_HOOK) + if ((flags & DMA_ISR_TEIF1) != 0) { + STM32_UART_DMA_ERROR_HOOK(uartp); + } +#else + (void)flags; +#endif + + dmaDisableChannel(uartp->dmap, uartp->dmatx); /* A callback is generated, if enabled, after a completed transfer.*/ uartp->txstate = UART_TX_COMPLETE; if (uartp->config->txend1_cb != NULL) @@ -194,6 +226,7 @@ static void serve_tx_end_irq(UARTDriver *uartp) { if (uartp->txstate == UART_TX_COMPLETE) uartp->txstate = UART_TX_IDLE; } + /** * @brief USART common service routine. * @@ -224,58 +257,6 @@ static void serve_usart_irq(UARTDriver *uartp) { /*===========================================================================*/ #if STM32_UART_USE_USART1 || defined(__DOXYGEN__) -/** - * @brief USART1 RX DMA interrupt handler (channel 5). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch5_IRQHandler) { - UARTDriver *uartp; - - CH_IRQ_PROLOGUE(); - - uartp = &UARTD1; - if ((STM32_DMA1->ISR & DMA_ISR_TEIF5) != 0) { - STM32_UART_USART1_DMA_ERROR_HOOK(); - } - if (uartp->rxstate == UART_RX_IDLE) { - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_5); - /* Fast IRQ path, this is why it is not centralized in serve_rx_end_irq().*/ - /* Receiver in idle state, a callback is generated, if enabled, for each - received character and then the driver stays in the same state.*/ - if (uartp->config->rxchar_cb != NULL) - uartp->config->rxchar_cb(uartp, uartp->rxbuf); - } - else { - /* Receiver in active state, a callback is generated, if enabled, after - a completed transfer.*/ - dmaDisableChannel(STM32_DMA1, STM32_DMA_CHANNEL_5); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_5); - serve_rx_end_irq(uartp); - } - - CH_IRQ_EPILOGUE(); -} - -/** - * @brief USART1 TX DMA interrupt handler (channel 4). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch4_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - if ((STM32_DMA1->ISR & DMA_ISR_TEIF4) != 0) { - STM32_UART_USART1_DMA_ERROR_HOOK(); - } - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_4); - dmaDisableChannel(STM32_DMA1, STM32_DMA_CHANNEL_4); - serve_tx_end_irq(&UARTD1); - - CH_IRQ_EPILOGUE(); -} - /** * @brief USART1 IRQ handler. * @@ -292,58 +273,6 @@ CH_IRQ_HANDLER(USART1_IRQHandler) { #endif /* STM32_UART_USE_USART1 */ #if STM32_UART_USE_USART2 || defined(__DOXYGEN__) -/** - * @brief USART2 RX DMA interrupt handler (channel 6). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch6_IRQHandler) { - UARTDriver *uartp; - - CH_IRQ_PROLOGUE(); - - uartp = &UARTD2; - if ((STM32_DMA1->ISR & DMA_ISR_TEIF6) != 0) { - STM32_UART_USART2_DMA_ERROR_HOOK(); - } - if (uartp->rxstate == UART_RX_IDLE) { - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_6); - /* Fast IRQ path, this is why it is not centralized in serve_rx_end_irq().*/ - /* Receiver in idle state, a callback is generated, if enabled, for each - received character and then the driver stays in the same state.*/ - if (uartp->config->rxchar_cb != NULL) - uartp->config->rxchar_cb(uartp, uartp->rxbuf); - } - else { - /* Receiver in active state, a callback is generated, if enabled, after - a completed transfer.*/ - dmaDisableChannel(STM32_DMA1, STM32_DMA_CHANNEL_6); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_6); - serve_rx_end_irq(uartp); - } - - CH_IRQ_EPILOGUE(); -} - -/** - * @brief USART2 TX DMA interrupt handler (channel 7). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch7_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - if ((STM32_DMA1->ISR & DMA_ISR_TEIF7) != 0) { - STM32_UART_USART2_DMA_ERROR_HOOK(); - } - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_7); - dmaDisableChannel(STM32_DMA1, STM32_DMA_CHANNEL_7); - serve_tx_end_irq(&UARTD2); - - CH_IRQ_EPILOGUE(); -} - /** * @brief USART2 IRQ handler. * @@ -360,58 +289,6 @@ CH_IRQ_HANDLER(USART2_IRQHandler) { #endif /* STM32_UART_USE_USART2 */ #if STM32_UART_USE_USART3 || defined(__DOXYGEN__) -/** - * @brief USART3 RX DMA interrupt handler (channel 3). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch3_IRQHandler) { - UARTDriver *uartp; - - CH_IRQ_PROLOGUE(); - - uartp = &UARTD3; - if ((STM32_DMA1->ISR & DMA_ISR_TEIF3) != 0) { - STM32_UART_USART1_DMA_ERROR_HOOK(); - } - if (uartp->rxstate == UART_RX_IDLE) { - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_3); - /* Fast IRQ path, this is why it is not centralized in serve_rx_end_irq().*/ - /* Receiver in idle state, a callback is generated, if enabled, for each - received character and then the driver stays in the same state.*/ - if (uartp->config->rxchar_cb != NULL) - uartp->config->rxchar_cb(uartp, uartp->rxbuf); - } - else { - /* Receiver in active state, a callback is generated, if enabled, after - a completed transfer.*/ - dmaDisableChannel(STM32_DMA1, STM32_DMA_CHANNEL_3); - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_3); - serve_rx_end_irq(uartp); - } - - CH_IRQ_EPILOGUE(); -} - -/** - * @brief USART3 TX DMA interrupt handler (channel 2). - * - * @isr - */ -CH_IRQ_HANDLER(DMA1_Ch2_IRQHandler) { - - CH_IRQ_PROLOGUE(); - - if ((STM32_DMA1->ISR & DMA_ISR_TEIF2) != 0) { - STM32_UART_USART1_DMA_ERROR_HOOK(); - } - dmaClearChannel(STM32_DMA1, STM32_DMA_CHANNEL_2); - dmaDisableChannel(STM32_DMA1, STM32_DMA_CHANNEL_2); - serve_tx_end_irq(&UARTD3); - - CH_IRQ_EPILOGUE(); -} - /** * @brief USART3 IRQ handler. * @@ -478,7 +355,11 @@ void uart_lld_start(UARTDriver *uartp) { if (uartp->state == UART_STOP) { #if STM32_UART_USE_USART1 if (&UARTD1 == uartp) { - dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_4, + (stm32_dmaisr_t)uart_lld_serve_tx_end_irq, (void *)uartp); + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_5, + (stm32_dmaisr_t)uart_lld_serve_rx_end_irq, (void *)uartp); NVICEnableVector(USART1_IRQn, CORTEX_PRIORITY_MASK(STM32_UART_USART1_IRQ_PRIORITY)); NVICEnableVector(DMA1_Channel4_IRQn, @@ -491,7 +372,11 @@ void uart_lld_start(UARTDriver *uartp) { #if STM32_UART_USE_USART2 if (&UARTD2 == uartp) { - dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_6, + (stm32_dmaisr_t)uart_lld_serve_rx_end_irq, (void *)uartp); + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_7, + (stm32_dmaisr_t)uart_lld_serve_tx_end_irq, (void *)uartp); NVICEnableVector(USART2_IRQn, CORTEX_PRIORITY_MASK(STM32_UART_USART2_IRQ_PRIORITY)); NVICEnableVector(DMA1_Channel6_IRQn, @@ -504,7 +389,11 @@ void uart_lld_start(UARTDriver *uartp) { #if STM32_UART_USE_USART3 if (&UARTD3 == uartp) { - dmaEnable(DMA1_ID); /* NOTE: Must be enabled before the IRQs.*/ + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_2, + (stm32_dmaisr_t)uart_lld_serve_tx_end_irq, (void *)uartp); + dmaAllocate(STM32_DMA1_ID, STM32_DMA_CHANNEL_3, + (stm32_dmaisr_t)uart_lld_serve_rx_end_irq, (void *)uartp); NVICEnableVector(USART3_IRQn, CORTEX_PRIORITY_MASK(STM32_UART_USART3_IRQ_PRIORITY)); NVICEnableVector(DMA1_Channel2_IRQn, @@ -549,7 +438,8 @@ void uart_lld_stop(UARTDriver *uartp) { NVICDisableVector(USART1_IRQn); NVICDisableVector(DMA1_Channel4_IRQn); NVICDisableVector(DMA1_Channel5_IRQn); - dmaDisable(DMA1_ID); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_4); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_5); RCC->APB2ENR &= ~RCC_APB2ENR_USART1EN; return; } @@ -560,7 +450,8 @@ void uart_lld_stop(UARTDriver *uartp) { NVICDisableVector(USART2_IRQn); NVICDisableVector(DMA1_Channel6_IRQn); NVICDisableVector(DMA1_Channel7_IRQn); - dmaDisable(DMA1_ID); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_6); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_7); RCC->APB1ENR &= ~RCC_APB1ENR_USART2EN; return; } @@ -571,7 +462,8 @@ void uart_lld_stop(UARTDriver *uartp) { NVICDisableVector(USART3_IRQn); NVICDisableVector(DMA1_Channel2_IRQn); NVICDisableVector(DMA1_Channel3_IRQn); - dmaDisable(DMA1_ID); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_2); + dmaRelease(STM32_DMA1_ID, STM32_DMA_CHANNEL_3); RCC->APB1ENR &= ~RCC_APB1ENR_USART3EN; return; } diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h index 0cd75a395..f24cd7b79 100644 --- a/os/hal/platforms/STM32/uart_lld.h +++ b/os/hal/platforms/STM32/uart_lld.h @@ -121,26 +121,8 @@ * @note The default action for DMA errors is a system halt because DMA * error can only happen because programming errors. */ -#if !defined(STM32_UART_USART1_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#endif - -/** - * @brief USART2 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA - * error can only happen because programming errors. - */ -#if !defined(STM32_UART_USART2_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#endif - -/** - * @brief USART3 DMA error hook. - * @note The default action for DMA errors is a system halt because DMA - * error can only happen because programming errors. - */ -#if !defined(STM32_UART_USART3_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#if !defined(STM32_UART_DMA_ERROR_HOOK) || defined(__DOXYGEN__) +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() #endif /*===========================================================================*/ @@ -164,6 +146,10 @@ #error "UART driver activated but no USART/UART peripheral assigned" #endif +#if !defined(STM32_DMA_REQUIRED) +#define STM32_DMA_REQUIRED +#endif + /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ diff --git a/readme.txt b/readme.txt index 3a464c3b1..68ac730ce 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,9 @@ *** 2.3.2 *** - FIX: Fixed spurious characters generated by Serial over USB driver (bug 3276379). +- NEW: Now it is possible to share DMA channels in the STM32 HAL thanks + to a centralized manager. Channels are allocated when the driver is + started and released when it is stopped. - OPT: STM32 PWM driver implementation simplified. - CHANGE: Now pwmChangePeriod() does not implicitly disable the active PWM channels. diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/GPT/mcuconf.h b/testhal/STM32/GPT/mcuconf.h index c7dc8742c..023c2ef9f 100644 --- a/testhal/STM32/GPT/mcuconf.h +++ b/testhal/STM32/GPT/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/IRQ_STORM/mcuconf.h b/testhal/STM32/IRQ_STORM/mcuconf.h index d27660a12..416f38ce1 100644 --- a/testhal/STM32/IRQ_STORM/mcuconf.h +++ b/testhal/STM32/IRQ_STORM/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/PWM-ICU/mcuconf.h b/testhal/STM32/PWM-ICU/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/testhal/STM32/PWM-ICU/mcuconf.h +++ b/testhal/STM32/PWM-ICU/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index d1f919486..f4cd4d3e2 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. diff --git a/testhal/STM32/USB_MSC/mcuconf.h b/testhal/STM32/USB_MSC/mcuconf.h index 94e9c5d15..93bae3aea 100644 --- a/testhal/STM32/USB_MSC/mcuconf.h +++ b/testhal/STM32/USB_MSC/mcuconf.h @@ -52,7 +52,7 @@ #define STM32_ADC_USE_ADC1 TRUE #define STM32_ADC_ADC1_DMA_PRIORITY 3 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_ERROR_HOOK() chSysHalt() +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() /* * CAN driver system settings. @@ -129,9 +129,7 @@ #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_SPI1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_SPI_SPI3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() /* * UART driver system settings. @@ -145,9 +143,7 @@ #define STM32_UART_USART1_DMA_PRIORITY 0 #define STM32_UART_USART2_DMA_PRIORITY 0 #define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_USART1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART2_DMA_ERROR_HOOK() chSysHalt() -#define STM32_UART_USART3_DMA_ERROR_HOOK() chSysHalt() +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() /* * USB driver system settings. -- cgit v1.2.3 From 2f2dba75ebf0f3043b2148af574f34591cac3be9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 10 Apr 2011 18:46:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2875 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72-GCC.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index 772e24d45..d71f70727 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -5,8 +5,8 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.3.0unstable -*** GCC Version: 4.5.2 +*** Kernel: 2.3.2unstable +*** GCC Version: 4.6.0 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 *** Platform: STM32 Performance Line Medium Density @@ -98,51 +98,51 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 248569 msgs/S, 497138 ctxswc/S +--- Score : 267097 msgs/S, 534194 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 198998 msgs/S, 397996 ctxswc/S +--- Score : 213832 msgs/S, 427664 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 198998 msgs/S, 397996 ctxswc/S +--- Score : 213832 msgs/S, 427664 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 839008 ctxswc/S +--- Score : 962832 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 156856 threads/S +--- Score : 161828 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 235543 threads/S +--- Score : 241113 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 61138 reschedules/S, 366828 ctxswc/S +--- Score : 64728 reschedules/S, 388368 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 478120 ctxswc/S +--- Score : 468840 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 474232 bytes/S +--- Score : 526392 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 647262 timers/S +--- Score : 647308 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 787368 wait+signal/S +--- Score : 787420 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 586492 lock+unlock/S +--- Score : 596276 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) -- cgit v1.2.3 From 224cb118225e2089c6ee6c2965b388d8d71156ee Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 15 Apr 2011 12:27:13 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2877 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/crt0.c | 275 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 os/ports/GCC/ARMCMx/crt0.c diff --git a/os/ports/GCC/ARMCMx/crt0.c b/os/ports/GCC/ARMCMx/crt0.c new file mode 100644 index 000000000..a51f4dbfe --- /dev/null +++ b/os/ports/GCC/ARMCMx/crt0.c @@ -0,0 +1,275 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file ARMCMx/crt0.c + * @brief Generic ARMvx-M (Cortex-M0/M1/M3/M4) startup file for ChibiOS/RT. + * + * @addtogroup ARMCMx_CORE + * @{ + */ + +#include "chtypes.h" + +/** + * @brief Control special register initialization value. + * @details The system is setup to run in privileged mode using the PSP + * stack (dual stack mode). + */ +#if !defined(CRT0_CONTROL_INIT) || defined(__DOXYGEN__) +#define CRT0_CONTROL_INIT 0x00000002 +#endif + +/** + * @brief DATA segment initialization switch. + */ +#if !defined(CRT0_INIT_DATA) || defined(__DOXYGEN__) +#define CRT0_INIT_DATA TRUE +#endif + +/** + * @brief BSS segment initialization switch. + */ +#if !defined(CRT0_INIT_BSS) || defined(__DOXYGEN__) +#define CRT0_INIT_BSS TRUE +#endif + +/** + * @brief Constructors invocation switch. + */ +#if !defined(CRT0_CALL_CONSTRUCTORS) || defined(__DOXYGEN__) +#define CRT0_CALL_CONSTRUCTORS TRUE +#endif + +/** + * @brief Destructors invocation switch. + */ +#if !defined(CRT0_CALL_DESTRUCTORS) || defined(__DOXYGEN__) +#define CRT0_CALL_DESTRUCTORS TRUE +#endif + +#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) + +/** + * @brief Ram end. + * @details This symbol must be exported by the linker script and represents + * the location after the last RAM location. + */ +extern uint8_t __ram_end__; + +/** + * @brief Main stack size. + * @details This symbol must be exported by the linker script and represents + * the main stack size. + * @note The main stack is the stack where interrupts and exceptions are + * processed. + */ +extern uint8_t __main_stack_size__; + +/** + * @brief Process stack size. + * @details This symbol must be exported by the linker script and represents + * the process stack size. + * @note The process stack is the stack used by the @p main() function. + */ +extern uint8_t __process_stack_size__; + +/** + * @brief ROM image of the data segment start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _textdata; + +/** + * @brief Data segment start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _data; + +/** + * @brief Data segment end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _edata; + +/** + * @brief BSS segment start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _bss_start; + +/** + * @brief BSS segment end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _bss_end; + +/** + * @brief Constructors table start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern void __init_array_start(void); + +/** + * @brief Constructors table end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern void __init_array_end(void); + +/** + * @brief Destructors table start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern void __fini_array_start(void); + +/** + * @brief Destructors table end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern void __fini_array_end(void); + +/** + * @brief Application @p main() function. + * + * @param[in] argc Number of arguments, always zero. + * @param[in] argv Pointer to an array of arguments, always @p NULL. + */ +extern void main(int argc, char **argv); + +/** + * @brief Default initialization hook 0. + * @details This hook is invoked immediately after the stack initialization + * and before the DATA and BSS segments initialization. The + * default behavior is to do nothing. + * @note This function is a weak symbol. + */ +#if !defined(__DOXYGEN__) +__attribute__((weak)) +#endif +void hwinit0(void) {} + +/** + * @brief Default initialization hook 1. + * @details This hook is invoked immediately after the DATA and BSS segments + * initialization and before entering the @p main() function. The + * default behavior is to do nothing. + * @note This function is a weak symbol. + */ +#if !defined(__DOXYGEN__) +__attribute__((weak)) +#endif +void hwinit1(void) {} + +/** + * @brief Default @p main() function exit handler. + * @details This handler is invoked or the @p main() function exit. The + * default behavior is to enter an infinite loop. + * @note This function is a weak symbol. + */ +#if !defined(__DOXYGEN__) +__attribute__((weak, naked)) +#endif +void _main_exit_handler(void) { + while (1) + ; +} + +/** + * @brief Reset vector. + */ +#if !defined(__DOXYGEN__) +__attribute__((naked)) +#endif +void ResetHandler(void) { + uint32_t sz, ctl; + + /* Process Stack initialization, it is allocated below the main stack. The + main stack is assumed to be allocated starting from @p __ram_end__ + extending downward.*/ + asm volatile ("cpsid i"); + sz = SYMVAL(__ram_end__) - SYMVAL(__main_stack_size__); + asm volatile ("msr PSP, %0" : : "r" (sz)); + + ctl = CRT0_CONTROL_INIT; + asm volatile ("msr CONTROL, %0" : : "r" (ctl)); + asm volatile ("isb"); + + /* Initialization hook 0 invocation.*/ + hwinit0(); + +#if CRT0_INIT_DATA + /* DATA segment initialization.*/ + { + uint32_t *tp, *dp; + + tp = &_textdata; + dp = &_data; + while (dp < &_edata) + *dp++ = *tp++; + } +#endif + +#if CRT0_INIT_BSS + /* BSS segment initialization.*/ + { + uint32_t *bp; + + bp = &_bss_start; + while (bp < &_bss_end) + *bp++ = 0; + } +#endif + + /* Initialization hook 1 invocation.*/ + hwinit1(); + +#if CRT0_CALL_CONSTRUCTORS + /* Constructors invocation.*/ + { + void (*dpp)(void); + + dpp = &__init_array_start; + while (dpp < &__init_array_end) { + (*dpp)(); + dpp++; + } + } +#endif + + /* Invoking application main() function.*/ + main(0, 0); + +#if CRT0_CALL_DESTRUCTORS + /* Destructors invocation.*/ + { + void (*dpp)(void); + + dpp = &__fini_array_start; + while (dpp < &__fini_array_end) { + (*dpp)(); + dpp++; + } + } +#endif + + /* Invoking the main() exit handler.*/ + asm volatile ("b _main_exit_handler"); +} + +/** @} */ -- cgit v1.2.3 From 786a0a6c71e98c1a3268ed2a13289459030c3032 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 16 Apr 2011 06:30:12 +0000 Subject: Fixed bug 3288112. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2878 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/spi.h | 2 ++ os/hal/platforms/STM32/spi_lld.c | 1 + readme.txt | 2 ++ 3 files changed, 5 insertions(+) diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h index 0974fb740..104dd9d3e 100644 --- a/os/hal/include/spi.h +++ b/os/hal/include/spi.h @@ -264,6 +264,8 @@ typedef enum { if ((spip)->state == SPI_COMPLETE) \ (spip)->state = SPI_READY; \ } \ + else \ + (spip)->state = SPI_READY; \ _spi_wakeup_isr(spip); \ } diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index 72db75857..690b1825e 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -116,6 +116,7 @@ static void spi_lld_serve_tx_interrupt(SPIDriver *spip, uint32_t flags) { /* DMA errors handling.*/ #if defined(STM32_SPI_DMA_ERROR_HOOK) + (void)spip; if ((flags & DMA_ISR_TEIF1) != 0) { STM32_SPI_DMA_ERROR_HOOK(spip); } diff --git a/readme.txt b/readme.txt index 68ac730ce..700da01d1 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed missing state transition in SPI driver (bug 3288112)(backported + to 2.2.4). - FIX: Fixed spurious characters generated by Serial over USB driver (bug 3276379). - NEW: Now it is possible to share DMA channels in the STM32 HAL thanks -- cgit v1.2.3 From faed89a33d39b13b88fbd3d680173b03055f4b49 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 16 Apr 2011 09:18:36 +0000 Subject: C++ demo for STM32. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2880 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103-G++/Makefile | 203 ++++++++++++++ demos/ARMCM3-STM32F103-G++/ch.ld | 116 ++++++++ demos/ARMCM3-STM32F103-G++/chconf.h | 508 ++++++++++++++++++++++++++++++++++ demos/ARMCM3-STM32F103-G++/halconf.h | 281 +++++++++++++++++++ demos/ARMCM3-STM32F103-G++/main.cpp | 176 ++++++++++++ demos/ARMCM3-STM32F103-G++/mcuconf.h | 154 +++++++++++ demos/ARMCM3-STM32F103-G++/readme.txt | 28 ++ demos/ARMCM3-STM32F103/main.c | 6 +- os/various/ch.cpp | 10 +- os/various/ch.hpp | 13 +- readme.txt | 1 + 11 files changed, 1482 insertions(+), 14 deletions(-) create mode 100644 demos/ARMCM3-STM32F103-G++/Makefile create mode 100644 demos/ARMCM3-STM32F103-G++/ch.ld create mode 100644 demos/ARMCM3-STM32F103-G++/chconf.h create mode 100644 demos/ARMCM3-STM32F103-G++/halconf.h create mode 100644 demos/ARMCM3-STM32F103-G++/main.cpp create mode 100644 demos/ARMCM3-STM32F103-G++/mcuconf.h create mode 100644 demos/ARMCM3-STM32F103-G++/readme.txt diff --git a/demos/ARMCM3-STM32F103-G++/Makefile b/demos/ARMCM3-STM32F103-G++/Makefile new file mode 100644 index 000000000..96ba1f7cd --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/Makefile @@ -0,0 +1,203 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti -fno-exceptions +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = $(CHIBIOS)/os/various/ch.cpp main.cpp + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F103-G++/ch.ld b/demos/ARMCM3-STM32F103-G++/ch.ld new file mode 100644 index 000000000..e378d8868 --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/ch.ld @@ -0,0 +1,116 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + + .text : ALIGN(16) SUBALIGN(16) + { + _text = .; + KEEP(*(vectors)) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + *(.ARM.extab) + *(.ARM.extab.*) + } > flash + + .ctors : + { + PROVIDE(_ctors_start_ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(_ctors_end_ = .); + } > flash + + .dtors : + { + PROVIDE(_dtors_start_ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(_dtors_end_ = .); + } > flash + + .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} + + __exidx_start = .; + .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash + __exidx_end = .; + + .eh_frame_hdr : {*(.eh_frame_hdr)} + + .eh_frame : ONLY_IF_RO {*(.eh_frame)} + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + _data = .; + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + _edata = .; + } > ram AT > flash + + .bss : + { + _bss_start = .; + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F103-G++/chconf.h b/demos/ARMCM3-STM32F103-G++/chconf.h new file mode 100644 index 000000000..04fa822cc --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/chconf.h @@ -0,0 +1,508 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103-G++/halconf.h b/demos/ARMCM3-STM32F103-G++/halconf.h new file mode 100644 index 000000000..af5658566 --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/halconf.h @@ -0,0 +1,281 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103-G++/main.cpp b/demos/ARMCM3-STM32F103-G++/main.cpp new file mode 100644 index 000000000..ce626ee9c --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/main.cpp @@ -0,0 +1,176 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.hpp" +#include "hal.h" +#include "test.h" +#include "evtimer.h" + +using namespace chibios_rt; + +/* + * LED blink sequences. + * NOTE: Sequences must always be terminated by a GOTO instruction. + * NOTE: The sequencer language could be easily improved but this is outside + * the scope of this demo. + */ +#define SLEEP 0 +#define GOTO 1 +#define STOP 2 +#define BITCLEAR 3 +#define BITSET 4 + +typedef struct { + uint8_t action; + uint32_t value; +} seqop_t; + +// Flashing sequence for LED1. +static const seqop_t LED1_sequence[] = +{ + {BITCLEAR, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 200}, + {BITSET, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 800}, + {BITCLEAR, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 400}, + {BITSET, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 600}, + {BITCLEAR, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 600}, + {BITSET, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 400}, + {BITCLEAR, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 800}, + {BITSET, PAL_PORT_BIT(GPIOC_LED)}, + {SLEEP, 200}, + {GOTO, 0} +}; + +/* + * Sequencer thread class. It can drive LEDs or other output pins. + * Any sequencer is just an instance of this class, all the details are + * totally encapsulated and hidden to the application level. + */ +class SequencerThread : public EnhancedThread<128> { +private: + const seqop_t *base, *curr; // Thread local variables. + +protected: + virtual msg_t Main(void) { + while (true) { + switch(curr->action) { + case SLEEP: + Sleep(curr->value); + break; + case GOTO: + curr = &base[curr->value]; + continue; + case STOP: + return 0; + case BITCLEAR: + palClearPort(GPIOC, curr->value); + break; + case BITSET: + palSetPort(GPIOC, curr->value); + break; + } + curr++; + } + } + +public: + SequencerThread(const seqop_t *sequence) : EnhancedThread<128>("sequencer") { + + base = curr = sequence; + } +}; + +/* + * Tester thread class. This thread executes the test suite. + */ +class TesterThread : public EnhancedThread<128> { + +protected: + virtual msg_t Main(void) { + + return TestThread(&SD2); + } + +public: + TesterThread(void) : EnhancedThread<128>("tester") { + } +}; + +/* + * Executed as an event handler at 500mS intervals. + */ +static void TimerHandler(eventid_t id) { + + (void)id; + if (palReadPad(GPIOA, GPIOA_BUTTON)) { + TesterThread tester; + tester.Wait(); + }; +} + +/* + * Application entry point. + */ +int main(void) { + static const evhandler_t evhndl[] = { + TimerHandler + }; + static EvTimer evt; + struct EventListener el0; + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + System::Init(); + + /* + * Activates the serial driver 2 using the driver default configuration. + */ + sdStart(&SD2, NULL); + + evtInit(&evt, 500); // Initializes an event timer. + evtStart(&evt); // Starts the event timer. + chEvtRegister(&evt.et_es, &el0, 0); // Registers a listener on the source. + + /* + * Starts several instances of the SequencerThread class, each one operating + * on a different LED. + */ + SequencerThread blinker1(LED1_sequence); + + /* + * Serves timer events. + */ + while (true) + Event::Dispatch(evhndl, Event::WaitOne(ALL_EVENTS)); + + return 0; +} diff --git a/demos/ARMCM3-STM32F103-G++/mcuconf.h b/demos/ARMCM3-STM32F103-G++/mcuconf.h new file mode 100644 index 000000000..93bae3aea --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/mcuconf.h @@ -0,0 +1,154 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED TRUE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103-G++/readme.txt b/demos/ARMCM3-STM32F103-G++/readme.txt new file mode 100644 index 000000000..e14bc600f --- /dev/null +++ b/demos/ARMCM3-STM32F103-G++/readme.txt @@ -0,0 +1,28 @@ +***************************************************************************** +** ChibiOS/RT port for ARM-Cortex-M3 STM32F103. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an Olimex STM32-P103 board. + +** The Demo ** + +The demo flashes the board LED using a thread, by pressing the button located +on the board the test procedure is activated with output on the serial port +SD2 (USART2). + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com diff --git a/demos/ARMCM3-STM32F103/main.c b/demos/ARMCM3-STM32F103/main.c index d694a1cd1..d16bea6ab 100644 --- a/demos/ARMCM3-STM32F103/main.c +++ b/demos/ARMCM3-STM32F103/main.c @@ -30,9 +30,9 @@ static msg_t Thread1(void *arg) { (void)arg; while (TRUE) { - palClearPad(IOPORT3, GPIOC_LED); + palClearPad(GPIOC, GPIOC_LED); chThdSleepMilliseconds(500); - palSetPad(IOPORT3, GPIOC_LED); + palSetPad(GPIOC, GPIOC_LED); chThdSleepMilliseconds(500); } } @@ -67,7 +67,7 @@ int main(void) { * sleeping in a loop and check the button state. */ while (TRUE) { - if (palReadPad(IOPORT1, GPIOA_BUTTON)) + if (palReadPad(GPIOA, GPIOA_BUTTON)) TestThread(&SD2); chThdSleepMilliseconds(500); } diff --git a/os/various/ch.cpp b/os/various/ch.cpp index 4c21904cb..2b23768d7 100644 --- a/os/various/ch.cpp +++ b/os/various/ch.cpp @@ -131,19 +131,19 @@ namespace chibios_rt { return chMsgSend(thread_ref, msg); } - msg_t BaseThread::WaitMessage(void) { + Thread *BaseThread::WaitMessage(void) { return chMsgWait(); } - msg_t BaseThread::GetMessage(void) { + msg_t BaseThread::GetMessage(Thread* tp) { - return chMsgGet(); + return chMsgGet(tp); } - void BaseThread::ReleaseMessage(msg_t msg) { + void BaseThread::ReleaseMessage(Thread* tp, msg_t msg) { - chMsgRelease(msg); + chMsgRelease(tp, msg); } bool BaseThread::IsPendingMessage(void) { diff --git a/os/various/ch.hpp b/os/various/ch.hpp index 487f03e75..d48dc30fe 100644 --- a/os/various/ch.hpp +++ b/os/various/ch.hpp @@ -198,26 +198,27 @@ namespace chibios_rt { msg_t SendMessage(msg_t msg); /** - * @brief Waits for a message and returns it. + * @brief Waits for a message. * - * @return The incoming message. + * @return The sebder thread. */ - static msg_t WaitMessage(void); + static Thread *WaitMessage(void); /** * @brief Returns an enqueued message or @p NULL. * + * @param[in] tp the sender thread * @return The incoming message. - * @retval NULL No incoming message. */ - static msg_t GetMessage(void); + static msg_t GetMessage(Thread* tp); /** * @brief Releases the next message in queue with a reply. * + * @param[in] tp the sender thread * @param[in] msg the answer message */ - static void ReleaseMessage(msg_t msg); + static void ReleaseMessage(Thread* tp, msg_t msg); /** * @brief Returns true if there is at least one message in queue. diff --git a/readme.txt b/readme.txt index 700da01d1..f57f3d247 100644 --- a/readme.txt +++ b/readme.txt @@ -78,6 +78,7 @@ - NEW: Now it is possible to share DMA channels in the STM32 HAL thanks to a centralized manager. Channels are allocated when the driver is started and released when it is stopped. +- NEW: Added an STM32 C++ demo for the GNU compiler. - OPT: STM32 PWM driver implementation simplified. - CHANGE: Now pwmChangePeriod() does not implicitly disable the active PWM channels. -- cgit v1.2.3 From aeed6d78c11a287f010a55b58bb640f5b54d6254 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 16 Apr 2011 09:27:46 +0000 Subject: Fixed bug 3288149. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2881 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/adc.h | 2 ++ readme.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h index 1e3f6edc7..a236a040a 100644 --- a/os/hal/include/adc.h +++ b/os/hal/include/adc.h @@ -205,6 +205,8 @@ typedef enum { if ((adcp)->state == ADC_COMPLETE) \ (adcp)->state = ADC_READY; \ } \ + else \ + (adcp)->state = ADC_READY; \ (adcp)->grpp = NULL; \ _adc_wakeup_isr(adcp); \ } \ diff --git a/readme.txt b/readme.txt index f57f3d247..0f5c72a30 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed missing state transition in ADC driver (bug 3288149)(backported + to 2.2.4). - FIX: Fixed missing state transition in SPI driver (bug 3288112)(backported to 2.2.4). - FIX: Fixed spurious characters generated by Serial over USB driver (bug -- cgit v1.2.3 From 6a57dd25e08f1a7164542751024429be814df5e3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 17 Apr 2011 13:55:31 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2883 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103/ch.ld | 66 ++++++++++++++++++++------------- os/ports/GCC/ARMCMx/STM32/port.mk | 5 ++- os/ports/GCC/ARMCMx/crt0.c | 77 +++++++++++++++++++-------------------- readme.txt | 3 ++ 4 files changed, 85 insertions(+), 66 deletions(-) diff --git a/demos/ARMCM3-STM32F103/ch.ld b/demos/ARMCM3-STM32F103/ch.ld index ae79ddd40..4d97e7682 100644 --- a/demos/ARMCM3-STM32F103/ch.ld +++ b/demos/ARMCM3-STM32F103/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/os/ports/GCC/ARMCMx/STM32/port.mk b/os/ports/GCC/ARMCMx/STM32/port.mk index 80764b3d9..104b22e42 100644 --- a/os/ports/GCC/ARMCMx/STM32/port.mk +++ b/os/ports/GCC/ARMCMx/STM32/port.mk @@ -1,10 +1,11 @@ # List of the ChibiOS/RT Cortex-M3 STM32 port files. -PORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/vectors.c \ +PORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/crt0.c \ + $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/vectors.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore_v7m.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/nvic.c -PORTASM = ${CHIBIOS}/os/ports/GCC/ARMCMx/crt0_v7m.s +PORTASM = PORTINC = ${CHIBIOS}/os/ports/GCC/ARMCMx \ ${CHIBIOS}/os/ports/GCC/ARMCMx/STM32 diff --git a/os/ports/GCC/ARMCMx/crt0.c b/os/ports/GCC/ARMCMx/crt0.c index a51f4dbfe..90f632271 100644 --- a/os/ports/GCC/ARMCMx/crt0.c +++ b/os/ports/GCC/ARMCMx/crt0.c @@ -27,6 +27,12 @@ #include "chtypes.h" +#define FALSE 0 +#define TRUE (!FALSE) + +typedef void (*funcp_t)(void); +typedef funcp_t * funcpp_t; + /** * @brief Control special register initialization value. * @details The system is setup to run in privileged mode using the PSP @@ -124,36 +130,33 @@ extern uint32_t _bss_end; * @brief Constructors table start. * @pre The symbol must be aligned to a 32 bits boundary. */ -extern void __init_array_start(void); +extern funcp_t __init_array_start; /** * @brief Constructors table end. * @pre The symbol must be aligned to a 32 bits boundary. */ -extern void __init_array_end(void); +extern funcp_t __init_array_end; /** * @brief Destructors table start. * @pre The symbol must be aligned to a 32 bits boundary. */ -extern void __fini_array_start(void); +extern funcp_t __fini_array_start; /** * @brief Destructors table end. * @pre The symbol must be aligned to a 32 bits boundary. */ -extern void __fini_array_end(void); +extern funcp_t __fini_array_end; /** * @brief Application @p main() function. - * - * @param[in] argc Number of arguments, always zero. - * @param[in] argv Pointer to an array of arguments, always @p NULL. */ -extern void main(int argc, char **argv); +extern void main(void); /** - * @brief Default initialization hook 0. + * @brief Early initialization. * @details This hook is invoked immediately after the stack initialization * and before the DATA and BSS segments initialization. The * default behavior is to do nothing. @@ -162,19 +165,19 @@ extern void main(int argc, char **argv); #if !defined(__DOXYGEN__) __attribute__((weak)) #endif -void hwinit0(void) {} +void __early_init(void) {} /** - * @brief Default initialization hook 1. - * @details This hook is invoked immediately after the DATA and BSS segments - * initialization and before entering the @p main() function. The + * @brief Late initialization. + * @details This hook is invoked after the DATA and BSS segments + * initialization and before any static constructor. The * default behavior is to do nothing. * @note This function is a weak symbol. */ #if !defined(__DOXYGEN__) __attribute__((weak)) #endif -void hwinit1(void) {} +void __late_init(void) {} /** * @brief Default @p main() function exit handler. @@ -183,9 +186,9 @@ void hwinit1(void) {} * @note This function is a weak symbol. */ #if !defined(__DOXYGEN__) -__attribute__((weak, naked)) +__attribute__((weak, noreturn)) #endif -void _main_exit_handler(void) { +void _default_exit(void) { while (1) ; } @@ -194,24 +197,24 @@ void _main_exit_handler(void) { * @brief Reset vector. */ #if !defined(__DOXYGEN__) -__attribute__((naked)) +__attribute__((noreturn)) #endif void ResetHandler(void) { - uint32_t sz, ctl; + uint32_t psp, ctl; /* Process Stack initialization, it is allocated below the main stack. The main stack is assumed to be allocated starting from @p __ram_end__ extending downward.*/ asm volatile ("cpsid i"); - sz = SYMVAL(__ram_end__) - SYMVAL(__main_stack_size__); - asm volatile ("msr PSP, %0" : : "r" (sz)); + psp = SYMVAL(__ram_end__) - SYMVAL(__main_stack_size__); + asm volatile ("msr PSP, %0" : : "r" (psp)); ctl = CRT0_CONTROL_INIT; asm volatile ("msr CONTROL, %0" : : "r" (ctl)); asm volatile ("isb"); - /* Initialization hook 0 invocation.*/ - hwinit0(); + /* Early initialization hook invocation.*/ + __early_init(); #if CRT0_INIT_DATA /* DATA segment initialization.*/ @@ -236,40 +239,36 @@ void ResetHandler(void) { } #endif - /* Initialization hook 1 invocation.*/ - hwinit1(); + /* Late initialization hook invocation.*/ + __late_init(); #if CRT0_CALL_CONSTRUCTORS /* Constructors invocation.*/ { - void (*dpp)(void); - - dpp = &__init_array_start; - while (dpp < &__init_array_end) { - (*dpp)(); - dpp++; + funcpp_t fpp = &__init_array_start; + while (fpp < &__init_array_end) { + (*fpp)(); + fpp++; } } #endif /* Invoking application main() function.*/ - main(0, 0); + main(); #if CRT0_CALL_DESTRUCTORS /* Destructors invocation.*/ { - void (*dpp)(void); - - dpp = &__fini_array_start; - while (dpp < &__fini_array_end) { - (*dpp)(); - dpp++; + funcpp_t fpp = &__fini_array_start; + while (fpp < &__fini_array_end) { + (*fpp)(); + fpp++; } } #endif - /* Invoking the main() exit handler.*/ - asm volatile ("b _main_exit_handler"); + /* Invoking the exit handler.*/ + _default_exit(); } /** @} */ diff --git a/readme.txt b/readme.txt index 0f5c72a30..f9bde293c 100644 --- a/readme.txt +++ b/readme.txt @@ -77,6 +77,9 @@ to 2.2.4). - FIX: Fixed spurious characters generated by Serial over USB driver (bug 3276379). +- NEW: New unified GCC startup file for Cortex-Mx processors, it is written + in C instead of asm and supports constructors/destructors. Improved the + Cortex-Mx linker scripts in all the GCC demos. - NEW: Now it is possible to share DMA channels in the STM32 HAL thanks to a centralized manager. Channels are allocated when the driver is started and released when it is stopped. -- cgit v1.2.3 From d43e444377e2f1e0db7ed93116e79c58c1520db7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 17 Apr 2011 14:41:19 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2884 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103-G++/Makefile | 4 +-- demos/ARMCM3-STM32F103-G++/ch.ld | 68 ++++++++++++++++++++++--------------- demos/ARMCM3-STM32F103-G++/main.cpp | 4 +-- os/ports/GCC/ARMCMx/crt0.c | 4 +-- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/demos/ARMCM3-STM32F103-G++/Makefile b/demos/ARMCM3-STM32F103-G++/Makefile index 96ba1f7cd..9dba58699 100644 --- a/demos/ARMCM3-STM32F103-G++/Makefile +++ b/demos/ARMCM3-STM32F103-G++/Makefile @@ -123,8 +123,8 @@ CPPC = $(TRGT)g++ # Enable loading with g++ only if you need C++ runtime support. # NOTE: You can use C++ even without C++ support if you are careful. C++ # runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ +#LD = $(TRGT)gcc +LD = $(TRGT)g++ CP = $(TRGT)objcopy AS = $(TRGT)gcc -x assembler-with-cpp OD = $(TRGT)objdump diff --git a/demos/ARMCM3-STM32F103-G++/ch.ld b/demos/ARMCM3-STM32F103-G++/ch.ld index e378d8868..4d97e7682 100644 --- a/demos/ARMCM3-STM32F103-G++/ch.ld +++ b/demos/ARMCM3-STM32F103-G++/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -50,35 +71,28 @@ SECTIONS *(.glue_7t) *(.glue_7) *(.gcc*) - *(.ARM.extab) - *(.ARM.extab.*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -86,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/demos/ARMCM3-STM32F103-G++/main.cpp b/demos/ARMCM3-STM32F103-G++/main.cpp index ce626ee9c..aab7331fc 100644 --- a/demos/ARMCM3-STM32F103-G++/main.cpp +++ b/demos/ARMCM3-STM32F103-G++/main.cpp @@ -106,7 +106,7 @@ public: /* * Tester thread class. This thread executes the test suite. */ -class TesterThread : public EnhancedThread<128> { +class TesterThread : public EnhancedThread<256> { protected: virtual msg_t Main(void) { @@ -115,7 +115,7 @@ protected: } public: - TesterThread(void) : EnhancedThread<128>("tester") { + TesterThread(void) : EnhancedThread<256>("tester") { } }; diff --git a/os/ports/GCC/ARMCMx/crt0.c b/os/ports/GCC/ARMCMx/crt0.c index 90f632271..685231ed1 100644 --- a/os/ports/GCC/ARMCMx/crt0.c +++ b/os/ports/GCC/ARMCMx/crt0.c @@ -186,7 +186,7 @@ void __late_init(void) {} * @note This function is a weak symbol. */ #if !defined(__DOXYGEN__) -__attribute__((weak, noreturn)) +__attribute__((weak, naked)) #endif void _default_exit(void) { while (1) @@ -197,7 +197,7 @@ void _default_exit(void) { * @brief Reset vector. */ #if !defined(__DOXYGEN__) -__attribute__((noreturn)) +__attribute__((naked)) #endif void ResetHandler(void) { uint32_t psp, ctl; -- cgit v1.2.3 From c878b791ebb49dc5fca876ec3b53dfaeb38b016d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 17 Apr 2011 16:46:51 +0000 Subject: Cortex-Mx linker scripts updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2885 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld | 66 +++++++++++++++++++++------------- demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld | 66 +++++++++++++++++++++------------- demos/ARMCM3-STM32F100-DISCOVERY/ch.ld | 66 +++++++++++++++++++++------------- demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld | 66 +++++++++++++++++++++------------- demos/ARMCM3-STM32F107/ch.ld | 66 +++++++++++++++++++++------------- testhal/LPC11xx/IRQ_STORM/ch.ld | 66 +++++++++++++++++++++------------- testhal/LPC13xx/IRQ_STORM/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/ADC/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/CAN/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/GPT/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/IRQ_STORM/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/PWM-ICU/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/SPI/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/UART/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/USB_CDC/ch.ld | 66 +++++++++++++++++++++------------- testhal/STM32/USB_MSC/ch.ld | 66 +++++++++++++++++++++------------- 16 files changed, 656 insertions(+), 400 deletions(-) diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld b/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld index de2e1862e..cfc5ff3b6 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld b/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld index 781ec9435..703f09ca4 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld b/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld index 253a71c1a..83ea62bd5 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld +++ b/demos/ARMCM3-STM32F100-DISCOVERY/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld b/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld index ae79ddd40..4d97e7682 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/demos/ARMCM3-STM32F107/ch.ld b/demos/ARMCM3-STM32F107/ch.ld index d871c1039..1381b8b1c 100644 --- a/demos/ARMCM3-STM32F107/ch.ld +++ b/demos/ARMCM3-STM32F107/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/LPC11xx/IRQ_STORM/ch.ld b/testhal/LPC11xx/IRQ_STORM/ch.ld index de2e1862e..cfc5ff3b6 100644 --- a/testhal/LPC11xx/IRQ_STORM/ch.ld +++ b/testhal/LPC11xx/IRQ_STORM/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/LPC13xx/IRQ_STORM/ch.ld b/testhal/LPC13xx/IRQ_STORM/ch.ld index 781ec9435..703f09ca4 100644 --- a/testhal/LPC13xx/IRQ_STORM/ch.ld +++ b/testhal/LPC13xx/IRQ_STORM/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/ADC/ch.ld b/testhal/STM32/ADC/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/ADC/ch.ld +++ b/testhal/STM32/ADC/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/CAN/ch.ld b/testhal/STM32/CAN/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/CAN/ch.ld +++ b/testhal/STM32/CAN/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/GPT/ch.ld b/testhal/STM32/GPT/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/GPT/ch.ld +++ b/testhal/STM32/GPT/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/IRQ_STORM/ch.ld b/testhal/STM32/IRQ_STORM/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/IRQ_STORM/ch.ld +++ b/testhal/STM32/IRQ_STORM/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/PWM-ICU/ch.ld b/testhal/STM32/PWM-ICU/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/PWM-ICU/ch.ld +++ b/testhal/STM32/PWM-ICU/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/SPI/ch.ld b/testhal/STM32/SPI/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/SPI/ch.ld +++ b/testhal/STM32/SPI/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/UART/ch.ld b/testhal/STM32/UART/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/UART/ch.ld +++ b/testhal/STM32/UART/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/USB_CDC/ch.ld b/testhal/STM32/USB_CDC/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/USB_CDC/ch.ld +++ b/testhal/STM32/USB_CDC/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } diff --git a/testhal/STM32/USB_MSC/ch.ld b/testhal/STM32/USB_MSC/ch.ld index ae79ddd40..4d97e7682 100644 --- a/testhal/STM32/USB_MSC/ch.ld +++ b/testhal/STM32/USB_MSC/ch.ld @@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__; SECTIONS { . = 0; + _text = .; - .text : ALIGN(16) SUBALIGN(16) + startup : ALIGN(16) SUBALIGN(16) { - _text = .; KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) *(.text) *(.text.*) *(.rodata) @@ -52,31 +73,26 @@ SECTIONS *(.gcc*) } > flash - .ctors : + .ARM.extab : { - PROVIDE(_ctors_start_ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(_ctors_end_ = .); + *(.ARM.extab* .gnu.linkonce.armextab.*) } > flash - .dtors : + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : { - PROVIDE(_dtors_start_ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(_dtors_end_ = .); + *(.eh_frame_hdr) } > flash - .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} - - __exidx_start = .; - .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash - __exidx_end = .; - - .eh_frame_hdr : {*(.eh_frame_hdr)} - - .eh_frame : ONLY_IF_RO {*(.eh_frame)} + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash . = ALIGN(4); _etext = .; @@ -84,26 +100,26 @@ SECTIONS .data : { - _data = .; + PROVIDE(_data = .); *(.data) . = ALIGN(4); *(.data.*) . = ALIGN(4); *(.ramtext) . = ALIGN(4); - _edata = .; + PROVIDE(_edata = .); } > ram AT > flash .bss : { - _bss_start = .; + PROVIDE(_bss_start = .); *(.bss) . = ALIGN(4); *(.bss.*) . = ALIGN(4); *(COMMON) . = ALIGN(4); - _bss_end = .; + PROVIDE(_bss_end = .); } > ram } -- cgit v1.2.3 From 1fcdf9b0f78be59eb18b5d0f3d285229bb665fbe Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 17 Apr 2011 18:29:20 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2886 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/LPC11xx/port.mk | 5 +++-- os/ports/GCC/ARMCMx/LPC13xx/port.mk | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/os/ports/GCC/ARMCMx/LPC11xx/port.mk b/os/ports/GCC/ARMCMx/LPC11xx/port.mk index 886add45d..a38729958 100644 --- a/os/ports/GCC/ARMCMx/LPC11xx/port.mk +++ b/os/ports/GCC/ARMCMx/LPC11xx/port.mk @@ -1,10 +1,11 @@ # List of the ChibiOS/RT Cortex-M0 LPC11xx port files. -PORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC11xx/vectors.c \ +PORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/crt0.c \ + $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC11xx/vectors.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore_v6m.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/nvic.c -PORTASM = ${CHIBIOS}/os/ports/GCC/ARMCMx/crt0_v6m.s +PORTASM = PORTINC = ${CHIBIOS}/os/ports/GCC/ARMCMx \ ${CHIBIOS}/os/ports/GCC/ARMCMx/LPC11xx diff --git a/os/ports/GCC/ARMCMx/LPC13xx/port.mk b/os/ports/GCC/ARMCMx/LPC13xx/port.mk index 3ab940082..d87487e54 100644 --- a/os/ports/GCC/ARMCMx/LPC13xx/port.mk +++ b/os/ports/GCC/ARMCMx/LPC13xx/port.mk @@ -1,10 +1,11 @@ # List of the ChibiOS/RT Cortex-M0 LPC13xx port files. -PORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC13xx/vectors.c \ +PORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/crt0.c \ + $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC13xx/vectors.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore_v7m.c \ ${CHIBIOS}/os/ports/GCC/ARMCMx/nvic.c -PORTASM = ${CHIBIOS}/os/ports/GCC/ARMCMx/crt0_v7m.s +PORTASM = PORTINC = ${CHIBIOS}/os/ports/GCC/ARMCMx \ ${CHIBIOS}/os/ports/GCC/ARMCMx/LPC13xx -- cgit v1.2.3 From 1a8c09bec544aba17d17c407741a20eee94f27a7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 07:59:54 +0000 Subject: Added STM3210E-EVAL board support files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2887 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/ST_STM3210E_EVAL/board.c | 57 +++++++++ boards/ST_STM3210E_EVAL/board.h | 252 +++++++++++++++++++++++++++++++++++++++ boards/ST_STM3210E_EVAL/board.mk | 5 + 3 files changed, 314 insertions(+) create mode 100644 boards/ST_STM3210E_EVAL/board.c create mode 100644 boards/ST_STM3210E_EVAL/board.h create mode 100644 boards/ST_STM3210E_EVAL/board.mk diff --git a/boards/ST_STM3210E_EVAL/board.c b/boards/ST_STM3210E_EVAL/board.c new file mode 100644 index 000000000..a5f4e5b48 --- /dev/null +++ b/boards/ST_STM3210E_EVAL/board.c @@ -0,0 +1,57 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, + {VAL_GPIOFODR, VAL_GPIOFCRL, VAL_GPIOFCRH}, + {VAL_GPIOGODR, VAL_GPIOGCRL, VAL_GPIOGCRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + +} diff --git a/boards/ST_STM3210E_EVAL/board.h b/boards/ST_STM3210E_EVAL/board.h new file mode 100644 index 000000000..9d4c237c7 --- /dev/null +++ b/boards/ST_STM3210E_EVAL/board.h @@ -0,0 +1,252 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for the STMicroelectronics STM3210E-EVAL evaluation board. + */ + +/* + * Board identifier. + */ +#define BOARD_OLIMEX_STM32_P107 +#define BOARD_NAME "ST STM3210E-EVAL" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F10X_HD + +/* + * IO pins assignments. + */ +#define GPIOA_WAKEUP_BUTTON 0 + +#define GPIOB_SC_3V_5V 0 +#define GPIOB_SPI1_CS 2 +#define GPIOB_TEMP_INT 5 +#define GPIOB_USB_DISC 14 + +#define GPIOC_SC_CMDVCC 6 +#define GPIOC_SC_OFF 7 +#define GPIOC_TAMPER_BUTTON 13 + +#define GPIOD_JOY_DOWN 3 + +#define GPIOF_LED1 6 +#define GPIOF_LED2 7 +#define GPIOF_LED3 8 +#define GPIOF_LED4 9 +#define GPIOF_SD_DETECT 11 + +#define GPIOG_JOY_SEL 7 +#define GPIOC_USER_BUTTON 8 +#define GPIOG_JOY_RIGHT 13 +#define GPIOG_JOY_LEFT 14 +#define GPIOG_JOY_UP 15 + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_ANALOG(n) (0 << (((n) & 7) * 4)) +#define PIN_OUTPUT_PP_10(n) (1 << (((n) & 7) * 4)) +#define PIN_OUTPUT_PP_2(n) (2 << (((n) & 7) * 4)) +#define PIN_OUTPUT_PP_50(n) (3 << (((n) & 7) * 4)) +#define PIN_INPUT(n) (4 << (((n) & 7) * 4)) +#define PIN_OUTPUT_OD_10(n) (5 << (((n) & 7) * 4)) +#define PIN_OUTPUT_OD_2(n) (6 << (((n) & 7) * 4)) +#define PIN_OUTPUT_OD_50(n) (7 << (((n) & 7) * 4)) +#define PIN_INPUT_PUD(n) (8 << (((n) & 7) * 4)) +#define PIN_ALTERNATE_PP_10(n) (9 << (((n) & 7) * 4)) +#define PIN_ALTERNATE_PP_2(n) (10 << (((n) & 7) * 4)) +#define PIN_ALTERNATE_PP_50(n) (11 << (((n) & 7) * 4)) +#define PIN_ALTERNATE_OD_10(n) (13 << (((n) & 7) * 4)) +#define PIN_ALTERNATE_OD_2(n) (14 << (((n) & 7) * 4)) +#define PIN_ALTERNATE_OD_50(n) (15 << (((n) & 7) * 4)) +#define PIN_UNDEFINED(n) PIN_INPUT_PUD(n) + +/* + * Port A setup. + */ +#define VAL_GPIOACRL (PIN_INPUT(0) | /* Wakeup Button. */ \ + PIN_OUTPUT_PP_50(1) | /* USART2_RTS. */ \ + PIN_ALTERNATE_PP_50(2) | /* USART2_TX. */ \ + PIN_INPUT(3) | /* USART2_RX. */ \ + PIN_UNDEFINED(4) | \ + PIN_ALTERNATE_PP_50(5) | /* SPI1_SCK. */ \ + PIN_INPUT(6) | /* SPI1_MISO. */ \ + PIN_ALTERNATE_PP_50(7)) /* SPI1_MOSI. */ +#define VAL_GPIOACRH (PIN_ALTERNATE_PP_50(8) | /* MCO. */ \ + PIN_ALTERNATE_PP_50(9) | /* USART1_TX. */ \ + PIN_INPUT(10) | /* USART1_RX. */ \ + PIN_INPUT_PUD(11) | /* USB_DM. */ \ + PIN_INPUT_PUD(12) | /* USB_DP. */ \ + PIN_INPUT(13) | /* TMS. */ \ + PIN_INPUT(14) | /* TCK. */ \ + PIN_INPUT(15)) /* TDI. */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + */ +#define VAL_GPIOBCRL (PIN_OUTPUT_PP_50(0) | /* SmartCard_3/5V. */ \ \ + PIN_INPUT_PUD(1) | /* Unconnected. */ \ + PIN_OUTPUT_PP_50(2) | /* SPI1_CS. */ \ + PIN_INPUT(3) | /* TDO. */ \ + PIN_INPUT(4) | /* TRST. */ \ + PIN_INPUT_PUD(5) | /* Temp.Sensor INT. */ \ + PIN_ALTERNATE_OD_50(6) | /* I2C1_SCK. */ \ + PIN_ALTERNATE_OD_50(7)) /* I2C1_SDA. */ +#define VAL_GPIOBCRH (PIN_INPUT(8) | /* CAN_RX. */ \ + PIN_ALTERNATE_PP_50(9) | /* CAN_TX. */ \ + PIN_ALTERNATE_OD_50(10)| /* SmartCard IO. */ \ + PIN_OUTPUT_PP_50(11) | /* SmartCard RST. */ \ + PIN_ALTERNATE_PP_50(12)| /* SmartCard CLK. */ \ + PIN_UNDEFINED(13) | \ + PIN_OUTPUT_PP_50(14) | /* USB disconnect. */ \ + PIN_UNDEFINED(15)) +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + */ +#define VAL_GPIOCCRL (PIN_UNDEFINED(0)) | \ + PIN_UNDEFINED(1) | \ + PIN_UNDEFINED(2) | \ + PIN_UNDEFINED(3) | \ + PIN_ANALOG(4) | /* Potentiometer. */ \ + PIN_UNDEFINED(5) | \ + PIN_OUTPUT_PP_50(6) | /* SmartCard CMDVCC. */ \ + PIN_INPUT(7)) /* SmartCard OFF. */ +#define VAL_GPIOCCRH (PIN_ALTERNATE_PP_50(8) | /* SDIO D0. */ \ + PIN_ALTERNATE_PP_50(9) | /* SDIO D1. */ \ + PIN_ALTERNATE_PP_50(10)| /* SDIO D2. */ \ + PIN_ALTERNATE_PP_50(11)| /* SDIO D3. */ \ + PIN_ALTERNATE_PP_50(12)| /* SDIO CLK. */ \ + PIN_INPUT(13) | /* Tamper Button. */ \ + PIN_INPUT(14) | /* OSC IN. */ \ + PIN_INPUT(15)) /* OSC OUT. */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup + */ +#define VAL_GPIODCRL (PIN_ALTERNATE_PP_50(0) | /* FSMC_D2. */ \ + PIN_ALTERNATE_PP_50(1) | /* FSMC_D3. */ \ + PIN_ALTERNATE_PP_50(2) | /* SDIO CMD. */ \ + PIN_INPUT(3) | /* Joy Down. */ \ + PIN_ALTERNATE_PP_50(4) | /* FSMC_NOE. */ \ + PIN_ALTERNATE_PP_50(5) | /* FSMC_NWE. */ \ + PIN_INPUT(6) | /* FSMC_NWAIT. */ \ + PIN_ALTERNATE_PP_50(7)) /* FSMC_NCE2. */ +#define VAL_GPIODCRH (PIN_ALTERNATE_PP_50(8) | /* FSMC_D13. */ \ + PIN_ALTERNATE_PP_50(9) | /* FSMC_D14. */ \ + PIN_ALTERNATE_PP_50(10)| /* FSMC_D15. */ \ + PIN_ALTERNATE_PP_50(11)| /* FSMC_A16. */ \ + PIN_ALTERNATE_PP_50(12)| /* FSMC_A17. */ \ + PIN_ALTERNATE_PP_50(13)| /* FSMC_A18. */ \ + PIN_ALTERNATE_PP_50(14)| /* FSMC_D0. */ \ + PIN_ALTERNATE_PP_50(15)) /* FSMC_D1. */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + */ +#define VAL_GPIOECRL (PIN_ALTERNATE_PP_50(0) | /* FSMC_NBL0. */ \ + PIN_ALTERNATE_PP_50(1) | /* FSMC_NBL1. */ \ + PIN_ALTERNATE_PP_50(2) | /* FSMC_A23. */ \ + PIN_ALTERNATE_PP_50(3) | /* FSMC_A19. */ \ + PIN_ALTERNATE_PP_50(4) | /* FSMC_A20. */ \ + PIN_ALTERNATE_PP_50(5) | /* FSMC_A21. */ \ + PIN_ALTERNATE_PP_50(6) | /* FSMC_A22. */ \ + PIN_ALTERNATE_PP_50(7)) /* FSMC_D4. */ +#define VAL_GPIOECRH (PIN_ALTERNATE_PP_50(8) | /* FSMC_D5. */ \ + PIN_ALTERNATE_PP_50(9) | /* FSMC_D6. */ \ + PIN_ALTERNATE_PP_50(10)| /* FSMC_D7. */ \ + PIN_ALTERNATE_PP_50(11)| /* FSMC_D8. */ \ + PIN_ALTERNATE_PP_50(12)| /* FSMC_D9. */ \ + PIN_ALTERNATE_PP_50(13)| /* FSMC_D10. */ \ + PIN_ALTERNATE_PP_50(14)| /* FSMC_D11. */ \ + PIN_ALTERNATE_PP_50(15)) /* FSMC_D12. */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * Port F setup. + */ +#define VAL_GPIOFCRL (PIN_ALTERNATE_PP_50(0) | /* FSMC_A0. */ \ + PIN_ALTERNATE_PP_50(1) | /* FSMC_A1. */ \ + PIN_ALTERNATE_PP_50(2) | /* FSMC_A2. */ \ + PIN_ALTERNATE_PP_50(3) | /* FSMC_A3. */ \ + PIN_ALTERNATE_PP_50(4) | /* FSMC_A4. */ \ + PIN_ALTERNATE_PP_50(5) | /* FSMC_A5. */ \ + PIN_OUTPUT_PP_50(6) | /* LED1. */ \ + PIN_OUTPUT_PP_50(7)) /* LED2. */ +#define VAL_GPIOFCRH (PIN_OUTPUT_PP_50(8) | /* LED3. */ \ + PIN_OUTPUT_PP_50(9) | /* LED4. */ \ + PIN_UNDEFINED(10) | \ + PIN_INPUT_PUD(11) | /* SDCard detect. */ \ + PIN_ALTERNATE_PP_50(12)| /* FSMC_A6. */ \ + PIN_ALTERNATE_PP_50(13)| /* FSMC_A7. */ \ + PIN_ALTERNATE_PP_50(14)| /* FSMC_A8. */ \ + PIN_ALTERNATE_PP_50(15)) /* FSMC_A9. */ +#define VAL_GPIOFODR 0xFFFFFC3F + +/* + * Port G setup. + */ +#define VAL_GPIOGCRL (PIN_ALTERNATE_PP_50(0) | /* FSMC_A10. */ \ + PIN_ALTERNATE_PP_50(1) | /* FSMC_A11. */ \ + PIN_ALTERNATE_PP_50(2) | /* FSMC_A12. */ \ + PIN_ALTERNATE_PP_50(3) | /* FSMC_A13. */ \ + PIN_ALTERNATE_PP_50(4) | /* FSMC_A14. */ \ + PIN_ALTERNATE_PP_50(5) | /* FSMC_A15. */ \ + PIN_INPUT(6) | /* FSMC_INT2. */ \ + PIN_INPUT(7)) /* Joy Select. */ +#define VAL_GPIOGCRH (PIN_INPUT(8) | /* User Button. */ \ + PIN_ALTERNATE_PP_50(9) | /* FSMC_NE2. */ \ + PIN_ALTERNATE_PP_50(10)| /* FSMC_NE3. */ \ + PIN_OUTPUT_PP_50(11) | /* Audio PDN. */ \ + PIN_ALTERNATE_PP_50(12)| /* FSMC_NE4. */ \ + PIN_INPUT(13) | /* Joy Right. */ \ + PIN_INPUT(14) | /* Joy Left. */ \ + PIN_INPUT(15) /* Joy Up. */ +#define VAL_GPIOGODR 0xFFFFF7FF + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/boards/ST_STM3210E_EVAL/board.mk b/boards/ST_STM3210E_EVAL/board.mk new file mode 100644 index 000000000..edd0baf21 --- /dev/null +++ b/boards/ST_STM3210E_EVAL/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = ${CHIBIOS}/boards/ST_STM3210E_EVAL/board.c + +# Required include directories +BOARDINC = ${CHIBIOS}/boards/ST_STM3210E_EVAL -- cgit v1.2.3 From 8e51a4e76af804a9dbb5f000f653df7cb471a260 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 08:41:42 +0000 Subject: Fixed bug 3291898. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2888 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/hal_lld.h | 2 +- readme.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/os/hal/platforms/STM32/hal_lld.h b/os/hal/platforms/STM32/hal_lld.h index 48669113d..c7b40c222 100644 --- a/os/hal/platforms/STM32/hal_lld.h +++ b/os/hal/platforms/STM32/hal_lld.h @@ -396,7 +396,7 @@ #define STM32_HAS_USB TRUE #define STM32_HAS_OTG1 FALSE -#elif defined(STM32F10X_XD) +#elif defined(STM32F10X_XL) /* * Capability flags for Performance Line eXtra Density devices. */ diff --git a/readme.txt b/readme.txt index f9bde293c..bfe752162 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed wrong macro check for STM32 XL devices (bug 3291898)(backported + to 2.2.4). - FIX: Fixed missing state transition in ADC driver (bug 3288149)(backported to 2.2.4). - FIX: Fixed missing state transition in SPI driver (bug 3288112)(backported -- cgit v1.2.3 From 476c5f0802791ee8e5a7292c1aef259e56e117b9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 08:46:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2890 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/ST_STM3210E_EVAL/board.h | 2 +- os/hal/platforms/STM32/hal_lld.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/ST_STM3210E_EVAL/board.h b/boards/ST_STM3210E_EVAL/board.h index 9d4c237c7..885459a74 100644 --- a/boards/ST_STM3210E_EVAL/board.h +++ b/boards/ST_STM3210E_EVAL/board.h @@ -40,7 +40,7 @@ /* * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. */ -#define STM32F10X_HD +#define STM32F10X_HL /* * IO pins assignments. diff --git a/os/hal/platforms/STM32/hal_lld.h b/os/hal/platforms/STM32/hal_lld.h index c7b40c222..b9c71dbbe 100644 --- a/os/hal/platforms/STM32/hal_lld.h +++ b/os/hal/platforms/STM32/hal_lld.h @@ -32,7 +32,7 @@ * - STM32F10X_LD for Performance Low Density devices. * - STM32F10X_MD for Performance Medium Density devices. * - STM32F10X_HD for Performance High Density devices. - * - STM32F10X_XD for Performance eXtra Density devices. + * - STM32F10X_XL for Performance eXtra Density devices. * - STM32F10X_CL for Connectivity Line devices. * . * -- cgit v1.2.3 From c73817447f025597bb38b4df2f606026a6de4009 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 11:42:06 +0000 Subject: More on bug 3291898. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2892 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/STM32/vectors.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/ports/GCC/ARMCMx/STM32/vectors.c b/os/ports/GCC/ARMCMx/STM32/vectors.c index 0995e21d1..f12e2e867 100644 --- a/os/ports/GCC/ARMCMx/STM32/vectors.c +++ b/os/ports/GCC/ARMCMx/STM32/vectors.c @@ -97,12 +97,13 @@ extern void VectorDC(void); extern void VectorE0(void); extern void VectorE4(void); extern void VectorE8(void); -#if defined(STM32F10X_MD_VL) || defined(STM32F10X_HD) || defined(STM32F10X_CL) +#if defined(STM32F10X_MD_VL) || defined(STM32F10X_HD) || \ + defined(STM32F10X_XL) || defined(STM32F10X_CL) extern void VectorEC(void); extern void VectorF0(void); extern void VectorF4(void); #endif -#if defined(STM32F10X_HD) || defined(STM32F10X_CL) +#if defined(STM32F10X_HD) || defined(STM32F10X_XL) || defined(STM32F10X_CL) extern void VectorF8(void); extern void VectorFC(void); extern void Vector100(void); -- cgit v1.2.3 From 001a994ff4d411f95bc1849bde82fc6c6767ca26 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 12:13:26 +0000 Subject: More on 3291898. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2894 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/hal_lld.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 784c159be..1c9714342 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -83,9 +83,10 @@ void hal_lld_init(void) { * * @special */ -#if defined(STM32F10X_LD) || defined(STM32F10X_MD) || \ - defined(STM32F10X_HD) || defined(STM32F10X_LD_VL) || \ - defined(STM32F10X_MD_VL) || defined(__DOXYGEN__) +#if defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) || \ + defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) || \ + defined(STM32F10X_HD) || defined(STM32F10X_XL) || \ + defined(STM32F10X_CL) || defined(__DOXYGEN__) /* * Clocks initialization for the LD, MD and HD sub-families. */ -- cgit v1.2.3 From 0f11c375d30dec535cabf59f906278be538540e1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 12:23:44 +0000 Subject: Added STM32F103ZG demo for STM3210E-EVAL board. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2896 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/ST_STM3210E_EVAL/board.h | 13 +- demos/ARMCM3-STM32F103ZG/Makefile | 204 +++++++++++++++ demos/ARMCM3-STM32F103ZG/ch.ld | 130 +++++++++ demos/ARMCM3-STM32F103ZG/chconf.h | 508 ++++++++++++++++++++++++++++++++++++ demos/ARMCM3-STM32F103ZG/halconf.h | 281 ++++++++++++++++++++ demos/ARMCM3-STM32F103ZG/main.c | 82 ++++++ demos/ARMCM3-STM32F103ZG/mcuconf.h | 154 +++++++++++ demos/ARMCM3-STM32F103ZG/readme.txt | 28 ++ readme.txt | 2 + 9 files changed, 1397 insertions(+), 5 deletions(-) create mode 100644 demos/ARMCM3-STM32F103ZG/Makefile create mode 100644 demos/ARMCM3-STM32F103ZG/ch.ld create mode 100644 demos/ARMCM3-STM32F103ZG/chconf.h create mode 100644 demos/ARMCM3-STM32F103ZG/halconf.h create mode 100644 demos/ARMCM3-STM32F103ZG/main.c create mode 100644 demos/ARMCM3-STM32F103ZG/mcuconf.h create mode 100644 demos/ARMCM3-STM32F103ZG/readme.txt diff --git a/boards/ST_STM3210E_EVAL/board.h b/boards/ST_STM3210E_EVAL/board.h index 885459a74..379f23ad1 100644 --- a/boards/ST_STM3210E_EVAL/board.h +++ b/boards/ST_STM3210E_EVAL/board.h @@ -39,8 +39,11 @@ /* * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + * Note: Older board revisions should define STM32F10X_HD instead, please + * verify the STM32 model mounted on your board. The change also + * affects your linker script. */ -#define STM32F10X_HL +#define STM32F10X_XL /* * IO pins assignments. @@ -65,7 +68,7 @@ #define GPIOF_SD_DETECT 11 #define GPIOG_JOY_SEL 7 -#define GPIOC_USER_BUTTON 8 +#define GPIOG_USER_BUTTON 8 #define GPIOG_JOY_RIGHT 13 #define GPIOG_JOY_LEFT 14 #define GPIOG_JOY_UP 15 @@ -116,7 +119,7 @@ /* * Port B setup. */ -#define VAL_GPIOBCRL (PIN_OUTPUT_PP_50(0) | /* SmartCard_3/5V. */ \ \ +#define VAL_GPIOBCRL (PIN_OUTPUT_PP_50(0) | /* SmartCard_3/5V. */ \ PIN_INPUT_PUD(1) | /* Unconnected. */ \ PIN_OUTPUT_PP_50(2) | /* SPI1_CS. */ \ PIN_INPUT(3) | /* TDO. */ \ @@ -137,7 +140,7 @@ /* * Port C setup. */ -#define VAL_GPIOCCRL (PIN_UNDEFINED(0)) | \ +#define VAL_GPIOCCRL (PIN_UNDEFINED(0) | \ PIN_UNDEFINED(1) | \ PIN_UNDEFINED(2) | \ PIN_UNDEFINED(3) | \ @@ -236,7 +239,7 @@ PIN_ALTERNATE_PP_50(12)| /* FSMC_NE4. */ \ PIN_INPUT(13) | /* Joy Right. */ \ PIN_INPUT(14) | /* Joy Left. */ \ - PIN_INPUT(15) /* Joy Up. */ + PIN_INPUT(15)) /* Joy Up. */ #define VAL_GPIOGODR 0xFFFFF7FF #if !defined(_FROM_ASM_) diff --git a/demos/ARMCM3-STM32F103ZG/Makefile b/demos/ARMCM3-STM32F103ZG/Makefile new file mode 100644 index 000000000..3c5bf32ec --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/Makefile @@ -0,0 +1,204 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../.. +include $(CHIBIOS)/boards/ST_STM3210E_EVAL/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F103ZG/ch.ld b/demos/ARMCM3-STM32F103ZG/ch.ld new file mode 100644 index 000000000..363ddce9f --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/ch.ld @@ -0,0 +1,130 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 1m + ram : org = 0x20000000, len = 96k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F103ZG/chconf.h b/demos/ARMCM3-STM32F103ZG/chconf.h new file mode 100644 index 000000000..04fa822cc --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/chconf.h @@ -0,0 +1,508 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h new file mode 100644 index 000000000..af5658566 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -0,0 +1,281 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103ZG/main.c b/demos/ARMCM3-STM32F103ZG/main.c new file mode 100644 index 000000000..7c66e1da4 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/main.c @@ -0,0 +1,82 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" +#include "test.h" + +/* + * Red LED blinker thread, times are in milliseconds. + */ +static WORKING_AREA(waThread1, 128); +static msg_t Thread1(void *arg) { + + (void)arg; + while (TRUE) { + palClearPad(GPIOF, GPIOF_LED4); + palSetPad(GPIOF, GPIOF_LED1); + chThdSleepMilliseconds(250); + palClearPad(GPIOF, GPIOF_LED1); + palSetPad(GPIOF, GPIOF_LED2); + chThdSleepMilliseconds(250); + palClearPad(GPIOF, GPIOF_LED2); + palSetPad(GPIOF, GPIOF_LED3); + chThdSleepMilliseconds(250); + palClearPad(GPIOF, GPIOF_LED3); + palSetPad(GPIOF, GPIOF_LED4); + chThdSleepMilliseconds(250); + } +} + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Activates the serial driver 1 using the driver default configuration. + */ + sdStart(&SD1, NULL); + + /* + * Creates the blinker thread. + */ + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + + /* + * Normal main() thread activity, in this demo it does nothing except + * sleeping in a loop and check the button state. + */ + while (TRUE) { + if (palReadPad(GPIOG, GPIOG_USER_BUTTON)) + TestThread(&SD1); + chThdSleepMilliseconds(500); + } +} diff --git a/demos/ARMCM3-STM32F103ZG/mcuconf.h b/demos/ARMCM3-STM32F103ZG/mcuconf.h new file mode 100644 index 000000000..87186fdaf --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/mcuconf.h @@ -0,0 +1,154 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED TRUE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 TRUE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103ZG/readme.txt b/demos/ARMCM3-STM32F103ZG/readme.txt new file mode 100644 index 000000000..f0e2fb1da --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG/readme.txt @@ -0,0 +1,28 @@ +***************************************************************************** +** ChibiOS/RT port for ARM-Cortex-M3 STM32F103ZG. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an STM3210E-EVAL board. + +** The Demo ** + +The demo flashes the board LEDs using a thread, by pressing the button located +on the board the test procedure is activated with output on the serial port +SD1 (USART1). + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com diff --git a/readme.txt b/readme.txt index bfe752162..45c099b6f 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,8 @@ to a centralized manager. Channels are allocated when the driver is started and released when it is stopped. - NEW: Added an STM32 C++ demo for the GNU compiler. +- NEW: Added an STM32F103ZG demo for the STM3210E-EVAL evaluation board. + - OPT: STM32 PWM driver implementation simplified. - CHANGE: Now pwmChangePeriod() does not implicitly disable the active PWM channels. -- cgit v1.2.3 From bdf2f3eff53f7e2c5117999f17ed16a3b826dcc7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 17:03:27 +0000 Subject: Tentative fix for bug 3288758 . git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2897 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/spi_lld.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index 690b1825e..e5f4ed6c5 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -237,9 +237,11 @@ void spi_lld_start(SPIDriver *spip) { DMA_CCR1_PSIZE_0; /* 16 bits transfers. */ /* SPI setup and enable.*/ - spip->spi->CR1 = 0; - spip->spi->CR2 = SPI_CR2_SSOE | SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN; - spip->spi->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SPE; + spip->spi->CR1 = 0; + spip->spi->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SSM | + SPI_CR1_SSI; + spip->spi->CR2 = SPI_CR2_SSOE | SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN; + spip->spi->CR1 |= SPI_CR1_SPE; } /** -- cgit v1.2.3 From 9a29560d71bec3998ce2720f1966ba111f7af43c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 17:20:08 +0000 Subject: Fixed bug 3292084. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2898 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/AVR/serial_lld.c | 2 +- readme.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/os/hal/platforms/AVR/serial_lld.c b/os/hal/platforms/AVR/serial_lld.c index bafca4537..a61d6b0c2 100644 --- a/os/hal/platforms/AVR/serial_lld.c +++ b/os/hal/platforms/AVR/serial_lld.c @@ -183,7 +183,7 @@ CH_IRQ_HANDLER(USART0_UDRE_vect) { CH_IRQ_PROLOGUE(); chSysLockFromIsr(); - b = sdRequestDataI(&SER1); + b = sdRequestDataI(&SD1); chSysUnlockFromIsr(); if (b < Q_OK) UCSR0B &= ~(1 << UDRIE); diff --git a/readme.txt b/readme.txt index 45c099b6f..6da9d5744 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed wrong identifier in AVR serial driver (bug 3292084)(backported + to 2.2.4). - FIX: Fixed wrong macro check for STM32 XL devices (bug 3291898)(backported to 2.2.4). - FIX: Fixed missing state transition in ADC driver (bug 3288149)(backported -- cgit v1.2.3 From dfc2c1e189dff36c57dfa521ac33289fe34972d2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 17:37:09 +0000 Subject: Updated all the HAL configuration files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2900 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7S-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 7 +++++++ demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-LPC214x-G++/halconf.h | 7 +++++++ demos/ARM7-LPC214x-GCC/halconf.h | 7 +++++++ demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 7 +++++++ demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 7 +++++++ demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103-G++/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103ZG/halconf.h | 7 +++++++ demos/ARMCM3-STM32F107/halconf.h | 7 +++++++ demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ demos/AVR-ATmega128-GCC/halconf.h | 7 +++++++ demos/MSP430-MSP430x1611-GCC/halconf.h | 7 +++++++ demos/PPC-SPC563-GCC/halconf.h | 7 +++++++ demos/Posix-GCC/halconf.h | 7 +++++++ demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 7 +++++++ demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 7 +++++++ demos/STM8S-STM8S208-RC/halconf.h | 7 +++++++ demos/Win32-MinGW/halconf.h | 7 +++++++ os/hal/templates/halconf.h | 7 +++++++ test/coverage/halconf.h | 7 +++++++ testhal/LPC11xx/IRQ_STORM/halconf.h | 7 +++++++ testhal/LPC13xx/IRQ_STORM/halconf.h | 7 +++++++ testhal/STM32/ADC/halconf.h | 7 +++++++ testhal/STM32/CAN/halconf.h | 7 +++++++ testhal/STM32/GPT/halconf.h | 7 +++++++ testhal/STM32/IRQ_STORM/halconf.h | 7 +++++++ testhal/STM32/PWM-ICU/halconf.h | 2 +- testhal/STM32/SPI/halconf.h | 7 +++++++ testhal/STM32/UART/halconf.h | 7 +++++++ testhal/STM32/USB_CDC/halconf.h | 7 +++++++ testhal/STM32/USB_MSC/halconf.h | 7 +++++++ testhal/STM8S/SPI/demo/halconf.h | 7 +++++++ 40 files changed, 274 insertions(+), 1 deletion(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index c48f97693..9f6a7ef60 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index c48f97693..9f6a7ef60 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 7bfe6a6c3..50ba3ae55 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index 7bfe6a6c3..50ba3ae55 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index c48f97693..9f6a7ef60 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 7c0d62de8..b5193b4db 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 7c0d62de8..b5193b4db 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index cccace57c..cea96035c 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index c48f97693..9f6a7ef60 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-STM32F103-G++/halconf.h b/demos/ARMCM3-STM32F103-G++/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARMCM3-STM32F103-G++/halconf.h +++ b/demos/ARMCM3-STM32F103-G++/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h index af5658566..ceadd748b 100644 --- a/demos/ARMCM3-STM32F107/halconf.h +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 3bfbca462..9c1d06fe3 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 3bfbca462..9c1d06fe3 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index af5658566..ceadd748b 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 36d1f3f08..44c442d15 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 34daac121..9f736e7dd 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index af5658566..ceadd748b 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index af5658566..ceadd748b 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index af5658566..ceadd748b 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 34daac121..9f736e7dd 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index e2dc4c85e..0f7d2cd9e 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index a06bfaa23..3f84017ff 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h index 88085ea45..0e01676fa 100644 --- a/testhal/LPC11xx/IRQ_STORM/halconf.h +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h index 88085ea45..0e01676fa 100644 --- a/testhal/LPC13xx/IRQ_STORM/halconf.h +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index aa76f8bd4..d51d4bf64 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 665572608..04c740c24 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h index f804593b0..a2439fda3 100644 --- a/testhal/STM32/GPT/halconf.h +++ b/testhal/STM32/GPT/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h index 88085ea45..0e01676fa 100644 --- a/testhal/STM32/IRQ_STORM/halconf.h +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/PWM-ICU/halconf.h b/testhal/STM32/PWM-ICU/halconf.h index 8d87b73cb..ce1d39cd7 100644 --- a/testhal/STM32/PWM-ICU/halconf.h +++ b/testhal/STM32/PWM-ICU/halconf.h @@ -70,7 +70,7 @@ #endif /** - * @brief Enables the I2C subsystem. + * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) #define HAL_USE_ICU TRUE diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index b5bf99b30..2336c1647 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index 58e578f74..58a7acbcb 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 91ea7a5f2..3c22a95fe 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h index 523c1ad6a..cfec30ee7 100644 --- a/testhal/STM32/USB_MSC/halconf.h +++ b/testhal/STM32/USB_MSC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index b5bf99b30..2336c1647 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ -- cgit v1.2.3 From ccbfd6ecc058ba55899bcaa9b360887a0330c1a5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 25 Apr 2011 12:41:47 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2901 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/hal.mk | 1 + os/hal/include/hal.h | 1 + os/hal/platforms/STM32/platform.mk | 1 + os/hal/platforms/STM32/stm32f10x.h | 485 +++++++++++++++++++++-------------- os/hal/src/hal.c | 3 + readme.txt | 2 + testhal/STM32/SDIO/.project | 85 +++++++ testhal/STM32/SDIO/Makefile | 204 +++++++++++++++ testhal/STM32/SDIO/ch.ld | 130 ++++++++++ testhal/STM32/SDIO/chconf.h | 508 +++++++++++++++++++++++++++++++++++++ testhal/STM32/SDIO/halconf.h | 295 +++++++++++++++++++++ testhal/STM32/SDIO/main.c | 57 +++++ testhal/STM32/SDIO/mcuconf.h | 154 +++++++++++ testhal/STM32/SDIO/readme.txt | 26 ++ 14 files changed, 1757 insertions(+), 195 deletions(-) create mode 100644 testhal/STM32/SDIO/.project create mode 100644 testhal/STM32/SDIO/Makefile create mode 100644 testhal/STM32/SDIO/ch.ld create mode 100644 testhal/STM32/SDIO/chconf.h create mode 100644 testhal/STM32/SDIO/halconf.h create mode 100644 testhal/STM32/SDIO/main.c create mode 100644 testhal/STM32/SDIO/mcuconf.h create mode 100644 testhal/STM32/SDIO/readme.txt diff --git a/os/hal/hal.mk b/os/hal/hal.mk index 52b9fab81..762bda57f 100644 --- a/os/hal/hal.mk +++ b/os/hal/hal.mk @@ -9,6 +9,7 @@ HALSRC = ${CHIBIOS}/os/hal/src/hal.c \ ${CHIBIOS}/os/hal/src/mac.c \ ${CHIBIOS}/os/hal/src/pal.c \ ${CHIBIOS}/os/hal/src/pwm.c \ + ${CHIBIOS}/os/hal/src/sdc.c \ ${CHIBIOS}/os/hal/src/serial.c \ ${CHIBIOS}/os/hal/src/spi.c \ ${CHIBIOS}/os/hal/src/uart.c \ diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h index 400aec17f..1ed893aab 100644 --- a/os/hal/include/hal.h +++ b/os/hal/include/hal.h @@ -43,6 +43,7 @@ #include "mac.h" #include "pwm.h" #include "serial.h" +#include "sdc.h" #include "spi.h" #include "uart.h" #include "usb.h" diff --git a/os/hal/platforms/STM32/platform.mk b/os/hal/platforms/STM32/platform.mk index 48e19ace6..f0aec9de6 100644 --- a/os/hal/platforms/STM32/platform.mk +++ b/os/hal/platforms/STM32/platform.mk @@ -6,6 +6,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32/hal_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/icu_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/pal_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/pwm_lld.c \ + ${CHIBIOS}/os/hal/platforms/STM32/sdc_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/serial_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/spi_lld.c \ ${CHIBIOS}/os/hal/platforms/STM32/uart_lld.c \ diff --git a/os/hal/platforms/STM32/stm32f10x.h b/os/hal/platforms/STM32/stm32f10x.h index a6f71cbdb..a187f0a84 100644 --- a/os/hal/platforms/STM32/stm32f10x.h +++ b/os/hal/platforms/STM32/stm32f10x.h @@ -2,14 +2,15 @@ ****************************************************************************** * @file stm32f10x.h * @author MCD Application Team - * @version V3.3.0 - * @date 04/16/2010 - * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File. - * This file contains all the peripheral register's definitions, bits - * definitions and memory mapping for STM32F10x Connectivity line, High - * density, Medium density, Medium density Value line, Low density - * and Low density Value line and XL-density devices. - ****************************************************************************** + * @version V3.4.0 + * @date 10/15/2010 + * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File. + * This file contains all the peripheral register's definitions, bits + * definitions and memory mapping for STM32F10x Connectivity line, + * High density, High density value line, Medium density, + * Medium density Value line, Low density, Low density Value line + * and XL-density devices. + ****************************************************************************** * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE @@ -29,77 +30,84 @@ /** @addtogroup stm32f10x * @{ */ - + #ifndef __STM32F10x_H #define __STM32F10x_H #ifdef __cplusplus extern "C" { -#endif - +#endif + /** @addtogroup Library_configuration_section * @{ */ - + /* Uncomment the line below according to the target STM32 device used in your - application + application */ -#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) +#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) /* #define STM32F10X_LD */ /*!< STM32F10X_LD: STM32 Low density devices */ - /* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */ + /* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */ /* #define STM32F10X_MD */ /*!< STM32F10X_MD: STM32 Medium density devices */ - /* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */ + /* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */ /* #define STM32F10X_HD */ /*!< STM32F10X_HD: STM32 High density devices */ - #define STM32F10X_XL /*!< STM32F10X_XL: STM32 XL-density devices */ + /* #define STM32F10X_HD_VL */ /*!< STM32F10X_HD_VL: STM32 High density value line devices */ + /* #define STM32F10X_XL */ /*!< STM32F10X_XL: STM32 XL-density devices */ /* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these devices, you can define the device in your toolchain compiler preprocessor. - - Low density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers + - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Low-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - - Medium density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers + - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. - - Medium-density value line devices are STM32F100xx microcontrollers where the - Flash memory density ranges between 64 and 128 Kbytes. - - High density devices are STM32F101xx and STM32F103xx microcontrollers where + - Medium-density value line devices are STM32F100xx microcontrollers where the + Flash memory density ranges between 64 and 128 Kbytes. + - High-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. + - High-density value line devices are STM32F100xx microcontrollers where the + Flash memory density ranges between 256 and 512 Kbytes. - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 512 and 1024 Kbytes. - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. */ +#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) + #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" +#endif + #if !defined USE_STDPERIPH_DRIVER /** * @brief Comment the line below if you will not use the peripherals drivers. - In this case, these drivers will not be included and the application code will - be based on direct access to peripherals registers + In this case, these drivers will not be included and the application code will + be based on direct access to peripherals registers */ /*#define USE_STDPERIPH_DRIVER*/ #endif /** * @brief In the following line adjust the value of External High Speed oscillator (HSE) - used in your application - + used in your application + Tip: To avoid modifying this file each time you need to use different HSE, you can define the HSE value in your toolchain compiler preprocessor. - */ + */ #if !defined HSE_VALUE - #ifdef STM32F10X_CL + #ifdef STM32F10X_CL #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ - #else + #else #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* STM32F10X_CL */ #endif /* HSE_VALUE */ /** - * @brief In the following line adjust the External High Speed oscillator (HSE) Startup - Timeout value + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + Timeout value */ #define HSE_STARTUP_TIMEOUT ((uint16_t)0x0500) /*!< Time out for HSE start up */ @@ -109,7 +117,7 @@ * @brief STM32F10x Standard Peripheral Library version number */ #define __STM32F10X_STDPERIPH_VERSION_MAIN (0x03) /*!< [31:16] STM32F10x Standard Peripheral Library main version */ -#define __STM32F10X_STDPERIPH_VERSION_SUB1 (0x03) /*!< [15:8] STM32F10x Standard Peripheral Library sub1 version */ +#define __STM32F10X_STDPERIPH_VERSION_SUB1 (0x04) /*!< [15:8] STM32F10x Standard Peripheral Library sub1 version */ #define __STM32F10X_STDPERIPH_VERSION_SUB2 (0x00) /*!< [7:0] STM32F10x Standard Peripheral Library sub2 version */ #define __STM32F10X_STDPERIPH_VERSION ((__STM32F10X_STDPERIPH_VERSION_MAIN << 16)\ | (__STM32F10X_STDPERIPH_VERSION_SUB1 << 8)\ @@ -124,7 +132,7 @@ */ /** - * @brief Configuration of the Cortex-M3 Processor and Core Peripherals + * @brief Configuration of the Cortex-M3 Processor and Core Peripherals */ #ifdef STM32F10X_XL #define __MPU_PRESENT 1 /*!< STM32 XL-density devices provide an MPU */ @@ -135,8 +143,8 @@ #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ /** - * @brief STM32F10x Interrupt Number Definition, according to the selected device - * in @ref Library_configuration_section + * @brief STM32F10x Interrupt Number Definition, according to the selected device + * in @ref Library_configuration_section */ typedef enum IRQn { @@ -190,8 +198,8 @@ typedef enum IRQn USART2_IRQn = 38, /*!< USART2 global Interrupt */ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */ - USBWakeUp_IRQn = 42 /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */ -#endif /* STM32F10X_LD */ + USBWakeUp_IRQn = 42 /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */ +#endif /* STM32F10X_LD */ #ifdef STM32F10X_LD_VL ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ @@ -209,9 +217,9 @@ typedef enum IRQn USART2_IRQn = 38, /*!< USART2 global Interrupt */ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */ - CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */ - TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */ - TIM7_IRQn = 55 /*!< TIM7 Interrupt */ + CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */ + TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */ + TIM7_IRQn = 55 /*!< TIM7 Interrupt */ #endif /* STM32F10X_LD_VL */ #ifdef STM32F10X_MD @@ -239,8 +247,8 @@ typedef enum IRQn USART3_IRQn = 39, /*!< USART3 global Interrupt */ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */ - USBWakeUp_IRQn = 42 /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */ -#endif /* STM32F10X_MD */ + USBWakeUp_IRQn = 42 /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */ +#endif /* STM32F10X_MD */ #ifdef STM32F10X_MD_VL ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ @@ -263,9 +271,9 @@ typedef enum IRQn USART3_IRQn = 39, /*!< USART3 global Interrupt */ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */ - CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */ - TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */ - TIM7_IRQn = 55 /*!< TIM7 Interrupt */ + CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */ + TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */ + TIM7_IRQn = 55 /*!< TIM7 Interrupt */ #endif /* STM32F10X_MD_VL */ #ifdef STM32F10X_HD @@ -311,7 +319,48 @@ typedef enum IRQn DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */ DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */ DMA2_Channel4_5_IRQn = 59 /*!< DMA2 Channel 4 and Channel 5 global Interrupt */ -#endif /* STM32F10X_HD */ +#endif /* STM32F10X_HD */ + +#ifdef STM32F10X_HD_VL + ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ + EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */ + TIM1_BRK_TIM15_IRQn = 24, /*!< TIM1 Break and TIM15 Interrupts */ + TIM1_UP_TIM16_IRQn = 25, /*!< TIM1 Update and TIM16 Interrupts */ + TIM1_TRG_COM_TIM17_IRQn = 26, /*!< TIM1 Trigger and Commutation and TIM17 Interrupt */ + TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */ + TIM2_IRQn = 28, /*!< TIM2 global Interrupt */ + TIM3_IRQn = 29, /*!< TIM3 global Interrupt */ + TIM4_IRQn = 30, /*!< TIM4 global Interrupt */ + I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */ + I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */ + I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */ + I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */ + SPI1_IRQn = 35, /*!< SPI1 global Interrupt */ + SPI2_IRQn = 36, /*!< SPI2 global Interrupt */ + USART1_IRQn = 37, /*!< USART1 global Interrupt */ + USART2_IRQn = 38, /*!< USART2 global Interrupt */ + USART3_IRQn = 39, /*!< USART3 global Interrupt */ + EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */ + RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */ + CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */ + TIM12_IRQn = 43, /*!< TIM12 global Interrupt */ + TIM13_IRQn = 44, /*!< TIM13 global Interrupt */ + TIM14_IRQn = 45, /*!< TIM14 global Interrupt */ + FSMC_IRQn = 48, /*!< FSMC global Interrupt */ + TIM5_IRQn = 50, /*!< TIM5 global Interrupt */ + SPI3_IRQn = 51, /*!< SPI3 global Interrupt */ + UART4_IRQn = 52, /*!< UART4 global Interrupt */ + UART5_IRQn = 53, /*!< UART5 global Interrupt */ + TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */ + TIM7_IRQn = 55, /*!< TIM7 Interrupt */ + DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */ + DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */ + DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */ + DMA2_Channel4_5_IRQn = 59, /*!< DMA2 Channel 4 and Channel 5 global Interrupt */ + DMA2_Channel5_IRQn = 60 /*!< DMA2 Channel 5 global Interrupt (DMA2 Channel 5 is + mapped at postion 60 only if the MISC_REMAP bit in + the AFIO_MAPR2 register is set) */ +#endif /* STM32F10X_HD_VL */ #ifdef STM32F10X_XL ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */ @@ -356,7 +405,7 @@ typedef enum IRQn DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */ DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */ DMA2_Channel4_5_IRQn = 59 /*!< DMA2 Channel 4 and Channel 5 global Interrupt */ -#endif /* STM32F10X_XL */ +#endif /* STM32F10X_XL */ #ifdef STM32F10X_CL ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */ @@ -402,7 +451,7 @@ typedef enum IRQn CAN2_RX1_IRQn = 65, /*!< CAN2 RX1 Interrupt */ CAN2_SCE_IRQn = 66, /*!< CAN2 SCE Interrupt */ OTG_FS_IRQn = 67 /*!< USB OTG FS global Interrupt */ -#endif /* STM32F10X_CL */ +#endif /* STM32F10X_CL */ } IRQn_Type; /** @@ -415,7 +464,7 @@ typedef enum IRQn /** @addtogroup Exported_types * @{ - */ + */ /*!< STM32F10x Standard Peripheral Library old types (maintained for legacy purpose) */ typedef int32_t s32; @@ -450,10 +499,6 @@ typedef __I uint32_t vuc32; /*!< Read Only */ typedef __I uint16_t vuc16; /*!< Read Only */ typedef __I uint8_t vuc8; /*!< Read Only */ -#ifndef __cplusplus -typedef enum {FALSE = 0, TRUE = !FALSE} bool; -#endif - typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; @@ -471,10 +516,10 @@ typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; /** @addtogroup Peripheral_registers_structures * @{ - */ + */ -/** - * @brief Analog to Digital Converter +/** + * @brief Analog to Digital Converter */ typedef struct @@ -501,8 +546,8 @@ typedef struct __IO uint32_t DR; } ADC_TypeDef; -/** - * @brief Backup Registers +/** + * @brief Backup Registers */ typedef struct @@ -527,7 +572,7 @@ typedef struct __IO uint16_t DR9; uint16_t RESERVED9; __IO uint16_t DR10; - uint16_t RESERVED10; + uint16_t RESERVED10; __IO uint16_t RTCCR; uint16_t RESERVED11; __IO uint16_t CR; @@ -573,7 +618,7 @@ typedef struct __IO uint16_t DR29; uint16_t RESERVED32; __IO uint16_t DR30; - uint16_t RESERVED33; + uint16_t RESERVED33; __IO uint16_t DR31; uint16_t RESERVED34; __IO uint16_t DR32; @@ -597,11 +642,11 @@ typedef struct __IO uint16_t DR41; uint16_t RESERVED44; __IO uint16_t DR42; - uint16_t RESERVED45; + uint16_t RESERVED45; } BKP_TypeDef; - -/** - * @brief Controller Area Network TxMailBox + +/** + * @brief Controller Area Network TxMailBox */ typedef struct @@ -612,10 +657,10 @@ typedef struct __IO uint32_t TDHR; } CAN_TxMailBox_TypeDef; -/** - * @brief Controller Area Network FIFOMailBox +/** + * @brief Controller Area Network FIFOMailBox */ - + typedef struct { __IO uint32_t RIR; @@ -624,20 +669,20 @@ typedef struct __IO uint32_t RDHR; } CAN_FIFOMailBox_TypeDef; -/** - * @brief Controller Area Network FilterRegister +/** + * @brief Controller Area Network FilterRegister */ - + typedef struct { __IO uint32_t FR1; __IO uint32_t FR2; } CAN_FilterRegister_TypeDef; -/** - * @brief Controller Area Network +/** + * @brief Controller Area Network */ - + typedef struct { __IO uint32_t MCR; @@ -665,10 +710,10 @@ typedef struct CAN_FilterRegister_TypeDef sFilterRegister[14]; #else CAN_FilterRegister_TypeDef sFilterRegister[28]; -#endif /* STM32F10X_CL */ +#endif /* STM32F10X_CL */ } CAN_TypeDef; -/** +/** * @brief Consumer Electronics Control (CEC) */ typedef struct @@ -679,11 +724,11 @@ typedef struct __IO uint32_t ESR; __IO uint32_t CSR; __IO uint32_t TXD; - __IO uint32_t RXD; + __IO uint32_t RXD; } CEC_TypeDef; -/** - * @brief CRC calculation unit +/** + * @brief CRC calculation unit */ typedef struct @@ -695,7 +740,7 @@ typedef struct __IO uint32_t CR; } CRC_TypeDef; -/** +/** * @brief Digital to Analog Converter */ @@ -714,22 +759,22 @@ typedef struct __IO uint32_t DHR8RD; __IO uint32_t DOR1; __IO uint32_t DOR2; -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) __IO uint32_t SR; #endif } DAC_TypeDef; -/** +/** * @brief Debug MCU */ typedef struct { __IO uint32_t IDCODE; - __IO uint32_t CR; + __IO uint32_t CR; }DBGMCU_TypeDef; -/** +/** * @brief DMA Controller */ @@ -747,7 +792,7 @@ typedef struct __IO uint32_t IFCR; } DMA_TypeDef; -/** +/** * @brief Ethernet MAC */ @@ -818,7 +863,7 @@ typedef struct __IO uint32_t DMACHRBAR; } ETH_TypeDef; -/** +/** * @brief External Interrupt/Event Controller */ @@ -832,7 +877,7 @@ typedef struct __IO uint32_t PR; } EXTI_TypeDef; -/** +/** * @brief FLASH Registers */ @@ -848,19 +893,19 @@ typedef struct __IO uint32_t OBR; __IO uint32_t WRPR; #ifdef STM32F10X_XL - uint32_t RESERVED1[8]; + uint32_t RESERVED1[8]; __IO uint32_t KEYR2; - uint32_t RESERVED2; + uint32_t RESERVED2; __IO uint32_t SR2; __IO uint32_t CR2; - __IO uint32_t AR2; -#endif /* STM32F10X_XL */ + __IO uint32_t AR2; +#endif /* STM32F10X_XL */ } FLASH_TypeDef; -/** +/** * @brief Option Bytes Registers */ - + typedef struct { __IO uint16_t RDP; @@ -873,66 +918,66 @@ typedef struct __IO uint16_t WRP3; } OB_TypeDef; -/** +/** * @brief Flexible Static Memory Controller */ typedef struct { - __IO uint32_t BTCR[8]; -} FSMC_Bank1_TypeDef; + __IO uint32_t BTCR[8]; +} FSMC_Bank1_TypeDef; -/** +/** * @brief Flexible Static Memory Controller Bank1E */ - + typedef struct { __IO uint32_t BWTR[7]; } FSMC_Bank1E_TypeDef; -/** +/** * @brief Flexible Static Memory Controller Bank2 */ - + typedef struct { __IO uint32_t PCR2; __IO uint32_t SR2; __IO uint32_t PMEM2; __IO uint32_t PATT2; - uint32_t RESERVED0; - __IO uint32_t ECCR2; -} FSMC_Bank2_TypeDef; + uint32_t RESERVED0; + __IO uint32_t ECCR2; +} FSMC_Bank2_TypeDef; -/** +/** * @brief Flexible Static Memory Controller Bank3 */ - + typedef struct { __IO uint32_t PCR3; __IO uint32_t SR3; __IO uint32_t PMEM3; __IO uint32_t PATT3; - uint32_t RESERVED0; - __IO uint32_t ECCR3; -} FSMC_Bank3_TypeDef; + uint32_t RESERVED0; + __IO uint32_t ECCR3; +} FSMC_Bank3_TypeDef; -/** +/** * @brief Flexible Static Memory Controller Bank4 */ - + typedef struct { __IO uint32_t PCR4; __IO uint32_t SR4; __IO uint32_t PMEM4; __IO uint32_t PATT4; - __IO uint32_t PIO4; -} FSMC_Bank4_TypeDef; + __IO uint32_t PIO4; +} FSMC_Bank4_TypeDef; -/** +/** * @brief General Purpose I/O */ @@ -947,7 +992,7 @@ typedef struct __IO uint32_t LCKR; } GPIO_TypeDef; -/** +/** * @brief Alternate Function I/O */ @@ -957,9 +1002,9 @@ typedef struct __IO uint32_t MAPR; __IO uint32_t EXTICR[4]; uint32_t RESERVED0; - __IO uint32_t MAPR2; + __IO uint32_t MAPR2; } AFIO_TypeDef; -/** +/** * @brief Inter-integrated Circuit Interface */ @@ -985,7 +1030,7 @@ typedef struct uint16_t RESERVED8; } I2C_TypeDef; -/** +/** * @brief Independent WATCHDOG */ @@ -997,7 +1042,7 @@ typedef struct __IO uint32_t SR; } IWDG_TypeDef; -/** +/** * @brief Power Control */ @@ -1007,7 +1052,7 @@ typedef struct __IO uint32_t CSR; } PWR_TypeDef; -/** +/** * @brief Reset and Clock Control */ @@ -1024,18 +1069,18 @@ typedef struct __IO uint32_t BDCR; __IO uint32_t CSR; -#ifdef STM32F10X_CL +#ifdef STM32F10X_CL __IO uint32_t AHBRSTR; __IO uint32_t CFGR2; -#endif /* STM32F10X_CL */ +#endif /* STM32F10X_CL */ -#if defined STM32F10X_LD_VL || defined STM32F10X_MD_VL +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) uint32_t RESERVED0; __IO uint32_t CFGR2; -#endif /* STM32F10X_LD_VL || STM32F10X_MD_VL */ +#endif /* STM32F10X_LD_VL || STM32F10X_MD_VL || STM32F10X_HD_VL */ } RCC_TypeDef; -/** +/** * @brief Real-Time Clock */ @@ -1063,7 +1108,7 @@ typedef struct uint16_t RESERVED9; } RTC_TypeDef; -/** +/** * @brief SD host Interface */ @@ -1091,7 +1136,7 @@ typedef struct __IO uint32_t FIFO; } SDIO_TypeDef; -/** +/** * @brief Serial Peripheral Interface */ @@ -1114,10 +1159,10 @@ typedef struct __IO uint16_t I2SCFGR; uint16_t RESERVED7; __IO uint16_t I2SPR; - uint16_t RESERVED8; + uint16_t RESERVED8; } SPI_TypeDef; -/** +/** * @brief TIM */ @@ -1165,10 +1210,10 @@ typedef struct uint16_t RESERVED19; } TIM_TypeDef; -/** +/** * @brief Universal Synchronous Asynchronous Receiver Transmitter */ - + typedef struct { __IO uint16_t SR; @@ -1187,7 +1232,7 @@ typedef struct uint16_t RESERVED6; } USART_TypeDef; -/** +/** * @brief Window WATCHDOG */ @@ -1201,16 +1246,18 @@ typedef struct /** * @} */ - + /** @addtogroup Peripheral_memory_map * @{ */ -#define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the alias region */ -#define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the alias region */ -#define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the bit-band region */ -#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the bit-band region */ +#define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */ +#define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */ +#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */ + +#define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the bit-band region */ +#define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */ #define FSMC_R_BASE ((uint32_t)0xA0000000) /*!< FSMC registers base address */ @@ -1308,10 +1355,10 @@ typedef struct /** * @} */ - + /** @addtogroup Peripheral_declaration * @{ - */ + */ #define TIM2 ((TIM_TypeDef *) TIM2_BASE) #define TIM3 ((TIM_TypeDef *) TIM3_BASE) @@ -1379,7 +1426,7 @@ typedef struct #define RCC ((RCC_TypeDef *) RCC_BASE) #define CRC ((CRC_TypeDef *) CRC_BASE) #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE) -#define OB ((OB_TypeDef *) OB_BASE) +#define OB ((OB_TypeDef *) OB_BASE) #define ETH ((ETH_TypeDef *) ETH_BASE) #define FSMC_Bank1 ((FSMC_Bank1_TypeDef *) FSMC_Bank1_R_BASE) #define FSMC_Bank1E ((FSMC_Bank1E_TypeDef *) FSMC_Bank1E_R_BASE) @@ -1395,11 +1442,11 @@ typedef struct /** @addtogroup Exported_constants * @{ */ - + /** @addtogroup Peripheral_Registers_Bits_Definition * @{ */ - + /******************************************************************************/ /* Peripheral Registers_Bits_Definition */ /******************************************************************************/ @@ -1727,9 +1774,9 @@ typedef struct #define RCC_CFGR_PLLMULL8 ((uint32_t)0x00180000) /*!< PLL input clock * 8 */ #define RCC_CFGR_PLLMULL9 ((uint32_t)0x001C0000) /*!< PLL input clock * 9 */ #define RCC_CFGR_PLLMULL6_5 ((uint32_t)0x00340000) /*!< PLL input clock * 6.5 */ - + #define RCC_CFGR_OTGFSPRE ((uint32_t)0x00400000) /*!< USB OTG FS prescaler */ - + /*!< MCO configuration */ #define RCC_CFGR_MCO ((uint32_t)0x0F000000) /*!< MCO[3:0] bits (Microcontroller Clock Output) */ #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000) /*!< Bit 0 */ @@ -1746,7 +1793,7 @@ typedef struct #define RCC_CFGR_MCO_PLL3CLK_Div2 ((uint32_t)0x09000000) /*!< PLL3 clock divided by 2 selected as MCO source*/ #define RCC_CFGR_MCO_Ext_HSE ((uint32_t)0x0A000000) /*!< XT1 external 3-25 MHz oscillator clock selected as MCO source */ #define RCC_CFGR_MCO_PLL3CLK ((uint32_t)0x0B000000) /*!< PLL3 clock selected as MCO source */ -#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) #define RCC_CFGR_PLLSRC_HSI_Div2 ((uint32_t)0x00000000) /*!< HSI clock divided by 2 selected as PLL entry clock source */ #define RCC_CFGR_PLLSRC_PREDIV1 ((uint32_t)0x00010000) /*!< PREDIV1 clock selected as PLL entry clock source */ @@ -1853,7 +1900,7 @@ typedef struct #define RCC_APB2RSTR_IOPDRST ((uint32_t)0x00000020) /*!< I/O port D reset */ #define RCC_APB2RSTR_ADC1RST ((uint32_t)0x00000200) /*!< ADC 1 interface reset */ -#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) +#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) #define RCC_APB2RSTR_ADC2RST ((uint32_t)0x00000400) /*!< ADC 2 interface reset */ #endif @@ -1861,7 +1908,7 @@ typedef struct #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI 1 reset */ #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000) /*!< USART1 reset */ -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) #define RCC_APB2RSTR_TIM15RST ((uint32_t)0x00010000) /*!< TIM15 Timer reset */ #define RCC_APB2RSTR_TIM16RST ((uint32_t)0x00020000) /*!< TIM16 Timer reset */ #define RCC_APB2RSTR_TIM17RST ((uint32_t)0x00040000) /*!< TIM17 Timer reset */ @@ -1878,6 +1925,11 @@ typedef struct #define RCC_APB2RSTR_ADC3RST ((uint32_t)0x00008000) /*!< ADC3 interface reset */ #endif +#if defined (STM32F10X_HD_VL) + #define RCC_APB2RSTR_IOPFRST ((uint32_t)0x00000080) /*!< I/O port F reset */ + #define RCC_APB2RSTR_IOPGRST ((uint32_t)0x00000100) /*!< I/O port G reset */ +#endif + #ifdef STM32F10X_XL #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00080000) /*!< TIM9 Timer reset */ #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00100000) /*!< TIM10 Timer reset */ @@ -1891,7 +1943,7 @@ typedef struct #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000) /*!< USART 2 reset */ #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 reset */ -#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) +#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) #define RCC_APB1RSTR_CAN1RST ((uint32_t)0x02000000) /*!< CAN1 reset */ #endif @@ -1919,11 +1971,21 @@ typedef struct #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */ #endif -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */ #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */ #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */ - #define RCC_APB1RSTR_CECRST ((uint32_t)0x40000000) /*!< CEC interface reset */ + #define RCC_APB1RSTR_CECRST ((uint32_t)0x40000000) /*!< CEC interface reset */ +#endif + +#if defined (STM32F10X_HD_VL) + #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008) /*!< Timer 5 reset */ + #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040) /*!< TIM12 Timer reset */ + #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080) /*!< TIM13 Timer reset */ + #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100) /*!< TIM14 Timer reset */ + #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000) /*!< SPI 3 reset */ + #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000) /*!< UART 4 reset */ + #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000) /*!< UART 5 reset */ #endif #ifdef STM32F10X_CL @@ -1942,7 +2004,7 @@ typedef struct #define RCC_AHBENR_FLITFEN ((uint16_t)0x0010) /*!< FLITF clock enable */ #define RCC_AHBENR_CRCEN ((uint16_t)0x0040) /*!< CRC clock enable */ -#if defined (STM32F10X_HD) || defined (STM32F10X_CL) +#if defined (STM32F10X_HD) || defined (STM32F10X_CL) || defined (STM32F10X_HD_VL) || defined (STM32F10X_XL) #define RCC_AHBENR_DMA2EN ((uint16_t)0x0002) /*!< DMA2 clock enable */ #endif @@ -1951,6 +2013,10 @@ typedef struct #define RCC_AHBENR_SDIOEN ((uint16_t)0x0400) /*!< SDIO clock enable */ #endif +#if defined (STM32F10X_HD_VL) + #define RCC_AHBENR_FSMCEN ((uint16_t)0x0100) /*!< FSMC clock enable */ +#endif + #ifdef STM32F10X_CL #define RCC_AHBENR_OTGFSEN ((uint32_t)0x00001000) /*!< USB OTG FS clock enable */ #define RCC_AHBENR_ETHMACEN ((uint32_t)0x00004000) /*!< ETHERNET MAC clock enable */ @@ -1966,7 +2032,7 @@ typedef struct #define RCC_APB2ENR_IOPDEN ((uint32_t)0x00000020) /*!< I/O port D clock enable */ #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000200) /*!< ADC 1 interface clock enable */ -#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) +#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) #define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000400) /*!< ADC 2 interface clock enable */ #endif @@ -1974,7 +2040,7 @@ typedef struct #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI 1 clock enable */ #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000) /*!< USART1 clock enable */ -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) #define RCC_APB2ENR_TIM15EN ((uint32_t)0x00010000) /*!< TIM15 Timer clock enable */ #define RCC_APB2ENR_TIM16EN ((uint32_t)0x00020000) /*!< TIM16 Timer clock enable */ #define RCC_APB2ENR_TIM17EN ((uint32_t)0x00040000) /*!< TIM17 Timer clock enable */ @@ -1991,6 +2057,11 @@ typedef struct #define RCC_APB2ENR_ADC3EN ((uint32_t)0x00008000) /*!< DMA1 clock enable */ #endif +#if defined (STM32F10X_HD_VL) + #define RCC_APB2ENR_IOPFEN ((uint32_t)0x00000080) /*!< I/O port F clock enable */ + #define RCC_APB2ENR_IOPGEN ((uint32_t)0x00000100) /*!< I/O port G clock enable */ +#endif + #ifdef STM32F10X_XL #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00080000) /*!< TIM9 Timer clock enable */ #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00100000) /*!< TIM10 Timer clock enable */ @@ -2004,7 +2075,7 @@ typedef struct #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000) /*!< USART 2 clock enable */ #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C 1 clock enable */ -#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) +#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) #define RCC_APB1ENR_CAN1EN ((uint32_t)0x02000000) /*!< CAN1 clock enable */ #endif @@ -2032,13 +2103,23 @@ typedef struct #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */ #endif -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */ #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */ #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */ - #define RCC_APB1ENR_CECEN ((uint32_t)0x40000000) /*!< CEC interface clock enable */ + #define RCC_APB1ENR_CECEN ((uint32_t)0x40000000) /*!< CEC interface clock enable */ #endif +#ifdef STM32F10X_HD_VL + #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008) /*!< Timer 5 clock enable */ + #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040) /*!< TIM12 Timer clock enable */ + #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080) /*!< TIM13 Timer clock enable */ + #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100) /*!< TIM14 Timer clock enable */ + #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000) /*!< SPI 3 clock enable */ + #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000) /*!< UART 4 clock enable */ + #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000) /*!< UART 5 clock enable */ +#endif /* STM32F10X_HD_VL */ + #ifdef STM32F10X_CL #define RCC_APB1ENR_CAN2EN ((uint32_t)0x04000000) /*!< CAN2 clock enable */ #endif /* STM32F10X_CL */ @@ -2067,7 +2148,7 @@ typedef struct #define RCC_BDCR_RTCEN ((uint32_t)0x00008000) /*!< RTC clock enable */ #define RCC_BDCR_BDRST ((uint32_t)0x00010000) /*!< Backup domain software reset */ -/******************* Bit definition for RCC_CSR register ********************/ +/******************* Bit definition for RCC_CSR register ********************/ #define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */ #define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */ #define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */ @@ -2173,7 +2254,7 @@ typedef struct #define RCC_CFGR2_I2S3SRC ((uint32_t)0x00040000) /*!< I2S3 clock source */ #endif /* STM32F10X_CL */ -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) /******************* Bit definition for RCC_CFGR2 register ******************/ /*!< PREDIV1 configuration */ #define RCC_CFGR2_PREDIV1 ((uint32_t)0x0000000F) /*!< PREDIV1[3:0] bits */ @@ -2199,7 +2280,7 @@ typedef struct #define RCC_CFGR2_PREDIV1_DIV15 ((uint32_t)0x0000000E) /*!< PREDIV1 input clock divided by 15 */ #define RCC_CFGR2_PREDIV1_DIV16 ((uint32_t)0x0000000F) /*!< PREDIV1 input clock divided by 16 */ #endif - + /******************************************************************************/ /* */ /* General Purpose and Alternate Function I/O */ @@ -2609,7 +2690,7 @@ typedef struct #define AFIO_EXTICR1_EXTI1_PF ((uint16_t)0x0050) /*!< PF[1] pin */ #define AFIO_EXTICR1_EXTI1_PG ((uint16_t)0x0060) /*!< PG[1] pin */ -/*!< EXTI2 configuration */ +/*!< EXTI2 configuration */ #define AFIO_EXTICR1_EXTI2_PA ((uint16_t)0x0000) /*!< PA[2] pin */ #define AFIO_EXTICR1_EXTI2_PB ((uint16_t)0x0100) /*!< PB[2] pin */ #define AFIO_EXTICR1_EXTI2_PC ((uint16_t)0x0200) /*!< PC[2] pin */ @@ -2651,7 +2732,7 @@ typedef struct #define AFIO_EXTICR2_EXTI5_PF ((uint16_t)0x0050) /*!< PF[5] pin */ #define AFIO_EXTICR2_EXTI5_PG ((uint16_t)0x0060) /*!< PG[5] pin */ -/*!< EXTI6 configuration */ +/*!< EXTI6 configuration */ #define AFIO_EXTICR2_EXTI6_PA ((uint16_t)0x0000) /*!< PA[6] pin */ #define AFIO_EXTICR2_EXTI6_PB ((uint16_t)0x0100) /*!< PB[6] pin */ #define AFIO_EXTICR2_EXTI6_PC ((uint16_t)0x0200) /*!< PC[6] pin */ @@ -2693,7 +2774,7 @@ typedef struct #define AFIO_EXTICR3_EXTI9_PF ((uint16_t)0x0050) /*!< PF[9] pin */ #define AFIO_EXTICR3_EXTI9_PG ((uint16_t)0x0060) /*!< PG[9] pin */ -/*!< EXTI10 configuration */ +/*!< EXTI10 configuration */ #define AFIO_EXTICR3_EXTI10_PA ((uint16_t)0x0000) /*!< PA[10] pin */ #define AFIO_EXTICR3_EXTI10_PB ((uint16_t)0x0100) /*!< PB[10] pin */ #define AFIO_EXTICR3_EXTI10_PC ((uint16_t)0x0200) /*!< PC[10] pin */ @@ -2735,7 +2816,7 @@ typedef struct #define AFIO_EXTICR4_EXTI13_PF ((uint16_t)0x0050) /*!< PF[13] pin */ #define AFIO_EXTICR4_EXTI13_PG ((uint16_t)0x0060) /*!< PG[13] pin */ -/*!< EXTI14 configuration */ +/*!< EXTI14 configuration */ #define AFIO_EXTICR4_EXTI14_PA ((uint16_t)0x0000) /*!< PA[14] pin */ #define AFIO_EXTICR4_EXTI14_PB ((uint16_t)0x0100) /*!< PB[14] pin */ #define AFIO_EXTICR4_EXTI14_PC ((uint16_t)0x0200) /*!< PC[14] pin */ @@ -2753,7 +2834,7 @@ typedef struct #define AFIO_EXTICR4_EXTI15_PF ((uint16_t)0x5000) /*!< PF[15] pin */ #define AFIO_EXTICR4_EXTI15_PG ((uint16_t)0x6000) /*!< PG[15] pin */ -#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) /****************** Bit definition for AFIO_MAPR2 register ******************/ #define AFIO_MAPR2_TIM15_REMAP ((uint32_t)0x00000001) /*!< TIM15 remapping */ #define AFIO_MAPR2_TIM16_REMAP ((uint32_t)0x00000002) /*!< TIM16 remapping */ @@ -2762,7 +2843,16 @@ typedef struct #define AFIO_MAPR2_TIM1_DMA_REMAP ((uint32_t)0x00000010) /*!< TIM1_DMA remapping */ #endif -#ifdef STM32F10X_XL +#ifdef STM32F10X_HD_VL +#define AFIO_MAPR2_TIM13_REMAP ((uint32_t)0x00000100) /*!< TIM13 remapping */ +#define AFIO_MAPR2_TIM14_REMAP ((uint32_t)0x00000200) /*!< TIM14 remapping */ +#define AFIO_MAPR2_FSMC_NADV_REMAP ((uint32_t)0x00000400) /*!< FSMC NADV remapping */ +#define AFIO_MAPR2_TIM67_DAC_DMA_REMAP ((uint32_t)0x00000800) /*!< TIM6/TIM7 and DAC DMA remapping */ +#define AFIO_MAPR2_TIM12_REMAP ((uint32_t)0x00001000) /*!< TIM12 remapping */ +#define AFIO_MAPR2_MISC_REMAP ((uint32_t)0x00002000) /*!< Miscellaneous remapping */ +#endif + +#ifdef STM32F10X_XL /****************** Bit definition for AFIO_MAPR2 register ******************/ #define AFIO_MAPR2_TIM9_REMAP ((uint32_t)0x00000020) /*!< TIM9 remapping */ #define AFIO_MAPR2_TIM10_REMAP ((uint32_t)0x00000040) /*!< TIM10 remapping */ @@ -3630,7 +3720,7 @@ typedef struct #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*! + + TEST-STM32-SDIO + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + os + 2 + D:/Progetti/ChibiOS-RT/os + + + diff --git a/testhal/STM32/SDIO/Makefile b/testhal/STM32/SDIO/Makefile new file mode 100644 index 000000000..cf88c1190 --- /dev/null +++ b/testhal/STM32/SDIO/Makefile @@ -0,0 +1,204 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../../.. +include $(CHIBIOS)/boards/ST_STM3210E_EVAL/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +#include $(CHIBIOS)/test/test.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARM/rules.mk diff --git a/testhal/STM32/SDIO/ch.ld b/testhal/STM32/SDIO/ch.ld new file mode 100644 index 000000000..363ddce9f --- /dev/null +++ b/testhal/STM32/SDIO/ch.ld @@ -0,0 +1,130 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 1m + ram : org = 0x20000000, len = 96k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/testhal/STM32/SDIO/chconf.h b/testhal/STM32/SDIO/chconf.h new file mode 100644 index 000000000..04fa822cc --- /dev/null +++ b/testhal/STM32/SDIO/chconf.h @@ -0,0 +1,508 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/SDIO/halconf.h b/testhal/STM32/SDIO/halconf.h new file mode 100644 index 000000000..7f129acc6 --- /dev/null +++ b/testhal/STM32/SDIO/halconf.h @@ -0,0 +1,295 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c new file mode 100644 index 000000000..3e7971f49 --- /dev/null +++ b/testhal/STM32/SDIO/main.c @@ -0,0 +1,57 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" + +/* + * SDIO configuration. + */ +static const SDCConfig sdccfg = { +}; + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Initializes the SDIO drivers. + */ + sdcStart(&SDCD1, &sdccfg); + + /* + * Normal main() thread activity. + */ + while (TRUE) { + chThdSleepMilliseconds(500); + } + return 0; +} diff --git a/testhal/STM32/SDIO/mcuconf.h b/testhal/STM32/SDIO/mcuconf.h new file mode 100644 index 000000000..87186fdaf --- /dev/null +++ b/testhal/STM32/SDIO/mcuconf.h @@ -0,0 +1,154 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED TRUE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 TRUE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/testhal/STM32/SDIO/readme.txt b/testhal/STM32/SDIO/readme.txt new file mode 100644 index 000000000..caeb7bce7 --- /dev/null +++ b/testhal/STM32/SDIO/readme.txt @@ -0,0 +1,26 @@ +***************************************************************************** +** ChibiOS/RT HAL - SDC driver demo for STM32. ** +***************************************************************************** + +** TARGET ** + +The demo will on an Olimex ST_STM3210E_EVAL board. + +** The Demo ** + +The application demonstrates the use of the STM32 SDC driver. + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com -- cgit v1.2.3 From bfe251b2e41d9639292d12492a03118df2f1ceb4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 26 Apr 2011 08:59:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2902 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SDIO/.project | 85 --------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 testhal/STM32/SDIO/.project diff --git a/testhal/STM32/SDIO/.project b/testhal/STM32/SDIO/.project deleted file mode 100644 index 5ab989a84..000000000 --- a/testhal/STM32/SDIO/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - TEST-STM32-SDIO - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - os - 2 - D:/Progetti/ChibiOS-RT/os - - - -- cgit v1.2.3 From 2f4dba80ea1d68a1165ca04a6b4d1ccd5853c27d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 26 Apr 2011 16:59:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2903 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 94 ++++++++++++++++++ os/hal/platforms/STM32/sdc_lld.c | 167 +++++++++++++++++++++++++++++++ os/hal/platforms/STM32/sdc_lld.h | 152 ++++++++++++++++++++++++++++ os/hal/src/sdc.c | 207 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 620 insertions(+) create mode 100644 os/hal/include/sdc.h create mode 100644 os/hal/platforms/STM32/sdc_lld.c create mode 100644 os/hal/platforms/STM32/sdc_lld.h create mode 100644 os/hal/src/sdc.c diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h new file mode 100644 index 000000000..d578e65b4 --- /dev/null +++ b/os/hal/include/sdc.h @@ -0,0 +1,94 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file sdc.h + * @brief SDC Driver macros and structures. + * + * @addtogroup SDC + * @{ + */ + +#ifndef _SDC_H_ +#define _SDC_H_ + +#if HAL_USE_SDC || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Driver state machine possible states. + */ +typedef enum { + SDC_UNINIT = 0, /**< Not initialized. */ + SDC_STOP = 1, /**< Stopped. */ + SDC_READY = 2, /**< Ready. */ + SDC_INITNG = 3, /**< Card initialization in progress. */ + SDC_ACTIVE = 4, /**< Cart initialized. */ + SDC_READING = 5, /**< Read operation in progress. */ + SDC_WRITING = 6, /**< Write operation in progress. */ +} sdcstate_t; + +#include "sdc_lld.h" + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void sdcInit(void); + void sdcObjectInit(SDCDriver *sdcp); + void sdcStart(SDCDriver *sdcp, const SDCConfig *config); + void sdcStop(SDCDriver *sdcp); + bool_t sdcConnect(SDCDriver *sdcp); + bool_t sdcDisconnect(SDCDriver *sdcp); + bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, + uint8_t *buffer, uint32_t n); + bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, + const uint8_t *buffer, uint32_t n); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_SDC */ + +#endif /* _SDC_H_ */ + +/** @} */ diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c new file mode 100644 index 000000000..48f8561f9 --- /dev/null +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -0,0 +1,167 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32/sdc_lld.c + * @brief STM32 SDC subsystem low level driver source. + * + * @addtogroup SDC + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_SDC || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/** @brief SDCD1 driver identifier.*/ +SDCDriver SDCD1; + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/** + * @brief SDIO IRQ handler. + * + * @isr + */ +CH_IRQ_HANDLER(SDIO_IRQHandler) { + + CH_IRQ_PROLOGUE(); + + + CH_IRQ_EPILOGUE(); +} + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief Low level SDC driver initialization. + * + * @notapi + */ +void sdc_lld_init(void) { + + sdcObjectInit(&SDCD1); +} + +/** + * @brief Configures and activates the SDC peripheral. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_start(SDCDriver *sdcp) { + + if (sdcp->state == SDC_STOP) { + /* Note, the DMA must be enabled before the IRQs.*/ + dmaAllocate(STM32_DMA2_ID, STM32_DMA_CHANNEL_4, NULL, NULL); + NVICEnableVector(SDIO_IRQn, + CORTEX_PRIORITY_MASK(STM32_SDC_SDIO_IRQ_PRIORITY)); + RCC->AHBENR |= RCC_AHBENR_SDIOEN; + } + /* Configuration, card clock is initially stopped.*/ + SDIO->POWER = 0; + SDIO->CLKCR = 0; + SDIO->DCTRL = 0; +} + +/** + * @brief Deactivates the SDC peripheral. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_stop(SDCDriver *sdcp) { + + if ((sdcp->state == SDC_READY) || (sdcp->state == SDC_ACTIVE)) { + SDIO->POWER = 0; + SDIO->CLKCR = 0; + SDIO->DCTRL = 0; + + /* Clock deactivation.*/ + NVICDisableVector(SDIO_IRQn); + dmaRelease(STM32_DMA2_ID, STM32_DMA_CHANNEL_4); + } +} + +/** + * @brief Sends an SDIO command with no response expected. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { + +} + +/** + * @brief Sends an SDIO command with a short response expected. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The operation status. + * @retval FALSE the operation succeeded. + * @retval TRUE the operation failed because timeout, CRC check or + * other errors. + * + * @notapi + */ +bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp) { + +} + +/** + * @brief Sends an SDIO command with a long response expected. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The operation status. + * @retval FALSE the operation succeeded. + * @retval TRUE the operation failed because timeout, CRC check or + * other errors. + * + * @notapi + */ +bool_t sdc_lld_send_cmd_long(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp) { + +} + +#endif /* HAL_USE_SDC */ + +/** @} */ diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h new file mode 100644 index 000000000..012fdb1c7 --- /dev/null +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -0,0 +1,152 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32/sdc_lld.h + * @brief STM32 SDC subsystem low level driver header. + * + * @addtogroup SDC + * @{ + */ + +#ifndef _SDC_LLD_H_ +#define _SDC_LLD_H_ + +#if HAL_USE_SDC || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/** + * @brief SDIO DMA priority (0..3|lowest..highest). + */ +#if !defined(STM32_SDC_SDIO_DMA_PRIORITY) || defined(__DOXYGEN__) +#define STM32_SDC_SDIO_DMA_PRIORITY 2 +#endif + +/** + * @brief SDIO interrupt priority level setting. + */ +#if !defined(STM32_SDC_SDIO_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define STM32_SDC_SDIO_IRQ_PRIORITY 9 +#endif + +/** + * @brief SDIO DMA error hook. + * @note The default action for DMA errors is a system halt because DMA + * error can only happen because programming errors. + */ +#if !defined(STM32_SDC_DMA_ERROR_HOOK) || defined(__DOXYGEN__) +#define STM32_SDC_DMA_ERROR_HOOK(sdcp) chSysHalt() +#endif + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +#if !STM32_HAS_SDIO +#error "SDIO not present in the selected device" +#endif + +#if !defined(STM32_DMA_REQUIRED) +#define STM32_DMA_REQUIRED +#endif + +/* + * SDIO clock divider. + */ +#if STM32_HCLK > 48000000 +#define STM32_SDIO_DIV_HS 0x01 +#define STM32_SDIO_DIV_LS 0xB2 +#else +#define STM32_SDIO_DIV_HS 0x00 +#define STM32_SDIO_DIV_LS 0x76 +#endif + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + + +/** + * @brief Type of a structure representing an SDC driver. + */ +typedef struct SDCDriver SDCDriver; + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + +} SDCConfig; + +/** + * @brief Structure representing an SDC driver. + */ +struct SDCDriver { + /** + * @brief Driver state. + */ + sdcstate_t state; + /** + * @brief Current configuration data. + */ + const SDCConfig *config; + /* End of the mandatory fields.*/ +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#if !defined(__DOXYGEN__) +extern SDCDriver SDCD1; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + void sdc_lld_init(void); + void sdc_lld_start(SDCDriver *sdcp); + void sdc_lld_stop(SDCDriver *sdcp); + void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg); + bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp); + bool_t sdc_lld_send_cmd_long(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_SDC */ + +#endif /* _SDC_LLD_H_ */ + +/** @} */ diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c new file mode 100644 index 000000000..33f2b3612 --- /dev/null +++ b/os/hal/src/sdc.c @@ -0,0 +1,207 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file sdc.c + * @brief SDC Driver code. + * + * @addtogroup SDC + * @{ + */ + +#include "ch.h" +#include "hal.h" + +#if HAL_USE_SDC || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief SDC Driver initialization. + * @note This function is implicitly invoked by @p halInit(), there is + * no need to explicitly initialize the driver. + * + * @init + */ +void sdcInit(void) { + + sdc_lld_init(); +} + +/** + * @brief Initializes the standard part of a @p SDCDriver structure. + * + * @param[out] sdcp pointer to the @p SDCDriver object + * + * @init + */ +void sdcObjectInit(SDCDriver *sdcp) { + + sdcp->state = SDC_STOP; + sdcp->config = NULL; +} + +/** + * @brief Configures and activates the SDC peripheral. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] config pointer to the @p SDCConfig object + * + * @api + */ +void sdcStart(SDCDriver *sdcp, const SDCConfig *config) { + + chDbgCheck((sdcp != NULL) && (config != NULL), "sdcStart"); + + chSysLock(); + chDbgAssert((sdcp->state == SDC_STOP) || (sdcp->state == SDC_READY), + "sdcStart(), #1", "invalid state"); + sdcp->config = config; + sdc_lld_start(sdcp); + sdcp->state = SDC_READY; + chSysUnlock(); +} + +/** + * @brief Deactivates the SDC peripheral. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @api + */ +void sdcStop(SDCDriver *sdcp) { + + chDbgCheck(sdcp != NULL, "sdcStop"); + + chSysLock(); + chDbgAssert((sdcp->state == SDC_STOP) || (sdcp->state == SDC_READY), + "sdcStop(), #1", "invalid state"); + sdc_lld_stop(sdcp); + sdcp->state = SDC_STOP; + chSysUnlock(); +} + +/** + * @brief Performs the initialization procedure on the inserted card. + * @details This function should be invoked when a card is inserted and + * brings the driver in the @p SDC_ACTIVE state where it is possible + * to perform read and write operations. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The operation status. + * @retval FALSE operation succeeded, the driver is now + * in the @p SDC_ACTIVE state. + * @retval TRUE operation failed. + * + * @api + */ +bool_t sdcConnect(SDCDriver *sdcp) { + + chDbgCheck(sdcp != NULL, "sdcConnect"); + + chSysLock(); + chDbgAssert(sdcp->state == SDC_READY, "mmcConnect(), #1", "invalid state"); + sdcp->state = SDC_INITNG; + chSysUnlock(); + + sdcp->state = SDC_ACTIVE; + return FALSE; +} + +/** + * @brief Brings the driver in a state safe for card removal. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The operation status. + * @retval FALSE the operation succeeded and the driver is now + * in the @p SDC_READY state. + * @retval TRUE the operation failed. + * + * @api + */ +bool_t sdcDisconnect(SDCDriver *sdcp) { + + chDbgCheck(sdcp != NULL, "sdcConnect"); + + chSysLock(); + chDbgAssert(sdcp->state == SDC_ACTIVE, + "sdcDisconnect(), #1", "invalid state"); + sdcp->state = SDC_READY; + chSysUnlock(); + return FALSE; +} + +/** + * @brief Reads one or more blocks. + * @pre The driver must be in the @p SDC_ACTIVE state after a successful + * sdcConnect() invocation. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to read + * @param[out] buffer pointer to the read buffer + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * read. + * @retval TRUE operation failed, the state of the buffer is uncertain. + * + * @api + */ +bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, + uint8_t *buffer, uint32_t n) { + +} + +/** + * @brief Writes one or more blocks. + * @pre The driver must be in the @p SDC_ACTIVE state after a successful + * sdcConnect() invocation. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to write + * @param[out] buffer pointer to the write buffer + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * written. + * @retval TRUE operation failed. + * + * @api + */ +bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, + const uint8_t *buffer, uint32_t n) { + +} + +#endif /* HAL_USE_SDC */ + +/** @} */ -- cgit v1.2.3 From 699789a7227a90c7b4b8cbcf91fe4cbad2de9132 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 29 Apr 2011 17:49:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2904 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/hal_lld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 1c9714342..9b4feb982 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -86,7 +86,7 @@ void hal_lld_init(void) { #if defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) || \ defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) || \ defined(STM32F10X_HD) || defined(STM32F10X_XL) || \ - defined(STM32F10X_CL) || defined(__DOXYGEN__) + defined(__DOXYGEN__) /* * Clocks initialization for the LD, MD and HD sub-families. */ -- cgit v1.2.3 From 2e7866f634ddf31530c0c83ff8bdfc3b75f42e82 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 30 Apr 2011 07:52:35 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2905 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 66 ++++++++++++++++++++++++++++++++++++++++ os/hal/platforms/STM32/sdc_lld.h | 12 ++++++++ os/hal/src/sdc.c | 2 ++ 3 files changed, 80 insertions(+) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 48f8561f9..25c7b6897 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -119,6 +119,72 @@ void sdc_lld_stop(SDCDriver *sdcp) { } } +/** + * @brief Starts the SDIO clock and sets it to init mode (400KHz or less). + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_start_clk(SDCDriver *sdcp) { + + (void)sdcp; + /* Initial clock setting: 400KHz, 1bit mode.*/ + SDIO->CLKCR = STM32_SDIO_DIV_LS; + SDIO->POWER |= SDIO_POWER_PWRCTRL_0 | SDIO_POWER_PWRCTRL_1; + SDIO->CLKCR |= SDIO_CLKCR_CLKEN; +} + +/** + * @brief Sets the SDIO clock to data mode (25MHz or less). + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_set_data_clk(SDCDriver *sdcp) { + + (void)sdcp; + SDIO->CLKCR = (SDIO->CLKCR & 0xFFFFFF00) | STM32_SDIO_DIV_HS; +} + +/** + * @brief Stops the SDIO clock. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_stop_clk(SDCDriver *sdcp) { + + (void)sdcp; + SDIO->CLKCR = 0; + SDIO->POWER = 0; +} + +/** + * @brief Switches the bus to 4 bits mode. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode) { + uint32_t clk = SDIO->CLKCR & ~SDIO_CLKCR_WIDBUS; + + (void)sdcp; + switch (mode) { + case SDC_MODE_1BIT: + SDIO->CLKCR = clk; + break; + case SDC_MODE_4BIT: + SDIO->CLKCR = clk | SDIO_CLKCR_WIDBUS_0; + break; + case SDC_MODE_8BIT: + SDIO->CLKCR = clk | SDIO_CLKCR_WIDBUS_1; + } +} + /** * @brief Sends an SDIO command with no response expected. * diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 012fdb1c7..8ed64a5b0 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -89,6 +89,14 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief Type of SDIO bus mode. + */ +typedef enum { + SDC_MODE_1BIT = 0, + SDC_MODE_4BIT, + SDC_MODE_8BIT +} sdcbusmode_t; /** * @brief Type of a structure representing an SDC driver. @@ -136,6 +144,10 @@ extern "C" { void sdc_lld_init(void); void sdc_lld_start(SDCDriver *sdcp); void sdc_lld_stop(SDCDriver *sdcp); + void sdc_lld_set_init_clk(SDCDriver *sdcp); + void sdc_lld_set_data_clk(SDCDriver *sdcp); + void sdc_lld_stop_clk(SDCDriver *sdcp); + void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode); void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg); bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp); diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 33f2b3612..701071b8b 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -135,6 +135,8 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdcp->state = SDC_INITNG; chSysUnlock(); + sdc_lld_start_clk(sdcp); + sdcp->state = SDC_ACTIVE; return FALSE; } -- cgit v1.2.3 From fc8ea30f6e774ab92b2a44c4eb5e40ae2a9d9d1f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 30 Apr 2011 10:14:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2906 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.h | 2 +- testhal/STM32/SDIO/halconf.h | 2 +- testhal/STM32/SDIO/main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 8ed64a5b0..729244e91 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -108,7 +108,7 @@ typedef struct SDCDriver SDCDriver; * @note It could be empty on some architectures. */ typedef struct { - + uint32_t dummy; } SDCConfig; /** diff --git a/testhal/STM32/SDIO/halconf.h b/testhal/STM32/SDIO/halconf.h index 7f129acc6..57022db5b 100644 --- a/testhal/STM32/SDIO/halconf.h +++ b/testhal/STM32/SDIO/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 3e7971f49..3194921f4 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -25,6 +25,7 @@ * SDIO configuration. */ static const SDCConfig sdccfg = { + 0 }; /* @@ -53,5 +54,4 @@ int main(void) { while (TRUE) { chThdSleepMilliseconds(500); } - return 0; } -- cgit v1.2.3 From dd9cac5ffa29031b1175bb750e587a20362f5276 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 30 Apr 2011 18:46:09 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2907 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 2 ++ os/hal/platforms/STM32/sdc_lld.c | 6 ++++++ os/hal/src/sdc.c | 2 ++ testhal/STM32/SDIO/main.c | 1 + 4 files changed, 11 insertions(+) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index d578e65b4..860bbbbda 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -35,6 +35,8 @@ /* Driver constants. */ /*===========================================================================*/ +#define SDC_CMD_GO_IDLE_STATE 0 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 25c7b6897..8517a040d 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -194,6 +194,12 @@ void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode) { */ void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { + (void)sdcp; + SDIO->ARG = arg; + SDIO->CMD = (uint32_t)cmd | SDIO_CMD_CPSMEN; + while ((SDIO->STA & SDIO_STA_CMDSENT) == 0) + ; + SDIO->ICR = 0xFFFFFFFF; } /** diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 701071b8b..b64dcf9c5 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -137,6 +137,8 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdc_lld_start_clk(sdcp); + sdc_lld_send_cmd_none(sdcp, SDC_CMD_GO_IDLE_STATE, 0); + sdcp->state = SDC_ACTIVE; return FALSE; } diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 3194921f4..44a294655 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -47,6 +47,7 @@ int main(void) { * Initializes the SDIO drivers. */ sdcStart(&SDCD1, &sdccfg); + sdcConnect(&SDCD1); /* * Normal main() thread activity. -- cgit v1.2.3 From 40c7b22bf43d795d9e6822f67907a1665aa6d7b6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 May 2011 09:10:22 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2908 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 12 ++++++++++ os/hal/platforms/STM32/sdc_lld.c | 34 ++++++++++++++++++++++++++++ os/hal/platforms/STM32/sdc_lld.h | 11 ++++++++- os/hal/src/sdc.c | 49 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 1 deletion(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 860bbbbda..027eee2c0 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -36,6 +36,18 @@ /*===========================================================================*/ #define SDC_CMD_GO_IDLE_STATE 0 +#define SDC_CMD_SEND_IF_COND 8 +#define SDC_CMD_APP_OP_COND 41 +#define SDC_CMD_APP_CMD 55 + +#define SDC_MODE_CARDTYPE_MASK 0xF +#define SDC_MODE_CARDTYPE_SD 0 /**< Old SD card. */ +#define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant. */ +#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC. */ + +#define SDC_CMD8_PATTERN 0x000001AA + +#define SDC_ACMD41_RETRY 100 /*===========================================================================*/ /* Driver pre-compile time settings. */ diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 8517a040d..626702084 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -189,6 +189,8 @@ void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode) { * @brief Sends an SDIO command with no response expected. * * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in[ cmd card command + * @param[in] arg command argument * * @notapi */ @@ -206,6 +208,9 @@ void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { * @brief Sends an SDIO command with a short response expected. * * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in[ cmd card command + * @param[in] arg command argument + * @param[out] resp pointer to the response buffer (one word) * @return The operation status. * @retval FALSE the operation succeeded. * @retval TRUE the operation failed because timeout, CRC check or @@ -215,13 +220,28 @@ void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { */ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp) { + uint32_t sta; + (void)sdcp; + SDIO->ARG = arg; + SDIO->CMD = (uint32_t)cmd | SDIO_CMD_WAITRESP_0 | SDIO_CMD_CPSMEN; + while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | + SDIO_STA_CCRCFAIL)) == 0) + ; + SDIO->ICR = 0xFFFFFFFF; + if ((sta & (SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) != 0) + return TRUE; + *resp = SDIO->RESP1; + return FALSE; } /** * @brief Sends an SDIO command with a long response expected. * * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in[ cmd card command + * @param[in] arg command argument + * @param[out] resp pointer to the response buffer (four words) * @return The operation status. * @retval FALSE the operation succeeded. * @retval TRUE the operation failed because timeout, CRC check or @@ -232,6 +252,20 @@ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, bool_t sdc_lld_send_cmd_long(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp) { + uint32_t sta; + + (void)sdcp; + SDIO->ARG = arg; + SDIO->CMD = (uint32_t)cmd | SDIO_CMD_WAITRESP_0 | SDIO_CMD_WAITRESP_1 | + SDIO_CMD_CPSMEN; + while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | + SDIO_STA_CCRCFAIL)) == 0) + ; + SDIO->ICR = 0xFFFFFFFF; + if ((sta & (SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) != 0) + return TRUE; + *resp = SDIO->RESP1; + return FALSE; } #endif /* HAL_USE_SDC */ diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 729244e91..fff6133b2 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -98,6 +98,11 @@ typedef enum { SDC_MODE_8BIT } sdcbusmode_t; +/** + * @brief Type of card flags. + */ +typedef uint32_t sdcmode_t; + /** * @brief Type of a structure representing an SDC driver. */ @@ -123,6 +128,10 @@ struct SDCDriver { * @brief Current configuration data. */ const SDCConfig *config; + /** + * @brief Various flags regarding the mounted card. + */ + sdcmode_t cardmode; /* End of the mandatory fields.*/ }; @@ -144,7 +153,7 @@ extern "C" { void sdc_lld_init(void); void sdc_lld_start(SDCDriver *sdcp); void sdc_lld_stop(SDCDriver *sdcp); - void sdc_lld_set_init_clk(SDCDriver *sdcp); + void sdc_lld_start_clk(SDCDriver *sdcp); void sdc_lld_set_data_clk(SDCDriver *sdcp); void sdc_lld_stop_clk(SDCDriver *sdcp); void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode); diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index b64dcf9c5..07f25aa65 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -127,6 +127,7 @@ void sdcStop(SDCDriver *sdcp) { * @api */ bool_t sdcConnect(SDCDriver *sdcp) { + uint32_t resp; chDbgCheck(sdcp != NULL, "sdcConnect"); @@ -135,12 +136,60 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdcp->state = SDC_INITNG; chSysUnlock(); + /* Resets card attributes.*/ + sdcp->cardmode = 0; + + /* Card clock initialization.*/ sdc_lld_start_clk(sdcp); + /* Enforces the initial card state.*/ sdc_lld_send_cmd_none(sdcp, SDC_CMD_GO_IDLE_STATE, 0); + /* V2.0 cards detection.*/ + if (!sdc_lld_send_cmd_short(sdcp, SDC_CMD_SEND_IF_COND, + SDC_CMD8_PATTERN, &resp)) + sdcp->cardmode |= SDC_MODE_CARDTYPE_SDV20; + /* Voltage verification.*/ + if (((resp >> 8) & 0xF) != 1) + goto failed; + if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + goto failed; + else { + /* MMC or SD detection.*/ + if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + sdcp->cardmode |= SDC_MODE_CARDTYPE_MMC; + } + + if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_MMC) { + } + else { + uint32_t ocr = 0x80100000; + unsigned i; + + if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_SDV20) + ocr |= 0x40000000; + + /* SD-type initialization. */ + i = 0; + while (TRUE) { + chThdSleepMilliseconds(10); + if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + goto failed; + if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, &resp)) + goto failed; + if ((resp & 0x80000000) != 0) + break; + if (++i >= SDC_ACMD41_RETRY) + goto failed; + } + } + sdcp->state = SDC_ACTIVE; return FALSE; +failed: + sdc_lld_stop_clk(sdcp); + sdcp->state = SDC_READY; + return TRUE; } /** -- cgit v1.2.3 From d5fb75afc4c7203500108fd573f90bfbbd1ac498 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 May 2011 10:33:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2909 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 38 +++++++++++++++++++++++++++++++++++--- os/hal/platforms/STM32/sdc_lld.h | 6 ++++-- os/hal/src/sdc.c | 10 +++++----- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 626702084..ecd09f1b8 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -206,6 +206,7 @@ void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { /** * @brief Sends an SDIO command with a short response expected. + * @note The CRC is not verified. * * @param[in] sdcp pointer to the @p SDCDriver object * @param[in[ cmd card command @@ -222,6 +223,37 @@ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp) { uint32_t sta; + (void)sdcp; + SDIO->ARG = arg; + SDIO->CMD = (uint32_t)cmd | SDIO_CMD_WAITRESP_0 | SDIO_CMD_CPSMEN; + while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | + SDIO_STA_CCRCFAIL)) == 0) + ; + SDIO->ICR = 0xFFFFFFFF; + if ((sta & (SDIO_STA_CTIMEOUT)) != 0) + return TRUE; + *resp = SDIO->RESP1; + return FALSE; +} + +/** + * @brief Sends an SDIO command with a short response expected and CRC. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in[ cmd card command + * @param[in] arg command argument + * @param[out] resp pointer to the response buffer (one word) + * @return The operation status. + * @retval FALSE the operation succeeded. + * @retval TRUE the operation failed because timeout, CRC check or + * other errors. + * + * @notapi + */ +bool_t sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp) { + uint32_t sta; + (void)sdcp; SDIO->ARG = arg; SDIO->CMD = (uint32_t)cmd | SDIO_CMD_WAITRESP_0 | SDIO_CMD_CPSMEN; @@ -236,7 +268,7 @@ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, } /** - * @brief Sends an SDIO command with a long response expected. + * @brief Sends an SDIO command with a long response expected and CRC. * * @param[in] sdcp pointer to the @p SDCDriver object * @param[in[ cmd card command @@ -249,8 +281,8 @@ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, * * @notapi */ -bool_t sdc_lld_send_cmd_long(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, - uint32_t *resp) { +bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp) { uint32_t sta; diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index fff6133b2..5f54f3b50 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -160,8 +160,10 @@ extern "C" { void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg); bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp); - bool_t sdc_lld_send_cmd_long(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, - uint32_t *resp); + bool_t sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp); + bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, + uint32_t *resp); #ifdef __cplusplus } #endif diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 07f25aa65..7cfac6705 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -146,17 +146,17 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdc_lld_send_cmd_none(sdcp, SDC_CMD_GO_IDLE_STATE, 0); /* V2.0 cards detection.*/ - if (!sdc_lld_send_cmd_short(sdcp, SDC_CMD_SEND_IF_COND, - SDC_CMD8_PATTERN, &resp)) + if (!sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_IF_COND, + SDC_CMD8_PATTERN, &resp)) sdcp->cardmode |= SDC_MODE_CARDTYPE_SDV20; /* Voltage verification.*/ if (((resp >> 8) & 0xF) != 1) goto failed; - if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, &resp)) goto failed; else { /* MMC or SD detection.*/ - if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, &resp)) sdcp->cardmode |= SDC_MODE_CARDTYPE_MMC; } @@ -173,7 +173,7 @@ bool_t sdcConnect(SDCDriver *sdcp) { i = 0; while (TRUE) { chThdSleepMilliseconds(10); - if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, &resp)) goto failed; if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, &resp)) goto failed; -- cgit v1.2.3 From b33b5201ad65ed0dafb2b9e0a2c40bf06fe27dfc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 May 2011 11:14:23 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2910 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 8 ++++++-- os/hal/platforms/STM32/sdc_lld.h | 8 ++++++++ os/hal/src/sdc.c | 44 ++++++++++++++++++++++++++++------------ 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 027eee2c0..4c43fe505 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -36,14 +36,18 @@ /*===========================================================================*/ #define SDC_CMD_GO_IDLE_STATE 0 +#define SDC_CMD_ALL_SEND_CID 2 +#define SDC_CMD_SEND_RELATIVE_ADDR 3 +#define SDC_CMD_SEL_DESEL_CARD 7 #define SDC_CMD_SEND_IF_COND 8 +#define SDC_CMD_SEND_CSD 9 #define SDC_CMD_APP_OP_COND 41 #define SDC_CMD_APP_CMD 55 #define SDC_MODE_CARDTYPE_MASK 0xF -#define SDC_MODE_CARDTYPE_SD 0 /**< Old SD card. */ +#define SDC_MODE_CARDTYPE_SDV11 0 /**< Card is V1.1 compliant. */ #define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant. */ -#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC. */ +#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ #define SDC_CMD8_PATTERN 0x000001AA diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 5f54f3b50..e55205b53 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -132,6 +132,14 @@ struct SDCDriver { * @brief Various flags regarding the mounted card. */ sdcmode_t cardmode; + /** + * @brief Card CID. + */ + uint32_t cid[4]; + /** + * @brief Card CSD. + */ + uint32_t csd[4]; /* End of the mandatory fields.*/ }; diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 7cfac6705..2fd4e7f7b 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -127,7 +127,7 @@ void sdcStop(SDCDriver *sdcp) { * @api */ bool_t sdcConnect(SDCDriver *sdcp) { - uint32_t resp; + uint32_t resp[1]; chDbgCheck(sdcp != NULL, "sdcConnect"); @@ -136,9 +136,6 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdcp->state = SDC_INITNG; chSysUnlock(); - /* Resets card attributes.*/ - sdcp->cardmode = 0; - /* Card clock initialization.*/ sdc_lld_start_clk(sdcp); @@ -147,17 +144,19 @@ bool_t sdcConnect(SDCDriver *sdcp) { /* V2.0 cards detection.*/ if (!sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_IF_COND, - SDC_CMD8_PATTERN, &resp)) - sdcp->cardmode |= SDC_MODE_CARDTYPE_SDV20; + SDC_CMD8_PATTERN, resp)) + sdcp->cardmode = SDC_MODE_CARDTYPE_SDV20; /* Voltage verification.*/ - if (((resp >> 8) & 0xF) != 1) + if (((resp[0] >> 8) & 0xF) != 1) goto failed; - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) goto failed; else { /* MMC or SD detection.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, &resp)) - sdcp->cardmode |= SDC_MODE_CARDTYPE_MMC; + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) + sdcp->cardmode = SDC_MODE_CARDTYPE_MMC; + else + sdcp->cardmode = SDC_MODE_CARDTYPE_SDV11; } if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_MMC) { @@ -173,17 +172,36 @@ bool_t sdcConnect(SDCDriver *sdcp) { i = 0; while (TRUE) { chThdSleepMilliseconds(10); - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, &resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) goto failed; - if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, &resp)) + if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, resp)) goto failed; - if ((resp & 0x80000000) != 0) + if ((resp[0] & 0x80000000) != 0) break; if (++i >= SDC_ACMD41_RETRY) goto failed; } } + /* Reads CID.*/ + if (sdc_lld_send_cmd_long_crc(sdcp, SDC_CMD_ALL_SEND_CID, 0, sdcp->cid)) + goto failed; + + /* Asks for the RCA.*/ + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_RELATIVE_ADDR, 0, resp)) + goto failed; + + /* Reads CSD.*/ + if (sdc_lld_send_cmd_long_crc(sdcp, SDC_CMD_SEND_CSD, resp[0], sdcp->csd)) + goto failed; + + /* Switches to high speed.*/ + sdc_lld_set_data_clk(sdcp); + + /* Selects the card for operations.*/ + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, resp[0], resp)) + goto failed; + sdcp->state = SDC_ACTIVE; return FALSE; failed: -- cgit v1.2.3 From 82b9e1cf4c0de6be44e273f3e49c3efbd0895d3f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 May 2011 14:33:22 +0000 Subject: SDC card initialization works. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2911 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 8 +++++--- os/hal/src/sdc.c | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 4c43fe505..802145525 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -41,13 +41,15 @@ #define SDC_CMD_SEL_DESEL_CARD 7 #define SDC_CMD_SEND_IF_COND 8 #define SDC_CMD_SEND_CSD 9 +#define SDC_CMD_SET_BLOCKLEN 16 #define SDC_CMD_APP_OP_COND 41 #define SDC_CMD_APP_CMD 55 #define SDC_MODE_CARDTYPE_MASK 0xF -#define SDC_MODE_CARDTYPE_SDV11 0 /**< Card is V1.1 compliant. */ -#define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant. */ -#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ +#define SDC_MODE_CARDTYPE_SDV11 0 /**< Card is V1.1 compliant. */ +#define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant. */ +#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ +#define SDC_MODE_HIGH_CAPACITY 0x10 /**< High capacity card. */ #define SDC_CMD8_PATTERN 0x000001AA diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 2fd4e7f7b..a4b80e60b 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -176,8 +176,11 @@ bool_t sdcConnect(SDCDriver *sdcp) { goto failed; if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, resp)) goto failed; - if ((resp[0] & 0x80000000) != 0) + if ((resp[0] & 0x80000000) != 0) { + if (resp[0] & 0x40000000) + sdcp->cardmode |= SDC_MODE_HIGH_CAPACITY; break; + } if (++i >= SDC_ACMD41_RETRY) goto failed; } @@ -202,6 +205,17 @@ bool_t sdcConnect(SDCDriver *sdcp) { if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, resp[0], resp)) goto failed; + /* Block lenght fixed at 512 bytes.*/ + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCKLEN, 512, resp)) + goto failed; + + /* Switches to wide bus mode.*/ + switch (sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) { + case SDC_MODE_CARDTYPE_SDV11: + case SDC_MODE_CARDTYPE_SDV20: + SDIO->CLKCR |= SDIO_CLKCR_WIDBUS_0; + } + sdcp->state = SDC_ACTIVE; return FALSE; failed: @@ -228,6 +242,7 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { chSysLock(); chDbgAssert(sdcp->state == SDC_ACTIVE, "sdcDisconnect(), #1", "invalid state"); + sdc_lld_stop_clk(sdcp); sdcp->state = SDC_READY; chSysUnlock(); return FALSE; -- cgit v1.2.3 From e916f7d7bf83960a007a4ced5387f375198a868a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 May 2011 17:24:12 +0000 Subject: Fixed board files for Olimex STM32-H102 and STM32-P107. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2912 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/OLIMEX_STM32_H103/board.h | 2 +- boards/OLIMEX_STM32_P107/board.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/OLIMEX_STM32_H103/board.h b/boards/OLIMEX_STM32_H103/board.h index af25d7cae..9bd3625e1 100644 --- a/boards/OLIMEX_STM32_H103/board.h +++ b/boards/OLIMEX_STM32_H103/board.h @@ -47,7 +47,7 @@ */ #define GPIOA_BUTTON 0 -#define GPIOC_DISC 11 +#define GPIOC_USB_DISC 11 #define GPIOC_LED 12 /* diff --git a/boards/OLIMEX_STM32_P107/board.h b/boards/OLIMEX_STM32_P107/board.h index 968721fbd..373123880 100644 --- a/boards/OLIMEX_STM32_P107/board.h +++ b/boards/OLIMEX_STM32_P107/board.h @@ -82,9 +82,9 @@ * PA1 - Normal input (ETH_RMII_REF_CLK). * PA2 - Alternate output (ETH_RMII_MDIO). * PA3 - Input with PU (unconnected). - * PA4 - Normal input (MMC, external pull down). - * PA5 - Normal input (MMC, external pull up). - * PA6 - Normal input (MMC, external pull up). + * PA4 - Push Pull output (CS_MMC). + * PA5 - Input with PU (unconnected). + * PA6 - Input with PU (unconnected). * PA7 - Normal input (ETH_RMII_CRS_DV). * PA8 - Alternate output (MCO). * PA9 - Normal input (OTG_VBUS). @@ -95,7 +95,7 @@ * PA14 - Normal input (TCK). * PA15 - Normal input (TDI). */ -#define VAL_GPIOACRL 0x44448B44 /* PA7...PA0 */ +#define VAL_GPIOACRL 0x48838B44 /* PA7...PA0 */ #define VAL_GPIOACRH 0x4444444B /* PA15...PA8 */ #define VAL_GPIOAODR 0xFFFFFFFF @@ -106,7 +106,7 @@ * PB2 - Normal input (BOOT1). * PB3 - Normal input (TDO). * PB4 - Normal input (TRST). - * PB5 - Normal input (MMC, external pull up). + * PB5 - Input with PU (unconnected). * PB6 - Input with PU (unconnected). * PB7 - Input with PU (unconnected). * PB8 - Alternate O.D. (I2C1 SCL, remapped). -- cgit v1.2.3 From 9dd9aca2d4da2c346b3dd48ce532bdd07ac913f6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 May 2011 18:52:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2913 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index ecd09f1b8..bc6855fed 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -89,6 +89,7 @@ void sdc_lld_start(SDCDriver *sdcp) { if (sdcp->state == SDC_STOP) { /* Note, the DMA must be enabled before the IRQs.*/ dmaAllocate(STM32_DMA2_ID, STM32_DMA_CHANNEL_4, NULL, NULL); + dmaChannelSetPeripheral(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], &SDIO->FIFO); NVICEnableVector(SDIO_IRQn, CORTEX_PRIORITY_MASK(STM32_SDC_SDIO_IRQ_PRIORITY)); RCC->AHBENR |= RCC_AHBENR_SDIOEN; -- cgit v1.2.3 From 31456cb4fea72d79b9c1af9a5b0cc7e3fed1ed6e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 2 May 2011 15:23:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2914 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 43 ++++++++++++++++++++---------------- os/hal/platforms/STM32/sdc_lld.c | 36 ++++++++++++++++++++++++++++++ os/hal/platforms/STM32/sdc_lld.h | 2 ++ os/hal/src/sdc.c | 47 ++++++++++++++++++++++++++++++++++------ 4 files changed, 102 insertions(+), 26 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 802145525..38b907000 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -35,25 +35,30 @@ /* Driver constants. */ /*===========================================================================*/ -#define SDC_CMD_GO_IDLE_STATE 0 -#define SDC_CMD_ALL_SEND_CID 2 -#define SDC_CMD_SEND_RELATIVE_ADDR 3 -#define SDC_CMD_SEL_DESEL_CARD 7 -#define SDC_CMD_SEND_IF_COND 8 -#define SDC_CMD_SEND_CSD 9 -#define SDC_CMD_SET_BLOCKLEN 16 -#define SDC_CMD_APP_OP_COND 41 -#define SDC_CMD_APP_CMD 55 - -#define SDC_MODE_CARDTYPE_MASK 0xF -#define SDC_MODE_CARDTYPE_SDV11 0 /**< Card is V1.1 compliant. */ -#define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant. */ -#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ -#define SDC_MODE_HIGH_CAPACITY 0x10 /**< High capacity card. */ - -#define SDC_CMD8_PATTERN 0x000001AA - -#define SDC_ACMD41_RETRY 100 +#define SDC_BLOCK_SIZE 512 /**< Fixed block size. */ + +#define SDC_CMD_GO_IDLE_STATE 0 +#define SDC_CMD_ALL_SEND_CID 2 +#define SDC_CMD_SEND_RELATIVE_ADDR 3 +#define SDC_CMD_SEL_DESEL_CARD 7 +#define SDC_CMD_SEND_IF_COND 8 +#define SDC_CMD_SEND_CSD 9 +#define SDC_CMD_STOP_TRANSMISSION 12 +#define SDC_CMD_SET_BLOCKLEN 16 +#define SDC_CMD_READ_MULTIPLE_BLOCK 18 +#define SDC_CMD_WRITE_MULTIPLE_BLOCK 25 +#define SDC_CMD_APP_OP_COND 41 +#define SDC_CMD_APP_CMD 55 + +#define SDC_MODE_CARDTYPE_MASK 0xF +#define SDC_MODE_CARDTYPE_SDV11 0 /**< Card is V1.1 compliant.*/ +#define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant.*/ +#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ +#define SDC_MODE_HIGH_CAPACITY 0x10 /**< High capacity card. */ + +#define SDC_CMD8_PATTERN 0x000001AA + +#define SDC_ACMD41_RETRY 100 /*===========================================================================*/ /* Driver pre-compile time settings. */ diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index bc6855fed..b289da8ba 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -301,6 +301,42 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, return FALSE; } +/** + * @brief Data read through the SDIO bus. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[out] buf pointer to the read buffer + * @param[in] n number of blocks to read + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * read. + * @retval TRUE operation failed, the state of the buffer is uncertain. + * + * @notapi + */ +bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { + + return TRUE; +} + +/** + * @brief Data write through the SDIO bus. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[out] buf pointer to the write buffer + * @param[in] n number of blocks to write + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * written. + * @retval TRUE operation failed. + * + * @notapi + */ +bool_t sdc_lld_write_blocks(SDCDriver *sdcp, const uint8_t *buf, uint32_t n) { + + return TRUE; +} + #endif /* HAL_USE_SDC */ /** @} */ diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index e55205b53..349c1df95 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -172,6 +172,8 @@ extern "C" { uint32_t *resp); bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp); + bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buffer, uint32_t n); + bool_t sdc_lld_write_blocks(SDCDriver *sdcp, const uint8_t *buf, uint32_t n); #ifdef __cplusplus } #endif diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index a4b80e60b..847647de4 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -205,8 +205,9 @@ bool_t sdcConnect(SDCDriver *sdcp) { if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, resp[0], resp)) goto failed; - /* Block lenght fixed at 512 bytes.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCKLEN, 512, resp)) + /* Block length fixed at 512 bytes.*/ + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCKLEN, + SDC_BLOCK_SIZE, resp)) goto failed; /* Switches to wide bus mode.*/ @@ -237,7 +238,7 @@ failed: */ bool_t sdcDisconnect(SDCDriver *sdcp) { - chDbgCheck(sdcp != NULL, "sdcConnect"); + chDbgCheck(sdcp != NULL, "sdcDisconnect"); chSysLock(); chDbgAssert(sdcp->state == SDC_ACTIVE, @@ -255,7 +256,8 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { * * @param[in] sdcp pointer to the @p SDCDriver object * @param[in] startblk first block to read - * @param[out] buffer pointer to the read buffer + * @param[out] buf pointer to the read buffer + * @param[in] n number of blocks to read * @return The operation status. * @retval FALSE operation succeeded, the requested blocks have been * read. @@ -264,8 +266,23 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { * @api */ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, - uint8_t *buffer, uint32_t n) { + uint8_t *buf, uint32_t n) { + bool_t sts; + uint32_t resp[1]; + + chDbgCheck((sdcp != NULL) && (buffer != NULL) && (n > 0), "sdcRead"); + + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) + startblk *= SDC_BLOCK_SIZE; + + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, + startblk, resp)) + return TRUE; + sts = sdc_lld_read_blocks(sdcp, buffer, n); + sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, + 0, resp); + return sts; } /** @@ -275,7 +292,8 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, * * @param[in] sdcp pointer to the @p SDCDriver object * @param[in] startblk first block to write - * @param[out] buffer pointer to the write buffer + * @param[out] buf pointer to the write buffer + * @param[in] n number of blocks to write * @return The operation status. * @retval FALSE operation succeeded, the requested blocks have been * written. @@ -284,8 +302,23 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, * @api */ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, - const uint8_t *buffer, uint32_t n) { + const uint8_t *buf, uint32_t n) { + bool_t sts; + uint32_t resp[1]; + + chDbgCheck((sdcp != NULL) && (buffer != NULL) && (n > 0), "sdcWrite"); + + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) + startblk *= SDC_BLOCK_SIZE; + + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, + startblk, resp)) + return TRUE; + sts = sdc_lld_write_blocks(sdcp, buffer, n); + sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, + 0, resp); + return sts; } #endif /* HAL_USE_SDC */ -- cgit v1.2.3 From f6ed2f2a8427129c0d24dee81536dbcedaf2d793 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 2 May 2011 19:49:35 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2916 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 13 +++++++++++-- os/hal/platforms/STM32/sdc_lld.h | 4 ++++ os/hal/src/sdc.c | 8 ++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index b289da8ba..43493d8dd 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -75,6 +75,7 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { void sdc_lld_init(void) { sdcObjectInit(&SDCD1); + SDCD1.thread = NULL; } /** @@ -315,8 +316,16 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, * @notapi */ bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { - - return TRUE; + msg_t msg; + + chSysLock(); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #2", "not NULL"); + msg = chThdSelf()->p_u.rdymsg; + chSysUnlock(); + return msg != RDY_OK; } /** diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 349c1df95..4b27b92c1 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -141,6 +141,10 @@ struct SDCDriver { */ uint32_t csd[4]; /* End of the mandatory fields.*/ + /** + * @brief Tthread waiting for I/O completion IRQ. + */ + Thread *thread; }; /*===========================================================================*/ diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 847647de4..3188afb64 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -270,7 +270,7 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, bool_t sts; uint32_t resp[1]; - chDbgCheck((sdcp != NULL) && (buffer != NULL) && (n > 0), "sdcRead"); + chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; @@ -279,7 +279,7 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, startblk, resp)) return TRUE; - sts = sdc_lld_read_blocks(sdcp, buffer, n); + sts = sdc_lld_read_blocks(sdcp, buf, n); sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); return sts; @@ -306,7 +306,7 @@ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, bool_t sts; uint32_t resp[1]; - chDbgCheck((sdcp != NULL) && (buffer != NULL) && (n > 0), "sdcWrite"); + chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcWrite"); if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; @@ -315,7 +315,7 @@ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, startblk, resp)) return TRUE; - sts = sdc_lld_write_blocks(sdcp, buffer, n); + sts = sdc_lld_write_blocks(sdcp, buf, n); sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); return sts; -- cgit v1.2.3 From 3e42a8fe7620e26912ed27f626f771b6bd757b31 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 3 May 2011 20:36:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2917 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 5 +++++ os/hal/platforms/STM32/spi_lld.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 43493d8dd..69c04a41a 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -319,6 +319,11 @@ bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { msg_t msg; chSysLock(); + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + n * SDC_BLOCK_SIZE, buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_MINC | DMA_CCR1_EN); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index e5f4ed6c5..d8ae657a7 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -230,11 +230,11 @@ void spi_lld_start(SPIDriver *spip) { /* More DMA setup.*/ if ((spip->config->cr1 & SPI_CR1_DFF) == 0) spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | - DMA_CCR1_TEIE; /* 8 bits transfers. */ + DMA_CCR1_TEIE; /* 8 bits transfers. */ else spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | - DMA_CCR1_TEIE | DMA_CCR1_MSIZE_0 | - DMA_CCR1_PSIZE_0; /* 16 bits transfers. */ + DMA_CCR1_TEIE | DMA_CCR1_MSIZE_0 | + DMA_CCR1_PSIZE_0; /* 16 bits transfers. */ /* SPI setup and enable.*/ spip->spi->CR1 = 0; -- cgit v1.2.3 From f8c8c48fa989c71ab9b2e26677329ed108a779fb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 4 May 2011 14:38:02 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2920 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 29 ++++++++++++++++++++--------- os/hal/platforms/STM32/sdc_lld.h | 8 ++++++++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 69c04a41a..ae84f812e 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -96,9 +96,10 @@ void sdc_lld_start(SDCDriver *sdcp) { RCC->AHBENR |= RCC_AHBENR_SDIOEN; } /* Configuration, card clock is initially stopped.*/ - SDIO->POWER = 0; - SDIO->CLKCR = 0; - SDIO->DCTRL = 0; + SDIO->POWER = 0; + SDIO->CLKCR = 0; + SDIO->DCTRL = 0; + SDIO->DTIMER = STM32_SDC_DATATIMEOUT; } /** @@ -111,9 +112,10 @@ void sdc_lld_start(SDCDriver *sdcp) { void sdc_lld_stop(SDCDriver *sdcp) { if ((sdcp->state == SDC_READY) || (sdcp->state == SDC_ACTIVE)) { - SDIO->POWER = 0; - SDIO->CLKCR = 0; - SDIO->DCTRL = 0; + SDIO->POWER = 0; + SDIO->CLKCR = 0; + SDIO->DCTRL = 0; + SDIO->DTIMER = 0; /* Clock deactivation.*/ NVICDisableVector(SDIO_IRQn); @@ -319,11 +321,20 @@ bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { msg_t msg; chSysLock(); + /* Prepares the DMA channel.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], - n * SDC_BLOCK_SIZE, buf, + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, (STM32_SDC_SDIO_DMA_PRIORITY << 12) | - DMA_CCR1_MINC | DMA_CCR1_EN); - + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC); + SDIO->DLEN = n; + /* Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->DCTRL = SDIO_DCTRL_RWMOD | + SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_3 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + /* DMA channel activation.*/ + dmaEnableChannel(&STM32_DMA2, STM32_DMA_CHANNEL_4); chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 4b27b92c1..3f12dd4fc 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -35,10 +35,18 @@ /* Driver constants. */ /*===========================================================================*/ + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief SDIO data timeout in SDIO clock cycles. + */ +#if !defined(STM32_SDC_DATATIMEOUT) || defined(__DOXYGEN__) +#define STM32_SDC_DATATIMEOUT 0x000FFFFF +#endif + /** * @brief SDIO DMA priority (0..3|lowest..highest). */ -- cgit v1.2.3 From 7109dcee27d7fbfa77f1c9b16c934f6ca550f5d5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 May 2011 13:24:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2923 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 3 +++ os/hal/platforms/STM32/sdc_lld.c | 43 +++++++++++++++++++++++++++++----------- os/hal/platforms/STM32/sdc_lld.h | 6 ++++-- os/hal/src/sdc.c | 27 ++++++++++++++++++------- 4 files changed, 58 insertions(+), 21 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 38b907000..b0d7cfe4a 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -46,6 +46,7 @@ #define SDC_CMD_STOP_TRANSMISSION 12 #define SDC_CMD_SET_BLOCKLEN 16 #define SDC_CMD_READ_MULTIPLE_BLOCK 18 +#define SDC_CMD_SET_BLOCK_COUNT 23 #define SDC_CMD_WRITE_MULTIPLE_BLOCK 25 #define SDC_CMD_APP_OP_COND 41 #define SDC_CMD_APP_CMD 55 @@ -60,6 +61,8 @@ #define SDC_ACMD41_RETRY 100 +#define SDC_R1_ERROR_MASK 0xFDFFE008 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index ae84f812e..78a02028a 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -205,7 +205,7 @@ void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { SDIO->CMD = (uint32_t)cmd | SDIO_CMD_CPSMEN; while ((SDIO->STA & SDIO_STA_CMDSENT) == 0) ; - SDIO->ICR = 0xFFFFFFFF; + SDIO->ICR = SDIO_ICR_CMDSENTC; } /** @@ -233,7 +233,7 @@ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) == 0) ; - SDIO->ICR = 0xFFFFFFFF; + SDIO->ICR = SDIO_ICR_CMDRENDC | SDIO_ICR_CTIMEOUTC | SDIO_ICR_CCRCFAILC; if ((sta & (SDIO_STA_CTIMEOUT)) != 0) return TRUE; *resp = SDIO->RESP1; @@ -264,7 +264,7 @@ bool_t sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) == 0) ; - SDIO->ICR = 0xFFFFFFFF; + SDIO->ICR = SDIO_ICR_CMDRENDC | SDIO_ICR_CTIMEOUTC | SDIO_ICR_CCRCFAILC; if ((sta & (SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) != 0) return TRUE; *resp = SDIO->RESP1; @@ -297,7 +297,7 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, while (((sta = SDIO->STA) & (SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) == 0) ; - SDIO->ICR = 0xFFFFFFFF; + SDIO->ICR = SDIO_ICR_CMDRENDC | SDIO_ICR_CTIMEOUTC | SDIO_ICR_CCRCFAILC; if ((sta & (SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL)) != 0) return TRUE; *resp = SDIO->RESP1; @@ -305,9 +305,10 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, } /** - * @brief Data read through the SDIO bus. + * @brief Reads one or more blocks. * * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to read * @param[out] buf pointer to the read buffer * @param[in] n number of blocks to read * @return The operation status. @@ -317,24 +318,40 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, * * @notapi */ -bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { +bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, + uint8_t *buf, uint32_t n) { msg_t msg; + uint32_t resp[1]; - chSysLock(); - /* Prepares the DMA channel.*/ + /* Clearing status.*/ + SDIO->ICR = 0xFFFFFFFF; + + /* Prepares the DMA channel for reading.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, (STM32_SDC_SDIO_DMA_PRIORITY << 12) | DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | DMA_CCR1_MINC); + + /* Setting up data transfer. + Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->DTIMER = STM32_SDC_DATATIMEOUT; SDIO->DLEN = n; - /* Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ SDIO->DCTRL = SDIO_DCTRL_RWMOD | SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DMAEN | SDIO_DCTRL_DTEN; + /* DMA channel activation.*/ - dmaEnableChannel(&STM32_DMA2, STM32_DMA_CHANNEL_4); + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, n, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) { + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->DCTRL = 0; + return TRUE; + } + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); @@ -345,9 +362,10 @@ bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { } /** - * @brief Data write through the SDIO bus. + * @brief Writes one or more blocks. * * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to write * @param[out] buf pointer to the write buffer * @param[in] n number of blocks to write * @return The operation status. @@ -357,7 +375,8 @@ bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) { * * @notapi */ -bool_t sdc_lld_write_blocks(SDCDriver *sdcp, const uint8_t *buf, uint32_t n) { +bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, + const uint8_t *buf, uint32_t n) { return TRUE; } diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 3f12dd4fc..702e27d59 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -184,8 +184,10 @@ extern "C" { uint32_t *resp); bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp); - bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buffer, uint32_t n); - bool_t sdc_lld_write_blocks(SDCDriver *sdcp, const uint8_t *buf, uint32_t n); + bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, + uint8_t *buf, uint32_t n); + bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, + const uint8_t *buf, uint32_t n); #ifdef __cplusplus } #endif diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 3188afb64..1874510a0 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -211,11 +211,11 @@ bool_t sdcConnect(SDCDriver *sdcp) { goto failed; /* Switches to wide bus mode.*/ - switch (sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) { +/* switch (sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) { case SDC_MODE_CARDTYPE_SDV11: case SDC_MODE_CARDTYPE_SDV20: SDIO->CLKCR |= SDIO_CLKCR_WIDBUS_0; - } + }*/ sdcp->state = SDC_ACTIVE; return FALSE; @@ -268,20 +268,33 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { bool_t sts; - uint32_t resp[1]; + uint32_t resp[4]; chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); + chSysLock(); + chDbgAssert(sdcp->state == SDC_ACTIVE, + "sdcDisconnect(), #1", "invalid state"); + sdcp->state = SDC_READING; + chSysUnlock(); + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, - startblk, resp)) +/* if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) return TRUE; + if (sdc_lld_send_cmd_long_crc(sdcp, 51, 0, resp)) + return TRUE; + + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCK_COUNT, n, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) + return TRUE;*/ - sts = sdc_lld_read_blocks(sdcp, buf, n); + sts = sdc_lld_read(sdcp, startblk, buf, n); sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); + sdcp->state = SDC_ACTIVE; return sts; } @@ -315,7 +328,7 @@ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, startblk, resp)) return TRUE; - sts = sdc_lld_write_blocks(sdcp, buf, n); + sts = sdc_lld_write(sdcp, startblk, buf, n); sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); return sts; -- cgit v1.2.3 From 6dc70a8453a1a2b5953330dcd688f2121ad62732 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 May 2011 16:16:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2924 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 30 ++++++++++++++++++------------ os/hal/src/sdc.c | 12 ------------ testhal/STM32/SDIO/main.c | 6 +++++- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 78a02028a..cb6eb2099 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -321,10 +321,7 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { msg_t msg; - uint32_t resp[1]; - - /* Clearing status.*/ - SDIO->ICR = 0xFFFFFFFF; + uint32_t sts, resp[1]; /* Prepares the DMA channel for reading.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], @@ -335,8 +332,10 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, /* Setting up data transfer. Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ - SDIO->DTIMER = STM32_SDC_DATATIMEOUT; - SDIO->DLEN = n; + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE; + SDIO->DLEN = n; SDIO->DCTRL = SDIO_DCTRL_RWMOD | SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DMAEN | @@ -346,19 +345,26 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, n, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) { - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->DCTRL = 0; - return TRUE; - } + (resp[0] & SDC_R1_ERROR_MASK)) + goto error; + chSysLock(); chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #2", "not NULL"); msg = chThdSelf()->p_u.rdymsg; chSysUnlock(); - return msg != RDY_OK; + + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp)) + goto error; + return FALSE; +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; + return TRUE; } /** diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 1874510a0..25fe6a259 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -281,19 +281,7 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; -/* if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) - return TRUE; - if (sdc_lld_send_cmd_long_crc(sdcp, 51, 0, resp)) - return TRUE; - - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCK_COUNT, n, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) - return TRUE;*/ - sts = sdc_lld_read(sdcp, startblk, buf, n); - sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, - 0, resp); sdcp->state = SDC_ACTIVE; return sts; } diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 44a294655..09fe82a9c 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,6 +28,8 @@ static const SDCConfig sdccfg = { 0 }; +static uint8_t buf[SDC_BLOCK_SIZE]; + /* * Application entry point. */ @@ -47,7 +49,9 @@ int main(void) { * Initializes the SDIO drivers. */ sdcStart(&SDCD1, &sdccfg); - sdcConnect(&SDCD1); + if (!sdcConnect(&SDCD1)) { + sdcRead(&SDCD1, 0, buf, 1); + } /* * Normal main() thread activity. -- cgit v1.2.3 From d12cc995d567ff3c43af6e33a9eee5259c95e287 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 May 2011 19:33:47 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2925 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index cb6eb2099..1697c2964 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -59,6 +59,16 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { CH_IRQ_PROLOGUE(); + chSysLockFromIsr(); + if (SDCD1.thread != NULL) { + if ((SDIO->STA & SDIO_STA_DATAEND) != 0) + SDCD1.thread->p_u.rdymsg = RDY_OK; + else + SDCD1.thread->p_u.rdymsg = RDY_RESET; + chSchReadyI(SDCD1.thread); + SDCD1.thread = NULL; + } + chSysUnlockFromIsr(); CH_IRQ_EPILOGUE(); } @@ -320,8 +330,7 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, */ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { - msg_t msg; - uint32_t sts, resp[1]; + uint32_t sta, resp[1]; /* Prepares the DMA channel for reading.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], @@ -349,11 +358,24 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, goto error; chSysLock(); - chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); - sdcp->thread = chThdSelf(); - chSchGoSleepS(THD_STATE_SUSPENDED); - chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #2", "not NULL"); - msg = chThdSelf()->p_u.rdymsg; + sta = SDIO->STA; + if ((sta & SDIO_STA_DCRCFAIL | SDIO_STA_DTIMEOUT | + SDIO_STA_DATAEND | SDIO_STA_STBITERR) == 0) { + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #2", "not NULL"); + if (chThdSelf()->p_u.rdymsg != RDY_OK) { + chSysUnlock(); + goto error; + } + } + else { + if ((sta & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + } chSysUnlock(); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp)) -- cgit v1.2.3 From 9963cfac608cbe53e03339847a34318f637e6530 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 05:43:18 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2926 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/ST_STM3210E_EVAL/board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/ST_STM3210E_EVAL/board.h b/boards/ST_STM3210E_EVAL/board.h index 379f23ad1..459dc752d 100644 --- a/boards/ST_STM3210E_EVAL/board.h +++ b/boards/ST_STM3210E_EVAL/board.h @@ -28,7 +28,7 @@ /* * Board identifier. */ -#define BOARD_OLIMEX_STM32_P107 +#define BOARD_ST_STM3210E_EVAL #define BOARD_NAME "ST STM3210E-EVAL" /* -- cgit v1.2.3 From a8ea499b27805ce5fa109f64cfff073c9b077f3b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 05:58:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2927 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 9 +++++---- os/hal/src/sdc.c | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 1697c2964..8afb41509 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -344,7 +344,7 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, SDIO->ICR = 0xFFFFFFFF; SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE; - SDIO->DLEN = n; + SDIO->DLEN = n * SDC_BLOCK_SIZE; SDIO->DCTRL = SDIO_DCTRL_RWMOD | SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DMAEN | @@ -353,14 +353,15 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, /* DMA channel activation.*/ dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, n, resp) || + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, + startblk, resp) || (resp[0] & SDC_R1_ERROR_MASK)) goto error; chSysLock(); sta = SDIO->STA; - if ((sta & SDIO_STA_DCRCFAIL | SDIO_STA_DTIMEOUT | - SDIO_STA_DATAEND | SDIO_STA_STBITERR) == 0) { + if ((sta & (SDIO_STA_DCRCFAIL | SDIO_STA_DTIMEOUT | + SDIO_STA_DATAEND | SDIO_STA_STBITERR)) == 0) { chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 25fe6a259..3af421254 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -268,7 +268,6 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { bool_t sts; - uint32_t resp[4]; chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); -- cgit v1.2.3 From f6c6d6ca848c449727a57b83491e4b2ae0d868a3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 06:12:09 +0000 Subject: Now the driver is able to read blocks. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2928 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 8afb41509..74ffd4184 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -70,6 +70,8 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { } chSysUnlockFromIsr(); + SDIO->ICR = 0xFFFFFFFF; + CH_IRQ_EPILOGUE(); } @@ -345,8 +347,8 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE; SDIO->DLEN = n * SDC_BLOCK_SIZE; - SDIO->DCTRL = SDIO_DCTRL_RWMOD | - SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_3 | + SDIO->DCTRL = SDIO_DCTRL_DTDIR | + SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | SDIO_DCTRL_DMAEN | SDIO_DCTRL_DTEN; @@ -377,6 +379,10 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, goto error; } } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; chSysUnlock(); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp)) -- cgit v1.2.3 From 88d64d091d358cf8f1a3a30ed427b06588cc6323 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 06:12:32 +0000 Subject: Fixed bug 3298889. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2929 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/hal_lld_f103.h | 10 ---------- readme.txt | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/os/hal/platforms/STM32/hal_lld_f103.h b/os/hal/platforms/STM32/hal_lld_f103.h index d8f1bab9c..1f11da249 100644 --- a/os/hal/platforms/STM32/hal_lld_f103.h +++ b/os/hal/platforms/STM32/hal_lld_f103.h @@ -128,28 +128,19 @@ #define TIM1_CC_IRQHandler VectorAC /**< TIM1 Capture Compare. */ #define TIM2_IRQHandler VectorB0 /**< TIM2. */ #define TIM3_IRQHandler VectorB4 /**< TIM3. */ -#if !defined(STM32F10X_LD) || defined(__DOXYGEN__) #define TIM4_IRQHandler VectorB8 /**< TIM4. */ -#endif #define I2C1_EV_IRQHandler VectorBC /**< I2C1 Event. */ #define I2C1_ER_IRQHandler VectorC0 /**< I2C1 Error. */ -#if !defined(STM32F10X_LD) || defined(__DOXYGEN__) #define I2C2_EV_IRQHandler VectorC4 /**< I2C2 Event. */ #define I2C2_ER_IRQHandler VectorC8 /**< I2C2 Error. */ -#endif #define SPI1_IRQHandler VectorCC /**< SPI1. */ -#if !defined(STM32F10X_LD) || defined(__DOXYGEN__) #define SPI2_IRQHandler VectorD0 /**< SPI2. */ -#endif #define USART1_IRQHandler VectorD4 /**< USART1. */ #define USART2_IRQHandler VectorD8 /**< USART2. */ -#if !defined(STM32F10X_LD) || defined(__DOXYGEN__) #define USART3_IRQHandler VectorDC /**< USART3. */ -#endif #define EXTI15_10_IRQHandler VectorE0 /**< EXTI Line 15..10. */ #define RTCAlarm_IRQHandler VectorE4 /**< RTC Alarm through EXTI. */ #define USBWakeUp_IRQHandler VectorE8 /**< USB Wakeup from suspend. */ -#if defined(STM32F10X_HD) || defined(__DOXYGEN__) #define TIM8_BRK_IRQHandler VectorEC /**< TIM8 Break. */ #define TIM8_UP_IRQHandler VectorF0 /**< TIM8 Update. */ #define TIM8_TRG_COM_IRQHandler VectorF4 /**< TIM8 Trigger and @@ -168,7 +159,6 @@ #define DMA2_Ch2_IRQHandler Vector124 /**< DMA2 Channel2. */ #define DMA2_Ch3_IRQHandler Vector128 /**< DMA2 Channel3. */ #define DMA2_Ch4_5_IRQHandler Vector12C /**< DMA2 Channel4 & Channel5. */ -#endif /*===========================================================================*/ /* Driver pre-compile time settings. */ diff --git a/readme.txt b/readme.txt index 82ea21d54..cc32f992e 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed missing IRQ vectors amicable names for STM32 XL devices (bug + 3298889)(backported to 2.2.4). - FIX: Fixed wrong identifier in AVR serial driver (bug 3292084)(backported to 2.2.4). - FIX: Fixed wrong macro check for STM32 XL devices (bug 3291898)(backported -- cgit v1.2.3 From a02604be122fa2ebbe65a513fbb03abd2fdc8d78 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 09:08:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2931 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SDIO/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 09fe82a9c..30859f6be 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,7 +28,7 @@ static const SDCConfig sdccfg = { 0 }; -static uint8_t buf[SDC_BLOCK_SIZE]; +static uint8_t buf[SDC_BLOCK_SIZE * 16]; /* * Application entry point. @@ -50,7 +50,10 @@ int main(void) { */ sdcStart(&SDCD1, &sdccfg); if (!sdcConnect(&SDCD1)) { - sdcRead(&SDCD1, 0, buf, 1); + int i; + for (i = 0; i < 1000; i++) + if (sdcRead(&SDCD1, 0, buf, 16)) + chSysHalt(); } /* -- cgit v1.2.3 From 82215e70199aa16ccad770a0e47ca5131a3f8b93 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 09:16:22 +0000 Subject: All halcof.h files updated for the SDC driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2932 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7S-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 7 +++++++ demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 7 +++++++ demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 7 +++++++ demos/ARM7-LPC214x-G++/halconf.h | 7 +++++++ demos/ARM7-LPC214x-GCC/halconf.h | 7 +++++++ demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 7 +++++++ demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 7 +++++++ demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103-G++/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103/halconf.h | 7 +++++++ demos/ARMCM3-STM32F103ZG/halconf.h | 7 +++++++ demos/ARMCM3-STM32F107/halconf.h | 7 +++++++ demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ demos/AVR-ATmega128-GCC/halconf.h | 7 +++++++ demos/MSP430-MSP430x1611-GCC/halconf.h | 7 +++++++ demos/PPC-SPC563-GCC/halconf.h | 7 +++++++ demos/Posix-GCC/halconf.h | 7 +++++++ demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 7 +++++++ demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 7 +++++++ demos/STM8S-STM8S208-RC/halconf.h | 7 +++++++ demos/Win32-MinGW/halconf.h | 7 +++++++ os/hal/templates/halconf.h | 7 +++++++ test/coverage/halconf.h | 7 +++++++ testhal/LPC11xx/IRQ_STORM/halconf.h | 7 +++++++ testhal/LPC13xx/IRQ_STORM/halconf.h | 7 +++++++ testhal/STM32/ADC/halconf.h | 7 +++++++ testhal/STM32/CAN/halconf.h | 7 +++++++ testhal/STM32/GPT/halconf.h | 7 +++++++ testhal/STM32/IRQ_STORM/halconf.h | 7 +++++++ testhal/STM32/PWM-ICU/halconf.h | 7 +++++++ testhal/STM32/SDIO/halconf.h | 14 +++++++------- testhal/STM32/SPI/halconf.h | 7 +++++++ testhal/STM32/UART/halconf.h | 7 +++++++ testhal/STM32/USB_CDC/halconf.h | 7 +++++++ testhal/STM32/USB_MSC/halconf.h | 7 +++++++ testhal/STM8S/SPI/demo/halconf.h | 7 +++++++ 41 files changed, 287 insertions(+), 7 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index 9f6a7ef60..fabceae6c 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index 9f6a7ef60..fabceae6c 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 50ba3ae55..cca8ce169 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index 50ba3ae55..cca8ce169 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index 9f6a7ef60..fabceae6c 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index b5193b4db..73e7227c9 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index b5193b4db..73e7227c9 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index cea96035c..04f4fe05a 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM TRUE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index 9f6a7ef60..fabceae6c 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-STM32F103-G++/halconf.h b/demos/ARMCM3-STM32F103-G++/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARMCM3-STM32F103-G++/halconf.h +++ b/demos/ARMCM3-STM32F103-G++/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/ARMCM3-STM32F107/halconf.h +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 9c1d06fe3..ba3a80121 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 9c1d06fe3..ba3a80121 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 44c442d15..06a9b747d 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 9f736e7dd..e89032a9c 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index ceadd748b..2d8fbb44f 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 9f736e7dd..e89032a9c 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index 0f7d2cd9e..d790d67c2 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM TRUE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index 3f84017ff..215ec1099 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h index 0e01676fa..75e8ec1f7 100644 --- a/testhal/LPC11xx/IRQ_STORM/halconf.h +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h index 0e01676fa..75e8ec1f7 100644 --- a/testhal/LPC13xx/IRQ_STORM/halconf.h +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index d51d4bf64..4a81d0186 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 04c740c24..9676efeaa 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h index a2439fda3..db8540b7e 100644 --- a/testhal/STM32/GPT/halconf.h +++ b/testhal/STM32/GPT/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h index 0e01676fa..75e8ec1f7 100644 --- a/testhal/STM32/IRQ_STORM/halconf.h +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/PWM-ICU/halconf.h b/testhal/STM32/PWM-ICU/halconf.h index ce1d39cd7..fb12c4531 100644 --- a/testhal/STM32/PWM-ICU/halconf.h +++ b/testhal/STM32/PWM-ICU/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM TRUE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/SDIO/halconf.h b/testhal/STM32/SDIO/halconf.h index 57022db5b..bde4463a1 100644 --- a/testhal/STM32/SDIO/halconf.h +++ b/testhal/STM32/SDIO/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ @@ -111,13 +118,6 @@ #define HAL_USE_SERIAL_USB FALSE #endif -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE -#endif - /** * @brief Enables the SPI subsystem. */ diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index 2336c1647..c4ff88935 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index 58a7acbcb..e3bfb1dd0 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 3c22a95fe..5036ecb39 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h index cfec30ee7..27bddd0d7 100644 --- a/testhal/STM32/USB_MSC/halconf.h +++ b/testhal/STM32/USB_MSC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index 2336c1647..c4ff88935 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ -- cgit v1.2.3 From eb36dbf4fe229a76e09219fc6ed0b3ce9d81095f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 09:28:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2933 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 14 ++++++-------- os/hal/src/sdc.c | 18 ++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 74ffd4184..d6876d3be 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -334,13 +334,6 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { uint32_t sta, resp[1]; - /* Prepares the DMA channel for reading.*/ - dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], - (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, - (STM32_SDC_SDIO_DMA_PRIORITY << 12) | - DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | - DMA_CCR1_MINC); - /* Setting up data transfer. Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ SDIO->ICR = 0xFFFFFFFF; @@ -353,7 +346,12 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, SDIO_DCTRL_DTEN; /* DMA channel activation.*/ - dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + /* Prepares the DMA channel for reading.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_EN); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, startblk, resp) || diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 3af421254..42b7cd903 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -272,8 +272,7 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); chSysLock(); - chDbgAssert(sdcp->state == SDC_ACTIVE, - "sdcDisconnect(), #1", "invalid state"); + chDbgAssert(sdcp->state == SDC_ACTIVE, "sdcRead(), #1", "invalid state"); sdcp->state = SDC_READING; chSysUnlock(); @@ -304,20 +303,19 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { bool_t sts; - uint32_t resp[1]; - chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcWrite"); + chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); + + chSysLock(); + chDbgAssert(sdcp->state == SDC_ACTIVE, "sdcWrite(), #1", "invalid state"); + sdcp->state = SDC_WRITING; + chSysUnlock(); if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, - startblk, resp)) - return TRUE; - sts = sdc_lld_write(sdcp, startblk, buf, n); - sts = sts || sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, - 0, resp); + sdcp->state = SDC_ACTIVE; return sts; } -- cgit v1.2.3 From 82f529d70e6e0c3e1af5d2598809f307f40c95c0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 09:58:19 +0000 Subject: SDC write implemented (not tested yet=, optimizations to the SDC read. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2934 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 78 +++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 8 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index d6876d3be..a7a598c45 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -70,7 +70,9 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { } chSysUnlockFromIsr(); - SDIO->ICR = 0xFFFFFFFF; + /* Disables the source but the status flags are not reset because the + read/write function need to check them.*/ + SDIO->MASK = 0; CH_IRQ_EPILOGUE(); } @@ -332,7 +334,7 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, */ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { - uint32_t sta, resp[1]; + uint32_t resp[1]; /* Setting up data transfer. Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ @@ -353,26 +355,27 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | DMA_CCR1_EN); + /* Read multiple blocks command.*/ if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, startblk, resp) || (resp[0] & SDC_R1_ERROR_MASK)) goto error; + /* Note the mask is checked before going to sleep because the interrupt + may have occurred before reaching the critical zone.*/ chSysLock(); - sta = SDIO->STA; - if ((sta & (SDIO_STA_DCRCFAIL | SDIO_STA_DTIMEOUT | - SDIO_STA_DATAEND | SDIO_STA_STBITERR)) == 0) { - chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read(), #1", "not NULL"); sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); - chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #2", "not NULL"); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_read(), #2", "not NULL"); if (chThdSelf()->p_u.rdymsg != RDY_OK) { chSysUnlock(); goto error; } } else { - if ((sta & SDIO_STA_DATAEND) == 0) { + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { chSysUnlock(); goto error; } @@ -410,7 +413,66 @@ error: */ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { + uint32_t resp[1]; + /* Write multiple blocks command.*/ + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_MULTIPLE_BLOCK, + startblk, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) + return TRUE; + + /* Setting up data transfer. + Options: Controller to Card, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | + SDIO_MASK_STBITERRIE; + SDIO->DLEN = n * SDC_BLOCK_SIZE; + SDIO->DCTRL = SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + + /* DMA channel activation.*/ + /* Prepares the DMA channel for reading.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_DIR | DMA_CCR1_EN); + + /* Note the mask is checked before going to sleep because the interrupt + may have occurred before reaching the critical zone.*/ + chSysLock(); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #2", "not NULL"); + if (chThdSelf()->p_u.rdymsg != RDY_OK) { + chSysUnlock(); + goto error; + } + } + else { + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; + chSysUnlock(); + + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp)) + goto error; + return FALSE; +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; return TRUE; } -- cgit v1.2.3 From d3af6e7b166b43bfe68c69bebff518a45dcca02b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 10:02:48 +0000 Subject: SDC optimizations. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2935 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index a7a598c45..907651020 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -375,6 +375,7 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, } } else { + SDIO->MASK = 0; if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { chSysUnlock(); goto error; @@ -382,13 +383,10 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, } dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = 0; SDIO->DCTRL = 0; chSysUnlock(); - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp)) - goto error; - return FALSE; + return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); error: dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; @@ -454,6 +452,7 @@ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, } } else { + SDIO->MASK = 0; if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { chSysUnlock(); goto error; @@ -461,13 +460,10 @@ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, } dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = 0; SDIO->DCTRL = 0; chSysUnlock(); - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp)) - goto error; - return FALSE; + return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); error: dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; -- cgit v1.2.3 From 5287718f21e95e2718a7f459118dbcdc797b4bca Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 10:04:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2936 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SDIO/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 30859f6be..bd5375910 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -51,6 +51,7 @@ int main(void) { sdcStart(&SDCD1, &sdccfg); if (!sdcConnect(&SDCD1)) { int i; + /* Repeated multiple reads.*/ for (i = 0; i < 1000; i++) if (sdcRead(&SDCD1, 0, buf, 16)) chSysHalt(); -- cgit v1.2.3 From c12c9fc11ceb64ee99bf10a7661654ea278ff250 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 19:37:57 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2938 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 77 +++++----------------------------------- 1 file changed, 9 insertions(+), 68 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 907651020..7c7265b94 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -71,7 +71,7 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { chSysUnlockFromIsr(); /* Disables the source but the status flags are not reset because the - read/write function need to check them.*/ + read/write functions need to check them.*/ SDIO->MASK = 0; CH_IRQ_EPILOGUE(); @@ -336,6 +336,13 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { uint32_t resp[1]; + /* Prepares the DMA channel for reading.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC); + /* Setting up data transfer. Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ SDIO->ICR = 0xFFFFFFFF; @@ -348,21 +355,13 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, SDIO_DCTRL_DTEN; /* DMA channel activation.*/ - /* Prepares the DMA channel for reading.*/ - dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], - (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, - (STM32_SDC_SDIO_DMA_PRIORITY << 12) | - DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | - DMA_CCR1_EN); + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - /* Read multiple blocks command.*/ if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, startblk, resp) || (resp[0] & SDC_R1_ERROR_MASK)) goto error; - /* Note the mask is checked before going to sleep because the interrupt - may have occurred before reaching the critical zone.*/ chSysLock(); if (SDIO->MASK != 0) { chDbgAssert(sdcp->thread == NULL, "sdc_lld_read(), #1", "not NULL"); @@ -375,7 +374,6 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, } } else { - SDIO->MASK = 0; if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { chSysUnlock(); goto error; @@ -411,64 +409,7 @@ error: */ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { - uint32_t resp[1]; - - /* Write multiple blocks command.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_MULTIPLE_BLOCK, - startblk, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) - return TRUE; - - /* Setting up data transfer. - Options: Controller to Card, Block mode, DMA mode, 512 bytes blocks.*/ - SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | - SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | - SDIO_MASK_STBITERRIE; - SDIO->DLEN = n * SDC_BLOCK_SIZE; - SDIO->DCTRL = SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | - SDIO_DCTRL_DMAEN | - SDIO_DCTRL_DTEN; - - /* DMA channel activation.*/ - /* Prepares the DMA channel for reading.*/ - dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], - (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, - (STM32_SDC_SDIO_DMA_PRIORITY << 12) | - DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | - DMA_CCR1_DIR | DMA_CCR1_EN); - - /* Note the mask is checked before going to sleep because the interrupt - may have occurred before reaching the critical zone.*/ - chSysLock(); - if (SDIO->MASK != 0) { - chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #1", "not NULL"); - sdcp->thread = chThdSelf(); - chSchGoSleepS(THD_STATE_SUSPENDED); - chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #2", "not NULL"); - if (chThdSelf()->p_u.rdymsg != RDY_OK) { - chSysUnlock(); - goto error; - } - } - else { - SDIO->MASK = 0; - if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { - chSysUnlock(); - goto error; - } - } - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->ICR = 0xFFFFFFFF; - SDIO->DCTRL = 0; - chSysUnlock(); - return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); -error: - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = 0; - SDIO->DCTRL = 0; return TRUE; } -- cgit v1.2.3 From d7f3d8c7d973a2f009bd6a1f3a6cdc1d424558a2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 19:41:37 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2939 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 7c7265b94..96a523846 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -61,10 +61,6 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { chSysLockFromIsr(); if (SDCD1.thread != NULL) { - if ((SDIO->STA & SDIO_STA_DATAEND) != 0) - SDCD1.thread->p_u.rdymsg = RDY_OK; - else - SDCD1.thread->p_u.rdymsg = RDY_RESET; chSchReadyI(SDCD1.thread); SDCD1.thread = NULL; } @@ -368,16 +364,10 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, sdcp->thread = chThdSelf(); chSchGoSleepS(THD_STATE_SUSPENDED); chDbgAssert(sdcp->thread == NULL, "sdc_lld_read(), #2", "not NULL"); - if (chThdSelf()->p_u.rdymsg != RDY_OK) { - chSysUnlock(); - goto error; - } } - else { - if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { - chSysUnlock(); - goto error; - } + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; } dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; -- cgit v1.2.3 From 060ddb0dfc442f41b846f9bdd05e75d1e07589f4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 19:46:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2940 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/sdc_lld.c | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 96a523846..9b56591b7 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -399,7 +399,59 @@ error: */ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { + uint32_t resp[1]; + + /* Prepares the DMA channel for writing.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC | DMA_CCR1_DIR); + + /* Write multiple blocks command.*/ + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_MULTIPLE_BLOCK, + startblk, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) + return TRUE; + + /* Setting up data transfer. + Options: Controller to Card, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | + SDIO_MASK_STBITERRIE; + SDIO->DLEN = n * SDC_BLOCK_SIZE; + SDIO->DCTRL = SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + + /* DMA channel activation.*/ + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + /* Note the mask is checked before going to sleep because the interrupt + may have occurred before reaching the critical zone.*/ + chSysLock(); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #2", "not NULL"); + } + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->DCTRL = 0; + chSysUnlock(); + + return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; return TRUE; } -- cgit v1.2.3 From 3d0610f1cceb8f13b5b73dfe4dfd855450e69664 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 19:50:20 +0000 Subject: SDC write seems to work. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2941 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SDIO/main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index bd5375910..075af2cc3 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,7 +28,7 @@ static const SDCConfig sdccfg = { 0 }; -static uint8_t buf[SDC_BLOCK_SIZE * 16]; +static uint8_t buf[SDC_BLOCK_SIZE * 2]; /* * Application entry point. @@ -52,9 +52,18 @@ int main(void) { if (!sdcConnect(&SDCD1)) { int i; /* Repeated multiple reads.*/ - for (i = 0; i < 1000; i++) - if (sdcRead(&SDCD1, 0, buf, 16)) + for (i = 0; i < 5000; i++) { + if (sdcRead(&SDCD1, 0, buf, 2)) chSysHalt(); + } + if (sdcRead(&SDCD1, 0x10000, buf, 2)) + chSysHalt(); + if (sdcWrite(&SDCD1, 0x10000, buf, 2)) + chSysHalt(); + if (sdcRead(&SDCD1, 0x10000, buf, 2)) + chSysHalt(); + if (sdcDisconnect(&SDCD1)) + chSysHalt(); } /* -- cgit v1.2.3 From 86e53137e14f8acbc8997ef583c40db1c15939fe Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 May 2011 07:48:43 +0000 Subject: Fixed bug 3299306. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2942 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/AVR/serial_lld.h | 2 +- readme.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h index 7884045fd..f660b7d2d 100644 --- a/os/hal/platforms/AVR/serial_lld.h +++ b/os/hal/platforms/AVR/serial_lld.h @@ -106,7 +106,7 @@ typedef struct { * @brief Macro for baud rate computation. * @note Make sure the final baud rate is within tolerance. */ -#define UBRR(b) ((F_CPU / (b << 4)) - 1) +#define UBRR(b) (((F_CPU / b) >> 4) - 1) /*===========================================================================*/ /* External declarations. */ diff --git a/readme.txt b/readme.txt index cc32f992e..215a6e166 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.2 *** +- FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306)(backported + to 2.2.4). - FIX: Fixed missing IRQ vectors amicable names for STM32 XL devices (bug 3298889)(backported to 2.2.4). - FIX: Fixed wrong identifier in AVR serial driver (bug 3292084)(backported -- cgit v1.2.3 From 4e00ffa69c4b712d34ffce9a4aed5cae352b7d89 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 May 2011 09:05:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2943 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/sdc.dox | 103 ++++++++++++++++++++++++++++++++++++ os/hal/platforms/STM32/platform.dox | 43 +++++++++++++-- 2 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 os/hal/dox/sdc.dox diff --git a/os/hal/dox/sdc.dox b/os/hal/dox/sdc.dox new file mode 100644 index 000000000..925b1af8a --- /dev/null +++ b/os/hal/dox/sdc.dox @@ -0,0 +1,103 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @defgroup SDC SDC Driver + * @brief Generic SD Card Driver. + * @details This module implements a generic SDC (Secure Digital Card) driver. + * @pre In order to use the SDC driver the @p HAL_USE_SDC option + * must be enabled in @p halconf.h. + * + * @section sdc_1 Driver State Machine + * The driver implements a state machine internally, not all the driver + * functionalities can be used in any moment, any transition not explicitly + * shown in the following diagram has to be considered an error and shall + * be captured by an assertion (if enabled). + * @if LATEX_PDF + * @dot + digraph example { + size="5, 7"; + rankdir="LR"; + + node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"]; + edge [fontname=Sans, fontsize=8]; + + stop [label="SDC_STOP\nLow Power"]; + uninit [label="SDC_UNINIT", style="bold"]; + ready [label="SDC_READY\nClock Enabled"]; + connect [label="SDC_CONNECT\nConnecting"]; + active [label="SDC_ACTIVE\nCard Ready"]; + reading [label="SDC_READING\nReading"]; + writing [label="SDC_WRITING\nWriting"]; + + uninit -> stop [label=" sdcInit()", constraint=false]; + stop -> stop [label="\nsdcStop()"]; + stop -> ready [label="\nsdcStart()"]; + ready -> stop [label="\nsdcStop()"]; + ready -> ready [label="\nsdcStart()"]; + ready -> connect [label="\nsdcConnect()"]; + connect -> active [label="\nconnection\nsuccessful"]; + connect -> ready [label="\nconnection\nfailed"]; + active -> ready [label="\nsdcDisconnect()"]; + active -> reading [label="\nsdcRead()"]; + reading -> active [label="\nread finished\nread error"]; + active -> writing [label="\nsdcWrite()"]; + writing -> active [label="\nwrite finished\nwrite error"]; + } + * @enddot + * @else + * @dot + digraph example { + rankdir="LR"; + + node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"]; + edge [fontname=Sans, fontsize=8]; + + stop [label="SDC_STOP\nLow Power"]; + uninit [label="SDC_UNINIT", style="bold"]; + ready [label="SDC_READY\nClock Enabled"]; + connect [label="SDC_CONNECT\nConnecting"]; + active [label="SDC_ACTIVE\nCard Ready"]; + reading [label="SDC_READING\nReading"]; + writing [label="SDC_WRITING\nWriting"]; + + uninit -> stop [label=" sdcInit()", constraint=false]; + stop -> stop [label="\nsdcStop()"]; + stop -> ready [label="\nsdcStart()"]; + ready -> stop [label="\nsdcStop()"]; + ready -> ready [label="\nsdcStart()"]; + ready -> connect [label="\nsdcConnect()"]; + connect -> active [label="\nconnection\nsuccessful"]; + connect -> ready [label="\nconnection\nfailed"]; + active -> ready [label="\nsdcDisconnect()"]; + active -> reading [label="\nsdcRead()"]; + reading -> active [label="\nread finished\nread error"]; + active -> writing [label="\nsdcWrite()"]; + writing -> active [label="\nwrite finished\nwrite error"]; + } + * @enddot + * @endif + * + * @section sdc_2 SDC Operations. + * This driver allows to read or write single or multiple 512 bytes blocks + * on a SD Card. + * + * @ingroup IO + */ diff --git a/os/hal/platforms/STM32/platform.dox b/os/hal/platforms/STM32/platform.dox index b2d9583e4..1963e625e 100644 --- a/os/hal/platforms/STM32/platform.dox +++ b/os/hal/platforms/STM32/platform.dox @@ -62,7 +62,7 @@ * - Programmable ADC interrupt priority level. * - Programmable DMA bus priority for each DMA channel. * - Programmable DMA interrupt priority for each DMA channel. - * - Programmable DMA error hook for each DMA channel. + * - Programmable DMA error hook. * . * @ingroup STM32_DRIVERS */ @@ -119,6 +119,25 @@ * @ingroup STM32_DRIVERS */ +/** + * @defgroup STM32_ICU STM32 ICU Support + * @details The STM32 ICU driver uses the TIMx peripherals. + * + * @section stm32_icu_1 Supported HW resources + * - TIM1. + * - TIM2. + * - TIM3. + * - TIM4. + * - TIM5. + * . + * @section stm32_icu_2 STM32 ICU driver implementation features + * - Each timer can be independently enabled and programmed. Unused + * peripherals are left in low power mode. + * - Programmable TIMx interrupts priority level. + * . + * @ingroup STM32_DRIVERS + */ + /** * @defgroup STM32_PAL STM32 PAL Support * @details The STM32 PAL driver uses the GPIO peripherals. @@ -189,6 +208,24 @@ * @ingroup STM32_DRIVERS */ +/** + * @defgroup STM32_SDC STM32 SDC Support + * @details The STM32 SDC driver uses the SDIO peripheral. + * + * @section stm32_sdc_1 Supported HW resources + * - SDIO. + * - DMA2. + * . + * @section stm32_sdc_2 STM32 SDC driver implementation features + * - Clock stop for reduced power usage when the driver is in stop state. + * - Programmable interrupt priority. + * - DMA is used for receiving and transmitting. + * - Programmable DMA bus priority for each DMA channel. + * - Programmable DMA error hook. + * . + * @ingroup STM32_DRIVERS + */ + /** * @defgroup STM32_SERIAL STM32 Serial Support * @details The STM32 Serial driver uses the USART/UART peripherals in a @@ -232,7 +269,7 @@ * - DMA is used for receiving and transmitting. * - Programmable DMA bus priority for each DMA channel. * - Programmable DMA interrupt priority for each DMA channel. - * - Programmable DMA error hook for each DMA channel. + * - Programmable DMA error hook. * . * @ingroup STM32_DRIVERS */ @@ -259,7 +296,7 @@ * - DMA is used for receiving and transmitting. * - Programmable DMA bus priority for each DMA channel. * - Programmable DMA interrupt priority for each DMA channel. - * - Programmable DMA error hook for each DMA channel. + * - Programmable DMA error hook. * . * @ingroup STM32_DRIVERS */ -- cgit v1.2.3 From 539fc8bfc35d0d03c46d553d21c8f332f4a9eb55 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 May 2011 17:54:23 +0000 Subject: Enabled 4 bits mode enabling in the SDC driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2944 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 1 + os/hal/platforms/STM32/sdc_lld.h | 4 ++++ os/hal/src/sdc.c | 20 +++++++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index b0d7cfe4a..56ee267e1 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -40,6 +40,7 @@ #define SDC_CMD_GO_IDLE_STATE 0 #define SDC_CMD_ALL_SEND_CID 2 #define SDC_CMD_SEND_RELATIVE_ADDR 3 +#define SDC_CMD_SET_BUS_WIDTH 6 #define SDC_CMD_SEL_DESEL_CARD 7 #define SDC_CMD_SEND_IF_COND 8 #define SDC_CMD_SEND_CSD 9 diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 702e27d59..96639eb39 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -148,6 +148,10 @@ struct SDCDriver { * @brief Card CSD. */ uint32_t csd[4]; + /** + * @brief Card RCA. + */ + uint32_t rca; /* End of the mandatory fields.*/ /** * @brief Tthread waiting for I/O completion IRQ. diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 42b7cd903..334caec0d 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -173,7 +173,7 @@ bool_t sdcConnect(SDCDriver *sdcp) { while (TRUE) { chThdSleepMilliseconds(10); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) - goto failed; + goto failed; if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, resp)) goto failed; if ((resp[0] & 0x80000000) != 0) { @@ -191,18 +191,18 @@ bool_t sdcConnect(SDCDriver *sdcp) { goto failed; /* Asks for the RCA.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_RELATIVE_ADDR, 0, resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_RELATIVE_ADDR, 0, &sdcp->rca)) goto failed; /* Reads CSD.*/ - if (sdc_lld_send_cmd_long_crc(sdcp, SDC_CMD_SEND_CSD, resp[0], sdcp->csd)) + if (sdc_lld_send_cmd_long_crc(sdcp, SDC_CMD_SEND_CSD, sdcp->rca, sdcp->csd)) goto failed; /* Switches to high speed.*/ sdc_lld_set_data_clk(sdcp); /* Selects the card for operations.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, resp[0], resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, sdcp->rca, resp)) goto failed; /* Block length fixed at 512 bytes.*/ @@ -211,11 +211,17 @@ bool_t sdcConnect(SDCDriver *sdcp) { goto failed; /* Switches to wide bus mode.*/ -/* switch (sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) { + switch (sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) { case SDC_MODE_CARDTYPE_SDV11: case SDC_MODE_CARDTYPE_SDV20: - SDIO->CLKCR |= SDIO_CLKCR_WIDBUS_0; - }*/ + sdc_lld_set_bus_mode(sdcp, SDC_MODE_4BIT); + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, sdcp->rca, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) + goto failed; + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BUS_WIDTH, 2, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) + goto failed; + } sdcp->state = SDC_ACTIVE; return FALSE; -- cgit v1.2.3 From f91dff51cc155f265a65417087f3402e99f6e5ae Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 May 2011 19:30:55 +0000 Subject: Added SDC status check to sdcWrite(); git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2945 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 12 ++++++++++++ os/hal/platforms/STM32/sdc_lld.c | 12 ++++++++++-- os/hal/src/sdc.c | 12 ++++++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 56ee267e1..7c505a170 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -45,6 +45,7 @@ #define SDC_CMD_SEND_IF_COND 8 #define SDC_CMD_SEND_CSD 9 #define SDC_CMD_STOP_TRANSMISSION 12 +#define SDC_CMD_SEND_STATUS 13 #define SDC_CMD_SET_BLOCKLEN 16 #define SDC_CMD_READ_MULTIPLE_BLOCK 18 #define SDC_CMD_SET_BLOCK_COUNT 23 @@ -58,6 +59,17 @@ #define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ #define SDC_MODE_HIGH_CAPACITY 0x10 /**< High capacity card. */ +#define SDC_STS(r1) (((r1) >> 9) & 15) +#define SDC_STS_IDLE 0 +#define SDC_STS_READY 1 +#define SDC_STS_IDENT 2 +#define SDC_STS_STBY 3 +#define SDC_STS_TRAN 4 +#define SDC_STS_DATA 5 +#define SDC_STS_RCV 6 +#define SDC_STS_PRG 7 +#define SDC_STS_DIS 8 + #define SDC_CMD8_PATTERN 0x000001AA #define SDC_ACMD41_RETRY 100 diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 9b56591b7..a0d5965fc 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -399,7 +399,8 @@ error: */ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { - uint32_t resp[1]; + uint32_t sts, resp[1]; + bool_t err; /* Prepares the DMA channel for writing.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], @@ -446,7 +447,14 @@ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, SDIO->DCTRL = 0; chSysUnlock(); - return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); + err = sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); + do { + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_STATUS,sdcp->rca, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) + return TRUE; + sts = SDC_STS(resp[0]); + } while ((sts == SDC_STS_RCV) || (sts == SDC_STS_PRG)); + return err; error: dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 334caec0d..5e1bede8f 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -149,11 +149,13 @@ bool_t sdcConnect(SDCDriver *sdcp) { /* Voltage verification.*/ if (((resp[0] >> 8) & 0xF) != 1) goto failed; - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) goto failed; else { /* MMC or SD detection.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) sdcp->cardmode = SDC_MODE_CARDTYPE_MMC; else sdcp->cardmode = SDC_MODE_CARDTYPE_SDV11; @@ -172,7 +174,8 @@ bool_t sdcConnect(SDCDriver *sdcp) { i = 0; while (TRUE) { chThdSleepMilliseconds(10); - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) goto failed; if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, resp)) goto failed; @@ -207,7 +210,8 @@ bool_t sdcConnect(SDCDriver *sdcp) { /* Block length fixed at 512 bytes.*/ if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCKLEN, - SDC_BLOCK_SIZE, resp)) + SDC_BLOCK_SIZE, resp) || + (resp[0] & SDC_R1_ERROR_MASK)) goto failed; /* Switches to wide bus mode.*/ -- cgit v1.2.3 From 0cb8d71e9da98423ea75f0c77b05d4a441d57af8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 10 May 2011 18:33:49 +0000 Subject: SDC improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2946 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/dox/sdc.dox | 24 +++++---- os/hal/include/sdc.h | 109 +++++++++++++++++++++++++++++---------- os/hal/platforms/STM32/sdc_lld.c | 24 ++++----- os/hal/src/sdc.c | 103 +++++++++++++++++++++++++++--------- readme.txt | 2 + 5 files changed, 190 insertions(+), 72 deletions(-) diff --git a/os/hal/dox/sdc.dox b/os/hal/dox/sdc.dox index 925b1af8a..2a18977ff 100644 --- a/os/hal/dox/sdc.dox +++ b/os/hal/dox/sdc.dox @@ -42,7 +42,8 @@ stop [label="SDC_STOP\nLow Power"]; uninit [label="SDC_UNINIT", style="bold"]; ready [label="SDC_READY\nClock Enabled"]; - connect [label="SDC_CONNECT\nConnecting"]; + connecting [label="SDC_CONN.ING\nConnecting"]; + disconnecting [label="SDC_DISC.ING\nDisconnecting"]; active [label="SDC_ACTIVE\nCard Ready"]; reading [label="SDC_READING\nReading"]; writing [label="SDC_WRITING\nWriting"]; @@ -52,10 +53,11 @@ stop -> ready [label="\nsdcStart()"]; ready -> stop [label="\nsdcStop()"]; ready -> ready [label="\nsdcStart()"]; - ready -> connect [label="\nsdcConnect()"]; - connect -> active [label="\nconnection\nsuccessful"]; - connect -> ready [label="\nconnection\nfailed"]; - active -> ready [label="\nsdcDisconnect()"]; + ready -> connecting [label="\nsdcConnect()"]; + connecting -> active [label="\nconnection\nsuccessful"]; + connecting -> ready [label="\nconnection\nfailed"]; + disconnecting -> active [label="\nsdcDisconnect()", dir="back"]; + ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"]; active -> reading [label="\nsdcRead()"]; reading -> active [label="\nread finished\nread error"]; active -> writing [label="\nsdcWrite()"]; @@ -73,7 +75,8 @@ stop [label="SDC_STOP\nLow Power"]; uninit [label="SDC_UNINIT", style="bold"]; ready [label="SDC_READY\nClock Enabled"]; - connect [label="SDC_CONNECT\nConnecting"]; + connecting [label="SDC_CONN.ING\nConnecting"]; + disconnecting [label="SDC_DISC.ING\nDisconnecting"]; active [label="SDC_ACTIVE\nCard Ready"]; reading [label="SDC_READING\nReading"]; writing [label="SDC_WRITING\nWriting"]; @@ -83,10 +86,11 @@ stop -> ready [label="\nsdcStart()"]; ready -> stop [label="\nsdcStop()"]; ready -> ready [label="\nsdcStart()"]; - ready -> connect [label="\nsdcConnect()"]; - connect -> active [label="\nconnection\nsuccessful"]; - connect -> ready [label="\nconnection\nfailed"]; - active -> ready [label="\nsdcDisconnect()"]; + ready -> connecting [label="\nsdcConnect()"]; + connecting -> active [label="\nconnection\nsuccessful"]; + connecting -> ready [label="\nconnection\nfailed"]; + disconnecting -> active [label="\nsdcDisconnect()", dir="back"]; + ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"]; active -> reading [label="\nsdcRead()"]; reading -> active [label="\nread finished\nread error"]; active -> writing [label="\nsdcWrite()"]; diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 7c505a170..1c095221b 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -37,7 +37,34 @@ #define SDC_BLOCK_SIZE 512 /**< Fixed block size. */ +/** + * @brief Fixed pattern for CMD8. + */ +#define SDC_CMD8_PATTERN 0x000001AA + +#define SDC_MODE_CARDTYPE_MASK 0xF /**< @brief Card type mask. */ +#define SDC_MODE_CARDTYPE_SDV11 0 /**< @brief Card is SD V1.1.*/ +#define SDC_MODE_CARDTYPE_SDV20 1 /**< @brief Card is SD V2.0.*/ +#define SDC_MODE_CARDTYPE_MMC 2 /**< @brief Card is MMC. */ +#define SDC_MODE_HIGH_CAPACITY 0x10 /**< @brief High cap.card. */ + +/** + * @brief Mask of error bits in R1 responses. + */ +#define SDC_R1_ERROR_MASK 0xFDFFE008 + +#define SDC_STS_IDLE 0 +#define SDC_STS_READY 1 +#define SDC_STS_IDENT 2 +#define SDC_STS_STBY 3 +#define SDC_STS_TRAN 4 +#define SDC_STS_DATA 5 +#define SDC_STS_RCV 6 +#define SDC_STS_PRG 7 +#define SDC_STS_DIS 8 + #define SDC_CMD_GO_IDLE_STATE 0 +#define SDC_CMD_INIT 1 #define SDC_CMD_ALL_SEND_CID 2 #define SDC_CMD_SEND_RELATIVE_ADDR 3 #define SDC_CMD_SET_BUS_WIDTH 6 @@ -51,35 +78,40 @@ #define SDC_CMD_SET_BLOCK_COUNT 23 #define SDC_CMD_WRITE_MULTIPLE_BLOCK 25 #define SDC_CMD_APP_OP_COND 41 +#define SDC_CMD_LOCK_UNLOCK 42 #define SDC_CMD_APP_CMD 55 -#define SDC_MODE_CARDTYPE_MASK 0xF -#define SDC_MODE_CARDTYPE_SDV11 0 /**< Card is V1.1 compliant.*/ -#define SDC_MODE_CARDTYPE_SDV20 1 /**< Card is V2.0 compliant.*/ -#define SDC_MODE_CARDTYPE_MMC 2 /**< Card is MMC compliant. */ -#define SDC_MODE_HIGH_CAPACITY 0x10 /**< High capacity card. */ - -#define SDC_STS(r1) (((r1) >> 9) & 15) -#define SDC_STS_IDLE 0 -#define SDC_STS_READY 1 -#define SDC_STS_IDENT 2 -#define SDC_STS_STBY 3 -#define SDC_STS_TRAN 4 -#define SDC_STS_DATA 5 -#define SDC_STS_RCV 6 -#define SDC_STS_PRG 7 -#define SDC_STS_DIS 8 - -#define SDC_CMD8_PATTERN 0x000001AA - -#define SDC_ACMD41_RETRY 100 - -#define SDC_R1_ERROR_MASK 0xFDFFE008 - /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ @@ -95,10 +127,11 @@ typedef enum { SDC_UNINIT = 0, /**< Not initialized. */ SDC_STOP = 1, /**< Stopped. */ SDC_READY = 2, /**< Ready. */ - SDC_INITNG = 3, /**< Card initialization in progress. */ - SDC_ACTIVE = 4, /**< Cart initialized. */ - SDC_READING = 5, /**< Read operation in progress. */ - SDC_WRITING = 6, /**< Write operation in progress. */ + SDC_CONNECTING = 3, /**< Card connection in progress. */ + SDC_DISCONNECTING = 4, /**< Card disconnection in progress. */ + SDC_ACTIVE = 5, /**< Cart initialized. */ + SDC_READING = 6, /**< Read operation in progress. */ + SDC_WRITING = 7, /**< Write operation in progress. */ } sdcstate_t; #include "sdc_lld.h" @@ -107,6 +140,27 @@ typedef enum { /* Driver macros. */ /*===========================================================================*/ +/** + * @brief Evaluates to @p TRUE if the R1 response contains error flags. + * + * @param[in] r1 the r1 response + */ +#define SDC_R1_ERROR(r1) (((r1) & SDC_R1_ERROR_MASK) != 0) + +/** + * @brief Returns the status field of an R1 response. + * + * @param[in] r1 the r1 response + */ +#define SDC_R1_STS(r1) (((r1) >> 9) & 15) + +/** + * @brief Evaluates to @p TRUE if the R1 response indicates a locked card. + * + * @param[in] r1 the r1 response + */ +#define SDC_R1_IS_CARD_LOCKED(r1) (((r1) >> 21) & 1) + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -124,6 +178,7 @@ extern "C" { uint8_t *buffer, uint32_t n); bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buffer, uint32_t n); + bool_t sdc_wait_for_transfer_state(SDCDriver *sdcp); #ifdef __cplusplus } #endif diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index a0d5965fc..6f2ea95ba 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -332,6 +332,10 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { uint32_t resp[1]; + /* Checks for errors and waits for the card to be ready for reading.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; + /* Prepares the DMA channel for reading.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, @@ -355,7 +359,7 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, startblk, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) goto error; chSysLock(); @@ -399,8 +403,11 @@ error: */ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { - uint32_t sts, resp[1]; - bool_t err; + uint32_t resp[1]; + + /* Checks for errors and waits for the card to be ready for writing.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; /* Prepares the DMA channel for writing.*/ dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], @@ -412,7 +419,7 @@ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, /* Write multiple blocks command.*/ if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_MULTIPLE_BLOCK, startblk, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) return TRUE; /* Setting up data transfer. @@ -447,14 +454,7 @@ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, SDIO->DCTRL = 0; chSysUnlock(); - err = sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); - do { - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_STATUS,sdcp->rca, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) - return TRUE; - sts = SDC_STS(resp[0]); - } while ((sts == SDC_STS_RCV) || (sts == SDC_STS_PRG)); - return err; + return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); error: dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); SDIO->ICR = 0xFFFFFFFF; diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 5e1bede8f..7eaa8e631 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -43,6 +43,43 @@ /* Driver local functions. */ /*===========================================================================*/ +/** + * @brief Wait for the card to complete pending operations. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The operation status. + * @retval FALSE the card is now in transfer state. + * @retval TRUE an error occurred while waiting or the card is in an + * unexpected state. + * + * @notapi + */ +bool_t sdc_wait_for_transfer_state(SDCDriver *sdcp) { + uint32_t resp[1]; + + while (TRUE) { + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_STATUS, + sdcp->rca, resp) || + SDC_R1_ERROR(resp[0])) + return TRUE; + switch (SDC_R1_STS(resp[0])) { + case SDC_STS_TRAN: + return FALSE; + case SDC_STS_DATA: + case SDC_STS_RCV: + case SDC_STS_PRG: +#if SDC_NICE_WAITING + chThdSleepMilliseconds(1); +#endif + continue; + default: + /* The card should have been initialized so any other state is not + valid and is reported as an error.*/ + return TRUE; + } + } +} + /*===========================================================================*/ /* Driver exported functions. */ /*===========================================================================*/ @@ -133,7 +170,7 @@ bool_t sdcConnect(SDCDriver *sdcp) { chSysLock(); chDbgAssert(sdcp->state == SDC_READY, "mmcConnect(), #1", "invalid state"); - sdcp->state = SDC_INITNG; + sdcp->state = SDC_CONNECTING; chSysUnlock(); /* Card clock initialization.*/ @@ -150,32 +187,41 @@ bool_t sdcConnect(SDCDriver *sdcp) { if (((resp[0] >> 8) & 0xF) != 1) goto failed; if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) goto failed; else { - /* MMC or SD detection.*/ +#if SDC_MMC_SUPPORT + /* MMC or SD V1.1 detection.*/ if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) sdcp->cardmode = SDC_MODE_CARDTYPE_MMC; else +#endif /* SDC_MMC_SUPPORT */ sdcp->cardmode = SDC_MODE_CARDTYPE_SDV11; } - if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_MMC) { +#if SDC_MMC_SUPPORT + if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_MMC) { + /* TODO: MMC initialization.*/ + return TRUE; } - else { - uint32_t ocr = 0x80100000; + else +#endif /* SDC_MMC_SUPPORT */ + { unsigned i; + uint32_t ocr; + /* SD initialization.*/ if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_SDV20) - ocr |= 0x40000000; + ocr = 0xC0100000; + else + ocr = 0x80100000; /* SD-type initialization. */ i = 0; while (TRUE) { - chThdSleepMilliseconds(10); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, 0, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) goto failed; if (sdc_lld_send_cmd_short(sdcp, SDC_CMD_APP_OP_COND, ocr, resp)) goto failed; @@ -184,8 +230,9 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdcp->cardmode |= SDC_MODE_HIGH_CAPACITY; break; } - if (++i >= SDC_ACMD41_RETRY) + if (++i >= SDC_INIT_RETRY) goto failed; + chThdSleepMilliseconds(10); } } @@ -194,7 +241,8 @@ bool_t sdcConnect(SDCDriver *sdcp) { goto failed; /* Asks for the RCA.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_RELATIVE_ADDR, 0, &sdcp->rca)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEND_RELATIVE_ADDR, + 0, &sdcp->rca)) goto failed; /* Reads CSD.*/ @@ -205,13 +253,14 @@ bool_t sdcConnect(SDCDriver *sdcp) { sdc_lld_set_data_clk(sdcp); /* Selects the card for operations.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, sdcp->rca, resp)) + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SEL_DESEL_CARD, + sdcp->rca, resp)) goto failed; /* Block length fixed at 512 bytes.*/ if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BLOCKLEN, SDC_BLOCK_SIZE, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) goto failed; /* Switches to wide bus mode.*/ @@ -220,10 +269,10 @@ bool_t sdcConnect(SDCDriver *sdcp) { case SDC_MODE_CARDTYPE_SDV20: sdc_lld_set_bus_mode(sdcp, SDC_MODE_4BIT); if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_APP_CMD, sdcp->rca, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) goto failed; if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_SET_BUS_WIDTH, 2, resp) || - (resp[0] & SDC_R1_ERROR_MASK)) + SDC_R1_ERROR(resp[0])) goto failed; } @@ -253,9 +302,17 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { chSysLock(); chDbgAssert(sdcp->state == SDC_ACTIVE, "sdcDisconnect(), #1", "invalid state"); + sdcp->state = SDC_DISCONNECTING; + chSysUnlock(); + + /* Waits for eventual pending operations completion.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; + + /* Card clock stopped.*/ sdc_lld_stop_clk(sdcp); + sdcp->state = SDC_READY; - chSysUnlock(); return FALSE; } @@ -277,7 +334,7 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { */ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { - bool_t sts; + bool_t err; chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); @@ -289,9 +346,9 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; - sts = sdc_lld_read(sdcp, startblk, buf, n); + err = sdc_lld_read(sdcp, startblk, buf, n); sdcp->state = SDC_ACTIVE; - return sts; + return err; } /** @@ -312,7 +369,7 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, */ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { - bool_t sts; + bool_t err; chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); @@ -324,9 +381,9 @@ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) startblk *= SDC_BLOCK_SIZE; - sts = sdc_lld_write(sdcp, startblk, buf, n); + err = sdc_lld_write(sdcp, startblk, buf, n); sdcp->state = SDC_ACTIVE; - return sts; + return err; } #endif /* HAL_USE_SDC */ diff --git a/readme.txt b/readme.txt index 215a6e166..bedf49b1f 100644 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,8 @@ to 2.2.4). - FIX: Fixed spurious characters generated by Serial over USB driver (bug 3276379). +- NEW: Added new SDC driver model, Secure Digital Card. +- NEW: SDC driver implementation for STM32. - NEW: Updated the STM32 header file to the latest version 3.4.0, had to fix a bug regarding the STM32 XL sub-family. - NEW: New unified GCC startup file for Cortex-Mx processors, it is written -- cgit v1.2.3 From b381c928c7b9e08d0594395e532aeeed6cdc6a2b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 10 May 2011 18:37:26 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2947 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/stm32_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/hal/platforms/STM32/stm32_dma.c b/os/hal/platforms/STM32/stm32_dma.c index 023f2fdd3..621659a0b 100644 --- a/os/hal/platforms/STM32/stm32_dma.c +++ b/os/hal/platforms/STM32/stm32_dma.c @@ -370,7 +370,7 @@ void dmaAllocate(uint32_t dma, uint32_t channel, "dmaAllocate(), #2", "already allocated"); /* If the DMA unit was idle then the clock is enabled.*/ - if (dmamsk1 == 0) { + if (dmamsk2 == 0) { RCC->AHBENR |= RCC_AHBENR_DMA2EN; DMA2->IFCR = 0x0FFFFFFF; } -- cgit v1.2.3 From 463a7d9bc131df78aca375e16921f58e7dbbebdf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 12 May 2011 17:44:13 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2948 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/ARMCM3-STM32F103ZG/main.c b/demos/ARMCM3-STM32F103ZG/main.c index 7c66e1da4..5e1ac9863 100644 --- a/demos/ARMCM3-STM32F103ZG/main.c +++ b/demos/ARMCM3-STM32F103ZG/main.c @@ -75,7 +75,7 @@ int main(void) { * sleeping in a loop and check the button state. */ while (TRUE) { - if (palReadPad(GPIOG, GPIOG_USER_BUTTON)) + if (!palReadPad(GPIOG, GPIOG_USER_BUTTON)) TestThread(&SD1); chThdSleepMilliseconds(500); } -- cgit v1.2.3 From 16feb88c2dc82420390b56226e8fe7cbc49aeb3b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 13 May 2011 09:03:46 +0000 Subject: Fixed STM8S SPI driver. Fixed STM32 DMA2 channels 4 and 5 sharing. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2949 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/stm32_dma.c | 34 ++++++++++++++++++++++++++++++++++ os/hal/platforms/STM8S/spi_lld.c | 6 ++++-- readme.txt | 3 +++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/os/hal/platforms/STM32/stm32_dma.c b/os/hal/platforms/STM32/stm32_dma.c index 621659a0b..2232df448 100644 --- a/os/hal/platforms/STM32/stm32_dma.c +++ b/os/hal/platforms/STM32/stm32_dma.c @@ -251,6 +251,7 @@ CH_IRQ_HANDLER(DMA2_Ch3_IRQHandler) { CH_IRQ_EPILOGUE(); } +#if defined(STM32F10X_CL) || defined(__DOXYGEN__) /** * @brief DMA2 channel 4 shared interrupt handler. * @@ -286,6 +287,39 @@ CH_IRQ_HANDLER(DMA2_Ch5_IRQHandler) { CH_IRQ_EPILOGUE(); } + +#else /* !STM32F10X_CL */ +/** + * @brief DMA2 channels 4 and 5 shared interrupt handler. + * @note This IRQ is shared between DMA2 channels 4 and 5 so it is a + * bit less efficient because an extra check. + * + * @isr + */ +CH_IRQ_HANDLER(DMA2_Ch4_5_IRQHandler) { + uint32_t isr; + + CH_IRQ_PROLOGUE(); + + /* Check on channel 4.*/ + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_5 * 4); + if (isr & DMA_ISR_GIF1) { + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_5); + if (dma2[3].dmaisrfunc) + dma2[3].dmaisrfunc(dma2[3].dmaisrparam, isr); + } + + /* Check on channel 5.*/ + isr = STM32_DMA2->ISR >> (STM32_DMA_CHANNEL_4 * 4); + if (isr & DMA_ISR_GIF1) { + dmaClearChannel(STM32_DMA2, STM32_DMA_CHANNEL_5); + if (dma2[4].dmaisrfunc) + dma2[4].dmaisrfunc(dma2[4].dmaisrparam, isr); + } + + CH_IRQ_EPILOGUE(); +} +#endif /* !STM32F10X_CL */ #endif /* STM32_HAS_DMA2 */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM8S/spi_lld.c b/os/hal/platforms/STM8S/spi_lld.c index f9af72cde..57e459d80 100644 --- a/os/hal/platforms/STM8S/spi_lld.c +++ b/os/hal/platforms/STM8S/spi_lld.c @@ -130,8 +130,10 @@ void spi_lld_start(SPIDriver *spip) { CLK->PCKENR1 |= CLK_PCKENR1_SPI; /* PCKEN11, clock source. */ /* Configuration.*/ - SPI->CR2 = 0; - SPI->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SPE; + SPI->CR1 = 0; + SPI->CR1 = spip->config->cr1 | SPI_CR1_MSTR; + SPI->CR2 = SPI_CR2_SSI | SPI_CR2_SSM; + SPI->CR1 |= SPI_CR1_SPE; } /** diff --git a/readme.txt b/readme.txt index bedf49b1f..956fe764e 100644 --- a/readme.txt +++ b/readme.txt @@ -79,6 +79,9 @@ to 2.2.4). - FIX: Fixed wrong macro check for STM32 XL devices (bug 3291898)(backported to 2.2.4). +- FIX: Fixed SPI driver restart in STM32 SPI driver implementation, also + applied the same fix to the STM8S SPI driver (bug 3288758)(backported to + 2.2.4). - FIX: Fixed missing state transition in ADC driver (bug 3288149)(backported to 2.2.4). - FIX: Fixed missing state transition in SPI driver (bug 3288112)(backported -- cgit v1.2.3 From 85f17ebe017f0ef2a42d96eb3525346db5b9c65e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 13 May 2011 17:20:39 +0000 Subject: Customer CR. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2951 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-AT91SAM7S-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-AT91SAM7X-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-LPC214x-FATFS-GCC/chconf.h | 17 +++++++++++++++++ demos/ARM7-LPC214x-G++/chconf.h | 17 +++++++++++++++++ demos/ARM7-LPC214x-GCC/chconf.h | 17 +++++++++++++++++ demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-STM32F100-DISCOVERY/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-STM32F103-G++/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-STM32F103/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-STM32F103ZG/chconf.h | 17 +++++++++++++++++ demos/ARMCM3-STM32F107/chconf.h | 17 +++++++++++++++++ demos/AVR-AT90CANx-GCC/chconf.h | 17 +++++++++++++++++ demos/AVR-ATmega128-GCC/chconf.h | 17 +++++++++++++++++ demos/MSP430-MSP430x1611-GCC/chconf.h | 17 +++++++++++++++++ demos/PPC-SPC563-GCC/chconf.h | 17 +++++++++++++++++ demos/Posix-GCC/chconf.h | 17 +++++++++++++++++ demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h | 17 +++++++++++++++++ demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h | 17 +++++++++++++++++ demos/STM8S-STM8S208-RC/chconf.h | 17 +++++++++++++++++ demos/Win32-MinGW/chconf.h | 17 +++++++++++++++++ os/kernel/src/chsys.c | 4 ++++ os/kernel/src/chthreads.c | 3 +-- os/kernel/templates/chconf.h | 17 +++++++++++++++++ readme.txt | 3 +++ test/coverage/chconf.h | 17 +++++++++++++++++ testhal/LPC11xx/IRQ_STORM/chconf.h | 17 +++++++++++++++++ testhal/LPC13xx/IRQ_STORM/chconf.h | 17 +++++++++++++++++ testhal/STM32/ADC/chconf.h | 17 +++++++++++++++++ testhal/STM32/CAN/chconf.h | 17 +++++++++++++++++ testhal/STM32/GPT/chconf.h | 17 +++++++++++++++++ testhal/STM32/IRQ_STORM/chconf.h | 17 +++++++++++++++++ testhal/STM32/PWM-ICU/chconf.h | 17 +++++++++++++++++ testhal/STM32/SDIO/chconf.h | 17 +++++++++++++++++ testhal/STM32/SPI/chconf.h | 17 +++++++++++++++++ testhal/STM32/UART/chconf.h | 17 +++++++++++++++++ testhal/STM32/USB_CDC/chconf.h | 17 +++++++++++++++++ testhal/STM32/USB_MSC/chconf.h | 17 +++++++++++++++++ testhal/STM8S/SPI/demo/chconf.h | 17 +++++++++++++++++ 44 files changed, 705 insertions(+), 2 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7S-GCC/chconf.h b/demos/ARM7-AT91SAM7S-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-AT91SAM7S-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-GCC/chconf.h b/demos/ARM7-AT91SAM7X-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-AT91SAM7X-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index 90df768e1..4c2ee5818 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-G++/chconf.h b/demos/ARM7-LPC214x-G++/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-LPC214x-G++/chconf.h +++ b/demos/ARM7-LPC214x-G++/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-G++/chconf.h b/demos/ARMCM3-STM32F103-G++/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-STM32F103-G++/chconf.h +++ b/demos/ARMCM3-STM32F103-G++/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103ZG/chconf.h b/demos/ARMCM3-STM32F103ZG/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-STM32F103ZG/chconf.h +++ b/demos/ARMCM3-STM32F103ZG/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F107/chconf.h b/demos/ARMCM3-STM32F107/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/ARMCM3-STM32F107/chconf.h +++ b/demos/ARMCM3-STM32F107/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 644d792db..3d5fefb9f 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 644d792db..3d5fefb9f 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/MSP430-MSP430x1611-GCC/chconf.h b/demos/MSP430-MSP430x1611-GCC/chconf.h index 603aa8473..d0679aa2b 100644 --- a/demos/MSP430-MSP430x1611-GCC/chconf.h +++ b/demos/MSP430-MSP430x1611-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 512 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/PPC-SPC563-GCC/chconf.h b/demos/PPC-SPC563-GCC/chconf.h index 04fa822cc..14109b635 100644 --- a/demos/PPC-SPC563-GCC/chconf.h +++ b/demos/PPC-SPC563-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/Posix-GCC/chconf.h b/demos/Posix-GCC/chconf.h index acb041f00..6c00f9851 100644 --- a/demos/Posix-GCC/chconf.h +++ b/demos/Posix-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0x20000 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h index 24f9bed32..b76fd0017 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h index 24f9bed32..b76fd0017 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S208-RC/chconf.h b/demos/STM8S-STM8S208-RC/chconf.h index 24f9bed32..b76fd0017 100644 --- a/demos/STM8S-STM8S208-RC/chconf.h +++ b/demos/STM8S-STM8S208-RC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index acb041f00..6c00f9851 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0x20000 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 29f4bdc7e..5d3c0bcf4 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -35,6 +35,7 @@ #include "ch.h" +#if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__) /** * @brief Idle thread working area. * @see IDLE_THREAD_STACK_SIZE @@ -59,6 +60,7 @@ void _idle_thread(void *p) { IDLE_LOOP_HOOK(); } } +#endif /* CH_NO_IDLE_THREAD */ /** * @brief ChibiOS/RT initialization. @@ -93,11 +95,13 @@ void chSysInit(void) { currp->p_state = THD_STATE_CURRENT; chSysEnable(); +#if !CH_NO_IDLE_THREAD /* This thread has the lowest priority in the system, its role is just to serve interrupts in its context while keeping the lowest energy saving mode compatible with the system status.*/ chThdCreateStatic(_idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO, (tfunc_t)_idle_thread, NULL); +#endif } /** diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index 234cd6ae1..7df276bea 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -206,8 +206,7 @@ Thread *chThdCreateStatic(void *wsp, size_t size, tprio_t chThdSetPriority(tprio_t newprio) { tprio_t oldprio; - chDbgCheck((newprio >= LOWPRIO) && (newprio <= HIGHPRIO), - "chThdSetPriority"); + chDbgCheck(newprio <= HIGHPRIO, "chThdSetPriority"); chSysLock(); #if CH_USE_MUTEXES diff --git a/os/kernel/templates/chconf.h b/os/kernel/templates/chconf.h index 04fa822cc..14109b635 100644 --- a/os/kernel/templates/chconf.h +++ b/os/kernel/templates/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/readme.txt b/readme.txt index 956fe764e..9c4905aaf 100644 --- a/readme.txt +++ b/readme.txt @@ -88,6 +88,9 @@ to 2.2.4). - FIX: Fixed spurious characters generated by Serial over USB driver (bug 3276379). +- NEW: Added an option to the kernel to not spawn the Idle Thread from within + chSysInit(), this way the application can spawn a custom idle thread or + even use the main() thread as idle thread (backported to 2.2.4). - NEW: Added new SDC driver model, Secure Digital Card. - NEW: SDC driver implementation for STM32. - NEW: Updated the STM32 header file to the latest version 3.4.0, had to diff --git a/test/coverage/chconf.h b/test/coverage/chconf.h index b16d5d0d3..1810540d5 100644 --- a/test/coverage/chconf.h +++ b/test/coverage/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0x20000 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/LPC11xx/IRQ_STORM/chconf.h b/testhal/LPC11xx/IRQ_STORM/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/LPC11xx/IRQ_STORM/chconf.h +++ b/testhal/LPC11xx/IRQ_STORM/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/LPC13xx/IRQ_STORM/chconf.h b/testhal/LPC13xx/IRQ_STORM/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/LPC13xx/IRQ_STORM/chconf.h +++ b/testhal/LPC13xx/IRQ_STORM/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/ADC/chconf.h b/testhal/STM32/ADC/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/ADC/chconf.h +++ b/testhal/STM32/ADC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/CAN/chconf.h b/testhal/STM32/CAN/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/CAN/chconf.h +++ b/testhal/STM32/CAN/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/GPT/chconf.h b/testhal/STM32/GPT/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/GPT/chconf.h +++ b/testhal/STM32/GPT/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/IRQ_STORM/chconf.h b/testhal/STM32/IRQ_STORM/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/IRQ_STORM/chconf.h +++ b/testhal/STM32/IRQ_STORM/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/PWM-ICU/chconf.h b/testhal/STM32/PWM-ICU/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/PWM-ICU/chconf.h +++ b/testhal/STM32/PWM-ICU/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/SDIO/chconf.h b/testhal/STM32/SDIO/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/SDIO/chconf.h +++ b/testhal/STM32/SDIO/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/SPI/chconf.h b/testhal/STM32/SPI/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/SPI/chconf.h +++ b/testhal/STM32/SPI/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/UART/chconf.h b/testhal/STM32/UART/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/UART/chconf.h +++ b/testhal/STM32/UART/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/USB_CDC/chconf.h b/testhal/STM32/USB_CDC/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/USB_CDC/chconf.h +++ b/testhal/STM32/USB_CDC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM32/USB_MSC/chconf.h b/testhal/STM32/USB_MSC/chconf.h index 04fa822cc..14109b635 100644 --- a/testhal/STM32/USB_MSC/chconf.h +++ b/testhal/STM32/USB_MSC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 0 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ diff --git a/testhal/STM8S/SPI/demo/chconf.h b/testhal/STM8S/SPI/demo/chconf.h index 24f9bed32..b76fd0017 100644 --- a/testhal/STM8S/SPI/demo/chconf.h +++ b/testhal/STM8S/SPI/demo/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ -- cgit v1.2.3 From 44f0f5de70fcba3065397317b153170169824989 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 13 May 2011 17:34:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2952 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chsys.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h index da13ed22f..37d4cd7ce 100644 --- a/os/kernel/include/chsys.h +++ b/os/kernel/include/chsys.h @@ -29,8 +29,11 @@ #ifndef _CHSYS_H_ #define _CHSYS_H_ +#if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__) /** * @brief Returns a pointer to the idle thread. + * @pre In order to use this function the option @p CH_NO_IDLE_THREAD + * must be disabled. * @note The reference counter of the idle thread is not incremented but * it is not strictly required being the idle thread a static * object. @@ -40,6 +43,7 @@ * @api */ #define chSysGetIdleThread() ((Thread *)_idle_thread_wa) +#endif /** * @brief Halts the system. -- cgit v1.2.3 From 8af2607871d3a2f5bc92ce9fb095a23d7adab27b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 05:24:10 +0000 Subject: Updated HAL configuration files with SDC driver settings. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2953 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-AT91SAM7S-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-AT91SAM7X-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-LPC214x-G++/halconf.h | 30 ++++++++++++++++++++++ demos/ARM7-LPC214x-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-STM32F103-G++/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-STM32F103/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-STM32F103ZG/halconf.h | 30 ++++++++++++++++++++++ demos/ARMCM3-STM32F107/halconf.h | 30 ++++++++++++++++++++++ demos/AVR-AT90CANx-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/AVR-ATmega128-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/MSP430-MSP430x1611-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/PPC-SPC563-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/Posix-GCC/halconf.h | 30 ++++++++++++++++++++++ demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 30 ++++++++++++++++++++++ demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 30 ++++++++++++++++++++++ demos/STM8S-STM8S208-RC/halconf.h | 30 ++++++++++++++++++++++ demos/Win32-MinGW/halconf.h | 30 ++++++++++++++++++++++ os/hal/templates/halconf.h | 30 ++++++++++++++++++++++ test/coverage/halconf.h | 30 ++++++++++++++++++++++ testhal/LPC11xx/IRQ_STORM/halconf.h | 30 ++++++++++++++++++++++ testhal/LPC13xx/IRQ_STORM/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/ADC/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/CAN/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/GPT/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/IRQ_STORM/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/PWM-ICU/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/SDIO/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/SPI/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/UART/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/USB_CDC/halconf.h | 30 ++++++++++++++++++++++ testhal/STM32/USB_MSC/halconf.h | 30 ++++++++++++++++++++++ testhal/STM8S/SPI/demo/halconf.h | 30 ++++++++++++++++++++++ 41 files changed, 1230 insertions(+) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index fabceae6c..65bd52b57 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index fabceae6c..65bd52b57 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index cca8ce169..0841a0070 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index cca8ce169..0841a0070 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index fabceae6c..65bd52b57 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 73e7227c9..e26ce86df 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 73e7227c9..e26ce86df 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index 04f4fe05a..0da72cc49 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index fabceae6c..65bd52b57 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-G++/halconf.h b/demos/ARMCM3-STM32F103-G++/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARMCM3-STM32F103-G++/halconf.h +++ b/demos/ARMCM3-STM32F103-G++/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/ARMCM3-STM32F107/halconf.h +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index ba3a80121..d13f55b9d 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index ba3a80121..d13f55b9d 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 06a9b747d..43c383266 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index e89032a9c..37e5ce01f 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index 2d8fbb44f..86f2aceb2 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index e89032a9c..37e5ce01f 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index d790d67c2..8e6ae94dc 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index 215ec1099..58b3ec841 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h index 75e8ec1f7..4bc5ee823 100644 --- a/testhal/LPC11xx/IRQ_STORM/halconf.h +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h index 75e8ec1f7..4bc5ee823 100644 --- a/testhal/LPC13xx/IRQ_STORM/halconf.h +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index 4a81d0186..bf1eebf0a 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 9676efeaa..8d91f7f77 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h index db8540b7e..9595fe9b7 100644 --- a/testhal/STM32/GPT/halconf.h +++ b/testhal/STM32/GPT/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h index 75e8ec1f7..4bc5ee823 100644 --- a/testhal/STM32/IRQ_STORM/halconf.h +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/PWM-ICU/halconf.h b/testhal/STM32/PWM-ICU/halconf.h index fb12c4531..9dc90edd8 100644 --- a/testhal/STM32/PWM-ICU/halconf.h +++ b/testhal/STM32/PWM-ICU/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/SDIO/halconf.h b/testhal/STM32/SDIO/halconf.h index bde4463a1..682167d84 100644 --- a/testhal/STM32/SDIO/halconf.h +++ b/testhal/STM32/SDIO/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index c4ff88935..4456d44ba 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index e3bfb1dd0..b30c54bfe 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 5036ecb39..6bfb97d81 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h index 27bddd0d7..d9a0f6960 100644 --- a/testhal/STM32/USB_MSC/halconf.h +++ b/testhal/STM32/USB_MSC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index c4ff88935..4456d44ba 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From b0af64e71f7f6accd46bbbbe481d4753fd38cf21 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 05:27:09 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2954 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG/mcuconf.h | 7 +++++++ os/hal/platforms/STM32/sdc_lld.h | 11 +---------- testhal/STM32/SDIO/mcuconf.h | 7 +++++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/demos/ARMCM3-STM32F103ZG/mcuconf.h b/demos/ARMCM3-STM32F103ZG/mcuconf.h index 87186fdaf..99c5f9391 100644 --- a/demos/ARMCM3-STM32F103ZG/mcuconf.h +++ b/demos/ARMCM3-STM32F103ZG/mcuconf.h @@ -103,6 +103,13 @@ #define STM32_PWM_TIM4_IRQ_PRIORITY 7 #define STM32_PWM_TIM5_IRQ_PRIORITY 7 +/* + * SDC driver system settings. + */ +#define STM32_SDC_DATATIMEOUT 0x000FFFFF +#define STM32_SDC_SDIO_DMA_PRIORITY 3 +#define STM32_SDC_SDIO_IRQ_PRIORITY 9 + /* * SERIAL driver system settings. */ diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 96639eb39..4263e5d6d 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -51,7 +51,7 @@ * @brief SDIO DMA priority (0..3|lowest..highest). */ #if !defined(STM32_SDC_SDIO_DMA_PRIORITY) || defined(__DOXYGEN__) -#define STM32_SDC_SDIO_DMA_PRIORITY 2 +#define STM32_SDC_SDIO_DMA_PRIORITY 3 #endif /** @@ -61,15 +61,6 @@ #define STM32_SDC_SDIO_IRQ_PRIORITY 9 #endif -/** - * @brief SDIO DMA error hook. - * @note The default action for DMA errors is a system halt because DMA - * error can only happen because programming errors. - */ -#if !defined(STM32_SDC_DMA_ERROR_HOOK) || defined(__DOXYGEN__) -#define STM32_SDC_DMA_ERROR_HOOK(sdcp) chSysHalt() -#endif - /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ diff --git a/testhal/STM32/SDIO/mcuconf.h b/testhal/STM32/SDIO/mcuconf.h index 87186fdaf..99c5f9391 100644 --- a/testhal/STM32/SDIO/mcuconf.h +++ b/testhal/STM32/SDIO/mcuconf.h @@ -103,6 +103,13 @@ #define STM32_PWM_TIM4_IRQ_PRIORITY 7 #define STM32_PWM_TIM5_IRQ_PRIORITY 7 +/* + * SDC driver system settings. + */ +#define STM32_SDC_DATATIMEOUT 0x000FFFFF +#define STM32_SDC_SDIO_DMA_PRIORITY 3 +#define STM32_SDC_SDIO_IRQ_PRIORITY 9 + /* * SERIAL driver system settings. */ -- cgit v1.2.3 From 67e6534f658113f8bdfccab5fb6373214501d32b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 07:05:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2955 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7S-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 2 +- demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 2 +- demos/ARM7-LPC214x-G++/halconf.h | 2 +- demos/ARM7-LPC214x-GCC/halconf.h | 2 +- demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 2 +- demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 2 +- demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 2 +- demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 2 +- demos/ARMCM3-STM32F103-G++/halconf.h | 2 +- demos/ARMCM3-STM32F103/halconf.h | 2 +- demos/ARMCM3-STM32F103ZG/halconf.h | 2 +- demos/ARMCM3-STM32F107/halconf.h | 2 +- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- demos/AVR-ATmega128-GCC/halconf.h | 2 +- demos/MSP430-MSP430x1611-GCC/halconf.h | 2 +- demos/PPC-SPC563-GCC/halconf.h | 2 +- demos/Posix-GCC/halconf.h | 2 +- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 2 +- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 2 +- demos/STM8S-STM8S208-RC/halconf.h | 2 +- demos/Win32-MinGW/halconf.h | 2 +- os/hal/templates/halconf.h | 2 +- test/coverage/halconf.h | 2 +- testhal/LPC11xx/IRQ_STORM/halconf.h | 2 +- testhal/LPC13xx/IRQ_STORM/halconf.h | 2 +- testhal/STM32/ADC/halconf.h | 2 +- testhal/STM32/CAN/halconf.h | 2 +- testhal/STM32/GPT/halconf.h | 2 +- testhal/STM32/IRQ_STORM/halconf.h | 2 +- testhal/STM32/PWM-ICU/halconf.h | 2 +- testhal/STM32/SPI/halconf.h | 2 +- testhal/STM32/UART/halconf.h | 2 +- testhal/STM32/USB_CDC/halconf.h | 2 +- testhal/STM32/USB_MSC/halconf.h | 2 +- testhal/STM8S/SPI/demo/halconf.h | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index 65bd52b57..360c28876 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index 65bd52b57..360c28876 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 0841a0070..b7aeefdb9 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index 0841a0070..b7aeefdb9 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index 65bd52b57..360c28876 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index e26ce86df..7871a2a26 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index e26ce86df..7871a2a26 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index 0da72cc49..88819e3f4 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index 65bd52b57..360c28876 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103-G++/halconf.h b/demos/ARMCM3-STM32F103-G++/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARMCM3-STM32F103-G++/halconf.h +++ b/demos/ARMCM3-STM32F103-G++/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/ARMCM3-STM32F107/halconf.h +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index d13f55b9d..82a219d8d 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index d13f55b9d..82a219d8d 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 43c383266..a4924c834 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 37e5ce01f..8af25ee13 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index 86f2aceb2..b625dccb7 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 37e5ce01f..8af25ee13 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index 8e6ae94dc..d4c63365e 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index 58b3ec841..525e97ae8 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h index 4bc5ee823..ec8fe5145 100644 --- a/testhal/LPC11xx/IRQ_STORM/halconf.h +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h index 4bc5ee823..ec8fe5145 100644 --- a/testhal/LPC13xx/IRQ_STORM/halconf.h +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index bf1eebf0a..64e30249a 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 8d91f7f77..2d6f92417 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h index 9595fe9b7..c5ea28ae7 100644 --- a/testhal/STM32/GPT/halconf.h +++ b/testhal/STM32/GPT/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h index 4bc5ee823..ec8fe5145 100644 --- a/testhal/STM32/IRQ_STORM/halconf.h +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/PWM-ICU/halconf.h b/testhal/STM32/PWM-ICU/halconf.h index 9dc90edd8..9656ff0aa 100644 --- a/testhal/STM32/PWM-ICU/halconf.h +++ b/testhal/STM32/PWM-ICU/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index 4456d44ba..593a64f1b 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index b30c54bfe..9eb3f65d5 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 6bfb97d81..0c4b567dd 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h index d9a0f6960..f57c0be6a 100644 --- a/testhal/STM32/USB_MSC/halconf.h +++ b/testhal/STM32/USB_MSC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index 4456d44ba..593a64f1b 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** -- cgit v1.2.3 From 391474c15f0695d4b1bbe1549fefc98ef3cf9e4d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 07:11:40 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2956 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7S-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 2 +- demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 2 +- demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 2 +- demos/ARM7-LPC214x-G++/halconf.h | 2 +- demos/ARM7-LPC214x-GCC/halconf.h | 2 +- demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 2 +- demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 2 +- demos/ARMCM3-STM32F100-DISCOVERY/halconf.h | 2 +- demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 2 +- demos/ARMCM3-STM32F103-G++/halconf.h | 2 +- demos/ARMCM3-STM32F103/halconf.h | 2 +- demos/ARMCM3-STM32F103ZG/halconf.h | 2 +- demos/ARMCM3-STM32F107/halconf.h | 2 +- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- demos/AVR-ATmega128-GCC/halconf.h | 2 +- demos/MSP430-MSP430x1611-GCC/halconf.h | 2 +- demos/PPC-SPC563-GCC/halconf.h | 2 +- demos/Posix-GCC/halconf.h | 2 +- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 2 +- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h | 2 +- demos/STM8S-STM8S208-RC/halconf.h | 2 +- demos/Win32-MinGW/halconf.h | 2 +- os/hal/templates/halconf.h | 2 +- test/coverage/halconf.h | 2 +- testhal/LPC11xx/IRQ_STORM/halconf.h | 2 +- testhal/LPC13xx/IRQ_STORM/halconf.h | 2 +- testhal/STM32/ADC/halconf.h | 2 +- testhal/STM32/CAN/halconf.h | 2 +- testhal/STM32/GPT/halconf.h | 2 +- testhal/STM32/IRQ_STORM/halconf.h | 2 +- testhal/STM32/SPI/halconf.h | 2 +- testhal/STM32/UART/halconf.h | 2 +- testhal/STM32/USB_CDC/halconf.h | 2 +- testhal/STM32/USB_MSC/halconf.h | 2 +- testhal/STM8S/SPI/demo/halconf.h | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index 360c28876..33ecee26a 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index 360c28876..33ecee26a 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index b7aeefdb9..d3124c4d3 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index b7aeefdb9..d3124c4d3 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index 360c28876..33ecee26a 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 7871a2a26..41a25b6a1 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 7871a2a26..41a25b6a1 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h index 88819e3f4..0ed6eed8b 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index 360c28876..33ecee26a 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103-G++/halconf.h b/demos/ARMCM3-STM32F103-G++/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARMCM3-STM32F103-G++/halconf.h +++ b/demos/ARMCM3-STM32F103-G++/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/ARMCM3-STM32F107/halconf.h b/demos/ARMCM3-STM32F107/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/ARMCM3-STM32F107/halconf.h +++ b/demos/ARMCM3-STM32F107/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 82a219d8d..e3ea70d99 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 82a219d8d..e3ea70d99 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index a4924c834..13ccb9fa8 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 8af25ee13..7c6d8a758 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index b625dccb7..d36e56ec7 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 8af25ee13..7c6d8a758 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index d4c63365e..da86f61ed 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index 525e97ae8..2829fb066 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/LPC11xx/IRQ_STORM/halconf.h b/testhal/LPC11xx/IRQ_STORM/halconf.h index ec8fe5145..249e2a621 100644 --- a/testhal/LPC11xx/IRQ_STORM/halconf.h +++ b/testhal/LPC11xx/IRQ_STORM/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/LPC13xx/IRQ_STORM/halconf.h b/testhal/LPC13xx/IRQ_STORM/halconf.h index ec8fe5145..249e2a621 100644 --- a/testhal/LPC13xx/IRQ_STORM/halconf.h +++ b/testhal/LPC13xx/IRQ_STORM/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index 64e30249a..b42f9088b 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 2d6f92417..a7ae76b45 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/GPT/halconf.h b/testhal/STM32/GPT/halconf.h index c5ea28ae7..b4361f9b9 100644 --- a/testhal/STM32/GPT/halconf.h +++ b/testhal/STM32/GPT/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/IRQ_STORM/halconf.h b/testhal/STM32/IRQ_STORM/halconf.h index ec8fe5145..249e2a621 100644 --- a/testhal/STM32/IRQ_STORM/halconf.h +++ b/testhal/STM32/IRQ_STORM/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index 593a64f1b..eaf7f9673 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index 9eb3f65d5..d353272b7 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/USB_CDC/halconf.h b/testhal/STM32/USB_CDC/halconf.h index 0c4b567dd..3895ff70a 100644 --- a/testhal/STM32/USB_CDC/halconf.h +++ b/testhal/STM32/USB_CDC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM32/USB_MSC/halconf.h b/testhal/STM32/USB_MSC/halconf.h index f57c0be6a..2302e0179 100644 --- a/testhal/STM32/USB_MSC/halconf.h +++ b/testhal/STM32/USB_MSC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** diff --git a/testhal/STM8S/SPI/demo/halconf.h b/testhal/STM8S/SPI/demo/halconf.h index 593a64f1b..eaf7f9673 100644 --- a/testhal/STM8S/SPI/demo/halconf.h +++ b/testhal/STM8S/SPI/demo/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** -- cgit v1.2.3 From 2325c7b2f7c1dcd9f2ae26ac689dc8f3d4ac7cea Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 07:40:31 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2957 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/coverage.txt | 2 +- docs/reports/kernel.txt | 72 +++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/reports/coverage.txt b/docs/reports/coverage.txt index 731ba75d5..d831c9959 100644 --- a/docs/reports/coverage.txt +++ b/docs/reports/coverage.txt @@ -33,7 +33,7 @@ Lines executed:100.00% of 18 ../../os/kernel/src/chregistry.c:creating `chregistry.c.gcov' File `../../os/kernel/src/chsem.c' -Lines executed:100.00% of 89 +Lines executed:100.00% of 88 ../../os/kernel/src/chsem.c:creating `chsem.c.gcov' File `../../os/kernel/src/chmtx.c' diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index a998d8484..3bc809e5f 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -2,13 +2,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 11724 +Kernel Size = 11768 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 11252 +Kernel Size = 11296 Platform : PowerPC OS Setup : Minimal kernel @@ -20,13 +20,13 @@ Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 10216 +Kernel Size = 10244 Platform : PowerPC OS Setup : Full kernel Compiler : powerpc-eabi-gcc (Sourcery G++ Lite 4.4-79) 4.4.1 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 9720 +Kernel Size = 9748 Platform : PowerPC OS Setup : Minimal kernel @@ -38,13 +38,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 6128 +Kernel Size = 6136 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5628 +Kernel Size = 5636 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -56,13 +56,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5532 +Kernel Size = 5544 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5120 +Kernel Size = 5132 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -74,13 +74,13 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5328 +Kernel Size = 5340 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4944 +Kernel Size = 4956 Platform : ARM Cortex-M3 OS Setup : Minimal kernel @@ -92,49 +92,49 @@ Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5404 +Kernel Size = 5396 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5204 +Kernel Size = 5196 Platform : ARM Cortex-M0 OS Setup : Minimal kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -Kernel Size = 1304 +Kernel Size = 1280 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 4964 +Kernel Size = 4952 Platform : ARM Cortex-M0 OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 4800 +Kernel Size = 4788 Platform : ARM Cortex-M0 OS Setup : Minimal kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -Kernel Size = 1180 +Kernel Size = 1156 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8948 +Kernel Size = 8988 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8480 +Kernel Size = 8520 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -146,13 +146,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8296 +Kernel Size = 8324 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7936 +Kernel Size = 7964 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -164,13 +164,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8684 +Kernel Size = 8724 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 8228 +Kernel Size = 8268 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -182,13 +182,13 @@ Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 8024 +Kernel Size = 8052 Platform : ARM7TDMI (ARM mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 7684 +Kernel Size = 7712 Platform : ARM7TDMI (ARM mode) OS Setup : Minimal kernel @@ -200,13 +200,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5972 +Kernel Size = 5988 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5760 +Kernel Size = 5776 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -218,13 +218,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5544 +Kernel Size = 5556 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5356 +Kernel Size = 5368 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -236,13 +236,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5832 +Kernel Size = 5848 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -O2 -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5628 +Kernel Size = 5644 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -254,13 +254,13 @@ Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=TRUE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5348 +Kernel Size = 5360 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-none-eabi-gcc (GCC) 4.5.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DCH_OPTIMIZE_SPEED=FALSE -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5188 +Kernel Size = 5200 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel @@ -272,13 +272,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5848 +Kernel Size = 5840 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5436 +Kernel Size = 5432 Platform : MSP430 OS Setup : Minimal kernel @@ -290,13 +290,13 @@ Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=TRUE -Kernel Size = 5784 +Kernel Size = 5776 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -DCH_OPTIMIZE_SPEED=FALSE -Kernel Size = 5400 +Kernel Size = 5396 Platform : MSP430 OS Setup : Minimal kernel -- cgit v1.2.3 From c2693bcad09b0fa5e5fbf323d3e23c8ee0a2e1dc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 08:27:27 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2958 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/platform.dox | 1 - os/hal/platforms/STM32/sdc_lld.c | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/os/hal/platforms/STM32/platform.dox b/os/hal/platforms/STM32/platform.dox index 1963e625e..50ab84f38 100644 --- a/os/hal/platforms/STM32/platform.dox +++ b/os/hal/platforms/STM32/platform.dox @@ -221,7 +221,6 @@ * - Programmable interrupt priority. * - DMA is used for receiving and transmitting. * - Programmable DMA bus priority for each DMA channel. - * - Programmable DMA error hook. * . * @ingroup STM32_DRIVERS */ diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 6f2ea95ba..755fdf5ab 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -180,6 +180,7 @@ void sdc_lld_stop_clk(SDCDriver *sdcp) { * @brief Switches the bus to 4 bits mode. * * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] mode bus mode * * @notapi */ @@ -203,7 +204,7 @@ void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode) { * @brief Sends an SDIO command with no response expected. * * @param[in] sdcp pointer to the @p SDCDriver object - * @param[in[ cmd card command + * @param[in] cmd card command * @param[in] arg command argument * * @notapi @@ -223,7 +224,7 @@ void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) { * @note The CRC is not verified. * * @param[in] sdcp pointer to the @p SDCDriver object - * @param[in[ cmd card command + * @param[in] cmd card command * @param[in] arg command argument * @param[out] resp pointer to the response buffer (one word) * @return The operation status. @@ -254,7 +255,7 @@ bool_t sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, * @brief Sends an SDIO command with a short response expected and CRC. * * @param[in] sdcp pointer to the @p SDCDriver object - * @param[in[ cmd card command + * @param[in] cmd card command * @param[in] arg command argument * @param[out] resp pointer to the response buffer (one word) * @return The operation status. @@ -285,7 +286,7 @@ bool_t sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, * @brief Sends an SDIO command with a long response expected and CRC. * * @param[in] sdcp pointer to the @p SDCDriver object - * @param[in[ cmd card command + * @param[in] cmd card command * @param[in] arg command argument * @param[out] resp pointer to the response buffer (four words) * @return The operation status. -- cgit v1.2.3 From b793081d9605192373ea4fc1c1d7d5ca6e46e546 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 15 May 2011 13:05:47 +0000 Subject: Fixed bug 3302420. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2964 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c | 10 ++++++---- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c | 2 +- docs/Doxyfile_chm | 2 +- docs/Doxyfile_html | 2 +- os/kernel/include/ch.h | 4 ++-- readme.txt | 4 ++++ 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c index d9b619e4d..082f2db4d 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c @@ -91,11 +91,12 @@ void sys_sem_signal(sys_sem_t sem) { } u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout) { - systime_t time; + systime_t time, tmo; chSysLock(); + tmo = timeout > 0 ? (systime_t)timeout : TIME_INFINITE; time = chTimeNow(); - if (chSemWaitTimeoutS(sem, (systime_t)timeout) != RDY_OK) + if (chSemWaitTimeoutS(sem, tmo) != RDY_OK) time = SYS_ARCH_TIMEOUT; else time = chTimeNow() - time; @@ -135,11 +136,12 @@ err_t sys_mbox_trypost(sys_mbox_t mbox, void *msg) { } u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout) { - systime_t time; + systime_t time, tmo; chSysLock(); + tmo = timeout > 0 ? (systime_t)timeout : TIME_INFINITE; time = chTimeNow(); - if (chMBFetchS(mbox, (msg_t *)msg, (systime_t)timeout) != RDY_OK) + if (chMBFetchS(mbox, (msg_t *)msg, tmo) != RDY_OK) time = SYS_ARCH_TIMEOUT; else time = chTimeNow() - time; diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c index 7f3b93e59..8b2fd1854 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c @@ -142,7 +142,7 @@ static struct pbuf *low_level_input(struct netif *netif) { (void)netif; if (macWaitReceiveDescriptor(Ð1, &rd, TIME_IMMEDIATE) == RDY_OK) { - len = (u16_t)rd.rd_size; + len = (u16_t)rd.size; #if ETH_PAD_SIZE len += ETH_PAD_SIZE; /* allow room for Ethernet padding */ diff --git a/docs/Doxyfile_chm b/docs/Doxyfile_chm index 30610aa3b..f6580b758 100644 --- a/docs/Doxyfile_chm +++ b/docs/Doxyfile_chm @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.2 +PROJECT_NUMBER = 2.3.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/docs/Doxyfile_html b/docs/Doxyfile_html index 42fadd49d..0d2e6e31b 100644 --- a/docs/Doxyfile_html +++ b/docs/Doxyfile_html @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.2 +PROJECT_NUMBER = 2.3.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index be461e291..7d33e2397 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -40,7 +40,7 @@ /** * @brief Kernel version string. */ -#define CH_KERNEL_VERSION "2.3.2unstable" +#define CH_KERNEL_VERSION "2.3.3unstable" /** * @brief Kernel version major number. @@ -55,7 +55,7 @@ /** * @brief Kernel version patch number. */ -#define CH_KERNEL_PATCH 2 +#define CH_KERNEL_PATCH 3 /* * Common values. diff --git a/readme.txt b/readme.txt index 9c4905aaf..c294fbad2 100644 --- a/readme.txt +++ b/readme.txt @@ -70,6 +70,10 @@ *** Releases *** ***************************************************************************** +*** 2.3.3 *** +- FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420) + (backported to 2.2.4). + *** 2.3.2 *** - FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306)(backported to 2.2.4). -- cgit v1.2.3 From e0b53350156cef01da9b83e46127f7322e967909 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 May 2011 14:49:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2966 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/ch.h | 2 +- os/kernel/src/chsys.c | 2 +- os/kernel/templates/chcore.h | 82 ++++++++++++------ os/ports/GCC/ARMCMx/chcore.h | 182 ++++++++++++++------------------------- os/ports/GCC/ARMCMx/chcore_v6m.h | 95 +++++++++++--------- os/ports/GCC/ARMCMx/chcore_v7m.c | 40 ++++++--- os/ports/GCC/ARMCMx/chcore_v7m.h | 161 +++++++++++++++++++++++----------- os/ports/GCC/ARMCMx/port.dox | 37 ++++++-- readme.txt | 9 ++ test/test.c | 10 ++- test/testbmk.c | 8 +- 11 files changed, 366 insertions(+), 262 deletions(-) diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index 7d33e2397..db96d4338 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -95,7 +95,7 @@ #include "chdebug.h" #if !defined(__DOXYGEN__) -extern WORKING_AREA(_idle_thread_wa, IDLE_THREAD_STACK_SIZE); +extern WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE); #endif #ifdef __cplusplus diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 5d3c0bcf4..13a1a53fa 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -40,7 +40,7 @@ * @brief Idle thread working area. * @see IDLE_THREAD_STACK_SIZE */ -WORKING_AREA(_idle_thread_wa, IDLE_THREAD_STACK_SIZE); +WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE); /** * @brief This function implements the idle thread infinite loop. diff --git a/os/kernel/templates/chcore.h b/os/kernel/templates/chcore.h index f190dfbe3..2c69362b2 100644 --- a/os/kernel/templates/chcore.h +++ b/os/kernel/templates/chcore.h @@ -31,6 +31,48 @@ #ifndef _CHCORE_H_ #define _CHCORE_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/** + * @brief Stack size for the system idle thread. + * @details This size depends on the idle thread implementation, usually + * the idle thread should take no more space than those reserved + * by @p INT_REQUIRED_STACK. + */ +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 +#endif + +/** + * @brief Per-thread stack overhead for interrupts servicing. + * @details This constant is used in the calculation of the correct working + * area size. + * This value can be zero on those architecture where there is a + * separate interrupt stack and the stack space between @p intctx and + * @p extctx is known to be zero. + */ +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 0 +#endif + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + /** * @brief Unique macro for the implemented architecture. */ @@ -39,12 +81,26 @@ /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "" +#define CH_ARCHITECTURE_NAME "" /** * @brief Name of the architecture variant (optional). */ -#define CH_ARCHITECTURE_VARIANT_NAME "" +#define CH_ARCHITECTURE_VARIANT_NAME "" + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "GCC" + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "" + +/*===========================================================================*/ +/* Port implementation part. */ +/*===========================================================================*/ /** * @brief Base type for stack and memory alignment. @@ -84,28 +140,6 @@ struct context { #define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ } -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 0 -#endif - /** * @brief Enforces a correct alignment for a stack area size value. */ diff --git a/os/ports/GCC/ARMCMx/chcore.h b/os/ports/GCC/ARMCMx/chcore.h index c58b7bb3a..42df48a09 100644 --- a/os/ports/GCC/ARMCMx/chcore.h +++ b/os/ports/GCC/ARMCMx/chcore.h @@ -35,10 +35,10 @@ /* Port constants. */ /*===========================================================================*/ -#define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ -#define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ -#define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ -#define CORTEX_M4 4 /**< @brief Cortex-M4 variant. */ +#define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ +#define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ +#define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ +#define CORTEX_M4 4 /**< @brief Cortex-M4 variant. */ /* Inclusion of the Cortex-Mx implementation specific parameters.*/ #include "cmparams.h" @@ -51,33 +51,29 @@ #error "unknown or unsupported Cortex-M model" #endif -/*===========================================================================*/ -/* Port statically derived parameters. */ -/*===========================================================================*/ - /** * @brief Total priority levels. */ -#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS) +#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS) /** * @brief Minimum priority level. * @details This minimum priority level is calculated from the number of * priority bits supported by the specific Cortex-Mx implementation. */ -#define CORTEX_MINIMUM_PRIORITY (CORTEX_PRIORITY_LEVELS - 1) +#define CORTEX_MINIMUM_PRIORITY (CORTEX_PRIORITY_LEVELS - 1) /** * @brief Maximum priority level. * @details The maximum allowed priority level is always zero. */ -#define CORTEX_MAXIMUM_PRIORITY 0 +#define CORTEX_MAXIMUM_PRIORITY 0 /** * @brief Disabled value for BASEPRI register. * @note ARMv7-M architecture only. */ -#define CORTEX_BASEPRI_DISABLED 0 +#define CORTEX_BASEPRI_DISABLED 0 /*===========================================================================*/ /* Port macros. */ @@ -100,73 +96,54 @@ /*===========================================================================*/ /** - * @brief Enables the use of the WFI instruction in the idle thread loop. + * @brief Stack size for the system idle thread. + * @details This size depends on the idle thread implementation, usually + * the idle thread should take no more space than those reserved + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have + * a stack frame when compiling without optimizations. You may + * reduce this value to zero when compiling with optimizations. */ -#ifndef CORTEX_ENABLE_WFI_IDLE -#define CORTEX_ENABLE_WFI_IDLE FALSE +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** - * @brief SYSTICK handler priority. - * @note The default SYSTICK handler priority is calculated as the priority - * level in the middle of the numeric priorities range. + * @brief Per-thread stack overhead for interrupts servicing. + * @details This constant is used in the calculation of the correct working + * area size. + * This value can be zero on those architecture where there is a + * separate interrupt stack and the stack space between @p intctx and + * @p extctx is known to be zero. + * @note In this port it is conservatively set to 16 because the function + * @p chSchDoRescheduleI() can have a stack frame, expecially with + * compiler optimizations disabled. */ -#ifndef CORTEX_PRIORITY_SYSTICK -#define CORTEX_PRIORITY_SYSTICK (CORTEX_PRIORITY_LEVELS >> 1) -#else -/* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SYSTICK) -#error "invalid priority level specified for CORTEX_PRIORITY_SYSTICK" -#endif +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** - * @brief SVCALL handler priority. - * @note The default SVCALL handler priority is calculated as - * @p CORTEX_MAXIMUM_PRIORITY+1, in the ARMv7-M port this reserves - * the @p CORTEX_MAXIMUM_PRIORITY priority level as fast interrupts - * priority level. - * @note The SVCALL vector is only used in the ARMv7-M port, it is available - * to user in the ARMv6-M port. + * @brief Enables the use of the WFI instruction in the idle thread loop. */ -#ifndef CORTEX_PRIORITY_SVCALL -#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1) -#else -/* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL) -#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL" -#endif +#ifndef CORTEX_ENABLE_WFI_IDLE +#define CORTEX_ENABLE_WFI_IDLE FALSE #endif /** - * @brief PENDSV handler priority. - * @note The default PENDSV handler priority is set at the - * @p CORTEX_MINIMUM_PRIORITY priority level. - * @note The PENDSV vector is only used in the ARMv7-M legacy port, it is - * available to user in the ARMv6-M and ARMv7-M ports. - * @note In the ARMv7-M legacy port this value should be not changed from - * the minimum priority level. + * @brief SYSTICK handler priority. + * @note The default SYSTICK handler priority is calculated as the priority + * level in the middle of the numeric priorities range. */ -#ifndef CORTEX_PRIORITY_PENDSV -#define CORTEX_PRIORITY_PENDSV CORTEX_MINIMUM_PRIORITY +#ifndef CORTEX_PRIORITY_SYSTICK +#define CORTEX_PRIORITY_SYSTICK (CORTEX_PRIORITY_LEVELS >> 1) #else /* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_PENDSV) -#error "invalid priority level specified for CORTEX_PRIORITY_PENDSV" +#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SYSTICK) +#error "invalid priority level specified for CORTEX_PRIORITY_SYSTICK" #endif #endif -/** - * @brief BASEPRI level within kernel lock. - * @note This value must not mask the SVCALL priority level or the - * kernel would hard fault. - * @note ARMv7-M architecture only. - */ -#ifndef CORTEX_BASEPRI_KERNEL -#define CORTEX_BASEPRI_KERNEL \ - CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) -#endif - /** * @brief Stack alignment enforcement. * @note The default value is 64 in order to comply with EABI, reducing @@ -175,9 +152,13 @@ * @note Allowed values are 32 or 64. */ #ifndef CORTEX_STACK_ALIGNMENT -#define CORTEX_STACK_ALIGNMENT 64 +#define CORTEX_STACK_ALIGNMENT 64 #endif +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + /*===========================================================================*/ /* Port exported info. */ /*===========================================================================*/ @@ -187,57 +168,10 @@ */ #define CH_ARCHITECTURE_ARM -#if defined(__DOXYGEN__) -/** - * @brief Macro defining the specific ARM architecture. - * @note This macro is for documentation only, the real name changes - * depending on the selected architecture, the possible names are: - * - CH_ARCHITECTURE_ARM_v6M. - * - CH_ARCHITECTURE_ARM_v7M. - * . - */ -#define CH_ARCHITECTURE_ARM_vxm - /** - * @brief Name of the implemented architecture. - * @note The value is for documentation only, the real value changes - * depending on the selected architecture, the possible values are: - * - "ARMv6-M". - * - "ARMv7-M". - * - "ARMv7-ME". - * . + * @brief Name of the compiler supported by this port. */ -#define CH_ARCHITECTURE_NAME "ARMvx-M" - -/** - * @brief Name of the architecture variant (optional). - * @note The value is for documentation only, the real value changes - * depending on the selected architecture, the possible values are: - * - "Cortex-M0" - * - "Cortex-M1" - * - "Cortex-M3" - * - "Cortex-M4" - * . - */ -#define CH_CORE_VARIANT_NAME "Cortex-Mx" - -#elif CORTEX_MODEL == CORTEX_M4 -#define CH_ARCHITECTURE_ARM_v7M -#define CH_ARCHITECTURE_NAME "ARMv7-ME" -#define CH_CORE_VARIANT_NAME "Cortex-M4" -#elif CORTEX_MODEL == CORTEX_M3 -#define CH_ARCHITECTURE_ARM_v7M -#define CH_ARCHITECTURE_NAME "ARMv7-M" -#define CH_CORE_VARIANT_NAME "Cortex-M3" -#elif CORTEX_MODEL == CORTEX_M1 -#define CH_ARCHITECTURE_ARM_v6M -#define CH_ARCHITECTURE_NAME "ARMv6-M" -#define CH_CORE_VARIANT_NAME "Cortex-M1" -#elif CORTEX_MODEL == CORTEX_M0 -#define CH_ARCHITECTURE_ARM_v6M -#define CH_ARCHITECTURE_NAME "ARMv6-M" -#define CH_CORE_VARIANT_NAME "Cortex-M0" -#endif +#define CH_COMPILER_NAME "GCC "__VERSION__ /*===========================================================================*/ /* Port implementation part (common). */ @@ -294,6 +228,20 @@ struct context { struct intctx *r13; }; +/** + * @brief Platform dependent part of the @p chThdCreateI() API. + * @details This code usually setup the context switching frame represented + * by an @p intctx structure. + */ +#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ + tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ + wsize - \ + sizeof(struct intctx)); \ + tp->p_ctx.r13->r4 = pf; \ + tp->p_ctx.r13->r5 = arg; \ + tp->p_ctx.r13->lr = _port_thread_start; \ +} + /** * @brief Enforces a correct alignment for a stack area size value. */ @@ -302,10 +250,10 @@ struct context { /** * @brief Computes the thread working area global size. */ -#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ - sizeof(struct intctx) + \ - sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) +#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ + sizeof(struct intctx) + \ + sizeof(struct extctx) + \ + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. @@ -315,9 +263,9 @@ struct context { #define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)] /* Includes the architecture-specific implementation part.*/ -#if defined(CH_ARCHITECTURE_ARM_v6M) +#if (CORTEX_MODEL == CORTEX_M0) || (CORTEX_MODEL == CORTEX_M1) #include "chcore_v6m.h" -#elif defined(CH_ARCHITECTURE_ARM_v7M) +#elif (CORTEX_MODEL == CORTEX_M3) || (CORTEX_MODEL == CORTEX_M4) #include "chcore_v7m.h" #endif diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 0212fe6b3..3154bde56 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -29,6 +29,57 @@ #ifndef _CHCORE_V6M_H_ #define _CHCORE_V6M_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/** + * @brief BASEPRI level within kernel lock. + * @note The ARMv6-M architecture does not implement the BASEPRI register + * so the kernel always masks the whole priority range during + * a kernel lock. + */ +#define CORTEX_BASEPRI_KERNEL 0 + +/** + * @brief PendSV priority level. + * @note This priority is enforced to be equal to @p CORTEX_BASEPRI_KERNEL, + * this handler always have the highest priority that cannot preempt + * the kernel. + */ +#define CORTEX_PRIORITY_PENDSV CORTEX_BASEPRI_KERNEL + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + +/** + * @brief Macro defining the specific ARM architecture. + */ +#define CH_ARCHITECTURE_ARM_v7M + +/** + * @brief Name of the implemented architecture. + */ +#define CH_ARCHITECTURE_NAME "ARMv6-M" + +/** + * @brief Name of the architecture variant. + */ +#if (CORTEX_MODEL == CORTEX_M0) || defined(__DOXYGEN__) +#define CH_CORE_VARIANT_NAME "Cortex-M0" +#elif (CORTEX_MODEL == CORTEX_M1) +#define CH_CORE_VARIANT_NAME "Cortex-M1" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ @@ -58,48 +109,6 @@ struct intctx { }; #endif -/** - * @brief Platform dependent part of the @p chThdCreateI() API. - * @details This code usually setup the context switching frame represented - * by an @p intctx structure. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ - wsize - \ - sizeof(struct intctx)); \ - tp->p_ctx.r13->r4 = pf; \ - tp->p_ctx.r13->r5 = arg; \ - tp->p_ctx.r13->lr = _port_thread_start; \ -} - -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have - * a stack frame when compiling without optimizations. You may - * reduce this value to zero when compiling with optimizations. - */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 16 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - * @note In this port it is conservatively set to 16 because the function - * @p chSchDoRescheduleI() can have a stack frame, expecially with - * compiler optimizations disabled. - */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 -#endif - /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -135,6 +144,8 @@ struct intctx { */ #define port_init() { \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ + NVICSetSystemHandlerPriority(HANDLER_PENDSV, \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_PENDSV)); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ } diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c index c71102127..da3f7b956 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/chcore_v7m.c @@ -28,7 +28,6 @@ #include "ch.h" -#if !defined(CH_CURRP_REGISTER_CACHE) || defined(__DOXXYGEN__) /** * @brief Internal context stacking. */ @@ -44,17 +43,6 @@ asm volatile ("pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}" \ : : : "memory"); \ } -#else /* defined(CH_CURRP_REGISTER_CACHE) */ -#define PUSH_CONTEXT() { \ - asm volatile ("push {r4, r5, r6, r8, r9, r10, r11, lr}" \ - : : : "memory"); \ -} - -#define POP_CONTEXT() { \ - asm volatile ("pop {r4, r5, r6, r8, r9, r10, r11, pc}" \ - : : : "memory"); \ -} -#endif /* defined(CH_CURRP_REGISTER_CACHE) */ #if !CH_OPTIMIZE_SPEED void _port_lock(void) { @@ -84,10 +72,12 @@ CH_IRQ_HANDLER(SysTickVector) { CH_IRQ_EPILOGUE(); } +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) /** * @brief SVC vector. * @details The SVC vector is used for exception mode re-entering after a * context switch. + * @note The PendSV vector is only used in advanced kernel mode. */ void SVCallVector(void) { register struct extctx *ctxp; @@ -99,6 +89,25 @@ void SVCallVector(void) { asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); port_unlock_from_isr(); } +#endif /* !CORTEX_SIMPLIFIED_PRIORITY */ + +#if CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +/** + * @brief PendSV vector. + * @details The PendSV vector is used for exception mode re-entering after a + * context switch. + * @note The PendSV vector is only used in normal kernel mode. + */ +void PendSVVector(void) { + register struct extctx *ctxp; + + /* Discarding the current exception context and positioning the stack to + point to the real one.*/ + asm volatile ("mrs %0, PSP" : "=r" (ctxp) : : "memory"); + ctxp++; + asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); +} +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Reschedule verification and setup after an IRQ. @@ -134,7 +143,14 @@ __attribute__((naked)) void _port_switch_from_isr(void) { chSchDoRescheduleI(); +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) asm volatile ("svc #0"); +#else /* CORTEX_SIMPLIFIED_PRIORITY */ + SCB_ICSR = ICSR_PENDSVSET; + port_unlock(); + while (TRUE) + ; +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ } /** diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index a7f02aece..ef7860b87 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -29,6 +29,93 @@ #ifndef _CHCORE_V7M_H_ #define _CHCORE_V7M_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/** + * @brief Simplified priority handling flag. + * @details Activating this option will make the Kernel work in normal mode. + */ +#ifndef CORTEX_SIMPLIFIED_PRIORITY +#define CORTEX_SIMPLIFIED_PRIORITY FALSE +#endif + +/** + * @brief SVCALL handler priority. + * @note The default SVCALL handler priority is defaulted to + * @p CORTEX_MAXIMUM_PRIORITY+1, this reserves the + * @p CORTEX_MAXIMUM_PRIORITY priority level as fast interrupts + * priority level. + */ +#ifndef CORTEX_PRIORITY_SVCALL +#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1) +#else +/* If it is externally redefined then better perform a validity check on it.*/ +#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL) +#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL" +#endif +#endif + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/** + * @brief BASEPRI level within kernel lock. + * @note In normal kernel mode this constant value is enforced to zero. + */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#define CORTEX_BASEPRI_KERNEL \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) +#else +#define CORTEX_BASEPRI_KERNEL 0 +#endif + +/** + * @brief PendSV priority level. + * @note This priority is enforced to be equal to @p CORTEX_BASEPRI_KERNEL, + * this handler always have the highest priority that cannot preempt + * the kernel. + */ +#define CORTEX_PRIORITY_PENDSV CORTEX_BASEPRI_KERNEL + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + +/** + * @brief Macro defining the specific ARM architecture. + */ +#define CH_ARCHITECTURE_ARM_v7M + +/** + * @brief Name of the implemented architecture. + */ +#define CH_ARCHITECTURE_NAME "ARMv7-M" + +/** + * @brief Name of the architecture variant. + */ +#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__) +#define CH_CORE_VARIANT_NAME "Cortex-M3" +#elif (CORTEX_MODEL == CORTEX_M4) +#define CH_CORE_VARIANT_NAME "Cortex-M4" +#endif + +/** + * @brief Port-specific information string. + */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#define CH_PORT_INFO "Advanced kernel mode" +#else +#define CH_PORT_INFO "Normal kernel mode" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ @@ -49,9 +136,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -60,48 +145,6 @@ struct intctx { }; #endif -/** - * @brief Platform dependent part of the @p chThdCreateI() API. - * @details This code usually setup the context switching frame represented - * by an @p intctx structure. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ - wsize - \ - sizeof(struct intctx)); \ - tp->p_ctx.r13->r4 = pf; \ - tp->p_ctx.r13->r5 = arg; \ - tp->p_ctx.r13->lr = _port_thread_start; \ -} - -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have - * a stack frame when compiling without optimizations. You may - * reduce this value to zero when compiling with optimizations. - */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - * @note In this port it is conservatively set to 16 because the function - * @p chSchDoRescheduleI() can have a stack frame, expecially with - * compiler optimizations disabled. - */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 -#endif - /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -137,6 +180,8 @@ struct intctx { SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SVCALL, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL)); \ + NVICSetSystemHandlerPriority(HANDLER_PENDSV, \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_PENDSV)); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ } @@ -147,16 +192,20 @@ struct intctx { * more actions. * @note In this port this it raises the base priority to kernel level. */ -#if CH_OPTIMIZE_SPEED +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#if CH_OPTIMIZE_SPEED || defined(__DOXYGEN__) #define port_lock() { \ register uint32_t tmp asm ("r3") = CORTEX_BASEPRI_KERNEL; \ asm volatile ("msr BASEPRI, %0" : : "r" (tmp) : "memory"); \ } -#else +#else /* !CH_OPTIMIZE_SPEED */ #define port_lock() { \ asm volatile ("bl _port_lock" : : : "r3", "lr", "memory"); \ } -#endif +#endif /* !CH_OPTIMIZE_SPEED */ +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_lock() asm volatile ("cpsid i" : : : "memory") +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Kernel-unlock action. @@ -164,16 +213,20 @@ struct intctx { * more actions. * @note In this port this it lowers the base priority to user level. */ -#if CH_OPTIMIZE_SPEED +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#if CH_OPTIMIZE_SPEED || defined(__DOXYGEN__) #define port_unlock() { \ register uint32_t tmp asm ("r3") = CORTEX_BASEPRI_DISABLED; \ asm volatile ("msr BASEPRI, %0" : : "r" (tmp) : "memory"); \ } -#else +#else /* !CH_OPTIMIZE_SPEED */ #define port_unlock() { \ asm volatile ("bl _port_unlock" : : : "r3", "lr", "memory"); \ } -#endif +#endif /* !CH_OPTIMIZE_SPEED */ +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_unlock() asm volatile ("cpsie i" : : : "memory") +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Kernel-lock action from an interrupt handler. @@ -206,21 +259,29 @@ struct intctx { * @note Interrupt sources above kernel level remains enabled. * @note In this port it raises/lowers the base priority to kernel level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_suspend() { \ register uint32_t tmp asm ("r3") = CORTEX_BASEPRI_KERNEL; \ asm volatile ("msr BASEPRI, %0 \n\t" \ "cpsie i" : : "r" (tmp) : "memory"); \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_suspend() asm volatile ("cpsid i" : : : "memory") +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Enables all the interrupt sources. * @note In this port it lowers the base priority to user level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_enable() { \ register uint32_t tmp asm ("r3") = CORTEX_BASEPRI_DISABLED; \ asm volatile ("msr BASEPRI, %0 \n\t" \ "cpsie i" : : "r" (tmp) : "memory"); \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_enable() asm volatile ("cpsie i" : : : "memory") +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Enters an architecture-dependent IRQ-waiting mode. diff --git a/os/ports/GCC/ARMCMx/port.dox b/os/ports/GCC/ARMCMx/port.dox index 27e321f21..8f4a9bd51 100644 --- a/os/ports/GCC/ARMCMx/port.dox +++ b/os/ports/GCC/ARMCMx/port.dox @@ -26,9 +26,28 @@ * This port supports all the cores implementing the ARMv6-M and ARMv7-M * architectures. * - * @section ARMCMx_STATES_A System logical states in ARMv6-M mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in the ARM - * Cortex-M0 port: + * @section ARMCMx_MODES Kernel Modes + * The Cortex-Mx port supports two distinct kernel modes: + * - Normal Kernel mode. In this mode the kernel handles IRQ priorities + * in a simplified way, all interrupt sources are disabled when the kernel + * enters into a critical zone and re-enabled on exit. This is simple and + * adequate for most applications, this mode results in a more compact and + * faster kernel. + * - Advanced Kernel mode. In this mode the kernel only masks + * interrupt sources with priorities below or equal to the + * @p CORTEX_BASEPRI_KERNEL level. Higher priorities are not affected by + * the kernel critical sections and can be used for fast interrupts. + * This mode is not available in the ARMv6-M architecture which does not + * support priority masking. + * . + * The selection of the mode is performed using the port configuration option + * @p CORTEX_SIMPLIFIED_PRIORITY. Apart from the different handling of + * interrupts there are no other differences between the two modes. The + * kernel API is exactly the same. + * + * @section ARMCMx_STATES_A System logical states in Normal Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in Normal + * Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a * special hardware state associated. @@ -53,21 +72,21 @@ * mode. * - Serving Fast Interrupt. This state is not implemented in the * ARMv6-M implementation. - * - Serving Non-Maskable Interrupt. The Cortex-M3 has a specific + * - Serving Non-Maskable Interrupt. The Cortex-Mx has a specific * asynchronous NMI vector and several synchronous fault vectors that can * be considered belonging to this category. * - Halted. Implemented as an infinite loop after globally masking all * the maskable interrupt sources. The ARM state is whatever the processor * was running when @p chSysHalt() was invoked. * - * @section ARMCMx_STATES_B System logical states in ARMv7-M mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in the ARM - * Cortex-M3 port: + * @section ARMCMx_STATES_B System logical states in Advanced Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in the + * Advanced Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a * special hardware state associated. * - Normal. This is the state the system has after executing - * @p chSysInit(). In this state the ARM Cortex-M3 has the BASEPRI register + * @p chSysInit(). In this state the ARM Cortex-Mx has the BASEPRI register * set at @p CORTEX_BASEPRI_USER level, interrupts are not masked. The * processor is running in thread-privileged mode. * - Suspended. In this state the interrupt sources are not globally @@ -93,7 +112,7 @@ * - Serving Fast Interrupt. It is basically the same of the SRI state * but it is not possible to switch to the I-Locked state because fast * interrupts can preempt the kernel critical zone. - * - Serving Non-Maskable Interrupt. The Cortex-M3 has a specific + * - Serving Non-Maskable Interrupt. The Cortex-Mx has a specific * asynchronous NMI vector and several synchronous fault vectors that can * be considered belonging to this category. * - Halted. Implemented as an infinite loop after globally masking all diff --git a/readme.txt b/readme.txt index c294fbad2..91b369749 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,15 @@ *** 2.3.3 *** - FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420) (backported to 2.2.4). +- NEW: Reorganization of the Cortex-Mx ports in order to reduced code and + comments duplication in the various headers. +- CHANGE: Renamed the macros IDLE_THREAD_STACK_SIZE and INT_REQUIRED_STACK + to PORT_IDLE_THREAD_STACK_SIZE and PORT_INT_REQUIRED_STACK for consistency. +- CHANGE: Removed the "old" Cortex-M3 port from the code, the current port + has no drawbacks and the old port is now just a maintenance cost. +- CHANGE: Removed the CH_CURRP_REGISTER_CACHE option, it is GCC-specific so + it does not belong to the kernel options. The feature will be eventually + reimplemented as a port-specific option. *** 2.3.2 *** - FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306)(backported diff --git a/test/test.c b/test/test.c index f1df08390..41662308c 100644 --- a/test/test.c +++ b/test/test.c @@ -328,9 +328,9 @@ msg_t TestThread(void *p) { test_println("***"); test_print("*** Kernel: "); test_println(CH_KERNEL_VERSION); -#ifdef __GNUC__ - test_print("*** GCC Version: "); - test_println(__VERSION__); +#ifdef CH_COMPILER_NAME + test_print("*** Compiler: "); + test_println(CH_COMPILER_NAME); #endif test_print("*** Architecture: "); test_println(CH_ARCHITECTURE_NAME); @@ -338,6 +338,10 @@ msg_t TestThread(void *p) { test_print("*** Core Variant: "); test_println(CH_CORE_VARIANT_NAME); #endif +#ifdef CH_PORT_INFO + test_print("*** Port Info: "); + test_println(CH_PORT_INFO); +#endif #ifdef PLATFORM_NAME test_print("*** Platform: "); test_println(PLATFORM_NAME); diff --git a/test/testbmk.c b/test/testbmk.c index 6c878f557..54da81fd8 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -635,9 +635,11 @@ ROMCONST struct testcase testbmk12 = { static void bmk13_execute(void) { test_print("--- System: "); - test_printn(sizeof(ReadyList) + sizeof(VTList) + IDLE_THREAD_STACK_SIZE + - (sizeof(Thread) + sizeof(struct intctx) + sizeof(struct extctx) + - INT_REQUIRED_STACK) * 2); + test_printn(sizeof(ReadyList) + sizeof(VTList) + + PORT_IDLE_THREAD_STACK_SIZE + + (sizeof(Thread) + sizeof(struct intctx) + + sizeof(struct extctx) + + PORT_INT_REQUIRED_STACK) * 2); test_println(" bytes"); test_print("--- Thread: "); test_printn(sizeof(Thread)); -- cgit v1.2.3 From f3134c14bdfba8203fa3c1fd84724448c83b0427 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 May 2011 16:50:58 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2967 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72-GCC.txt | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index d71f70727..4c528f0cf 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -5,10 +5,11 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.3.2unstable -*** GCC Version: 4.6.0 +*** Kernel: 2.3.3unstable +*** Compiler: GCC 4.5.2 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 +*** Port Info: Advanced kernel mode *** Platform: STM32 Performance Line Medium Density *** Test Board: Olimex STM32-P103 @@ -98,55 +99,55 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 267097 msgs/S, 534194 ctxswc/S +--- Score : 248569 msgs/S, 497138 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 213832 msgs/S, 427664 ctxswc/S +--- Score : 198998 msgs/S, 397996 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 213832 msgs/S, 427664 ctxswc/S +--- Score : 198998 msgs/S, 397996 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 962832 ctxswc/S +--- Score : 839008 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 161828 threads/S +--- Score : 156856 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 241113 threads/S +--- Score : 235543 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 64728 reschedules/S, 388368 ctxswc/S +--- Score : 61138 reschedules/S, 366828 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 468840 ctxswc/S +--- Score : 478124 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 526392 bytes/S +--- Score : 479776 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 647308 timers/S +--- Score : 647262 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 787420 wait+signal/S +--- Score : 787368 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 596276 lock+unlock/S +--- Score : 586492 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) ---- System: 360 bytes +--- System: 368 bytes --- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes -- cgit v1.2.3 From a07d46f30ac86b125a6dbc89ba83669c3ebe90ac Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 May 2011 17:04:12 +0000 Subject: ARMv7-M compact kernel mode working. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2968 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103/chconf.h | 2 ++ docs/reports/STM32F103-72-GCC.txt | 26 +++++++++++++------------- os/ports/GCC/ARMCMx/chcore_v7m.c | 2 +- os/ports/GCC/ARMCMx/chcore_v7m.h | 6 +++--- os/ports/GCC/ARMCMx/port.dox | 14 +++++++------- readme.txt | 4 ++++ 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 14109b635..12f6b82d7 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -520,6 +520,8 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ +/*#define CORTEX_SIMPLIFIED_PRIORITY TRUE*/ + #endif /* _CHCONF_H_ */ /** @} */ diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index 4c528f0cf..0b0c28f19 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -9,7 +9,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) *** Compiler: GCC 4.5.2 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 -*** Port Info: Advanced kernel mode +*** Port Info: Normal kernel mode *** Platform: STM32 Performance Line Medium Density *** Test Board: Olimex STM32-P103 @@ -99,51 +99,51 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 248569 msgs/S, 497138 ctxswc/S +--- Score : 258426 msgs/S, 516852 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 198998 msgs/S, 397996 ctxswc/S +--- Score : 204682 msgs/S, 409364 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 198998 msgs/S, 397996 ctxswc/S +--- Score : 204682 msgs/S, 409364 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 839008 ctxswc/S +--- Score : 831792 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 156856 threads/S +--- Score : 161453 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 235543 threads/S +--- Score : 238693 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 61138 reschedules/S, 366828 ctxswc/S +--- Score : 62418 reschedules/S, 374508 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 478124 ctxswc/S +--- Score : 481380 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 479776 bytes/S +--- Score : 476632 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 647262 timers/S +--- Score : 641534 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 787368 wait+signal/S +--- Score : 842840 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 586492 lock+unlock/S +--- Score : 611492 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c index da3f7b956..2cf5cfe6b 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/chcore_v7m.c @@ -96,7 +96,7 @@ void SVCallVector(void) { * @brief PendSV vector. * @details The PendSV vector is used for exception mode re-entering after a * context switch. - * @note The PendSV vector is only used in normal kernel mode. + * @note The PendSV vector is only used in compact kernel mode. */ void PendSVVector(void) { register struct extctx *ctxp; diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index ef7860b87..7a7eaeb53 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -39,7 +39,7 @@ /** * @brief Simplified priority handling flag. - * @details Activating this option will make the Kernel work in normal mode. + * @details Activating this option will make the Kernel work in compact mode. */ #ifndef CORTEX_SIMPLIFIED_PRIORITY #define CORTEX_SIMPLIFIED_PRIORITY FALSE @@ -67,7 +67,7 @@ /** * @brief BASEPRI level within kernel lock. - * @note In normal kernel mode this constant value is enforced to zero. + * @note In compact kernel mode this constant value is enforced to zero. */ #if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define CORTEX_BASEPRI_KERNEL \ @@ -113,7 +113,7 @@ #if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define CH_PORT_INFO "Advanced kernel mode" #else -#define CH_PORT_INFO "Normal kernel mode" +#define CH_PORT_INFO "Compact kernel mode" #endif /*===========================================================================*/ diff --git a/os/ports/GCC/ARMCMx/port.dox b/os/ports/GCC/ARMCMx/port.dox index 8f4a9bd51..689791c2f 100644 --- a/os/ports/GCC/ARMCMx/port.dox +++ b/os/ports/GCC/ARMCMx/port.dox @@ -28,25 +28,25 @@ * * @section ARMCMx_MODES Kernel Modes * The Cortex-Mx port supports two distinct kernel modes: - * - Normal Kernel mode. In this mode the kernel handles IRQ priorities - * in a simplified way, all interrupt sources are disabled when the kernel - * enters into a critical zone and re-enabled on exit. This is simple and - * adequate for most applications, this mode results in a more compact and - * faster kernel. * - Advanced Kernel mode. In this mode the kernel only masks * interrupt sources with priorities below or equal to the * @p CORTEX_BASEPRI_KERNEL level. Higher priorities are not affected by * the kernel critical sections and can be used for fast interrupts. * This mode is not available in the ARMv6-M architecture which does not * support priority masking. + * - Compact Kernel mode. In this mode the kernel handles IRQ priorities + * in a simplified way, all interrupt sources are disabled when the kernel + * enters into a critical zone and re-enabled on exit. This is simple and + * adequate for most applications, this mode results in a more compact and + * faster kernel. * . * The selection of the mode is performed using the port configuration option * @p CORTEX_SIMPLIFIED_PRIORITY. Apart from the different handling of * interrupts there are no other differences between the two modes. The * kernel API is exactly the same. * - * @section ARMCMx_STATES_A System logical states in Normal Kernel mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in Normal + * @section ARMCMx_STATES_A System logical states in Compact Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in Compact * Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a diff --git a/readme.txt b/readme.txt index 91b369749..1824f63c5 100644 --- a/readme.txt +++ b/readme.txt @@ -75,6 +75,10 @@ (backported to 2.2.4). - NEW: Reorganization of the Cortex-Mx ports in order to reduced code and comments duplication in the various headers. +- NEW: Improved the ARMv7-M port now there are two modes: Compact and Advanced. + The advanced mode is equivalent to the previous versions, the compact mode + is new and makes the kernel *much* smaller and faster but does not support + fast interrupts, see reports. - CHANGE: Renamed the macros IDLE_THREAD_STACK_SIZE and INT_REQUIRED_STACK to PORT_IDLE_THREAD_STACK_SIZE and PORT_INT_REQUIRED_STACK for consistency. - CHANGE: Removed the "old" Cortex-M3 port from the code, the current port -- cgit v1.2.3 From 228f5ba5754ab3dd721829f32022673f2e706a09 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 May 2011 17:09:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2969 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72-GCC.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index 0b0c28f19..87366005c 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -6,10 +6,10 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) *** ChibiOS/RT test suite *** *** Kernel: 2.3.3unstable -*** Compiler: GCC 4.5.2 +*** Compiler: GCC 4.6.0 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 -*** Port Info: Normal kernel mode +*** Port Info: Advanced kernel mode *** Platform: STM32 Performance Line Medium Density *** Test Board: Olimex STM32-P103 @@ -99,51 +99,51 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 258426 msgs/S, 516852 ctxswc/S +--- Score : 267098 msgs/S, 534196 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 204682 msgs/S, 409364 ctxswc/S +--- Score : 213832 msgs/S, 427664 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 204682 msgs/S, 409364 ctxswc/S +--- Score : 213832 msgs/S, 427664 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 831792 ctxswc/S +--- Score : 962832 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 161453 threads/S +--- Score : 161828 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 238693 threads/S +--- Score : 241113 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 62418 reschedules/S, 374508 ctxswc/S +--- Score : 64728 reschedules/S, 388368 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 481380 ctxswc/S +--- Score : 468840 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 476632 bytes/S +--- Score : 526392 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 641534 timers/S +--- Score : 647308 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 842840 wait+signal/S +--- Score : 787420 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 611492 lock+unlock/S +--- Score : 596276 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) -- cgit v1.2.3 From ade5cc3c6fdb41270ff0f483a8daa44d28d1064c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 May 2011 17:17:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2970 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103/chconf.h | 2 -- readme.txt | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 12f6b82d7..14109b635 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -520,8 +520,6 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ -/*#define CORTEX_SIMPLIFIED_PRIORITY TRUE*/ - #endif /* _CHCONF_H_ */ /** @} */ diff --git a/readme.txt b/readme.txt index 1824f63c5..7b4729e8b 100644 --- a/readme.txt +++ b/readme.txt @@ -75,10 +75,13 @@ (backported to 2.2.4). - NEW: Reorganization of the Cortex-Mx ports in order to reduced code and comments duplication in the various headers. -- NEW: Improved the ARMv7-M port now there are two modes: Compact and Advanced. +- NEW: Improved the ARMv7-M sub-port now there are two modes: Compact and + Advanced. The advanced mode is equivalent to the previous versions, the compact mode - is new and makes the kernel *much* smaller and faster but does not support - fast interrupts, see reports. + is new and makes the kernel *much* smaller and generally faster but does + not support fast interrupts, see the reports for details. +- NEW: Now the port layer exports info regarding the compiler and the port + options. The info are printed into the test reports. - CHANGE: Renamed the macros IDLE_THREAD_STACK_SIZE and INT_REQUIRED_STACK to PORT_IDLE_THREAD_STACK_SIZE and PORT_INT_REQUIRED_STACK for consistency. - CHANGE: Removed the "old" Cortex-M3 port from the code, the current port -- cgit v1.2.3 From b4aa14e88c9e28a16a5f9c0c220fac6cc36750ad Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 18 May 2011 09:03:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2971 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h | 20 -------------------- demos/ARM7-AT91SAM7S-GCC/chconf.h | 20 -------------------- demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h | 20 -------------------- demos/ARM7-AT91SAM7X-GCC/chconf.h | 20 -------------------- demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 20 -------------------- demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h | 20 -------------------- demos/ARM7-LPC214x-FATFS-GCC/chconf.h | 20 -------------------- demos/ARM7-LPC214x-G++/chconf.h | 20 -------------------- demos/ARM7-LPC214x-GCC/chconf.h | 20 -------------------- demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h | 20 -------------------- demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h | 20 -------------------- demos/ARMCM3-STM32F100-DISCOVERY/chconf.h | 20 -------------------- demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h | 20 -------------------- demos/ARMCM3-STM32F103-G++/chconf.h | 20 -------------------- demos/ARMCM3-STM32F103/chconf.h | 20 -------------------- demos/ARMCM3-STM32F103ZG/chconf.h | 20 -------------------- demos/ARMCM3-STM32F107/chconf.h | 20 -------------------- demos/AVR-AT90CANx-GCC/chconf.h | 20 -------------------- demos/AVR-ATmega128-GCC/chconf.h | 20 -------------------- demos/MSP430-MSP430x1611-GCC/chconf.h | 20 -------------------- demos/PPC-SPC563-GCC/chconf.h | 20 -------------------- demos/Posix-GCC/chconf.h | 20 -------------------- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h | 20 -------------------- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h | 20 -------------------- demos/STM8S-STM8S208-RC/chconf.h | 20 -------------------- demos/Win32-MinGW/chconf.h | 20 -------------------- os/kernel/include/chschd.h | 6 ------ os/kernel/src/chsys.c | 2 +- os/kernel/templates/chconf.h | 20 -------------------- os/kernel/templates/chcore.h | 8 ++++---- os/ports/GCC/ARM/chcore.h | 14 ++++++-------- os/ports/GCC/ARMCMx/old/chcore_v7m.c | 15 --------------- os/ports/GCC/ARMCMx/old/chcore_v7m.h | 10 +++++----- os/ports/GCC/AVR/chcore.c | 4 ---- os/ports/GCC/AVR/chcore.h | 14 ++++++-------- os/ports/GCC/MSP430/chcore.h | 12 ++++++------ os/ports/GCC/PPC/chcore.h | 12 ++++++------ os/ports/GCC/SIMIA32/chcore.h | 10 +++++----- os/ports/IAR/ARMCMx/chcore.h | 2 +- os/ports/IAR/ARMCMx/chcore_v6m.h | 10 +++++----- os/ports/IAR/ARMCMx/chcore_v7m.h | 14 ++++++-------- os/ports/RC/STM8/chcore.h | 12 ++++++------ os/ports/RVCT/ARMCMx/chcore.h | 2 +- os/ports/RVCT/ARMCMx/chcore_v6m.h | 10 +++++----- os/ports/RVCT/ARMCMx/chcore_v7m.h | 14 ++++++-------- os/ports/cosmic/STM8/chcore.h | 12 ++++++------ test/coverage/chconf.h | 20 -------------------- testhal/LPC11xx/IRQ_STORM/chconf.h | 20 -------------------- testhal/LPC13xx/IRQ_STORM/chconf.h | 20 -------------------- testhal/STM32/ADC/chconf.h | 20 -------------------- testhal/STM32/CAN/chconf.h | 20 -------------------- testhal/STM32/GPT/chconf.h | 20 -------------------- testhal/STM32/IRQ_STORM/chconf.h | 20 -------------------- testhal/STM32/PWM-ICU/chconf.h | 20 -------------------- testhal/STM32/SDIO/chconf.h | 20 -------------------- testhal/STM32/SPI/chconf.h | 20 -------------------- testhal/STM32/UART/chconf.h | 20 -------------------- testhal/STM32/USB_CDC/chconf.h | 20 -------------------- testhal/STM32/USB_MSC/chconf.h | 20 -------------------- testhal/STM8S/SPI/demo/chconf.h | 20 -------------------- 60 files changed, 75 insertions(+), 928 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7S-GCC/chconf.h b/demos/ARM7-AT91SAM7S-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-AT91SAM7S-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-GCC/chconf.h b/demos/ARM7-AT91SAM7X-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-AT91SAM7X-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index 4c2ee5818..c117dccdd 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-G++/chconf.h b/demos/ARM7-LPC214x-G++/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-LPC214x-G++/chconf.h +++ b/demos/ARM7-LPC214x-G++/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103-G++/chconf.h b/demos/ARMCM3-STM32F103-G++/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-STM32F103-G++/chconf.h +++ b/demos/ARMCM3-STM32F103-G++/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F103ZG/chconf.h b/demos/ARMCM3-STM32F103ZG/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-STM32F103ZG/chconf.h +++ b/demos/ARMCM3-STM32F103ZG/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/ARMCM3-STM32F107/chconf.h b/demos/ARMCM3-STM32F107/chconf.h index 14109b635..ccde82347 100644 --- a/demos/ARMCM3-STM32F107/chconf.h +++ b/demos/ARMCM3-STM32F107/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 3d5fefb9f..b941ca77d 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 3d5fefb9f..b941ca77d 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/MSP430-MSP430x1611-GCC/chconf.h b/demos/MSP430-MSP430x1611-GCC/chconf.h index d0679aa2b..dcddb9a23 100644 --- a/demos/MSP430-MSP430x1611-GCC/chconf.h +++ b/demos/MSP430-MSP430x1611-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/PPC-SPC563-GCC/chconf.h b/demos/PPC-SPC563-GCC/chconf.h index 14109b635..ccde82347 100644 --- a/demos/PPC-SPC563-GCC/chconf.h +++ b/demos/PPC-SPC563-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/Posix-GCC/chconf.h b/demos/Posix-GCC/chconf.h index 6c00f9851..cda9cabab 100644 --- a/demos/Posix-GCC/chconf.h +++ b/demos/Posix-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h index b76fd0017..3f42e3885 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED FALSE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h index b76fd0017..3f42e3885 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED FALSE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/STM8S-STM8S208-RC/chconf.h b/demos/STM8S-STM8S208-RC/chconf.h index b76fd0017..3f42e3885 100644 --- a/demos/STM8S-STM8S208-RC/chconf.h +++ b/demos/STM8S-STM8S208-RC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED FALSE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index 6c00f9851..cda9cabab 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h index 1cd8e0664..e154da863 100644 --- a/os/kernel/include/chschd.h +++ b/os/kernel/include/chschd.h @@ -84,10 +84,8 @@ typedef struct { #if CH_TIME_QUANTUM > 0 cnt_t r_preempt; /**< @brief Round robin counter. */ #endif -#ifndef CH_CURRP_REGISTER_CACHE Thread *r_current; /**< @brief The currently running thread. */ -#endif } ReadyList; #endif /* !defined(PORT_OPTIMIZED_READYLIST_STRUCT) */ @@ -103,11 +101,7 @@ extern ReadyList rlist; * (currp = something), use @p setcurrp() instead. */ #if !defined(PORT_OPTIMIZED_CURRP) || defined(__DOXYGEN__) -#if !defined(CH_CURRP_REGISTER_CACHE) || defined(__DOXYGEN__) #define currp rlist.r_current -#else /* defined(CH_CURRP_REGISTER_CACHE) */ -register Thread *currp asm(CH_CURRP_REGISTER_CACHE); -#endif /* defined(CH_CURRP_REGISTER_CACHE) */ #endif /* !defined(PORT_OPTIMIZED_CURRP) */ /** diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 13a1a53fa..6892ec73a 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -38,7 +38,7 @@ #if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__) /** * @brief Idle thread working area. - * @see IDLE_THREAD_STACK_SIZE + * @see PORT_IDLE_THREAD_STACK_SIZE */ WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE); diff --git a/os/kernel/templates/chconf.h b/os/kernel/templates/chconf.h index 14109b635..ccde82347 100644 --- a/os/kernel/templates/chconf.h +++ b/os/kernel/templates/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/os/kernel/templates/chcore.h b/os/kernel/templates/chcore.h index 2c69362b2..5c8236c7b 100644 --- a/os/kernel/templates/chcore.h +++ b/os/kernel/templates/chcore.h @@ -47,10 +47,10 @@ * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ #ifndef PORT_IDLE_THREAD_STACK_SIZE -#define PORT_IDLE_THREAD_STACK_SIZE 0 +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -62,7 +62,7 @@ * @p extctx is known to be zero. */ #ifndef PORT_INT_REQUIRED_STACK -#define PORT_INT_REQUIRED_STACK 0 +#define PORT_INT_REQUIRED_STACK 0 #endif /*===========================================================================*/ @@ -151,7 +151,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/ARM/chcore.h b/os/ports/GCC/ARM/chcore.h index b67fb9c1b..5a36d82c8 100644 --- a/os/ports/GCC/ARM/chcore.h +++ b/os/ports/GCC/ARM/chcore.h @@ -155,9 +155,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -192,12 +190,12 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 4 because the idle thread does have * a stack frame when compiling without optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 4 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 4 #endif /** @@ -210,8 +208,8 @@ struct context { * @note In this port 0x10 is a safe value, it can be reduced after careful * analysis of the generated code. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 0x10 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 0x10 #endif /** @@ -225,7 +223,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/ARMCMx/old/chcore_v7m.c b/os/ports/GCC/ARMCMx/old/chcore_v7m.c index bd888cd01..244ff396e 100644 --- a/os/ports/GCC/ARMCMx/old/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/old/chcore_v7m.c @@ -54,7 +54,6 @@ void SysTickVector(void) { chSysUnlockFromIsr(); } -#if !defined(CH_CURRP_REGISTER_CACHE) #define PUSH_CONTEXT(sp, prio) { \ asm volatile ("mrs %0, PSP \n\t" \ "stmdb %0!, {r3-r11,lr}" : \ @@ -67,20 +66,6 @@ void SysTickVector(void) { "msr BASEPRI, r3 \n\t" \ "bx lr" : "=r" (sp) : "r" (sp)); \ } -#else /* defined(CH_CURRP_REGISTER_CACHE) */ -#define PUSH_CONTEXT(sp, prio) { \ - asm volatile ("mrs %0, PSP \n\t" \ - "stmdb %0!, {r3-r6,r8-r11, lr}" : \ - "=r" (sp) : "r" (sp), "r" (prio)); \ -} - -#define POP_CONTEXT(sp) { \ - asm volatile ("ldmia %0!, {r3-r6,r8-r11, lr} \n\t" \ - "msr PSP, %0 \n\t" \ - "msr BASEPRI, r3 \n\t" \ - "bx lr" : "=r" (sp) : "r" (sp)); \ -} -#endif /* defined(CH_CURRP_REGISTER_CACHE) */ /** * @brief SVC vector. diff --git a/os/ports/GCC/ARMCMx/old/chcore_v7m.h b/os/ports/GCC/ARMCMx/old/chcore_v7m.h index 93e701202..b94afdca3 100644 --- a/os/ports/GCC/ARMCMx/old/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/old/chcore_v7m.h @@ -96,12 +96,12 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 4 because the idle thread does have * a stack frame when compiling without optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 4 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 4 #endif /** @@ -113,8 +113,8 @@ struct intctx { * @p extctx is known to be zero. * @note This port requires no extra stack space for interrupt handling. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 0 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 0 #endif /** diff --git a/os/ports/GCC/AVR/chcore.c b/os/ports/GCC/AVR/chcore.c index 166c0d1b1..7cb0dda07 100644 --- a/os/ports/GCC/AVR/chcore.c +++ b/os/ports/GCC/AVR/chcore.c @@ -51,10 +51,8 @@ void port_switch(Thread *ntp, Thread *otp) { asm volatile ("push r5"); asm volatile ("push r6"); asm volatile ("push r7"); -#ifndef CH_CURRP_REGISTER_CACHE asm volatile ("push r8"); asm volatile ("push r9"); -#endif asm volatile ("push r10"); asm volatile ("push r11"); asm volatile ("push r12"); @@ -88,10 +86,8 @@ void port_switch(Thread *ntp, Thread *otp) { asm volatile ("pop r12"); asm volatile ("pop r11"); asm volatile ("pop r10"); -#ifndef CH_CURRP_REGISTER_CACHE asm volatile ("pop r9"); asm volatile ("pop r8"); -#endif asm volatile ("pop r7"); asm volatile ("pop r6"); asm volatile ("pop r5"); diff --git a/os/ports/GCC/AVR/chcore.h b/os/ports/GCC/AVR/chcore.h index 4377c5047..5e1c4d954 100644 --- a/os/ports/GCC/AVR/chcore.h +++ b/os/ports/GCC/AVR/chcore.h @@ -105,10 +105,8 @@ struct intctx { uint8_t r12; uint8_t r11; uint8_t r10; -#ifndef CH_CURRP_REGISTER_CACHE uint8_t r9; uint8_t r8; -#endif uint8_t r7; uint8_t r6; uint8_t r5; @@ -149,11 +147,11 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 8. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 8 #endif /** @@ -165,8 +163,8 @@ struct context { * @p extctx is known to be zero. * @note In this port the default is 32 bytes per thread. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 32 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 32 #endif /** @@ -180,7 +178,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/MSP430/chcore.h b/os/ports/GCC/MSP430/chcore.h index 5cb88ab3d..f70a34438 100644 --- a/os/ports/GCC/MSP430/chcore.h +++ b/os/ports/GCC/MSP430/chcore.h @@ -122,10 +122,10 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -137,8 +137,8 @@ struct context { * @p extctx is known to be zero. * @note In this port the default is 32 bytes per thread. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 32 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 32 #endif /** @@ -152,7 +152,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/PPC/chcore.h b/os/ports/GCC/PPC/chcore.h index 058379923..30e5f717c 100644 --- a/os/ports/GCC/PPC/chcore.h +++ b/os/ports/GCC/PPC/chcore.h @@ -185,10 +185,10 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -199,8 +199,8 @@ struct context { * separate interrupt stack and the stack space between @p intctx and * @p extctx is known to be zero. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 128 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 128 #endif /** @@ -214,7 +214,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/SIMIA32/chcore.h b/os/ports/GCC/SIMIA32/chcore.h index 266cfd955..05dc05db4 100644 --- a/os/ports/GCC/SIMIA32/chcore.h +++ b/os/ports/GCC/SIMIA32/chcore.h @@ -108,8 +108,8 @@ struct context { /** * Stack size for the system idle thread. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 256 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 256 #endif /** @@ -118,8 +118,8 @@ struct context { * It requires stack space because the simulated "interrupt handlers" can * invoke host library functions inside so it better have a lot of space. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16384 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16384 #endif /** @@ -134,7 +134,7 @@ struct context { sizeof(void *) * 4 + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * Macro used to allocate a thread working area aligned as both position and diff --git a/os/ports/IAR/ARMCMx/chcore.h b/os/ports/IAR/ARMCMx/chcore.h index 3854de61e..9c6a63730 100644 --- a/os/ports/IAR/ARMCMx/chcore.h +++ b/os/ports/IAR/ARMCMx/chcore.h @@ -302,7 +302,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index a2d5ef577..41b656532 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -76,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 8 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 16 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -96,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h index 9c5d700ee..31be9a04a 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.h +++ b/os/ports/IAR/ARMCMx/chcore_v7m.h @@ -49,9 +49,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -78,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -98,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/RC/STM8/chcore.h b/os/ports/RC/STM8/chcore.h index ed10b564e..4de8bea54 100644 --- a/os/ports/RC/STM8/chcore.h +++ b/os/ports/RC/STM8/chcore.h @@ -147,10 +147,10 @@ struct stm8_startctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -158,8 +158,8 @@ struct stm8_startctx { * @details This is a safe value, you may trim it down after reading the * right size in the map file. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 48 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 48 #endif /** @@ -173,7 +173,7 @@ struct stm8_startctx { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/RVCT/ARMCMx/chcore.h b/os/ports/RVCT/ARMCMx/chcore.h index aa8fe2483..767f71923 100644 --- a/os/ports/RVCT/ARMCMx/chcore.h +++ b/os/ports/RVCT/ARMCMx/chcore.h @@ -305,7 +305,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 9c5e35b33..1c4af7da9 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -76,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 8 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 16 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -96,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index 3a4cbe381..7f7d8c5be 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -49,9 +49,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -78,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -98,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/cosmic/STM8/chcore.h b/os/ports/cosmic/STM8/chcore.h index 615116736..e154b8914 100644 --- a/os/ports/cosmic/STM8/chcore.h +++ b/os/ports/cosmic/STM8/chcore.h @@ -145,10 +145,10 @@ struct stm8_startctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -156,8 +156,8 @@ struct stm8_startctx { * @details This is a safe value, you may trim it down after reading the * right size in the map file. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 48 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 48 #endif /** @@ -171,7 +171,7 @@ struct stm8_startctx { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/test/coverage/chconf.h b/test/coverage/chconf.h index 1810540d5..f1cce630a 100644 --- a/test/coverage/chconf.h +++ b/test/coverage/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED FALSE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/LPC11xx/IRQ_STORM/chconf.h b/testhal/LPC11xx/IRQ_STORM/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/LPC11xx/IRQ_STORM/chconf.h +++ b/testhal/LPC11xx/IRQ_STORM/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/LPC13xx/IRQ_STORM/chconf.h b/testhal/LPC13xx/IRQ_STORM/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/LPC13xx/IRQ_STORM/chconf.h +++ b/testhal/LPC13xx/IRQ_STORM/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/ADC/chconf.h b/testhal/STM32/ADC/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/ADC/chconf.h +++ b/testhal/STM32/ADC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/CAN/chconf.h b/testhal/STM32/CAN/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/CAN/chconf.h +++ b/testhal/STM32/CAN/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/GPT/chconf.h b/testhal/STM32/GPT/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/GPT/chconf.h +++ b/testhal/STM32/GPT/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/IRQ_STORM/chconf.h b/testhal/STM32/IRQ_STORM/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/IRQ_STORM/chconf.h +++ b/testhal/STM32/IRQ_STORM/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/PWM-ICU/chconf.h b/testhal/STM32/PWM-ICU/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/PWM-ICU/chconf.h +++ b/testhal/STM32/PWM-ICU/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/SDIO/chconf.h b/testhal/STM32/SDIO/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/SDIO/chconf.h +++ b/testhal/STM32/SDIO/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/SPI/chconf.h b/testhal/STM32/SPI/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/SPI/chconf.h +++ b/testhal/STM32/SPI/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/UART/chconf.h b/testhal/STM32/UART/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/UART/chconf.h +++ b/testhal/STM32/UART/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/USB_CDC/chconf.h b/testhal/STM32/USB_CDC/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/USB_CDC/chconf.h +++ b/testhal/STM32/USB_CDC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM32/USB_MSC/chconf.h b/testhal/STM32/USB_MSC/chconf.h index 14109b635..ccde82347 100644 --- a/testhal/STM32/USB_MSC/chconf.h +++ b/testhal/STM32/USB_MSC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ diff --git a/testhal/STM8S/SPI/demo/chconf.h b/testhal/STM8S/SPI/demo/chconf.h index b76fd0017..3f42e3885 100644 --- a/testhal/STM8S/SPI/demo/chconf.h +++ b/testhal/STM8S/SPI/demo/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED FALSE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ -- cgit v1.2.3 From 807c5f1882224c2afd471a44889b83c2adf80589 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 18 May 2011 17:54:55 +0000 Subject: Fixed bug 3303908. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2972 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chqueues.h | 91 ++++++++++++++++++++++--------- os/kernel/include/chthreads.h | 4 +- os/kernel/src/chmtx.c | 8 ++- os/kernel/src/chqueues.c | 124 ++++++++++++++++++++++-------------------- os/kernel/src/chschd.c | 6 +- readme.txt | 3 + 6 files changed, 147 insertions(+), 89 deletions(-) diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index 4b55e9c46..d1bad3149 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -67,12 +67,13 @@ typedef void (*qnotify_t)(GenericQueue *qp); * @ref system_states) and is non-blocking. */ struct GenericQueue { + ThreadsQueue q_waiting; /**< @brief Queue of waiting threads. */ + size_t q_counter; /**< @brief Resources counter. */ uint8_t *q_buffer; /**< @brief Pointer to the queue buffer.*/ uint8_t *q_top; /**< @brief Pointer to the first location after the buffer. */ uint8_t *q_wrptr; /**< @brief Write pointer. */ uint8_t *q_rdptr; /**< @brief Read pointer. */ - Semaphore q_sem; /**< @brief Counter @p Semaphore. */ qnotify_t q_notify; /**< @brief Data notification callback. */ }; @@ -84,21 +85,19 @@ struct GenericQueue { * * @iclass */ -#define chQSizeI(qp) ((qp)->q_top - (qp)->q_buffer) +#define chQSizeI(qp) ((size_t)((qp)->q_top - (qp)->q_buffer)) /** * @brief Queue space. * @details Returns the used space if used on an input queue or the empty * space if used on an output queue. - * @note The returned value can be less than zero when there are waiting - * threads on the internal semaphore. * * @param[in] qp pointer to a @p GenericQueue structure. * @return The buffer space. * * @iclass */ -#define chQSpaceI(qp) chSemGetCounterI(&(qp)->q_sem) +#define chQSpaceI(qp) ((size_t)((qp)->q_counter)) /** * @extends GenericQueue @@ -113,6 +112,28 @@ struct GenericQueue { */ typedef GenericQueue InputQueue; +/** + * @brief Returns the filled space into an input queue. + * + * @param[in] iqp pointer to an @p InputQueue structure + * @return The number of full bytes in the queue. + * @retval 0 if the queue is empty. + * + * @iclass + */ +#define chIQGetFullI(iqp) chQSpaceI(iqp) + +/** + * @brief Returns the empty space into an input queue. + * + * @param[in] iqp pointer to an @p InputQueue structure + * @return The number of empty bytes in the queue. + * @retval 0 if the queue is full. + * + * @iclass + */ +#define chIQGetEmptyI(iqp) (chQSizeI(iqp) - chQSpaceI(iqp)) + /** * @brief Evaluates to @p TRUE if the specified input queue is empty. * @@ -135,8 +156,7 @@ typedef GenericQueue InputQueue; * * @iclass */ -#define chIQIsFullI(iqp) ((bool_t)(((iqp)->q_wrptr == (iqp)->q_rdptr) && \ - !chIQIsEmptyI(iqp))) +#define chIQIsFullI(iqp) ((bool_t)(chQSpaceI(iqp) >= chQSizeI(iqp))) /** * @brief Input queue read. @@ -162,13 +182,14 @@ typedef GenericQueue InputQueue; * @param[in] size size of the queue buffer area * @param[in] inotify input notification callback pointer */ -#define _INPUTQUEUE_DATA(name, buffer, size, inotify) { \ - (uint8_t *)(buffer), \ - (uint8_t *)(buffer) + size, \ - (uint8_t *)(buffer), \ - (uint8_t *)(buffer), \ - _SEMAPHORE_DATA(name.q_sem, 0), \ - inotify \ +#define _INPUTQUEUE_DATA(name, buffer, size, inotify) { \ + _THREADSQUEUE_DATA(name), \ + 0, \ + (uint8_t *)(buffer), \ + (uint8_t *)(buffer) + (size), \ + (uint8_t *)(buffer), \ + (uint8_t *)(buffer), \ + inotify \ } /** @@ -197,6 +218,28 @@ typedef GenericQueue InputQueue; */ typedef GenericQueue OutputQueue; + /** + * @brief Returns the filled space into an output queue. + * + * @param[in] oqp pointer to an @p OutputQueue structure + * @return The number of full bytes in the queue. + * @retval 0 if the queue is empty. + * + * @iclass + */ +#define chOQGetFullI(oqp) (chQSizeI(oqp) - chQSpaceI(oqp)) + +/** + * @brief Returns the empty space into an output queue. + * + * @param[in] iqp pointer to an @p OutputQueue structure + * @return The number of empty bytes in the queue. + * @retval 0 if the queue is full. + * + * @iclass + */ +#define chOQGetEmptyI(iqp) chQSpaceI(oqp) + /** * @brief Evaluates to @p TRUE if the specified output queue is empty. * @@ -207,8 +250,7 @@ typedef GenericQueue OutputQueue; * * @iclass */ -#define chOQIsEmptyI(oqp) ((bool_t)(((oqp)->q_wrptr == (oqp)->q_rdptr) && \ - !chOQIsFullI(oqp))) +#define chOQIsEmptyI(oqp) ((bool_t)(chQSpaceI(oqp) >= chQSizeI(oqp))) /** * @brief Evaluates to @p TRUE if the specified output queue is full. @@ -248,13 +290,14 @@ typedef GenericQueue OutputQueue; * @param[in] size size of the queue buffer area * @param[in] onotify output notification callback pointer */ -#define _OUTPUTQUEUE_DATA(name, buffer, size, onotify) { \ - (uint8_t *)(buffer), \ - (uint8_t *)(buffer) + size, \ - (uint8_t *)(buffer), \ - (uint8_t *)(buffer), \ - _SEMAPHORE_DATA(name.q_sem, size), \ - onotify \ +#define _OUTPUTQUEUE_DATA(name, buffer, size, onotify) { \ + _THREADSQUEUE_DATA(name), \ + (size), \ + (uint8_t *)(buffer), \ + (uint8_t *)(buffer) + (size), \ + (uint8_t *)(buffer), \ + (uint8_t *)(buffer), \ + onotify \ } /** @@ -274,7 +317,6 @@ typedef GenericQueue OutputQueue; extern "C" { #endif void chIQInit(InputQueue *iqp, uint8_t *bp, size_t size, qnotify_t infy); - size_t chIQGetFullI(InputQueue *iqp); void chIQResetI(InputQueue *iqp); msg_t chIQPutI(InputQueue *iqp, uint8_t b); msg_t chIQGetTimeout(InputQueue *iqp, systime_t time); @@ -282,7 +324,6 @@ extern "C" { size_t n, systime_t time); void chOQInit(OutputQueue *oqp, uint8_t *bp, size_t size, qnotify_t onfy); - size_t chOQGetFullI(OutputQueue *oqp); void chOQResetI(OutputQueue *oqp); msg_t chOQPutTimeout(OutputQueue *oqp, uint8_t b, systime_t time); msg_t chOQGetI(OutputQueue *oqp); diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index df6fc329f..215bb9920 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -183,8 +183,10 @@ struct Thread { #define THD_STATE_SNDMSG 11 /** @brief Thread state: Waiting in @p chMsgWait().*/ #define THD_STATE_WTMSG 12 +/** @brief Thread state: Waiting on an I/O queue.*/ +#define THD_STATE_WTQUEUE 13 /** @brief Thread state: After termination.*/ -#define THD_STATE_FINAL 13 +#define THD_STATE_FINAL 14 /* * Various flags into the thread p_flags field. diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c index af2b7f347..df71d1cc6 100644 --- a/os/kernel/src/chmtx.c +++ b/os/kernel/src/chmtx.c @@ -134,14 +134,16 @@ void chMtxLockS(Mutex *mp) { prio_insert(dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp); tp = ((Mutex *)tp->p_u.wtobjp)->m_owner; continue; -#if CH_USE_CONDVARS | CH_USE_SEMAPHORES_PRIORITY | CH_USE_MESSAGES_PRIORITY +#if CH_USE_CONDVARS | \ + (CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY) | \ + (CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY) #if CH_USE_CONDVARS case THD_STATE_WTCOND: #endif -#if CH_USE_SEMAPHORES_PRIORITY +#if CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY case THD_STATE_WTSEM: #endif -#if CH_USE_MESSAGES_PRIORITY +#if CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY case THD_STATE_SNDMSGQ: #endif /* Re-enqueues tp with its new priority on the queue.*/ diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index 05fbddfb9..f6ae10257 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -47,6 +47,30 @@ #if CH_USE_QUEUES || defined(__DOXYGEN__) +/** + * @brief Puts the invoking thread into the queue's threads queue. + * + * @param[out] qp pointer to an @p GenericQueue structure + * @param[in] time the number of ticks before the operation timeouts, + * the following special values are allowed: + * - @a TIME_IMMEDIATE immediate timeout. + * - @a TIME_INFINITE no timeout. + * . + * @return A message specifying how the invoking thread has been + * released from threads queue. + * @retval RDY_OK is the normal exit, thread signaled. + * @retval RDY_RESET if the queue has been reset. + * @retval RDY_TIMEOUT if the queue operation timed out. + */ +static msg_t qwait(GenericQueue *qp, systime_t time) { + + if (TIME_IMMEDIATE == time) + return RDY_TIMEOUT; + currp->p_u.wtobjp = qp; + queue_insert(currp, &qp->q_waiting); + return chSchGoSleepTimeoutS(THD_STATE_WTQUEUE, time); +} + /** * @brief Initializes an input queue. * @details A Semaphore is internally initialized and works as a counter of @@ -64,28 +88,11 @@ */ void chIQInit(InputQueue *iqp, uint8_t *bp, size_t size, qnotify_t infy) { + queue_init(&iqp->q_waiting); + iqp->q_counter = 0; iqp->q_buffer = iqp->q_rdptr = iqp->q_wrptr = bp; iqp->q_top = bp + size; iqp->q_notify = infy; - chSemInit(&iqp->q_sem, 0); -} - -/** - * @brief Returns the filled space into an input queue. - * - * @param[in] iqp pointer to an @p InputQueue structure - * @return The number of bytes in the queue. - * @retval 0 if the queue is empty. - * - * @iclass - */ -size_t chIQGetFullI(InputQueue *iqp) { - cnt_t cnt; - - cnt = chQSpaceI(iqp); - if (cnt < 0) - return 0; - return (size_t)cnt; } /** @@ -102,7 +109,9 @@ size_t chIQGetFullI(InputQueue *iqp) { void chIQResetI(InputQueue *iqp) { iqp->q_rdptr = iqp->q_wrptr = iqp->q_buffer; - chSemResetI(&iqp->q_sem, 0); + iqp->q_counter = 0; + while (notempty(&iqp->q_waiting)) + chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = RDY_RESET; } /** @@ -123,10 +132,12 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { if (chIQIsFullI(iqp)) return Q_FULL; + iqp->q_counter++; *iqp->q_wrptr++ = b; if (iqp->q_wrptr >= iqp->q_top) iqp->q_wrptr = iqp->q_buffer; - chSemSignalI(&iqp->q_sem); + if (notempty(&iqp->q_waiting)) + chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = RDY_OK; return Q_OK; } @@ -150,17 +161,21 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { */ msg_t chIQGetTimeout(InputQueue *iqp, systime_t time) { uint8_t b; - msg_t msg; chSysLock(); - if (iqp->q_notify) iqp->q_notify(iqp); - if ((msg = chSemWaitTimeoutS(&iqp->q_sem, time)) < RDY_OK) { - chSysUnlock(); - return msg; + while (chIQIsEmptyI(iqp)) { + msg_t msg; + + if ((msg = qwait((GenericQueue *)iqp, time)) < RDY_OK) { + chSysUnlock(); + return msg; + } } + + iqp->q_counter--; b = *iqp->q_rdptr++; if (iqp->q_rdptr >= iqp->q_top) iqp->q_rdptr = iqp->q_buffer; @@ -202,16 +217,16 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp, chSysLock(); while (TRUE) { - if (chIQIsEmptyI(iqp)) { + while (chIQIsEmptyI(iqp)) { if (nfy) nfy(iqp); - if ((chSemWaitTimeoutS(&iqp->q_sem, time) != RDY_OK)) { + if (qwait((GenericQueue *)iqp, time) != RDY_OK) { chSysUnlock(); return r; } } - else - chSemFastWaitI(&iqp->q_sem); + + iqp->q_counter--; *bp++ = *iqp->q_rdptr++; if (iqp->q_rdptr >= iqp->q_top) iqp->q_rdptr = iqp->q_buffer; @@ -245,28 +260,11 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp, */ void chOQInit(OutputQueue *oqp, uint8_t *bp, size_t size, qnotify_t onfy) { + queue_init(&oqp->q_waiting); + oqp->q_counter = size; oqp->q_buffer = oqp->q_rdptr = oqp->q_wrptr = bp; oqp->q_top = bp + size; oqp->q_notify = onfy; - chSemInit(&oqp->q_sem, (cnt_t)size); -} - -/** - * @brief Returns the filled space into an output queue. - * - * @param[in] oqp pointer to an @p OutputQueue structure - * @return The number of bytes in the queue. - * @retval 0 if the queue is empty. - * - * @iclass - */ -size_t chOQGetFullI(OutputQueue *oqp) { - cnt_t cnt; - - cnt = chQSpaceI(oqp); - if (cnt < 0) - return chQSizeI(oqp); - return chQSizeI(oqp) - (size_t)cnt; } /** @@ -283,7 +281,9 @@ size_t chOQGetFullI(OutputQueue *oqp) { void chOQResetI(OutputQueue *oqp) { oqp->q_rdptr = oqp->q_wrptr = oqp->q_buffer; - chSemResetI(&oqp->q_sem, (cnt_t)(oqp->q_top - oqp->q_buffer)); + oqp->q_counter = chQSizeI(oqp); + while (notempty(&oqp->q_waiting)) + chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = RDY_RESET; } /** @@ -307,13 +307,18 @@ void chOQResetI(OutputQueue *oqp) { * @api */ msg_t chOQPutTimeout(OutputQueue *oqp, uint8_t b, systime_t time) { - msg_t msg; chSysLock(); - if ((msg = chSemWaitTimeoutS(&oqp->q_sem, time)) < RDY_OK) { - chSysUnlock(); - return msg; + while (chOQIsFullI(oqp)) { + msg_t msg; + + if ((msg = qwait((GenericQueue *)oqp, time)) < RDY_OK) { + chSysUnlock(); + return msg; + } } + + oqp->q_counter--; *oqp->q_wrptr++ = b; if (oqp->q_wrptr >= oqp->q_top) oqp->q_wrptr = oqp->q_buffer; @@ -341,10 +346,12 @@ msg_t chOQGetI(OutputQueue *oqp) { if (chOQIsEmptyI(oqp)) return Q_EMPTY; + oqp->q_counter++; b = *oqp->q_rdptr++; if (oqp->q_rdptr >= oqp->q_top) oqp->q_rdptr = oqp->q_buffer; - chSemSignalI(&oqp->q_sem); + if (notempty(&oqp->q_waiting)) + chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = RDY_OK; return b; } @@ -381,16 +388,15 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp, chSysLock(); while (TRUE) { - if (chOQIsFullI(oqp)) { + while (chOQIsFullI(oqp)) { if (nfy) nfy(oqp); - if ((chSemWaitTimeoutS(&oqp->q_sem, time) != RDY_OK)) { + if (qwait((GenericQueue *)oqp, time) != RDY_OK) { chSysUnlock(); return w; } } - else - chSemFastWaitI(&oqp->q_sem); + oqp->q_counter--; *oqp->q_wrptr++ = *bp++; if (oqp->q_wrptr >= oqp->q_top) oqp->q_wrptr = oqp->q_buffer; diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 54e7918b1..d41649b4c 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -130,12 +130,16 @@ static void wakeup(void *p) { /* Handling the special case where the thread has been made ready by another thread with higher priority.*/ return; -#if CH_USE_SEMAPHORES || (CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT) +#if CH_USE_SEMAPHORES || CH_USE_QUEUES || \ + (CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT) #if CH_USE_SEMAPHORES case THD_STATE_WTSEM: chSemFastSignalI((Semaphore *)tp->p_u.wtobjp); /* Falls into, intentional. */ #endif +#if CH_USE_QUEUES + case THD_STATE_WTQUEUE: +#endif #if CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT case THD_STATE_WTCOND: #endif diff --git a/readme.txt b/readme.txt index 7b4729e8b..484a57dd8 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,7 @@ ***************************************************************************** *** 2.3.3 *** +- FIX: Race condition in output queues (bug 3303908)(backported to 2.2.4). - FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420) (backported to 2.2.4). - NEW: Reorganization of the Cortex-Mx ports in order to reduced code and @@ -89,6 +90,8 @@ - CHANGE: Removed the CH_CURRP_REGISTER_CACHE option, it is GCC-specific so it does not belong to the kernel options. The feature will be eventually reimplemented as a port-specific option. +- CHANGE: chiQGetFullI() and chOQGetFullI() become macros. The queues + subsystem has been optimized and is no more dependent on semaphores. *** 2.3.2 *** - FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306)(backported -- cgit v1.2.3 From 5e1249af266c9688ec575e5a2f14ecfe6084de49 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 19 May 2011 09:13:24 +0000 Subject: Fixed bug 3303841. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2973 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chheap.h | 2 ++ os/kernel/src/chheap.c | 4 +++- readme.txt | 2 ++ test/testdyn.c | 14 ++++++++------ test/testheap.c | 4 ++-- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/os/kernel/include/chheap.h b/os/kernel/include/chheap.h index eb642cd18..0db1cbc1d 100644 --- a/os/kernel/include/chheap.h +++ b/os/kernel/include/chheap.h @@ -76,7 +76,9 @@ struct memory_heap { extern "C" { #endif void _heap_init(void); +#if !CH_USE_MALLOC_HEAP void chHeapInit(MemoryHeap *heapp, void *buf, size_t size); +#endif void *chHeapAlloc(MemoryHeap *heapp, size_t size); void chHeapFree(void *p); size_t chHeapStatus(MemoryHeap *heapp, size_t *sizep); diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index bcfca9b77..b90b21909 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -80,6 +80,8 @@ void _heap_init(void) { * @brief Initializes a memory heap from a static memory area. * @pre Both the heap buffer base and the heap size must be aligned to * the @p stkalign_t type size. + * @pre In order to use this function the option @p CH_USE_MALLOC_HEAP + * must be disabled. * * @param[out] heapp pointer to the memory heap descriptor to be initialized * @param[in] buf heap buffer base @@ -271,7 +273,7 @@ static Mutex hmtx; static Semaphore hsem; #endif -void heap_init(void) { +void _heap_init(void) { #if CH_USE_MUTEXES chMtxInit(&hmtx); diff --git a/readme.txt b/readme.txt index 484a57dd8..5b225c3f5 100644 --- a/readme.txt +++ b/readme.txt @@ -72,6 +72,8 @@ *** 2.3.3 *** - FIX: Race condition in output queues (bug 3303908)(backported to 2.2.4). +- FIX: Fixed CH_USE_HEAP and CH_USE_MALLOC_HEAP conflict (bug 3303841) + (backported to 2.2.4) - FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420) (backported to 2.2.4). - NEW: Reorganization of the Cortex-Mx ports in order to reduced code and diff --git a/test/testdyn.c b/test/testdyn.c index 5657a8dc2..d015e2ac6 100644 --- a/test/testdyn.c +++ b/test/testdyn.c @@ -54,7 +54,7 @@ */ #if CH_USE_DYNAMIC || defined(__DOXYGEN__) -#if CH_USE_HEAP || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) static MemoryHeap heap1; #endif #if CH_USE_MEMPOOLS || defined(__DOXYGEN__) @@ -78,7 +78,7 @@ static msg_t thread(void *p) { return 0; } -#if CH_USE_HEAP || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) static void dyn1_setup(void) { chHeapInit(&heap1, test.buffer, sizeof(union test_buffers)); @@ -124,7 +124,7 @@ ROMCONST struct testcase testdyn1 = { NULL, dyn1_execute }; -#endif /* CH_USE_HEAP */ +#endif /* (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) */ #if CH_USE_MEMPOOLS || defined(__DOXYGEN__) /** @@ -182,7 +182,8 @@ ROMCONST struct testcase testdyn2 = { }; #endif /* CH_USE_MEMPOOLS */ -#if (CH_USE_HEAP && CH_USE_REGISTRY) || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \ + defined(__DOXYGEN__) /** * @page test_dynamic_003 Registry and References test * @@ -252,13 +253,14 @@ ROMCONST struct testcase testdyn3 = { */ ROMCONST struct testcase * ROMCONST patterndyn[] = { #if CH_USE_DYNAMIC || defined(__DOXYGEN__) -#if CH_USE_HEAP || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) &testdyn1, #endif #if CH_USE_MEMPOOLS || defined(__DOXYGEN__) &testdyn2, #endif -#if (CH_USE_HEAP && CH_USE_REGISTRY) || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \ + defined(__DOXYGEN__) &testdyn3, #endif #endif diff --git a/test/testheap.c b/test/testheap.c index bfdcea1e6..6316b56c6 100644 --- a/test/testheap.c +++ b/test/testheap.c @@ -48,7 +48,7 @@ * @brief Heap header file */ -#if CH_USE_HEAP || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) #define SIZE 16 @@ -156,7 +156,7 @@ ROMCONST struct testcase testheap1 = { * @brief Test sequence for heap. */ ROMCONST struct testcase * ROMCONST patternheap[] = { -#if CH_USE_HEAP || defined(__DOXYGEN__) +#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) &testheap1, #endif NULL -- cgit v1.2.3 From 3495905f51318549a2bd6764360a4812aac869fa Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 19 May 2011 17:46:52 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2974 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h | 1 - demos/ARM7-AT91SAM7S-GCC/chconf.h | 1 - demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h | 1 - demos/ARM7-AT91SAM7X-GCC/chconf.h | 1 - demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 1 - demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h | 1 - demos/ARM7-LPC214x-FATFS-GCC/chconf.h | 1 - demos/ARM7-LPC214x-G++/chconf.h | 1 - demos/ARM7-LPC214x-GCC/chconf.h | 1 - demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h | 1 - demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h | 1 - demos/ARMCM3-STM32F100-DISCOVERY/chconf.h | 1 - demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h | 1 - demos/ARMCM3-STM32F103-G++/chconf.h | 1 - demos/ARMCM3-STM32F103/chconf.h | 1 - demos/ARMCM3-STM32F103ZG/chconf.h | 1 - demos/ARMCM3-STM32F107/chconf.h | 1 - demos/AVR-AT90CANx-GCC/chconf.h | 1 - demos/AVR-ATmega128-GCC/chconf.h | 1 - demos/MSP430-MSP430x1611-GCC/chconf.h | 1 - demos/PPC-SPC563-GCC/chconf.h | 1 - demos/Posix-GCC/chconf.h | 1 - demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h | 1 - demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h | 1 - demos/STM8S-STM8S208-RC/chconf.h | 1 - demos/Win32-MinGW/chconf.h | 1 - docs/reports/STM32F103-72-GCC.txt | 28 +++++++++---------- os/kernel/include/chqueues.h | 11 ++------ os/kernel/src/chqueues.c | 34 +++++++++++------------ os/kernel/templates/chconf.h | 1 - test/coverage/chconf.h | 1 - testhal/LPC11xx/IRQ_STORM/chconf.h | 1 - testhal/LPC13xx/IRQ_STORM/chconf.h | 1 - testhal/STM32/ADC/chconf.h | 1 - testhal/STM32/CAN/chconf.h | 1 - testhal/STM32/GPT/chconf.h | 1 - testhal/STM32/IRQ_STORM/chconf.h | 1 - testhal/STM32/PWM-ICU/chconf.h | 1 - testhal/STM32/SDIO/chconf.h | 1 - testhal/STM32/SPI/chconf.h | 1 - testhal/STM32/UART/chconf.h | 1 - testhal/STM32/USB_CDC/chconf.h | 1 - testhal/STM32/USB_MSC/chconf.h | 1 - testhal/STM8S/SPI/demo/chconf.h | 1 - 44 files changed, 33 insertions(+), 81 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-AT91SAM7S-GCC/chconf.h b/demos/ARM7-AT91SAM7S-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-AT91SAM7S-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-AT91SAM7X-GCC/chconf.h b/demos/ARM7-AT91SAM7X-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-AT91SAM7X-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index c117dccdd..dc89525ef 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-LPC214x-G++/chconf.h b/demos/ARM7-LPC214x-G++/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-LPC214x-G++/chconf.h +++ b/demos/ARM7-LPC214x-G++/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-STM32F103-G++/chconf.h b/demos/ARMCM3-STM32F103-G++/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-STM32F103-G++/chconf.h +++ b/demos/ARMCM3-STM32F103-G++/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-STM32F103ZG/chconf.h b/demos/ARMCM3-STM32F103ZG/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-STM32F103ZG/chconf.h +++ b/demos/ARMCM3-STM32F103ZG/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/ARMCM3-STM32F107/chconf.h b/demos/ARMCM3-STM32F107/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/ARMCM3-STM32F107/chconf.h +++ b/demos/ARMCM3-STM32F107/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index b941ca77d..2568f89ca 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index b941ca77d..2568f89ca 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/MSP430-MSP430x1611-GCC/chconf.h b/demos/MSP430-MSP430x1611-GCC/chconf.h index dcddb9a23..6428f5feb 100644 --- a/demos/MSP430-MSP430x1611-GCC/chconf.h +++ b/demos/MSP430-MSP430x1611-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/PPC-SPC563-GCC/chconf.h b/demos/PPC-SPC563-GCC/chconf.h index ccde82347..1bfd36e58 100644 --- a/demos/PPC-SPC563-GCC/chconf.h +++ b/demos/PPC-SPC563-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/Posix-GCC/chconf.h b/demos/Posix-GCC/chconf.h index cda9cabab..c01a15331 100644 --- a/demos/Posix-GCC/chconf.h +++ b/demos/Posix-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h index 3f42e3885..3f0e7f5ec 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h index 3f42e3885..3f0e7f5ec 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/STM8S-STM8S208-RC/chconf.h b/demos/STM8S-STM8S208-RC/chconf.h index 3f42e3885..3f0e7f5ec 100644 --- a/demos/STM8S-STM8S208-RC/chconf.h +++ b/demos/STM8S-STM8S208-RC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index cda9cabab..c01a15331 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index 87366005c..28041072a 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -1,12 +1,12 @@ *************************************************************************** -Options: -O2 -fomit-frame-pointer -mabi=apcs-gnu -falign-functions=16 +Options: -O2 -fomit-frame-pointer -falign-functions=16 Settings: SYSCLK=72, ACR=0x12 (2 wait states) *************************************************************************** *** ChibiOS/RT test suite *** *** Kernel: 2.3.3unstable -*** Compiler: GCC 4.6.0 +*** Compiler: GCC 4.5.2 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 *** Port Info: Advanced kernel mode @@ -99,51 +99,51 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 267098 msgs/S, 534196 ctxswc/S +--- Score : 248569 msgs/S, 497138 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 213832 msgs/S, 427664 ctxswc/S +--- Score : 198998 msgs/S, 397996 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 213832 msgs/S, 427664 ctxswc/S +--- Score : 198998 msgs/S, 397996 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 962832 ctxswc/S +--- Score : 839008 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 161828 threads/S +--- Score : 156856 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 241113 threads/S +--- Score : 235543 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 64728 reschedules/S, 388368 ctxswc/S +--- Score : 61138 reschedules/S, 366828 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 468840 ctxswc/S +--- Score : 478124 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 526392 bytes/S +--- Score : 581768 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 647308 timers/S +--- Score : 647262 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 787420 wait+signal/S +--- Score : 787368 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 596276 lock+unlock/S +--- Score : 586492 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index d1bad3149..d38b25e6f 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -31,18 +31,11 @@ #if CH_USE_QUEUES || defined(__DOXYGEN__) -/* - * Module dependencies check. - */ -#if !CH_USE_SEMAPHORES -#error "CH_USE_QUEUES requires CH_USE_SEMAPHORES" -#endif - /** @brief Returned by the queue functions if the operation is successful.*/ #define Q_OK RDY_OK /** @brief Returned by the queue functions if a timeout occurs.*/ #define Q_TIMEOUT RDY_TIMEOUT -/** @brief Returned by the queue functions if the queue is reset.*/ +/** @brief Returned by the queue functions if the queue has been reset.*/ #define Q_RESET RDY_RESET /** @brief Returned by the queue functions if the queue is empty.*/ #define Q_EMPTY -3 @@ -166,7 +159,7 @@ typedef GenericQueue InputQueue; * * @param[in] iqp pointer to an @p InputQueue structure * @return A byte value from the queue. - * @retval Q_RESET If the queue has been reset. + * @retval Q_RESET if the queue has been reset. * * @api */ diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index f6ae10257..767a36e63 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -58,14 +58,14 @@ * . * @return A message specifying how the invoking thread has been * released from threads queue. - * @retval RDY_OK is the normal exit, thread signaled. - * @retval RDY_RESET if the queue has been reset. - * @retval RDY_TIMEOUT if the queue operation timed out. + * @retval Q_OK is the normal exit, thread signaled. + * @retval Q_RESET if the queue has been reset. + * @retval Q_TIMEOUT if the queue operation timed out. */ static msg_t qwait(GenericQueue *qp, systime_t time) { if (TIME_IMMEDIATE == time) - return RDY_TIMEOUT; + return Q_TIMEOUT; currp->p_u.wtobjp = qp; queue_insert(currp, &qp->q_waiting); return chSchGoSleepTimeoutS(THD_STATE_WTQUEUE, time); @@ -111,7 +111,7 @@ void chIQResetI(InputQueue *iqp) { iqp->q_rdptr = iqp->q_wrptr = iqp->q_buffer; iqp->q_counter = 0; while (notempty(&iqp->q_waiting)) - chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = RDY_RESET; + chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_RESET; } /** @@ -137,7 +137,7 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { if (iqp->q_wrptr >= iqp->q_top) iqp->q_wrptr = iqp->q_buffer; if (notempty(&iqp->q_waiting)) - chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = RDY_OK; + chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_OK; return Q_OK; } @@ -155,7 +155,7 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { * . * @return A byte value from the queue. * @retval Q_TIMEOUT if the specified time expired. - * @retval Q_RESET if the queue was reset. + * @retval Q_RESET if the queue has been reset. * * @api */ @@ -163,13 +163,13 @@ msg_t chIQGetTimeout(InputQueue *iqp, systime_t time) { uint8_t b; chSysLock(); - if (iqp->q_notify) - iqp->q_notify(iqp); - while (chIQIsEmptyI(iqp)) { msg_t msg; - if ((msg = qwait((GenericQueue *)iqp, time)) < RDY_OK) { + if (iqp->q_notify) + iqp->q_notify(iqp); + + if ((msg = qwait((GenericQueue *)iqp, time)) < Q_OK) { chSysUnlock(); return msg; } @@ -220,7 +220,7 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp, while (chIQIsEmptyI(iqp)) { if (nfy) nfy(iqp); - if (qwait((GenericQueue *)iqp, time) != RDY_OK) { + if (qwait((GenericQueue *)iqp, time) != Q_OK) { chSysUnlock(); return r; } @@ -283,7 +283,7 @@ void chOQResetI(OutputQueue *oqp) { oqp->q_rdptr = oqp->q_wrptr = oqp->q_buffer; oqp->q_counter = chQSizeI(oqp); while (notempty(&oqp->q_waiting)) - chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = RDY_RESET; + chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_RESET; } /** @@ -302,7 +302,7 @@ void chOQResetI(OutputQueue *oqp) { * @return The operation status. * @retval Q_OK if the operation succeeded. * @retval Q_TIMEOUT if the specified time expired. - * @retval Q_RESET if the queue was reset. + * @retval Q_RESET if the queue has been reset. * * @api */ @@ -312,7 +312,7 @@ msg_t chOQPutTimeout(OutputQueue *oqp, uint8_t b, systime_t time) { while (chOQIsFullI(oqp)) { msg_t msg; - if ((msg = qwait((GenericQueue *)oqp, time)) < RDY_OK) { + if ((msg = qwait((GenericQueue *)oqp, time)) < Q_OK) { chSysUnlock(); return msg; } @@ -351,7 +351,7 @@ msg_t chOQGetI(OutputQueue *oqp) { if (oqp->q_rdptr >= oqp->q_top) oqp->q_rdptr = oqp->q_buffer; if (notempty(&oqp->q_waiting)) - chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = RDY_OK; + chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_OK; return b; } @@ -391,7 +391,7 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp, while (chOQIsFullI(oqp)) { if (nfy) nfy(oqp); - if (qwait((GenericQueue *)oqp, time) != RDY_OK) { + if (qwait((GenericQueue *)oqp, time) != Q_OK) { chSysUnlock(); return w; } diff --git a/os/kernel/templates/chconf.h b/os/kernel/templates/chconf.h index ccde82347..1bfd36e58 100644 --- a/os/kernel/templates/chconf.h +++ b/os/kernel/templates/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/test/coverage/chconf.h b/test/coverage/chconf.h index f1cce630a..cf85ab513 100644 --- a/test/coverage/chconf.h +++ b/test/coverage/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/LPC11xx/IRQ_STORM/chconf.h b/testhal/LPC11xx/IRQ_STORM/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/LPC11xx/IRQ_STORM/chconf.h +++ b/testhal/LPC11xx/IRQ_STORM/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/LPC13xx/IRQ_STORM/chconf.h b/testhal/LPC13xx/IRQ_STORM/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/LPC13xx/IRQ_STORM/chconf.h +++ b/testhal/LPC13xx/IRQ_STORM/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/ADC/chconf.h b/testhal/STM32/ADC/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/ADC/chconf.h +++ b/testhal/STM32/ADC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/CAN/chconf.h b/testhal/STM32/CAN/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/CAN/chconf.h +++ b/testhal/STM32/CAN/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/GPT/chconf.h b/testhal/STM32/GPT/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/GPT/chconf.h +++ b/testhal/STM32/GPT/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/IRQ_STORM/chconf.h b/testhal/STM32/IRQ_STORM/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/IRQ_STORM/chconf.h +++ b/testhal/STM32/IRQ_STORM/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/PWM-ICU/chconf.h b/testhal/STM32/PWM-ICU/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/PWM-ICU/chconf.h +++ b/testhal/STM32/PWM-ICU/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/SDIO/chconf.h b/testhal/STM32/SDIO/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/SDIO/chconf.h +++ b/testhal/STM32/SDIO/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/SPI/chconf.h b/testhal/STM32/SPI/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/SPI/chconf.h +++ b/testhal/STM32/SPI/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/UART/chconf.h b/testhal/STM32/UART/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/UART/chconf.h +++ b/testhal/STM32/UART/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/USB_CDC/chconf.h b/testhal/STM32/USB_CDC/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/USB_CDC/chconf.h +++ b/testhal/STM32/USB_CDC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM32/USB_MSC/chconf.h b/testhal/STM32/USB_MSC/chconf.h index ccde82347..1bfd36e58 100644 --- a/testhal/STM32/USB_MSC/chconf.h +++ b/testhal/STM32/USB_MSC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE diff --git a/testhal/STM8S/SPI/demo/chconf.h b/testhal/STM8S/SPI/demo/chconf.h index 3f42e3885..3f0e7f5ec 100644 --- a/testhal/STM8S/SPI/demo/chconf.h +++ b/testhal/STM8S/SPI/demo/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE -- cgit v1.2.3 From dfd3915859a4a3dbe055788dd4823742108b5205 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 19 May 2011 18:19:24 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2978 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 5b225c3f5..b8e11b162 100644 --- a/readme.txt +++ b/readme.txt @@ -71,9 +71,10 @@ ***************************************************************************** *** 2.3.3 *** -- FIX: Race condition in output queues (bug 3303908)(backported to 2.2.4). +- FIX: Fixed race condition in output queues (bug 3303908)(backported + to 2.2.4). - FIX: Fixed CH_USE_HEAP and CH_USE_MALLOC_HEAP conflict (bug 3303841) - (backported to 2.2.4) + (backported to 2.2.4). - FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420) (backported to 2.2.4). - NEW: Reorganization of the Cortex-Mx ports in order to reduced code and -- cgit v1.2.3 From 6b6790350e7861f2a15b308d84bc052681d1d150 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 19 May 2011 18:54:35 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2980 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h | 6 +++--- demos/ARM7-AT91SAM7S-GCC/chconf.h | 6 +++--- demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h | 6 +++--- demos/ARM7-AT91SAM7X-GCC/chconf.h | 6 +++--- demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 6 +++--- demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h | 6 +++--- demos/ARM7-LPC214x-FATFS-GCC/chconf.h | 6 +++--- demos/ARM7-LPC214x-G++/chconf.h | 6 +++--- demos/ARM7-LPC214x-GCC/chconf.h | 6 +++--- demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h | 6 +++--- demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h | 6 +++--- demos/ARMCM3-STM32F100-DISCOVERY/chconf.h | 6 +++--- demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h | 6 +++--- demos/ARMCM3-STM32F103-G++/chconf.h | 6 +++--- demos/ARMCM3-STM32F103/chconf.h | 6 +++--- demos/ARMCM3-STM32F103ZG/chconf.h | 6 +++--- demos/ARMCM3-STM32F107/chconf.h | 6 +++--- demos/AVR-AT90CANx-GCC/chconf.h | 6 +++--- demos/AVR-ATmega128-GCC/chconf.h | 6 +++--- demos/MSP430-MSP430x1611-GCC/chconf.h | 6 +++--- demos/PPC-SPC563-GCC/chconf.h | 6 +++--- demos/Posix-GCC/chconf.h | 6 +++--- demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h | 6 +++--- demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h | 6 +++--- demos/STM8S-STM8S208-RC/chconf.h | 6 +++--- demos/Win32-MinGW/chconf.h | 6 +++--- os/kernel/templates/chconf.h | 6 +++--- test/coverage/chconf.h | 6 +++--- testhal/LPC11xx/IRQ_STORM/chconf.h | 6 +++--- testhal/LPC13xx/IRQ_STORM/chconf.h | 6 +++--- testhal/STM32/ADC/chconf.h | 6 +++--- testhal/STM32/CAN/chconf.h | 6 +++--- testhal/STM32/GPT/chconf.h | 6 +++--- testhal/STM32/IRQ_STORM/chconf.h | 6 +++--- testhal/STM32/PWM-ICU/chconf.h | 6 +++--- testhal/STM32/SDIO/chconf.h | 6 +++--- testhal/STM32/SPI/chconf.h | 6 +++--- testhal/STM32/UART/chconf.h | 6 +++--- testhal/STM32/USB_CDC/chconf.h | 6 +++--- testhal/STM32/USB_MSC/chconf.h | 6 +++--- testhal/STM8S/SPI/demo/chconf.h | 6 +++--- 41 files changed, 123 insertions(+), 123 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-AT91SAM7S-GCC/chconf.h b/demos/ARM7-AT91SAM7S-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-AT91SAM7S-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-AT91SAM7X-GCC/chconf.h b/demos/ARM7-AT91SAM7X-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-AT91SAM7X-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index dc89525ef..496dcf2ab 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/chconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-LPC214x-G++/chconf.h b/demos/ARM7-LPC214x-G++/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-LPC214x-G++/chconf.h +++ b/demos/ARM7-LPC214x-G++/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-STM32F103-G++/chconf.h b/demos/ARMCM3-STM32F103-G++/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F103-G++/chconf.h +++ b/demos/ARMCM3-STM32F103-G++/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-STM32F103ZG/chconf.h b/demos/ARMCM3-STM32F103ZG/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F103ZG/chconf.h +++ b/demos/ARMCM3-STM32F103ZG/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/ARMCM3-STM32F107/chconf.h b/demos/ARMCM3-STM32F107/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F107/chconf.h +++ b/demos/ARMCM3-STM32F107/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2568f89ca..15e938e53 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2568f89ca..15e938e53 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/MSP430-MSP430x1611-GCC/chconf.h b/demos/MSP430-MSP430x1611-GCC/chconf.h index 6428f5feb..59112cded 100644 --- a/demos/MSP430-MSP430x1611-GCC/chconf.h +++ b/demos/MSP430-MSP430x1611-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 512 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/PPC-SPC563-GCC/chconf.h b/demos/PPC-SPC563-GCC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/demos/PPC-SPC563-GCC/chconf.h +++ b/demos/PPC-SPC563-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/Posix-GCC/chconf.h b/demos/Posix-GCC/chconf.h index c01a15331..e571b2800 100644 --- a/demos/Posix-GCC/chconf.h +++ b/demos/Posix-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0x20000 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h index 3f0e7f5ec..cd12e6e2b 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h index 3f0e7f5ec..cd12e6e2b 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/STM8S-STM8S208-RC/chconf.h b/demos/STM8S-STM8S208-RC/chconf.h index 3f0e7f5ec..cd12e6e2b 100644 --- a/demos/STM8S-STM8S208-RC/chconf.h +++ b/demos/STM8S-STM8S208-RC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index c01a15331..e571b2800 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0x20000 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/os/kernel/templates/chconf.h b/os/kernel/templates/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/os/kernel/templates/chconf.h +++ b/os/kernel/templates/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/test/coverage/chconf.h b/test/coverage/chconf.h index cf85ab513..d063fa93f 100644 --- a/test/coverage/chconf.h +++ b/test/coverage/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0x20000 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/LPC11xx/IRQ_STORM/chconf.h b/testhal/LPC11xx/IRQ_STORM/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/LPC11xx/IRQ_STORM/chconf.h +++ b/testhal/LPC11xx/IRQ_STORM/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/LPC13xx/IRQ_STORM/chconf.h b/testhal/LPC13xx/IRQ_STORM/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/LPC13xx/IRQ_STORM/chconf.h +++ b/testhal/LPC13xx/IRQ_STORM/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/ADC/chconf.h b/testhal/STM32/ADC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/ADC/chconf.h +++ b/testhal/STM32/ADC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/CAN/chconf.h b/testhal/STM32/CAN/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/CAN/chconf.h +++ b/testhal/STM32/CAN/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/GPT/chconf.h b/testhal/STM32/GPT/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/GPT/chconf.h +++ b/testhal/STM32/GPT/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/IRQ_STORM/chconf.h b/testhal/STM32/IRQ_STORM/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/IRQ_STORM/chconf.h +++ b/testhal/STM32/IRQ_STORM/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/PWM-ICU/chconf.h b/testhal/STM32/PWM-ICU/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/PWM-ICU/chconf.h +++ b/testhal/STM32/PWM-ICU/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/SDIO/chconf.h b/testhal/STM32/SDIO/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/SDIO/chconf.h +++ b/testhal/STM32/SDIO/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/SPI/chconf.h b/testhal/STM32/SPI/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/SPI/chconf.h +++ b/testhal/STM32/SPI/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/UART/chconf.h b/testhal/STM32/UART/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/UART/chconf.h +++ b/testhal/STM32/UART/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/USB_CDC/chconf.h b/testhal/STM32/USB_CDC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/USB_CDC/chconf.h +++ b/testhal/STM32/USB_CDC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM32/USB_MSC/chconf.h b/testhal/STM32/USB_MSC/chconf.h index 1bfd36e58..c9c4c286a 100644 --- a/testhal/STM32/USB_MSC/chconf.h +++ b/testhal/STM32/USB_MSC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 0 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) diff --git a/testhal/STM8S/SPI/demo/chconf.h b/testhal/STM8S/SPI/demo/chconf.h index 3f0e7f5ec..cd12e6e2b 100644 --- a/testhal/STM8S/SPI/demo/chconf.h +++ b/testhal/STM8S/SPI/demo/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) -- cgit v1.2.3 From 3cfb4077fb27e9ab51bc33d67def962ae68f26c7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 May 2011 07:29:52 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2982 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/serial_usb.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index bc2c39426..7fecd5f30 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -123,9 +123,12 @@ static void inotify(GenericQueue *qp) { n = usbReadPacketI(sdup->config->usbp, DATA_AVAILABLE_EP, sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); if (n != USB_ENDPOINT_BUSY) { - sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; - chSemAddCounterI(&sdup->iqueue.q_sem, n); chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); + sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; + sdup->iqueue.q_counter = n; + if (notempty(&sdup->iqueue.q_waiting)) + chSchReadyI(fifo_remove(&sdup->iqueue.q_waiting))->p_u.rdymsg = Q_OK; + chSchRescheduleS(); } } } @@ -143,9 +146,12 @@ static void onotify(GenericQueue *qp) { w = usbWritePacketI(sdup->config->usbp, DATA_REQUEST_EP, sdup->oqueue.q_buffer, n); if (w != USB_ENDPOINT_BUSY) { - sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; - chSemAddCounterI(&sdup->oqueue.q_sem, n); chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); + sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; + sdup->oqueue.q_counter = n; + if (notempty(&sdup->oqueue.q_waiting)) + chSchReadyI(fifo_remove(&sdup->oqueue.q_waiting))->p_u.rdymsg = Q_OK; + chSchRescheduleS(); } } @@ -286,9 +292,11 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { if (n > 0) { w = usbWritePacketI(usbp, ep, sdup->oqueue.q_buffer, n); if (w != USB_ENDPOINT_BUSY) { - sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; - chSemAddCounterI(&sdup->oqueue.q_sem, n); chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); + sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; + sdup->oqueue.q_counter = n; + if (notempty(&sdup->oqueue.q_waiting)) + chSchReadyI(fifo_remove(&sdup->oqueue.q_waiting))->p_u.rdymsg = Q_OK; } } chSysUnlockFromIsr(); @@ -314,9 +322,11 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) { n = usbReadPacketI(usbp, ep, sdup->iqueue.q_buffer, SERIAL_USB_BUFFERS_SIZE); if (n != USB_ENDPOINT_BUSY) { - sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; - chSemAddCounterI(&sdup->iqueue.q_sem, n); chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); + sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; + sdup->iqueue.q_counter = n; + if (notempty(&sdup->iqueue.q_waiting)) + chSchReadyI(fifo_remove(&sdup->iqueue.q_waiting))->p_u.rdymsg = Q_OK; } } chSysUnlockFromIsr(); -- cgit v1.2.3 From f4ec81ae144ef2ae7ddd9a0e56082970420c0464 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 May 2011 12:46:24 +0000 Subject: USB CDC functionality restored, more improvements to the I/O queues. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2983 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/serial_usb.c | 14 ++++++-------- os/kernel/src/chqueues.c | 41 +++++++++++++++++++++++------------------ readme.txt | 2 ++ 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 7fecd5f30..3f53d7df0 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -126,9 +126,8 @@ static void inotify(GenericQueue *qp) { chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; sdup->iqueue.q_counter = n; - if (notempty(&sdup->iqueue.q_waiting)) + while (notempty(&sdup->iqueue.q_waiting)) chSchReadyI(fifo_remove(&sdup->iqueue.q_waiting))->p_u.rdymsg = Q_OK; - chSchRescheduleS(); } } } @@ -148,10 +147,9 @@ static void onotify(GenericQueue *qp) { if (w != USB_ENDPOINT_BUSY) { chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; - sdup->oqueue.q_counter = n; - if (notempty(&sdup->oqueue.q_waiting)) + sdup->oqueue.q_counter = chQSizeI(&sdup->oqueue); + while (notempty(&sdup->oqueue.q_waiting)) chSchReadyI(fifo_remove(&sdup->oqueue.q_waiting))->p_u.rdymsg = Q_OK; - chSchRescheduleS(); } } @@ -294,8 +292,8 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { if (w != USB_ENDPOINT_BUSY) { chIOAddFlagsI(sdup, IO_OUTPUT_EMPTY); sdup->oqueue.q_wrptr = sdup->oqueue.q_buffer; - sdup->oqueue.q_counter = n; - if (notempty(&sdup->oqueue.q_waiting)) + sdup->oqueue.q_counter = chQSizeI(&sdup->oqueue); + while (notempty(&sdup->oqueue.q_waiting)) chSchReadyI(fifo_remove(&sdup->oqueue.q_waiting))->p_u.rdymsg = Q_OK; } } @@ -325,7 +323,7 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) { chIOAddFlagsI(sdup, IO_INPUT_AVAILABLE); sdup->iqueue.q_rdptr = sdup->iqueue.q_buffer; sdup->iqueue.q_counter = n; - if (notempty(&sdup->iqueue.q_waiting)) + while (notempty(&sdup->iqueue.q_waiting)) chSchReadyI(fifo_remove(&sdup->iqueue.q_waiting))->p_u.rdymsg = Q_OK; } } diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index 767a36e63..8532f8307 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -136,8 +136,10 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { *iqp->q_wrptr++ = b; if (iqp->q_wrptr >= iqp->q_top) iqp->q_wrptr = iqp->q_buffer; + if (notempty(&iqp->q_waiting)) chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_OK; + return Q_OK; } @@ -146,6 +148,9 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { * @details This function reads a byte value from an input queue. If the queue * is empty then the calling thread is suspended until a byte arrives * in the queue or a timeout occurs. + * @note The callback is invoked if the queue is empty before entering the + * @p THD_STATE_WTQUEUE state in order to solicit the low level to + * start queue filling. * * @param[in] iqp pointer to an @p InputQueue structure * @param[in] time the number of ticks before the operation timeouts, @@ -192,8 +197,9 @@ msg_t chIQGetTimeout(InputQueue *iqp, systime_t time) { * been reset. * @note The function is not atomic, if you need atomicity it is suggested * to use a semaphore or a mutex for mutual exclusion. - * @note The queue callback is invoked before entering a sleep state and at - * the end of the transfer. + * @note The callback is invoked if the queue is empty before entering the + * @p THD_STATE_WTQUEUE state in order to solicit the low level to + * start queue filling. * * @param[in] iqp pointer to an @p InputQueue structure * @param[out] bp pointer to the data buffer @@ -220,6 +226,7 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp, while (chIQIsEmptyI(iqp)) { if (nfy) nfy(iqp); + if (qwait((GenericQueue *)iqp, time) != Q_OK) { chSysUnlock(); return r; @@ -230,15 +237,12 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp, *bp++ = *iqp->q_rdptr++; if (iqp->q_rdptr >= iqp->q_top) iqp->q_rdptr = iqp->q_buffer; + chSysUnlock(); /* Gives a preemption chance in a controlled point.*/ r++; - if (--n == 0) { - chSysLock(); - if (nfy) - nfy(iqp); - chSysUnlock(); + if (--n == 0) return r; - } + chSysLock(); } } @@ -291,6 +295,8 @@ void chOQResetI(OutputQueue *oqp) { * @details This function writes a byte value to an output queue. If the queue * is full then the calling thread is suspended until there is space * in the queue or a timeout occurs. + * @note The callback is invoked after writing the character into the + * buffer. * * @param[in] oqp pointer to an @p OutputQueue structure * @param[in] b the byte value to be written in the queue @@ -350,8 +356,10 @@ msg_t chOQGetI(OutputQueue *oqp) { b = *oqp->q_rdptr++; if (oqp->q_rdptr >= oqp->q_top) oqp->q_rdptr = oqp->q_buffer; + if (notempty(&oqp->q_waiting)) chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_OK; + return b; } @@ -363,8 +371,8 @@ msg_t chOQGetI(OutputQueue *oqp) { * been reset. * @note The function is not atomic, if you need atomicity it is suggested * to use a semaphore or a mutex for mutual exclusion. - * @note The queue callback is invoked before entering a sleep state and at - * the end of the transfer. + * @note The callback is invoked after writing each character into the + * buffer. * * @param[in] oqp pointer to an @p OutputQueue structure * @param[out] bp pointer to the data buffer @@ -389,8 +397,6 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp, chSysLock(); while (TRUE) { while (chOQIsFullI(oqp)) { - if (nfy) - nfy(oqp); if (qwait((GenericQueue *)oqp, time) != Q_OK) { chSysUnlock(); return w; @@ -400,15 +406,14 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp, *oqp->q_wrptr++ = *bp++; if (oqp->q_wrptr >= oqp->q_top) oqp->q_wrptr = oqp->q_buffer; + + if (nfy) + nfy(oqp); + chSysUnlock(); /* Gives a preemption chance in a controlled point.*/ w++; - if (--n == 0) { - chSysLock(); - if (nfy) - nfy(oqp); - chSysUnlock(); + if (--n == 0) return w; - } chSysLock(); } } diff --git a/readme.txt b/readme.txt index b8e11b162..03541aa30 100644 --- a/readme.txt +++ b/readme.txt @@ -95,6 +95,8 @@ reimplemented as a port-specific option. - CHANGE: chiQGetFullI() and chOQGetFullI() become macros. The queues subsystem has been optimized and is no more dependent on semaphores. + Note that the queues callbacks invocation policy has been slightly + changed, see the documentation. *** 2.3.2 *** - FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306)(backported -- cgit v1.2.3 From 300345460518dcafbd955e7d3975dd7cb47999e1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 May 2011 12:57:01 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2984 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 03541aa30..4c7893b37 100644 --- a/readme.txt +++ b/readme.txt @@ -96,7 +96,7 @@ - CHANGE: chiQGetFullI() and chOQGetFullI() become macros. The queues subsystem has been optimized and is no more dependent on semaphores. Note that the queues callbacks invocation policy has been slightly - changed, see the documentation. + changed, see the documentation (backported to 2.2.4). *** 2.3.2 *** - FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306)(backported -- cgit v1.2.3 From 530fc2f44089fc8a96cd68884cdb9c9d9993bd12 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 May 2011 19:46:45 +0000 Subject: Change required by a bug into the Cosmic STM8 compiler. This change is a workaround. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2986 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chqueues.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index d38b25e6f..a2df59dad 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -149,7 +149,8 @@ typedef GenericQueue InputQueue; * * @iclass */ -#define chIQIsFullI(iqp) ((bool_t)(chQSpaceI(iqp) >= chQSizeI(iqp))) +#define chIQIsFullI(iqp) ((bool_t)(((iqp)->q_wrptr == (iqp)->q_rdptr) && \ + ((iqp)->q_counter != 0))) /** * @brief Input queue read. @@ -243,7 +244,8 @@ typedef GenericQueue OutputQueue; * * @iclass */ -#define chOQIsEmptyI(oqp) ((bool_t)(chQSpaceI(oqp) >= chQSizeI(oqp))) +#define chOQIsEmptyI(oqp) ((bool_t)(((oqp)->q_wrptr == (oqp)->q_rdptr) && \ + ((oqp)->q_counter != 0))) /** * @brief Evaluates to @p TRUE if the specified output queue is full. -- cgit v1.2.3 From bf5a88b425eb989d597e91d8b338bc4203bfc86e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 21 May 2011 07:15:40 +0000 Subject: Reordered the build sequence to avoid the idiotic STM8 stack limit. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2990 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../cosmic/cosmic.stp | 288 ++++++++------------- 1 file changed, 110 insertions(+), 178 deletions(-) diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/cosmic.stp b/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/cosmic.stp index a477aa256..c9868a0f1 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/cosmic.stp +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/cosmic.stp @@ -222,7 +222,7 @@ String.6.0=2010,5,25,14,45,56 [Root.Source Files] ElemType=Folder PathName=Source Files -Child=Root.Source Files...\demo\main.c +Child=Root.Source Files.Source Files\test Next=Root.Include Files Config.0=Root.Source Files.Config.0 Config.1=Root.Source Files.Config.1 @@ -293,14 +293,79 @@ String.4.0= String.5.0= String.6.0=2010,5,25,14,45,56 -[Root.Source Files...\demo\main.c] -ElemType=File -PathName=..\demo\main.c +[Root.Source Files.Source Files\test] +ElemType=Folder +PathName=Source Files\test +Child=Root.Source Files.Source Files\test...\..\..\test\testthd.c Next=Root.Source Files.vectors.c +[Root.Source Files.Source Files\test...\..\..\test\testthd.c] +ElemType=File +PathName=..\..\..\test\testthd.c +Next=Root.Source Files.Source Files\test...\..\..\test\testsem.c + +[Root.Source Files.Source Files\test...\..\..\test\testsem.c] +ElemType=File +PathName=..\..\..\test\testsem.c +Next=Root.Source Files.Source Files\test...\..\..\test\testqueues.c + +[Root.Source Files.Source Files\test...\..\..\test\testqueues.c] +ElemType=File +PathName=..\..\..\test\testqueues.c +Next=Root.Source Files.Source Files\test...\..\..\test\testpools.c + +[Root.Source Files.Source Files\test...\..\..\test\testpools.c] +ElemType=File +PathName=..\..\..\test\testpools.c +Next=Root.Source Files.Source Files\test...\..\..\test\testmtx.c + +[Root.Source Files.Source Files\test...\..\..\test\testmtx.c] +ElemType=File +PathName=..\..\..\test\testmtx.c +Next=Root.Source Files.Source Files\test...\..\..\test\testmsg.c + +[Root.Source Files.Source Files\test...\..\..\test\testmsg.c] +ElemType=File +PathName=..\..\..\test\testmsg.c +Next=Root.Source Files.Source Files\test...\..\..\test\testmbox.c + +[Root.Source Files.Source Files\test...\..\..\test\testmbox.c] +ElemType=File +PathName=..\..\..\test\testmbox.c +Next=Root.Source Files.Source Files\test...\..\..\test\testheap.c + +[Root.Source Files.Source Files\test...\..\..\test\testheap.c] +ElemType=File +PathName=..\..\..\test\testheap.c +Next=Root.Source Files.Source Files\test...\..\..\test\testevt.c + +[Root.Source Files.Source Files\test...\..\..\test\testevt.c] +ElemType=File +PathName=..\..\..\test\testevt.c +Next=Root.Source Files.Source Files\test...\..\..\test\testdyn.c + +[Root.Source Files.Source Files\test...\..\..\test\testdyn.c] +ElemType=File +PathName=..\..\..\test\testdyn.c +Next=Root.Source Files.Source Files\test...\..\..\test\testbmk.c + +[Root.Source Files.Source Files\test...\..\..\test\testbmk.c] +ElemType=File +PathName=..\..\..\test\testbmk.c +Next=Root.Source Files.Source Files\test...\..\..\test\test.c + +[Root.Source Files.Source Files\test...\..\..\test\test.c] +ElemType=File +PathName=..\..\..\test\test.c + [Root.Source Files.vectors.c] ElemType=File PathName=vectors.c +Next=Root.Source Files...\demo\main.c + +[Root.Source Files...\demo\main.c] +ElemType=File +PathName=..\demo\main.c Next=Root.Source Files.Source Files\board [Root.Source Files.Source Files\board] @@ -385,7 +450,6 @@ PathName=..\..\..\boards\st_stm8s_discovery\board.c ElemType=Folder PathName=Source Files\os Child=Root.Source Files.Source Files\os.Source Files\os\hal -Next=Root.Source Files.Source Files\test [Root.Source Files.Source Files\os.Source Files\os\hal] ElemType=Folder @@ -1620,142 +1684,10 @@ String.6.0=2010,5,25,14,45,56 ElemType=File PathName=..\..\..\os\ports\cosmic\stm8\chcore.c -[Root.Source Files.Source Files\test] -ElemType=Folder -PathName=Source Files\test -Child=Root.Source Files.Source Files\test...\..\..\test\test.c -Config.0=Root.Source Files.Source Files\test.Config.0 -Config.1=Root.Source Files.Source Files\test.Config.1 - -[Root.Source Files.Source Files\test.Config.0] -Settings.0.0=Root.Source Files.Source Files\test.Config.0.Settings.0 -Settings.0.1=Root.Source Files.Source Files\test.Config.0.Settings.1 -Settings.0.2=Root.Source Files.Source Files\test.Config.0.Settings.2 -Settings.0.3=Root.Source Files.Source Files\test.Config.0.Settings.3 - -[Root.Source Files.Source Files\test.Config.1] -Settings.1.0=Root.Source Files.Source Files\test.Config.1.Settings.0 -Settings.1.1=Root.Source Files.Source Files\test.Config.1.Settings.1 -Settings.1.2=Root.Source Files.Source Files\test.Config.1.Settings.2 -Settings.1.3=Root.Source Files.Source Files\test.Config.1.Settings.3 - -[Root.Source Files.Source Files\test.Config.0.Settings.0] -String.6.0=2010,6,3,14,55,17 -String.8.0=Debug -Int.0=0 -Int.1=0 - -[Root.Source Files.Source Files\test.Config.0.Settings.1] -String.2.0=Compiling $(InputFile)... -String.3.0=cxstm8 +warn +modsl0 -customDebCompat -customOpt-no -customC-pp -customLst -l -i..\demo -i..\..\..\test -i..\..\..\os\hal\include -i..\..\..\os\hal\platforms\stm8s -i..\..\..\boards\st_stm8s_discovery -i..\..\..\os\ports\cosmic\stm8 -i..\..\..\os\kernel\include $(ToolsetIncOpts) -cl$(IntermPath) -co$(IntermPath) $(InputFile) -String.4.0=$(IntermPath)$(InputName).$(ObjectExt) -String.5.0=$(IntermPath)$(InputName).ls -String.6.0=2010,6,5,11,53,48 - -[Root.Source Files.Source Files\test.Config.0.Settings.2] -String.2.0=Assembling $(InputFile)... -String.3.0=castm8 -xx -l $(ToolsetIncOpts) -o$(IntermPath)$(InputName).$(ObjectExt) $(InputFile) -String.4.0=$(IntermPath)$(InputName).$(ObjectExt) -String.5.0=$(IntermPath)$(InputName).ls -String.6.0=2010,5,25,14,45,56 - -[Root.Source Files.Source Files\test.Config.0.Settings.3] -String.2.0=Performing Custom Build on $(InputFile) -String.3.0= -String.4.0= -String.5.0= -String.6.0=2010,5,25,14,45,56 - -[Root.Source Files.Source Files\test.Config.1.Settings.0] -String.6.0=2010,6,3,14,55,17 -String.8.0=Release -Int.0=0 -Int.1=0 - -[Root.Source Files.Source Files\test.Config.1.Settings.1] -String.2.0=Compiling $(InputFile)... -String.3.0=cxstm8 +modsl0 -customC-pp -customLst-l -i..\demo -i..\..\..\test -i..\..\..\os\hal\include -i..\..\..\os\hal\platforms\stm8s -i..\..\..\boards\st_stm8s_discovery -i..\..\..\os\ports\cosmic\stm8 -i..\..\..\os\kernel\include $(ToolsetIncOpts) -cl$(IntermPath) -co$(IntermPath) $(InputFile) -String.4.0=$(IntermPath)$(InputName).$(ObjectExt) -String.5.0=$(IntermPath)$(InputName).ls -String.6.0=2010,6,5,11,53,48 - -[Root.Source Files.Source Files\test.Config.1.Settings.2] -String.2.0=Assembling $(InputFile)... -String.3.0=castm8 -l $(ToolsetIncOpts) -o$(IntermPath)$(InputName).$(ObjectExt) $(InputFile) -String.4.0=$(IntermPath)$(InputName).$(ObjectExt) -String.5.0=$(IntermPath)$(InputName).ls -String.6.0=2010,6,2,8,54,4 - -[Root.Source Files.Source Files\test.Config.1.Settings.3] -String.2.0=Performing Custom Build on $(InputFile) -String.3.0= -String.4.0= -String.5.0= -String.6.0=2010,5,25,14,45,56 - -[Root.Source Files.Source Files\test...\..\..\test\test.c] -ElemType=File -PathName=..\..\..\test\test.c -Next=Root.Source Files.Source Files\test...\..\..\test\testbmk.c - -[Root.Source Files.Source Files\test...\..\..\test\testbmk.c] -ElemType=File -PathName=..\..\..\test\testbmk.c -Next=Root.Source Files.Source Files\test...\..\..\test\testdyn.c - -[Root.Source Files.Source Files\test...\..\..\test\testdyn.c] -ElemType=File -PathName=..\..\..\test\testdyn.c -Next=Root.Source Files.Source Files\test...\..\..\test\testevt.c - -[Root.Source Files.Source Files\test...\..\..\test\testevt.c] -ElemType=File -PathName=..\..\..\test\testevt.c -Next=Root.Source Files.Source Files\test...\..\..\test\testheap.c - -[Root.Source Files.Source Files\test...\..\..\test\testheap.c] -ElemType=File -PathName=..\..\..\test\testheap.c -Next=Root.Source Files.Source Files\test...\..\..\test\testmbox.c - -[Root.Source Files.Source Files\test...\..\..\test\testmbox.c] -ElemType=File -PathName=..\..\..\test\testmbox.c -Next=Root.Source Files.Source Files\test...\..\..\test\testmsg.c - -[Root.Source Files.Source Files\test...\..\..\test\testmsg.c] -ElemType=File -PathName=..\..\..\test\testmsg.c -Next=Root.Source Files.Source Files\test...\..\..\test\testmtx.c - -[Root.Source Files.Source Files\test...\..\..\test\testmtx.c] -ElemType=File -PathName=..\..\..\test\testmtx.c -Next=Root.Source Files.Source Files\test...\..\..\test\testpools.c - -[Root.Source Files.Source Files\test...\..\..\test\testpools.c] -ElemType=File -PathName=..\..\..\test\testpools.c -Next=Root.Source Files.Source Files\test...\..\..\test\testqueues.c - -[Root.Source Files.Source Files\test...\..\..\test\testqueues.c] -ElemType=File -PathName=..\..\..\test\testqueues.c -Next=Root.Source Files.Source Files\test...\..\..\test\testsem.c - -[Root.Source Files.Source Files\test...\..\..\test\testsem.c] -ElemType=File -PathName=..\..\..\test\testsem.c -Next=Root.Source Files.Source Files\test...\..\..\test\testthd.c - -[Root.Source Files.Source Files\test...\..\..\test\testthd.c] -ElemType=File -PathName=..\..\..\test\testthd.c - [Root.Include Files] ElemType=Folder PathName=Include Files -Child=Root.Include Files...\demo\halconf.h +Child=Root.Include Files...\demo\chconf.h Config.0=Root.Include Files.Config.0 Config.1=Root.Include Files.Config.1 @@ -1825,14 +1757,14 @@ String.4.0= String.5.0= String.6.0=2010,5,25,14,45,56 -[Root.Include Files...\demo\halconf.h] -ElemType=File -PathName=..\demo\halconf.h -Next=Root.Include Files...\demo\chconf.h - [Root.Include Files...\demo\chconf.h] ElemType=File PathName=..\demo\chconf.h +Next=Root.Include Files...\demo\halconf.h + +[Root.Include Files...\demo\halconf.h] +ElemType=File +PathName=..\demo\halconf.h Next=Root.Include Files...\demo\mcuconf.h [Root.Include Files...\demo\mcuconf.h] @@ -2078,63 +2010,63 @@ PathName=..\..\..\os\ports\cosmic\stm8\chtypes.h [Root.Include Files.Include Files\test] ElemType=Folder PathName=Include Files\test -Child=Root.Include Files.Include Files\test...\..\..\test\test.h - -[Root.Include Files.Include Files\test...\..\..\test\test.h] -ElemType=File -PathName=..\..\..\test\test.h -Next=Root.Include Files.Include Files\test...\..\..\test\testbmk.h +Child=Root.Include Files.Include Files\test...\..\..\test\testthd.h -[Root.Include Files.Include Files\test...\..\..\test\testbmk.h] +[Root.Include Files.Include Files\test...\..\..\test\testthd.h] ElemType=File -PathName=..\..\..\test\testbmk.h -Next=Root.Include Files.Include Files\test...\..\..\test\testdyn.h +PathName=..\..\..\test\testthd.h +Next=Root.Include Files.Include Files\test...\..\..\test\testsem.h -[Root.Include Files.Include Files\test...\..\..\test\testdyn.h] +[Root.Include Files.Include Files\test...\..\..\test\testsem.h] ElemType=File -PathName=..\..\..\test\testdyn.h -Next=Root.Include Files.Include Files\test...\..\..\test\testevt.h +PathName=..\..\..\test\testsem.h +Next=Root.Include Files.Include Files\test...\..\..\test\testqueues.h -[Root.Include Files.Include Files\test...\..\..\test\testevt.h] +[Root.Include Files.Include Files\test...\..\..\test\testqueues.h] ElemType=File -PathName=..\..\..\test\testevt.h -Next=Root.Include Files.Include Files\test...\..\..\test\testheap.h +PathName=..\..\..\test\testqueues.h +Next=Root.Include Files.Include Files\test...\..\..\test\testpools.h -[Root.Include Files.Include Files\test...\..\..\test\testheap.h] +[Root.Include Files.Include Files\test...\..\..\test\testpools.h] ElemType=File -PathName=..\..\..\test\testheap.h -Next=Root.Include Files.Include Files\test...\..\..\test\testmbox.h +PathName=..\..\..\test\testpools.h +Next=Root.Include Files.Include Files\test...\..\..\test\testmtx.h -[Root.Include Files.Include Files\test...\..\..\test\testmbox.h] +[Root.Include Files.Include Files\test...\..\..\test\testmtx.h] ElemType=File -PathName=..\..\..\test\testmbox.h +PathName=..\..\..\test\testmtx.h Next=Root.Include Files.Include Files\test...\..\..\test\testmsg.h [Root.Include Files.Include Files\test...\..\..\test\testmsg.h] ElemType=File PathName=..\..\..\test\testmsg.h -Next=Root.Include Files.Include Files\test...\..\..\test\testmtx.h +Next=Root.Include Files.Include Files\test...\..\..\test\testmbox.h -[Root.Include Files.Include Files\test...\..\..\test\testmtx.h] +[Root.Include Files.Include Files\test...\..\..\test\testmbox.h] ElemType=File -PathName=..\..\..\test\testmtx.h -Next=Root.Include Files.Include Files\test...\..\..\test\testpools.h +PathName=..\..\..\test\testmbox.h +Next=Root.Include Files.Include Files\test...\..\..\test\testheap.h -[Root.Include Files.Include Files\test...\..\..\test\testpools.h] +[Root.Include Files.Include Files\test...\..\..\test\testheap.h] ElemType=File -PathName=..\..\..\test\testpools.h -Next=Root.Include Files.Include Files\test...\..\..\test\testqueues.h +PathName=..\..\..\test\testheap.h +Next=Root.Include Files.Include Files\test...\..\..\test\testevt.h -[Root.Include Files.Include Files\test...\..\..\test\testqueues.h] +[Root.Include Files.Include Files\test...\..\..\test\testevt.h] ElemType=File -PathName=..\..\..\test\testqueues.h -Next=Root.Include Files.Include Files\test...\..\..\test\testsem.h +PathName=..\..\..\test\testevt.h +Next=Root.Include Files.Include Files\test...\..\..\test\testdyn.h -[Root.Include Files.Include Files\test...\..\..\test\testsem.h] +[Root.Include Files.Include Files\test...\..\..\test\testdyn.h] ElemType=File -PathName=..\..\..\test\testsem.h -Next=Root.Include Files.Include Files\test...\..\..\test\testthd.h +PathName=..\..\..\test\testdyn.h +Next=Root.Include Files.Include Files\test...\..\..\test\testbmk.h -[Root.Include Files.Include Files\test...\..\..\test\testthd.h] +[Root.Include Files.Include Files\test...\..\..\test\testbmk.h] +ElemType=File +PathName=..\..\..\test\testbmk.h +Next=Root.Include Files.Include Files\test...\..\..\test\test.h + +[Root.Include Files.Include Files\test...\..\..\test\test.h] ElemType=File -PathName=..\..\..\test\testthd.h \ No newline at end of file +PathName=..\..\..\test\test.h \ No newline at end of file -- cgit v1.2.3 From 6d58148a5270e9b0e64af4273c07fff11fb83b02 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 May 2011 07:06:19 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2993 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SDIO/main.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 075af2cc3..8c5452ed7 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,7 +28,7 @@ static const SDCConfig sdccfg = { 0 }; -static uint8_t buf[SDC_BLOCK_SIZE * 2]; +static uint8_t blkbuf[SDC_BLOCK_SIZE * 4]; /* * Application entry point. @@ -53,15 +53,18 @@ int main(void) { int i; /* Repeated multiple reads.*/ for (i = 0; i < 5000; i++) { - if (sdcRead(&SDCD1, 0, buf, 2)) + if (sdcRead(&SDCD1, 0, blkbuf, 4)) + chSysHalt(); + } + /* Repeated multiple write.*/ + for (i = 0; i < 100; i++) { + if (sdcRead(&SDCD1, 0x10000, blkbuf, 4)) + chSysHalt(); + if (sdcWrite(&SDCD1, 0x10000, blkbuf, 4)) + chSysHalt(); + if (sdcWrite(&SDCD1, 0x10000, blkbuf, 4)) chSysHalt(); } - if (sdcRead(&SDCD1, 0x10000, buf, 2)) - chSysHalt(); - if (sdcWrite(&SDCD1, 0x10000, buf, 2)) - chSysHalt(); - if (sdcRead(&SDCD1, 0x10000, buf, 2)) - chSysHalt(); if (sdcDisconnect(&SDCD1)) chSysHalt(); } -- cgit v1.2.3 From b3ab17b27821114133e2ef8ffa46edb7a5a74097 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 May 2011 09:45:47 +0000 Subject: Reordered STM32 drivers default DMA priorities. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2994 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h | 8 ++++---- demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 8 ++++---- demos/ARMCM3-STM32F103-G++/mcuconf.h | 8 ++++---- demos/ARMCM3-STM32F103/mcuconf.h | 8 ++++---- demos/ARMCM3-STM32F103ZG/mcuconf.h | 8 ++++---- demos/ARMCM3-STM32F107/mcuconf.h | 8 ++++---- os/hal/platforms/STM32/adc_lld.h | 2 +- os/hal/platforms/STM32/spi_lld.h | 6 +++--- testhal/STM32/ADC/mcuconf.h | 8 ++++---- testhal/STM32/CAN/mcuconf.h | 8 ++++---- testhal/STM32/GPT/mcuconf.h | 8 ++++---- testhal/STM32/IRQ_STORM/mcuconf.h | 8 ++++---- testhal/STM32/PWM-ICU/mcuconf.h | 8 ++++---- testhal/STM32/SDIO/mcuconf.h | 8 ++++---- testhal/STM32/SPI/mcuconf.h | 8 ++++---- testhal/STM32/UART/mcuconf.h | 8 ++++---- testhal/STM32/USB_CDC/mcuconf.h | 8 ++++---- testhal/STM32/USB_MSC/mcuconf.h | 8 ++++---- 18 files changed, 68 insertions(+), 68 deletions(-) diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h index 5b3a5c785..0461fd201 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h +++ b/demos/ARMCM3-STM32F100-DISCOVERY/mcuconf.h @@ -49,7 +49,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -122,9 +122,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/demos/ARMCM3-STM32F103-G++/mcuconf.h b/demos/ARMCM3-STM32F103-G++/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/demos/ARMCM3-STM32F103-G++/mcuconf.h +++ b/demos/ARMCM3-STM32F103-G++/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/demos/ARMCM3-STM32F103/mcuconf.h b/demos/ARMCM3-STM32F103/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/demos/ARMCM3-STM32F103/mcuconf.h +++ b/demos/ARMCM3-STM32F103/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/demos/ARMCM3-STM32F103ZG/mcuconf.h b/demos/ARMCM3-STM32F103ZG/mcuconf.h index 99c5f9391..05b5e167d 100644 --- a/demos/ARMCM3-STM32F103ZG/mcuconf.h +++ b/demos/ARMCM3-STM32F103ZG/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -130,9 +130,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/demos/ARMCM3-STM32F107/mcuconf.h b/demos/ARMCM3-STM32F107/mcuconf.h index fbebae6db..7fcb1ab6a 100644 --- a/demos/ARMCM3-STM32F107/mcuconf.h +++ b/demos/ARMCM3-STM32F107/mcuconf.h @@ -57,7 +57,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -130,9 +130,9 @@ #define STM32_SPI_USE_SPI1 FALSE #define STM32_SPI_USE_SPI2 FALSE #define STM32_SPI_USE_SPI3 TRUE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/os/hal/platforms/STM32/adc_lld.h b/os/hal/platforms/STM32/adc_lld.h index 3cc34735f..ce93e60ed 100644 --- a/os/hal/platforms/STM32/adc_lld.h +++ b/os/hal/platforms/STM32/adc_lld.h @@ -83,7 +83,7 @@ * @brief ADC1 DMA priority (0..3|lowest..highest). */ #if !defined(STM32_ADC_ADC1_DMA_PRIORITY) || defined(__DOXYGEN__) -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #endif /** diff --git a/os/hal/platforms/STM32/spi_lld.h b/os/hal/platforms/STM32/spi_lld.h index 49e03e38c..6f1e94096 100644 --- a/os/hal/platforms/STM32/spi_lld.h +++ b/os/hal/platforms/STM32/spi_lld.h @@ -73,7 +73,7 @@ * over the TX channel. */ #if !defined(STM32_SPI_SPI1_DMA_PRIORITY) || defined(__DOXYGEN__) -#define STM32_SPI_SPI1_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 #endif /** @@ -83,7 +83,7 @@ * over the TX channel. */ #if !defined(STM32_SPI_SPI2_DMA_PRIORITY) || defined(__DOXYGEN__) -#define STM32_SPI_SPI2_DMA_PRIORITY 2 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 #endif /** @@ -93,7 +93,7 @@ * over the TX channel. */ #if !defined(STM32_SPI_SPI3_DMA_PRIORITY) || defined(__DOXYGEN__) -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #endif /** diff --git a/testhal/STM32/ADC/mcuconf.h b/testhal/STM32/ADC/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/testhal/STM32/ADC/mcuconf.h +++ b/testhal/STM32/ADC/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/CAN/mcuconf.h b/testhal/STM32/CAN/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/testhal/STM32/CAN/mcuconf.h +++ b/testhal/STM32/CAN/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/GPT/mcuconf.h b/testhal/STM32/GPT/mcuconf.h index 023c2ef9f..b2b7c525c 100644 --- a/testhal/STM32/GPT/mcuconf.h +++ b/testhal/STM32/GPT/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/IRQ_STORM/mcuconf.h b/testhal/STM32/IRQ_STORM/mcuconf.h index 416f38ce1..57af141f5 100644 --- a/testhal/STM32/IRQ_STORM/mcuconf.h +++ b/testhal/STM32/IRQ_STORM/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/PWM-ICU/mcuconf.h b/testhal/STM32/PWM-ICU/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/testhal/STM32/PWM-ICU/mcuconf.h +++ b/testhal/STM32/PWM-ICU/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/SDIO/mcuconf.h b/testhal/STM32/SDIO/mcuconf.h index 99c5f9391..05b5e167d 100644 --- a/testhal/STM32/SDIO/mcuconf.h +++ b/testhal/STM32/SDIO/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -130,9 +130,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/SPI/mcuconf.h b/testhal/STM32/SPI/mcuconf.h index f4cd4d3e2..971f0723d 100644 --- a/testhal/STM32/SPI/mcuconf.h +++ b/testhal/STM32/SPI/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 FALSE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/UART/mcuconf.h b/testhal/STM32/UART/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/testhal/STM32/UART/mcuconf.h +++ b/testhal/STM32/UART/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/USB_CDC/mcuconf.h b/testhal/STM32/USB_CDC/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/testhal/STM32/USB_CDC/mcuconf.h +++ b/testhal/STM32/USB_CDC/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 diff --git a/testhal/STM32/USB_MSC/mcuconf.h b/testhal/STM32/USB_MSC/mcuconf.h index 93bae3aea..8f6199e69 100644 --- a/testhal/STM32/USB_MSC/mcuconf.h +++ b/testhal/STM32/USB_MSC/mcuconf.h @@ -50,7 +50,7 @@ * ADC driver system settings. */ #define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 3 +#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 5 #define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() @@ -123,9 +123,9 @@ #define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 TRUE #define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 2 -#define STM32_SPI_SPI2_DMA_PRIORITY 2 -#define STM32_SPI_SPI3_DMA_PRIORITY 2 +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 #define STM32_SPI_SPI1_IRQ_PRIORITY 10 #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_SPI3_IRQ_PRIORITY 10 -- cgit v1.2.3 From 60807316406941aa437ca69cd9f0fb9f77370a81 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 May 2011 09:47:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2995 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- todo.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo.txt b/todo.txt index 294c33498..1f0c99c30 100644 --- a/todo.txt +++ b/todo.txt @@ -21,14 +21,14 @@ Within 2.3.x (hopefully) * New device driver models: GPT, ICU. X GPT implementation and long duration "IRQ storm" stress test applications for all the supported critical platforms. +X Introduce compiler-info macros to the port layer, improve the test reports + with the compiler info. - Add UART4 support to the STM32 UART driver (CL line only, HD has a nasty shared interrupt). - Add ADC3 support to the STM32 ADC driver. ? Make thread functions return void and add a CH_THREAD macro for threads declaration in order to hide compiler-specific optimizations for thread functions. -- Introduce compiler-info macros to the port layer, improve the test reports - with the compiler info. - Test suite overhaul, the API should be more generic in order to be used with different subsystems and not just the kernel. - Device drivers for STM8/STM8L (ADC, PWM, bring them on par with STM32). -- cgit v1.2.3 From 2a6ece58eaac63be0baf6505c2de4785b5e5b0ed Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 May 2011 11:43:45 +0000 Subject: Updated GCC-ARM port. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2996 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC2148-48-ARM.txt | 15 ++++++++------- docs/reports/LPC2148-48-THUMB.txt | 15 ++++++++------- os/ports/GCC/ARM/chcore.h | 40 ++++++++++++++++++++++++++++++++------- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/docs/reports/LPC2148-48-ARM.txt b/docs/reports/LPC2148-48-ARM.txt index f1ce426dd..8f38fa9cf 100644 --- a/docs/reports/LPC2148-48-ARM.txt +++ b/docs/reports/LPC2148-48-ARM.txt @@ -5,10 +5,11 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.1.7unstable -*** GCC Version: 4.5.1 +*** Kernel: 2.3.3unstable +*** Compiler: GCC 4.5.2 *** Architecture: ARM7 *** Core Variant: ARM7TDMI +*** Port Info: Pure ARM mode *** Platform: LPC214x *** Test Board: Olimex LPC-P2148 @@ -98,15 +99,15 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 145386 msgs/S, 290772 ctxswc/S +--- Score : 148549 msgs/S, 297098 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 113890 msgs/S, 227780 ctxswc/S +--- Score : 113347 msgs/S, 226694 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 113890 msgs/S, 227780 ctxswc/S +--- Score : 113347 msgs/S, 226694 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) @@ -126,11 +127,11 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 276084 ctxswc/S +--- Score : 276080 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 341980 bytes/S +--- Score : 402384 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) diff --git a/docs/reports/LPC2148-48-THUMB.txt b/docs/reports/LPC2148-48-THUMB.txt index 199f592f4..95c0ce7e0 100644 --- a/docs/reports/LPC2148-48-THUMB.txt +++ b/docs/reports/LPC2148-48-THUMB.txt @@ -5,10 +5,11 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.1.6unstable -*** GCC Version: 4.5.1 +*** Kernel: 2.3.3unstable +*** Compiler: GCC 4.5.2 *** Architecture: ARM7 *** Core Variant: ARM7TDMI +*** Port Info: Pure THUMB mode *** Platform: LPC214x *** Test Board: Olimex LPC-P2148 @@ -98,15 +99,15 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 106224 msgs/S, 212448 ctxswc/S +--- Score : 108146 msgs/S, 216292 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 88032 msgs/S, 176064 ctxswc/S +--- Score : 89014 msgs/S, 178028 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 88032 msgs/S, 176064 ctxswc/S +--- Score : 89014 msgs/S, 178028 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) @@ -130,7 +131,7 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 261396 bytes/S +--- Score : 315532 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) @@ -138,7 +139,7 @@ Settings: CCLK=48, MAMCR=2, MAMTIM=3 (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 350836 wait+signal/S +--- Score : 350832 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) diff --git a/os/ports/GCC/ARM/chcore.h b/os/ports/GCC/ARM/chcore.h index 5a36d82c8..20727ce23 100644 --- a/os/ports/GCC/ARM/chcore.h +++ b/os/ports/GCC/ARM/chcore.h @@ -62,7 +62,7 @@ * @brief If enabled allows the idle thread to enter a low power mode. */ #ifndef ARM_ENABLE_WFI_IDLE -#define ARM_ENABLE_WFI_IDLE FALSE +#define ARM_ENABLE_WFI_IDLE FALSE #endif /*===========================================================================*/ @@ -93,7 +93,7 @@ * - "ARM9". * . */ -#define CH_ARCHITECTURE_NAME "ARMx" +#define CH_ARCHITECTURE_NAME "ARMx" /** * @brief Name of the architecture variant (optional). @@ -103,19 +103,45 @@ * - "ARM9" * . */ -#define CH_CORE_VARIANT_NAME "ARMxy" +#define CH_CORE_VARIANT_NAME "ARMxy" + +/** + * @brief Port-specific information string. + * @note The value is for documentation only, the real value changes + * depending on the selected options, the possible values are: + * - "Pure ARM" + * - "Pure THUMB" + * - "Interworking" + * . + */ +#define CH_PORT_INFO "ARM|THUMB|Interworking" #elif ARM_CORE == ARM_CORE_ARM7TDMI #define CH_ARCHITECTURE_ARM7TDMI -#define CH_ARCHITECTURE_NAME "ARM7" -#define CH_CORE_VARIANT_NAME "ARM7TDMI" +#define CH_ARCHITECTURE_NAME "ARM7" +#define CH_CORE_VARIANT_NAME "ARM7TDMI" #elif ARM_MODEL == ARM_VARIANT_ARM9 #define CH_ARCHITECTURE_ARM9 -#define CH_ARCHITECTURE_NAME "ARM9" -#define CH_CORE_VARIANT_NAME "ARM9" +#define CH_ARCHITECTURE_NAME "ARM9" +#define CH_CORE_VARIANT_NAME "ARM9" #endif +#if THUMB_PRESENT +#if THUMB_NO_INTERWORKING +#define CH_PORT_INFO "Pure THUMB mode" +#else /* !THUMB_NO_INTERWORKING */ +#define CH_PORT_INFO "Interworking mode" +#endif /* !THUMB_NO_INTERWORKING */ +#else /* !THUMB_PRESENT */ +#define CH_PORT_INFO "Pure ARM mode" +#endif /* !THUMB_PRESENT */ + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "GCC "__VERSION__ + /*===========================================================================*/ /* Port implementation part (common). */ /*===========================================================================*/ -- cgit v1.2.3 From ee268d12c253ed336543b235b3af3ba9e9ff7b80 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 May 2011 11:51:17 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2997 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/AVR/chcore.h | 16 +++++++++++++--- os/ports/GCC/MSP430/chcore.h | 16 +++++++++++++--- os/ports/GCC/PPC/chcore.h | 24 +++++++++++++++++------- os/ports/GCC/SIMIA32/chcore.h | 14 ++++++++++++-- 4 files changed, 55 insertions(+), 15 deletions(-) diff --git a/os/ports/GCC/AVR/chcore.h b/os/ports/GCC/AVR/chcore.h index 5e1c4d954..2d33b205d 100644 --- a/os/ports/GCC/AVR/chcore.h +++ b/os/ports/GCC/AVR/chcore.h @@ -36,7 +36,7 @@ * @brief If enabled allows the idle thread to enter a low power mode. */ #ifndef ENABLE_WFI_IDLE -#define ENABLE_WFI_IDLE 0 +#define ENABLE_WFI_IDLE 0 #endif /** @@ -47,12 +47,22 @@ /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "AVR" +#define CH_ARCHITECTURE_NAME "AVR" /** * @brief Name of the architecture variant (optional). */ -#define CH_CORE_VARIANT_NAME "MegaAVR" +#define CH_CORE_VARIANT_NAME "MegaAVR" + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "GCC "__VERSION__ + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "None" /** * @brief 8 bits stack and memory alignment enforcement. diff --git a/os/ports/GCC/MSP430/chcore.h b/os/ports/GCC/MSP430/chcore.h index f70a34438..3e3d5b5d1 100644 --- a/os/ports/GCC/MSP430/chcore.h +++ b/os/ports/GCC/MSP430/chcore.h @@ -36,7 +36,7 @@ * @brief Enables the use of a wait state in the idle thread loop. */ #ifndef ENABLE_WFI_IDLE -#define ENABLE_WFI_IDLE 0 +#define ENABLE_WFI_IDLE 0 #endif /** @@ -47,12 +47,22 @@ /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "MSP430" +#define CH_ARCHITECTURE_NAME "MSP430" /** * @brief Name of the architecture variant (optional). */ -#define CH_CORE_VARIANT_NAME "MSP430" +#define CH_CORE_VARIANT_NAME "MSP430" + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "GCC "__VERSION__ + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "None" /** * @brief 16 bits stack and memory alignment enforcement. diff --git a/os/ports/GCC/PPC/chcore.h b/os/ports/GCC/PPC/chcore.h index 30e5f717c..6504532ac 100644 --- a/os/ports/GCC/PPC/chcore.h +++ b/os/ports/GCC/PPC/chcore.h @@ -37,12 +37,12 @@ * @brief Enables the use of the @p WFI instruction. */ #ifndef ENABLE_WFI_IDLE -#define ENABLE_WFI_IDLE 0 +#define ENABLE_WFI_IDLE 0 #endif /* Core variants identifiers.*/ -#define PPC_VARIANT_e200z3 3 /**< e200z3 core identifier. */ -#define PPC_VARIANT_e200z4 4 /**< e200z4 core identifier. */ +#define PPC_VARIANT_e200z3 3 /**< e200z3 core identifier. */ +#define PPC_VARIANT_e200z4 4 /**< e200z4 core identifier. */ /** * @brief Core variant selector. @@ -50,7 +50,7 @@ * possibly code paths and structures into the port layer. */ #if !defined(PPC_VARIANT) || defined(__DOXYGEN__) -#define PPC_VARIANT PPC_VARIANT_e200z3 +#define PPC_VARIANT PPC_VARIANT_e200z3 #endif /** @@ -61,19 +61,29 @@ /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "PowerPC" +#define CH_ARCHITECTURE_NAME "Power Architecture" /** * @brief Name of the architecture variant. */ #if (PPC_VARIANT == PPC_VARIANT_e200z3) || defined(__DOXYGEN__) -#define CH_CORE_VARIANT_NAME "e200z3" +#define CH_CORE_VARIANT_NAME "e200z3" #elif PPC_VARIANT == PPC_VARIANT_e200z4 -#define CH_CORE_VARIANT_NAME "e200z4" +#define CH_CORE_VARIANT_NAME "e200z4" #else #error "unknown or unsupported PowerPC variant specified" #endif +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "GCC "__VERSION__ + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "None" + /** * @brief Base type for stack and memory alignment. */ diff --git a/os/ports/GCC/SIMIA32/chcore.h b/os/ports/GCC/SIMIA32/chcore.h index 05dc05db4..3d5c62b23 100644 --- a/os/ports/GCC/SIMIA32/chcore.h +++ b/os/ports/GCC/SIMIA32/chcore.h @@ -34,12 +34,22 @@ /** * Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "Simulator" +#define CH_ARCHITECTURE_NAME "Simulator" /** * @brief Name of the architecture variant (optional). */ -#define CH_CORE_VARIANT_NAME "x86 (integer only)" +#define CH_CORE_VARIANT_NAME "x86 (integer only)" + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "GCC "__VERSION__ + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "No preemption" /** * 16 bytes stack alignment. -- cgit v1.2.3 From a3239bf257f320ba2d85da27b23f16d058efbb96 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 May 2011 15:23:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2998 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/RC/STM8/chcore.h | 14 ++++++++++++-- os/ports/cosmic/STM8/chcore.h | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/os/ports/RC/STM8/chcore.h b/os/ports/RC/STM8/chcore.h index 4de8bea54..07b7fa0b6 100644 --- a/os/ports/RC/STM8/chcore.h +++ b/os/ports/RC/STM8/chcore.h @@ -39,7 +39,7 @@ * @brief Enables the use of the WFI instruction in the idle thread loop. */ #ifndef STM8_ENABLE_WFI_IDLE -#define STM8_ENABLE_WFI_IDLE FALSE +#define STM8_ENABLE_WFI_IDLE FALSE #endif /*===========================================================================*/ @@ -54,7 +54,17 @@ /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "STM8" +#define CH_ARCHITECTURE_NAME "STM8" + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "Raisonance" + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "None" /*===========================================================================*/ /* Port implementation part. */ diff --git a/os/ports/cosmic/STM8/chcore.h b/os/ports/cosmic/STM8/chcore.h index e154b8914..93a4c24f0 100644 --- a/os/ports/cosmic/STM8/chcore.h +++ b/os/ports/cosmic/STM8/chcore.h @@ -37,7 +37,7 @@ * @brief Enables the use of the WFI instruction in the idle thread loop. */ #ifndef STM8_ENABLE_WFI_IDLE -#define STM8_ENABLE_WFI_IDLE FALSE +#define STM8_ENABLE_WFI_IDLE FALSE #endif /*===========================================================================*/ @@ -52,7 +52,17 @@ /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "STM8" +#define CH_ARCHITECTURE_NAME "STM8" + +/** + * @brief Name of the compiler supported by this port. + */ +#define CH_COMPILER_NAME "Cosmic" + +/** + * @brief Port-specific information string. + */ +#define CH_PORT_INFO "None" /*===========================================================================*/ /* Port implementation part. */ -- cgit v1.2.3 From 88e92b3fc3a14ec04780815b1061e680dfbb9777 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 May 2011 09:09:22 +0000 Subject: Improvements to the STM32 SDC driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3001 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile_chm | 2 +- docs/Doxyfile_html | 2 +- os/hal/include/sdc.h | 2 + os/hal/platforms/STM32/sdc_lld.c | 470 ++++++++++++++++++++++++++++++--------- os/hal/platforms/STM32/sdc_lld.h | 7 + os/hal/src/sdc.c | 8 +- os/kernel/include/ch.h | 4 +- readme.txt | 3 + testhal/STM32/SDIO/main.c | 43 +++- 9 files changed, 417 insertions(+), 124 deletions(-) diff --git a/docs/Doxyfile_chm b/docs/Doxyfile_chm index f6580b758..f088be782 100644 --- a/docs/Doxyfile_chm +++ b/docs/Doxyfile_chm @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.3 +PROJECT_NUMBER = 2.3.4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/docs/Doxyfile_html b/docs/Doxyfile_html index 0d2e6e31b..ab9d037da 100644 --- a/docs/Doxyfile_html +++ b/docs/Doxyfile_html @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.3 +PROJECT_NUMBER = 2.3.4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 1c095221b..2c35b8a0e 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -74,8 +74,10 @@ #define SDC_CMD_STOP_TRANSMISSION 12 #define SDC_CMD_SEND_STATUS 13 #define SDC_CMD_SET_BLOCKLEN 16 +#define SDC_CMD_READ_SINGLE_BLOCK 17 #define SDC_CMD_READ_MULTIPLE_BLOCK 18 #define SDC_CMD_SET_BLOCK_COUNT 23 +#define SDC_CMD_WRITE_BLOCK 24 #define SDC_CMD_WRITE_MULTIPLE_BLOCK 25 #define SDC_CMD_APP_OP_COND 41 #define SDC_CMD_LOCK_UNLOCK 42 diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 755fdf5ab..c790f49d9 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -26,6 +26,8 @@ * @{ */ +#include + #include "ch.h" #include "hal.h" @@ -42,10 +44,339 @@ SDCDriver SDCD1; /* Driver local variables. */ /*===========================================================================*/ +#if STM32_SDC_UNALIGNED_SUPPORT +/** + * @brief Buffer for temporary storage during unaligned transfers. + */ +static union { + uint32_t alignment; + uint8_t buf[SDC_BLOCK_SIZE]; +} u; +#endif + /*===========================================================================*/ /* Driver local functions. */ /*===========================================================================*/ +/** + * @brief Reads one or more blocks. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to read + * @param[out] buf pointer to the read buffer, it must be aligned to + * four bytes boundary + * @param[in] n number of blocks to read + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * read. + * @retval TRUE operation failed, the state of the buffer is uncertain. + * + * @notapi + */ +static bool_t sdc_lld_read_multiple(SDCDriver *sdcp, uint32_t startblk, + uint8_t *buf, uint32_t n) { + uint32_t resp[1]; + + /* Checks for errors and waits for the card to be ready for reading.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; + + /* Prepares the DMA channel for reading.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC); + + /* Setting up data transfer. + Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE; + SDIO->DLEN = n * SDC_BLOCK_SIZE; + SDIO->DCTRL = SDIO_DCTRL_DTDIR | + SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + + /* DMA channel activation.*/ + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + + /* Read multiple blocks command.*/ + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) + startblk *= SDC_BLOCK_SIZE; + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, + startblk, resp) || + SDC_R1_ERROR(resp[0])) + goto error; + + chSysLock(); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_read_multiple(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_read_multiple(), #2", "not NULL"); + } + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->DCTRL = 0; + chSysUnlock(); + + return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; + return TRUE; +} + +/** + * @brief Reads one block. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to read + * @param[out] buf pointer to the read buffer, it must be aligned to + * four bytes boundary + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * read. + * @retval TRUE operation failed, the state of the buffer is uncertain. + * + * @notapi + */ +static bool_t sdc_lld_read_single(SDCDriver *sdcp, uint32_t startblk, + uint8_t *buf) { + uint32_t resp[1]; + + /* Checks for errors and waits for the card to be ready for reading.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; + + /* Prepares the DMA channel for reading.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + SDC_BLOCK_SIZE / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC); + + /* Setting up data transfer. + Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE; + SDIO->DLEN = SDC_BLOCK_SIZE; + SDIO->DCTRL = SDIO_DCTRL_DTDIR | + SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + + /* DMA channel activation.*/ + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + + /* Read single block command.*/ + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) + startblk *= SDC_BLOCK_SIZE; + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_SINGLE_BLOCK, + startblk, resp) || + SDC_R1_ERROR(resp[0])) + goto error; + + chSysLock(); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_read_single(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_read_single(), #2", "not NULL"); + } + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->DCTRL = 0; + chSysUnlock(); + + return FALSE; +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; + return TRUE; +} + +/** + * @brief Writes one or more blocks. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to write + * @param[out] buf pointer to the write buffer, it must be aligned to + * four bytes boundary + * @param[in] n number of blocks to write + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * written. + * @retval TRUE operation failed. + * + * @notapi + */ +static bool_t sdc_lld_write_multiple(SDCDriver *sdcp, uint32_t startblk, + const uint8_t *buf, uint32_t n) { + uint32_t resp[1]; + + /* Checks for errors and waits for the card to be ready for writing.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; + + /* Prepares the DMA channel for writing.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC | DMA_CCR1_DIR); + + /* Write multiple blocks command.*/ + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) + startblk *= SDC_BLOCK_SIZE; + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_MULTIPLE_BLOCK, + startblk, resp) || + SDC_R1_ERROR(resp[0])) + return TRUE; + + /* Setting up data transfer. + Options: Controller to Card, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | + SDIO_MASK_STBITERRIE; + SDIO->DLEN = n * SDC_BLOCK_SIZE; + SDIO->DCTRL = SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + + /* DMA channel activation.*/ + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + + /* Note the mask is checked before going to sleep because the interrupt + may have occurred before reaching the critical zone.*/ + chSysLock(); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_write_multiple(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_write_multiple(), #2", "not NULL"); + } + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->DCTRL = 0; + chSysUnlock(); + + return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; + return TRUE; +} + +/** + * @brief Writes one block. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] startblk first block to write + * @param[out] buf pointer to the write buffer, it must be aligned to + * four bytes boundary + * @param[in] n number of blocks to write + * @return The operation status. + * @retval FALSE operation succeeded, the requested blocks have been + * written. + * @retval TRUE operation failed. + * + * @notapi + */ +static bool_t sdc_lld_write_single(SDCDriver *sdcp, uint32_t startblk, + const uint8_t *buf) { + uint32_t resp[1]; + + /* Checks for errors and waits for the card to be ready for writing.*/ + if (sdc_wait_for_transfer_state(sdcp)) + return TRUE; + + /* Prepares the DMA channel for writing.*/ + dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], + SDC_BLOCK_SIZE / sizeof (uint32_t), buf, + (STM32_SDC_SDIO_DMA_PRIORITY << 12) | + DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | + DMA_CCR1_MINC | DMA_CCR1_DIR); + + /* Write single block command.*/ + if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) + startblk *= SDC_BLOCK_SIZE; + if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_BLOCK, + startblk, resp) || + SDC_R1_ERROR(resp[0])) + return TRUE; + + /* Setting up data transfer. + Options: Controller to Card, Block mode, DMA mode, 512 bytes blocks.*/ + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | + SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | + SDIO_MASK_STBITERRIE; + SDIO->DLEN = SDC_BLOCK_SIZE; + SDIO->DCTRL = SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | + SDIO_DCTRL_DMAEN | + SDIO_DCTRL_DTEN; + + /* DMA channel activation.*/ + dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + + /* Note the mask is checked before going to sleep because the interrupt + may have occurred before reaching the critical zone.*/ + chSysLock(); + if (SDIO->MASK != 0) { + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_write_single(), #1", "not NULL"); + sdcp->thread = chThdSelf(); + chSchGoSleepS(THD_STATE_SUSPENDED); + chDbgAssert(sdcp->thread == NULL, + "sdc_lld_write_single(), #2", "not NULL"); + } + if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { + chSysUnlock(); + goto error; + } + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->DCTRL = 0; + chSysUnlock(); + + return FALSE; +error: + dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); + SDIO->ICR = 0xFFFFFFFF; + SDIO->MASK = 0; + SDIO->DCTRL = 0; + return TRUE; +} + /*===========================================================================*/ /* Driver interrupt handlers. */ /*===========================================================================*/ @@ -331,61 +662,23 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, */ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, uint8_t *buf, uint32_t n) { - uint32_t resp[1]; - - /* Checks for errors and waits for the card to be ready for reading.*/ - if (sdc_wait_for_transfer_state(sdcp)) - return TRUE; - - /* Prepares the DMA channel for reading.*/ - dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], - (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, - (STM32_SDC_SDIO_DMA_PRIORITY << 12) | - DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | - DMA_CCR1_MINC); - - /* Setting up data transfer. - Options: Card to Controller, Block mode, DMA mode, 512 bytes blocks.*/ - SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | - SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE; - SDIO->DLEN = n * SDC_BLOCK_SIZE; - SDIO->DCTRL = SDIO_DCTRL_DTDIR | - SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | - SDIO_DCTRL_DMAEN | - SDIO_DCTRL_DTEN; - /* DMA channel activation.*/ - dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_READ_MULTIPLE_BLOCK, - startblk, resp) || - SDC_R1_ERROR(resp[0])) - goto error; - - chSysLock(); - if (SDIO->MASK != 0) { - chDbgAssert(sdcp->thread == NULL, "sdc_lld_read(), #1", "not NULL"); - sdcp->thread = chThdSelf(); - chSchGoSleepS(THD_STATE_SUSPENDED); - chDbgAssert(sdcp->thread == NULL, "sdc_lld_read(), #2", "not NULL"); +#if STM32_SDC_UNALIGNED_SUPPORT + if (((unsigned)buf & 3) != 0) { + uint32_t i; + for (i = 0; i < n; i++) { + if (sdc_lld_read_single(sdcp, startblk, u.buf)) + return TRUE; + memcpy(buf, u.buf, SDC_BLOCK_SIZE); + buf += SDC_BLOCK_SIZE; + startblk++; + } + return FALSE; } - if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { - chSysUnlock(); - goto error; - } - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->ICR = 0xFFFFFFFF; - SDIO->DCTRL = 0; - chSysUnlock(); - - return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); -error: - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = 0; - SDIO->DCTRL = 0; - return TRUE; +#endif + if (n == 1) + return sdc_lld_read_single(sdcp, startblk, buf); + return sdc_lld_read_multiple(sdcp, startblk, buf, n); } /** @@ -404,64 +697,23 @@ error: */ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { - uint32_t resp[1]; - - /* Checks for errors and waits for the card to be ready for writing.*/ - if (sdc_wait_for_transfer_state(sdcp)) - return TRUE; - - /* Prepares the DMA channel for writing.*/ - dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4], - (n * SDC_BLOCK_SIZE) / sizeof (uint32_t), buf, - (STM32_SDC_SDIO_DMA_PRIORITY << 12) | - DMA_CCR1_PSIZE_1 | DMA_CCR1_MSIZE_1 | - DMA_CCR1_MINC | DMA_CCR1_DIR); - - /* Write multiple blocks command.*/ - if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_WRITE_MULTIPLE_BLOCK, - startblk, resp) || - SDC_R1_ERROR(resp[0])) - return TRUE; - - /* Setting up data transfer. - Options: Controller to Card, Block mode, DMA mode, 512 bytes blocks.*/ - SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | - SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | - SDIO_MASK_STBITERRIE; - SDIO->DLEN = n * SDC_BLOCK_SIZE; - SDIO->DCTRL = SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 | - SDIO_DCTRL_DMAEN | - SDIO_DCTRL_DTEN; - /* DMA channel activation.*/ - dmaEnableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - - /* Note the mask is checked before going to sleep because the interrupt - may have occurred before reaching the critical zone.*/ - chSysLock(); - if (SDIO->MASK != 0) { - chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #1", "not NULL"); - sdcp->thread = chThdSelf(); - chSchGoSleepS(THD_STATE_SUSPENDED); - chDbgAssert(sdcp->thread == NULL, "sdc_lld_write(), #2", "not NULL"); - } - if ((SDIO->STA & SDIO_STA_DATAEND) == 0) { - chSysUnlock(); - goto error; + #if STM32_SDC_UNALIGNED_SUPPORT + if (((unsigned)buf & 3) != 0) { + uint32_t i; + for (i = 0; i < n; i++) { + memcpy(u.buf, buf, SDC_BLOCK_SIZE); + buf += SDC_BLOCK_SIZE; + if (sdc_lld_write_single(sdcp, startblk, u.buf)) + return TRUE; + startblk++; + } + return FALSE; } - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->ICR = 0xFFFFFFFF; - SDIO->DCTRL = 0; - chSysUnlock(); - - return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp); -error: - dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4); - SDIO->ICR = 0xFFFFFFFF; - SDIO->MASK = 0; - SDIO->DCTRL = 0; - return TRUE; +#endif + if (n == 1) + return sdc_lld_write_single(sdcp, startblk, buf); + return sdc_lld_write_multiple(sdcp, startblk, buf, n); } #endif /* HAL_USE_SDC */ diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index 4263e5d6d..c0d1b8bdd 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -61,6 +61,13 @@ #define STM32_SDC_SDIO_IRQ_PRIORITY 9 #endif +/** + * @brief SDIO support for unaligned transfers. + */ +#if !defined(STM32_SDC_UNALIGNED_SUPPORT) || defined(__DOXYGEN__) +#define STM32_SDC_UNALIGNED_SUPPORT TRUE +#endif + /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 7eaa8e631..a7a39c268 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -343,9 +343,6 @@ bool_t sdcRead(SDCDriver *sdcp, uint32_t startblk, sdcp->state = SDC_READING; chSysUnlock(); - if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) - startblk *= SDC_BLOCK_SIZE; - err = sdc_lld_read(sdcp, startblk, buf, n); sdcp->state = SDC_ACTIVE; return err; @@ -371,16 +368,13 @@ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n) { bool_t err; - chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcRead"); + chDbgCheck((sdcp != NULL) && (buf != NULL) && (n > 0), "sdcWrite"); chSysLock(); chDbgAssert(sdcp->state == SDC_ACTIVE, "sdcWrite(), #1", "invalid state"); sdcp->state = SDC_WRITING; chSysUnlock(); - if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) == 0) - startblk *= SDC_BLOCK_SIZE; - err = sdc_lld_write(sdcp, startblk, buf, n); sdcp->state = SDC_ACTIVE; return err; diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index db96d4338..250f6adbf 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -40,7 +40,7 @@ /** * @brief Kernel version string. */ -#define CH_KERNEL_VERSION "2.3.3unstable" +#define CH_KERNEL_VERSION "2.3.4unstable" /** * @brief Kernel version major number. @@ -55,7 +55,7 @@ /** * @brief Kernel version patch number. */ -#define CH_KERNEL_PATCH 3 +#define CH_KERNEL_PATCH 4 /* * Common values. diff --git a/readme.txt b/readme.txt index 4c7893b37..cfa33c642 100644 --- a/readme.txt +++ b/readme.txt @@ -70,6 +70,9 @@ *** Releases *** ***************************************************************************** +*** 2.3.4 *** +- NEW: Now the STM32 SDC driver supports unaligned buffers transparently. + *** 2.3.3 *** - FIX: Fixed race condition in output queues (bug 3303908)(backported to 2.2.4). diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index 8c5452ed7..9736f0268 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,7 +28,7 @@ static const SDCConfig sdccfg = { 0 }; -static uint8_t blkbuf[SDC_BLOCK_SIZE * 4]; +static uint8_t blkbuf[SDC_BLOCK_SIZE * 4 + 1]; /* * Application entry point. @@ -51,12 +51,36 @@ int main(void) { sdcStart(&SDCD1, &sdccfg); if (!sdcConnect(&SDCD1)) { int i; - /* Repeated multiple reads.*/ - for (i = 0; i < 5000; i++) { + + /* Single aligned read.*/ + if (sdcRead(&SDCD1, 0, blkbuf, 1)) + chSysHalt(); + + /* Single unaligned read.*/ + if (sdcRead(&SDCD1, 0, blkbuf + 1, 1)) + chSysHalt(); + + /* Multiple aligned read.*/ + if (sdcRead(&SDCD1, 0, blkbuf, 4)) + chSysHalt(); + + /* Multiple unaligned read.*/ + if (sdcRead(&SDCD1, 0, blkbuf + 1, 4)) + chSysHalt(); + + /* Repeated multiple aligned reads.*/ + for (i = 0; i < 1000; i++) { if (sdcRead(&SDCD1, 0, blkbuf, 4)) chSysHalt(); } - /* Repeated multiple write.*/ + + /* Repeated multiple unaligned reads.*/ + for (i = 0; i < 1000; i++) { + if (sdcRead(&SDCD1, 0, blkbuf + 1, 4)) + chSysHalt(); + } + + /* Repeated multiple aligned writes.*/ for (i = 0; i < 100; i++) { if (sdcRead(&SDCD1, 0x10000, blkbuf, 4)) chSysHalt(); @@ -65,6 +89,17 @@ int main(void) { if (sdcWrite(&SDCD1, 0x10000, blkbuf, 4)) chSysHalt(); } + + /* Repeated multiple unaligned writes.*/ + for (i = 0; i < 100; i++) { + if (sdcRead(&SDCD1, 0x10000, blkbuf + 1, 4)) + chSysHalt(); + if (sdcWrite(&SDCD1, 0x10000, blkbuf + 1, 4)) + chSysHalt(); + if (sdcWrite(&SDCD1, 0x10000, blkbuf + 1, 4)) + chSysHalt(); + } + if (sdcDisconnect(&SDCD1)) chSysHalt(); } -- cgit v1.2.3 From 9b9bd471edae25a3ec4771485329f7ce6734c3ed Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 May 2011 16:19:21 +0000 Subject: Enhancements to the SDC driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3002 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 26 ++++++++++++++++++++++++++ os/hal/platforms/STM32/sdc_lld.h | 1 + readme.txt | 1 + 3 files changed, 28 insertions(+) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 2c35b8a0e..3f0634fc5 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -163,6 +163,32 @@ typedef enum { */ #define SDC_R1_IS_CARD_LOCKED(r1) (((r1) >> 21) & 1) +/** + * @brief Returns the driver state. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The driver state. + * + * @api + */ +#define sdcGetDriverState(sdcp) ((sdcp)->state) + +/** + * @brief Returns the write protect status. + * @note This macro wraps a low level function named + * @p sdc_lld_is_write_protected(), this function must be + * provided by the application because it is not part of the + * SDC driver. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The card state. + * @retval FALSE card not inserted. + * @retval TRUE card inserted. + * + * @api + */ +#define sdcIsWriteProtected(sdcp) (sdc_lld_is_write_protected(sdcp)) + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index c0d1b8bdd..a856fbf2b 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -190,6 +190,7 @@ extern "C" { uint8_t *buf, uint32_t n); bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n); + bool_t sdc_lld_is_write_protected(SDCDriver *sdcp); #ifdef __cplusplus } #endif diff --git a/readme.txt b/readme.txt index cfa33c642..851f2e0b0 100644 --- a/readme.txt +++ b/readme.txt @@ -72,6 +72,7 @@ *** 2.3.4 *** - NEW: Now the STM32 SDC driver supports unaligned buffers transparently. + Optimized the driver for single block read and write operations. *** 2.3.3 *** - FIX: Fixed race condition in output queues (bug 3303908)(backported -- cgit v1.2.3 From 4015cc5e3a0302529d2e7a13ee343cdba2d72488 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 May 2011 16:37:45 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3003 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG/Makefile | 1 + demos/ARMCM3-STM32F103ZG/halconf.h | 2 +- ext/diskio.c | 222 +++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 ext/diskio.c diff --git a/demos/ARMCM3-STM32F103ZG/Makefile b/demos/ARMCM3-STM32F103ZG/Makefile index 3c5bf32ec..d7a8b7490 100644 --- a/demos/ARMCM3-STM32F103ZG/Makefile +++ b/demos/ARMCM3-STM32F103ZG/Makefile @@ -63,6 +63,7 @@ include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk include $(CHIBIOS)/os/kernel/kernel.mk include $(CHIBIOS)/test/test.mk +include $(CHIBIOS)/ext/fatfs/fatfs.mk # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h index d36e56ec7..682167d84 100644 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ b/demos/ARMCM3-STM32F103ZG/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE +#define HAL_USE_SDC TRUE #endif /** diff --git a/ext/diskio.c b/ext/diskio.c new file mode 100644 index 000000000..2da536c34 --- /dev/null +++ b/ext/diskio.c @@ -0,0 +1,222 @@ +/*-----------------------------------------------------------------------*/ +/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */ +/*-----------------------------------------------------------------------*/ +/* This is a stub disk I/O module that acts as front end of the existing */ +/* disk I/O modules and attach it to FatFs module with common interface. */ +/*-----------------------------------------------------------------------*/ + +#include "ch.h" +#include "hal.h" + +#include "diskio.h" + +extern MMCDriver MMCD1; + +/*-----------------------------------------------------------------------*/ +/* Correspondence between physical drive number and physical drive. */ + +#define MMC 0 +#define SDC 1 + + + +/*-----------------------------------------------------------------------*/ +/* Inidialize a Drive */ + +DSTATUS disk_initialize ( + BYTE drv /* Physical drive nmuber (0..) */ +) +{ + DSTATUS stat; + + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (mmcGetDriverState(&MMCD1) != MMC_READY) + stat |= STA_NODISK; + if (mmcIsWriteProtected(&MMCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcIsWriteProtected(&SDCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_SDC */ + } + return STA_NOINIT; +} + + + +/*-----------------------------------------------------------------------*/ +/* Return Disk Status */ + +DSTATUS disk_status ( + BYTE drv /* Physical drive nmuber (0..) */ +) +{ + DSTATUS stat; + + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (mmcGetDriverState(&MMCD1) != MMC_READY) + stat |= STA_NODISK; + if (mmcIsWriteProtected(&MMCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcIsWriteProtected(&SDCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_SDC */ + } + return STA_NOINIT; +} + + + +/*-----------------------------------------------------------------------*/ +/* Read Sector(s) */ + +DRESULT disk_read ( + BYTE drv, /* Physical drive nmuber (0..) */ + BYTE *buff, /* Data buffer to store read data */ + DWORD sector, /* Sector address (LBA) */ + BYTE count /* Number of sectors to read (1..255) */ +) +{ + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + if (mmcGetDriverState(&MMCD1) != MMC_READY) + return RES_NOTRDY; + if (mmcStartSequentialRead(&MMCD1, sector)) + return RES_ERROR; + while (count > 0) { + if (mmcSequentialRead(&MMCD1, buff)) + return RES_ERROR; + buff += MMC_SECTOR_SIZE; + count--; + } + if (mmcStopSequentialRead(&MMCD1)) + return RES_ERROR; + return RES_OK; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcRead(&SDCD1, sector, buff, count)) + return RES_ERROR; +#endif /* HAL_USE_SDC */ + } + return RES_PARERR; +} + + + +/*-----------------------------------------------------------------------*/ +/* Write Sector(s) */ + +#if _READONLY == 0 +DRESULT disk_write ( + BYTE drv, /* Physical drive nmuber (0..) */ + const BYTE *buff, /* Data to be written */ + DWORD sector, /* Sector address (LBA) */ + BYTE count /* Number of sectors to write (1..255) */ +) +{ + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + if (mmcGetDriverState(&MMCD1) != MMC_READY) + return RES_NOTRDY; + if (mmcIsWriteProtected(&MMCD1)) + return RES_WRPRT; + if (mmcStartSequentialWrite(&MMCD1, sector)) + return RES_ERROR; + while (count > 0) { + if (mmcSequentialWrite(&MMCD1, buff)) + return RES_ERROR; + buff += MMC_SECTOR_SIZE; + count--; + } + if (mmcStopSequentialWrite(&MMCD1)) + return RES_ERROR; + return RES_OK; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcWrite(&SDCD1, sector, buff, count)) + return RES_ERROR; +#endif /* HAL_USE_SDC */ + } + return RES_PARERR; +} +#endif /* _READONLY */ + + + +/*-----------------------------------------------------------------------*/ +/* Miscellaneous Functions */ + +DRESULT disk_ioctl ( + BYTE drv, /* Physical drive nmuber (0..) */ + BYTE ctrl, /* Control code */ + void *buff /* Buffer to send/receive control data */ +) +{ + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + switch (ctrl) { + case CTRL_SYNC: + return RES_OK; + case GET_SECTOR_SIZE: + *((WORD *)buff) = MMC_SECTOR_SIZE; + return RES_OK; + default: + return RES_PARERR; + } + return RES_OK; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + switch (ctrl) { + case CTRL_SYNC: + return RES_OK; + case GET_SECTOR_SIZE: + *((WORD *)buff) = SDC_BLOCK_SIZE; + return RES_OK; + default: + return RES_PARERR; + } + return RES_OK; +#endif /* HAL_USE_SDC */ + } + return RES_PARERR; +} + +DWORD get_fattime(void) { + + return 0; +} -- cgit v1.2.3 From 03c0617a9fe69f113d3a55b3760a566643475394 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 May 2011 16:39:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3004 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/Makefile | 205 ++++++++++++ demos/ARMCM3-STM32F103ZG-FATFS/ch.ld | 130 ++++++++ demos/ARMCM3-STM32F103ZG-FATFS/chconf.h | 504 ++++++++++++++++++++++++++++++ demos/ARMCM3-STM32F103ZG-FATFS/halconf.h | 325 +++++++++++++++++++ demos/ARMCM3-STM32F103ZG-FATFS/main.c | 82 +++++ demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h | 161 ++++++++++ demos/ARMCM3-STM32F103ZG-FATFS/readme.txt | 28 ++ demos/ARMCM3-STM32F103ZG/Makefile | 205 ------------ demos/ARMCM3-STM32F103ZG/ch.ld | 130 -------- demos/ARMCM3-STM32F103ZG/chconf.h | 504 ------------------------------ demos/ARMCM3-STM32F103ZG/halconf.h | 325 ------------------- demos/ARMCM3-STM32F103ZG/main.c | 82 ----- demos/ARMCM3-STM32F103ZG/mcuconf.h | 161 ---------- demos/ARMCM3-STM32F103ZG/readme.txt | 28 -- 14 files changed, 1435 insertions(+), 1435 deletions(-) create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/Makefile create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/ch.ld create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/chconf.h create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/halconf.h create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/main.c create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/readme.txt delete mode 100644 demos/ARMCM3-STM32F103ZG/Makefile delete mode 100644 demos/ARMCM3-STM32F103ZG/ch.ld delete mode 100644 demos/ARMCM3-STM32F103ZG/chconf.h delete mode 100644 demos/ARMCM3-STM32F103ZG/halconf.h delete mode 100644 demos/ARMCM3-STM32F103ZG/main.c delete mode 100644 demos/ARMCM3-STM32F103ZG/mcuconf.h delete mode 100644 demos/ARMCM3-STM32F103ZG/readme.txt diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/Makefile b/demos/ARMCM3-STM32F103ZG-FATFS/Makefile new file mode 100644 index 000000000..d7a8b7490 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/Makefile @@ -0,0 +1,205 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../.. +include $(CHIBIOS)/boards/ST_STM3210E_EVAL/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk +include $(CHIBIOS)/ext/fatfs/fatfs.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/ch.ld b/demos/ARMCM3-STM32F103ZG-FATFS/ch.ld new file mode 100644 index 000000000..363ddce9f --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/ch.ld @@ -0,0 +1,130 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 1m + ram : org = 0x20000000, len = 96k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/chconf.h b/demos/ARMCM3-STM32F103ZG-FATFS/chconf.h new file mode 100644 index 000000000..c9c4c286a --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/chconf.h @@ -0,0 +1,504 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_MEMCORE. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/halconf.h b/demos/ARMCM3-STM32F103ZG-FATFS/halconf.h new file mode 100644 index 000000000..682167d84 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/halconf.h @@ -0,0 +1,325 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c new file mode 100644 index 000000000..5e1ac9863 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -0,0 +1,82 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" +#include "test.h" + +/* + * Red LED blinker thread, times are in milliseconds. + */ +static WORKING_AREA(waThread1, 128); +static msg_t Thread1(void *arg) { + + (void)arg; + while (TRUE) { + palClearPad(GPIOF, GPIOF_LED4); + palSetPad(GPIOF, GPIOF_LED1); + chThdSleepMilliseconds(250); + palClearPad(GPIOF, GPIOF_LED1); + palSetPad(GPIOF, GPIOF_LED2); + chThdSleepMilliseconds(250); + palClearPad(GPIOF, GPIOF_LED2); + palSetPad(GPIOF, GPIOF_LED3); + chThdSleepMilliseconds(250); + palClearPad(GPIOF, GPIOF_LED3); + palSetPad(GPIOF, GPIOF_LED4); + chThdSleepMilliseconds(250); + } +} + +/* + * Application entry point. + */ +int main(void) { + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Activates the serial driver 1 using the driver default configuration. + */ + sdStart(&SD1, NULL); + + /* + * Creates the blinker thread. + */ + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + + /* + * Normal main() thread activity, in this demo it does nothing except + * sleeping in a loop and check the button state. + */ + while (TRUE) { + if (!palReadPad(GPIOG, GPIOG_USER_BUTTON)) + TestThread(&SD1); + chThdSleepMilliseconds(500); + } +} diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h b/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h new file mode 100644 index 000000000..05b5e167d --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h @@ -0,0 +1,161 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED TRUE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SDC driver system settings. + */ +#define STM32_SDC_DATATIMEOUT 0x000FFFFF +#define STM32_SDC_SDIO_DMA_PRIORITY 3 +#define STM32_SDC_SDIO_IRQ_PRIORITY 9 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 TRUE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/readme.txt b/demos/ARMCM3-STM32F103ZG-FATFS/readme.txt new file mode 100644 index 000000000..f0e2fb1da --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/readme.txt @@ -0,0 +1,28 @@ +***************************************************************************** +** ChibiOS/RT port for ARM-Cortex-M3 STM32F103ZG. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an STM3210E-EVAL board. + +** The Demo ** + +The demo flashes the board LEDs using a thread, by pressing the button located +on the board the test procedure is activated with output on the serial port +SD1 (USART1). + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain +and YAGARTO. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distribited +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com diff --git a/demos/ARMCM3-STM32F103ZG/Makefile b/demos/ARMCM3-STM32F103ZG/Makefile deleted file mode 100644 index d7a8b7490..000000000 --- a/demos/ARMCM3-STM32F103ZG/Makefile +++ /dev/null @@ -1,205 +0,0 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable register caching optimization (read documentation). -ifeq ($(USE_CURRP_CACHING),) - USE_CURRP_CACHING = no -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Enable this if you really want to use the STM FWLib. -ifeq ($(USE_FWLIB),) - USE_FWLIB = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Define linker script file here -LDSCRIPT= ch.ld - -# Imported source files -CHIBIOS = ../.. -include $(CHIBIOS)/boards/ST_STM3210E_EVAL/board.mk -include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk -include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk -include $(CHIBIOS)/os/kernel/kernel.mk -include $(CHIBIOS)/test/test.mk -include $(CHIBIOS)/ext/fatfs/fatfs.mk - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(PORTSRC) \ - $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(CHIBIOS)/os/various/evtimer.c \ - $(CHIBIOS)/os/various/syscalls.c \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = $(PORTASM) - -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m3 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -OD = $(TRGT)objdump -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of default section -# - -# List all default C defines here, like -D_DEBUG=1 -DDEFS = - -# List all default ASM defines here, like -D_DEBUG=1 -DADEFS = - -# List all default directories to look for include files here -DINCDIR = - -# List the default directory to look for the libraries here -DLIBDIR = - -# List all default libraries here -DLIBS = - -# -# End of default section -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# -# End of user defines -############################################################################## - -ifeq ($(USE_FWLIB),yes) - include $(CHIBIOS)/ext/stm32lib/stm32lib.mk - CSRC += $(STM32SRC) - INCDIR += $(STM32INC) - USE_OPT += -DUSE_STDPERIPH_DRIVER -endif - -include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F103ZG/ch.ld b/demos/ARMCM3-STM32F103ZG/ch.ld deleted file mode 100644 index 363ddce9f..000000000 --- a/demos/ARMCM3-STM32F103ZG/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F103xG memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; -__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; - -MEMORY -{ - flash : org = 0x08000000, len = 1m - ram : org = 0x20000000, len = 96k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .data : - { - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F103ZG/chconf.h b/demos/ARMCM3-STM32F103ZG/chconf.h deleted file mode 100644 index c9c4c286a..000000000 --- a/demos/ARMCM3-STM32F103ZG/chconf.h +++ /dev/null @@ -1,504 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/* Kernel parameters. */ -/*===========================================================================*/ - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) -#define CH_FREQUENCY 1000 -#endif - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - */ -#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) -#define CH_TIME_QUANTUM 20 -#endif - -/** - * @brief Nested locks. - * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() - * operations is allowed.
- * For performance and code size reasons the recommended setting - * is to leave this option disabled.
- * You may use this option if you need to merge ChibiOS/RT with - * external libraries that require nested lock/unlock operations. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) -#define CH_USE_NESTED_LOCKS FALSE -#endif - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_MEMCORE. - */ -#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) -#define CH_MEMCORE_SIZE 0 -#endif - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread automatically. The application has - * then the responsibility to do one of the following: - * - Spawn a custom idle thread at priority @p IDLEPRIO. - * - Change the main() thread priority to @p IDLEPRIO then enter - * an endless loop. In this scenario the @p main() thread acts as - * the idle thread. - * . - * @note Unless an idle thread is spawned the @p main() thread must not - * enter a sleep state. - */ -#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) -#define CH_NO_IDLE_THREAD FALSE -#endif - -/*===========================================================================*/ -/* Performance options. */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) -#define CH_OPTIMIZE_SPEED TRUE -#endif - -/*===========================================================================*/ -/* Subsystem options. */ -/*===========================================================================*/ - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) -#define CH_USE_REGISTRY TRUE -#endif - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) -#define CH_USE_WAITEXIT TRUE -#endif - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES TRUE -#endif - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES_PRIORITY FALSE -#endif - -/** - * @brief Atomic semaphore API. - * @details If enabled then the semaphores the @p chSemSignalWait() API - * is included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) -#define CH_USE_SEMSW TRUE -#endif - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) -#define CH_USE_MUTEXES TRUE -#endif - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MUTEXES. - */ -#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS TRUE -#endif - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_CONDVARS. - */ -#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS_TIMEOUT TRUE -#endif - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) -#define CH_USE_EVENTS TRUE -#endif - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_EVENTS. - */ -#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_EVENTS_TIMEOUT TRUE -#endif - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES TRUE -#endif - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_MESSAGES. - */ -#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES_PRIORITY FALSE -#endif - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) -#define CH_USE_MAILBOXES TRUE -#endif - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) -#define CH_USE_QUEUES TRUE -#endif - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) -#define CH_USE_MEMCORE TRUE -#endif - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or - * @p CH_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) -#define CH_USE_HEAP TRUE -#endif - -/** - * @brief C-runtime allocator. - * @details If enabled the the heap allocator APIs just wrap the C-runtime - * @p malloc() and @p free() functions. - * - * @note The default is @p FALSE. - * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the - * appropriate documentation. - */ -#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) -#define CH_USE_MALLOC_HEAP FALSE -#endif - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) -#define CH_USE_MEMPOOLS TRUE -#endif - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_WAITEXIT. - * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. - */ -#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) -#define CH_USE_DYNAMIC TRUE -#endif - -/*===========================================================================*/ -/* Debug options. */ -/*===========================================================================*/ - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_CHECKS FALSE -#endif - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_ASSERTS FALSE -#endif - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_TRACE FALSE -#endif - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_STACK_CHECK FALSE -#endif - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) -#define CH_DBG_FILL_THREADS FALSE -#endif - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p Thread structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p TRUE. - * @note This debug option is defaulted to TRUE because it is required by - * some test cases into the test suite. - */ -#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) -#define CH_DBG_THREADS_PROFILING TRUE -#endif - -/*===========================================================================*/ -/* Kernel hooks. */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p Thread structure. - */ -#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) -#define THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ -#endif - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitily from all - * the threads creation APIs. - */ -#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} -#endif - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} -#endif - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) -#define IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} -#endif - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_TICK_EVENT_HOOK() { \ - /* System tick event code here.*/ \ -} -#endif - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_HALT_HOOK() { \ - /* System halt code here.*/ \ -} -#endif - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/demos/ARMCM3-STM32F103ZG/halconf.h b/demos/ARMCM3-STM32F103ZG/halconf.h deleted file mode 100644 index 682167d84..000000000 --- a/demos/ARMCM3-STM32F103ZG/halconf.h +++ /dev/null @@ -1,325 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Block size for MMC transfers. - */ -#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) -#define MMC_SECTOR_SIZE 512 -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/** - * @brief Number of positive insertion queries before generating the - * insertion event. - */ -#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) -#define MMC_POLLING_INTERVAL 10 -#endif - -/** - * @brief Interval, in milliseconds, between insertion queries. - */ -#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) -#define MMC_POLLING_DELAY 10 -#endif - -/** - * @brief Uses the SPI polled API for small data transfers. - * @details Polled transfers usually improve performance because it - * saves two context switches and interrupt servicing. Note - * that this option has no effect on large transfers which - * are always performed using DMAs/IRQs. - */ -#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) -#define MMC_USE_SPI_POLLING TRUE -#endif - -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intevals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/demos/ARMCM3-STM32F103ZG/main.c b/demos/ARMCM3-STM32F103ZG/main.c deleted file mode 100644 index 5e1ac9863..000000000 --- a/demos/ARMCM3-STM32F103ZG/main.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "test.h" - -/* - * Red LED blinker thread, times are in milliseconds. - */ -static WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { - - (void)arg; - while (TRUE) { - palClearPad(GPIOF, GPIOF_LED4); - palSetPad(GPIOF, GPIOF_LED1); - chThdSleepMilliseconds(250); - palClearPad(GPIOF, GPIOF_LED1); - palSetPad(GPIOF, GPIOF_LED2); - chThdSleepMilliseconds(250); - palClearPad(GPIOF, GPIOF_LED2); - palSetPad(GPIOF, GPIOF_LED3); - chThdSleepMilliseconds(250); - palClearPad(GPIOF, GPIOF_LED3); - palSetPad(GPIOF, GPIOF_LED4); - chThdSleepMilliseconds(250); - } -} - -/* - * Application entry point. - */ -int main(void) { - - /* - * System initializations. - * - HAL initialization, this also initializes the configured device drivers - * and performs the board-specific initializations. - * - Kernel initialization, the main() function becomes a thread and the - * RTOS is active. - */ - halInit(); - chSysInit(); - - /* - * Activates the serial driver 1 using the driver default configuration. - */ - sdStart(&SD1, NULL); - - /* - * Creates the blinker thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - - /* - * Normal main() thread activity, in this demo it does nothing except - * sleeping in a loop and check the button state. - */ - while (TRUE) { - if (!palReadPad(GPIOG, GPIOG_USER_BUTTON)) - TestThread(&SD1); - chThdSleepMilliseconds(500); - } -} diff --git a/demos/ARMCM3-STM32F103ZG/mcuconf.h b/demos/ARMCM3-STM32F103ZG/mcuconf.h deleted file mode 100644 index 05b5e167d..000000000 --- a/demos/ARMCM3-STM32F103ZG/mcuconf.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * STM32 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -/* - * HAL driver system settings. - */ -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_USBPRE STM32_USBPRE_DIV1P5 -#define STM32_MCO STM32_MCO_NOCLOCK - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 TRUE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 TRUE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED TRUE -#define STM32_PWM_USE_TIM1 TRUE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 - -/* - * SDC driver system settings. - */ -#define STM32_SDC_DATATIMEOUT 0x000FFFFF -#define STM32_SDC_SDIO_DMA_PRIORITY 3 -#define STM32_SDC_SDIO_IRQ_PRIORITY 9 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 TRUE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 TRUE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 TRUE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103ZG/readme.txt b/demos/ARMCM3-STM32F103ZG/readme.txt deleted file mode 100644 index f0e2fb1da..000000000 --- a/demos/ARMCM3-STM32F103ZG/readme.txt +++ /dev/null @@ -1,28 +0,0 @@ -***************************************************************************** -** ChibiOS/RT port for ARM-Cortex-M3 STM32F103ZG. ** -***************************************************************************** - -** TARGET ** - -The demo runs on an STM3210E-EVAL board. - -** The Demo ** - -The demo flashes the board LEDs using a thread, by pressing the button located -on the board the test procedure is activated with output on the serial port -SD1 (USART1). - -** Build Procedure ** - -The demo has been tested by using the free Codesourcery GCC-based toolchain -and YAGARTO. -Just modify the TRGT line in the makefile in order to use different GCC ports. - -** Notes ** - -Some files used by the demo are not part of ChibiOS/RT but are copyright of -ST Microelectronics and are licensed under a different license. -Also note that not all the files present in the ST library are distribited -with ChibiOS/RT, you can find the whole library on the ST web site: - - http://www.st.com -- cgit v1.2.3 From 33ecba3fd8ea17494b7154d20e677dd50f57b510 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 1 Jun 2011 17:56:23 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3005 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72-GCC.txt | 4 +- docs/reports/STM32F103-72-IAR.txt | 30 ++--- docs/reports/STM32F103-72-RVCT.txt | 30 ++--- os/ports/GCC/ARMCMx/chcore.h | 49 ++++---- os/ports/GCC/ARMCMx/chcore_v6m.h | 23 ++-- os/ports/GCC/ARMCMx/chcore_v7m.h | 19 +++- os/ports/IAR/ARMCMx/chcore.h | 224 ++++++++++++++----------------------- os/ports/IAR/ARMCMx/chcore_v6m.h | 96 +++++++++------- os/ports/IAR/ARMCMx/chcore_v7m.h | 164 ++++++++++++++++++++------- os/ports/RVCT/ARMCMx/chcore.h | 221 ++++++++++++++---------------------- os/ports/RVCT/ARMCMx/chcore_v6m.h | 96 +++++++++------- os/ports/RVCT/ARMCMx/chcore_v7m.h | 165 ++++++++++++++++++++------- readme.txt | 4 + 13 files changed, 616 insertions(+), 509 deletions(-) diff --git a/docs/reports/STM32F103-72-GCC.txt b/docs/reports/STM32F103-72-GCC.txt index 28041072a..9c017adae 100644 --- a/docs/reports/STM32F103-72-GCC.txt +++ b/docs/reports/STM32F103-72-GCC.txt @@ -5,7 +5,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.3.3unstable +*** Kernel: 2.3.4unstable *** Compiler: GCC 4.5.2 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 @@ -131,7 +131,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 581768 bytes/S +--- Score : 592560 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) diff --git a/docs/reports/STM32F103-72-IAR.txt b/docs/reports/STM32F103-72-IAR.txt index 0ad93a193..45c9f2345 100644 --- a/docs/reports/STM32F103-72-IAR.txt +++ b/docs/reports/STM32F103-72-IAR.txt @@ -6,9 +6,11 @@ Compiler: IAR C/C++ Compiler for ARM 6.10.1.32143 *** ChibiOS/RT test suite *** -*** Kernel: 2.1.7unstable +*** Kernel: 2.3.4unstable +*** Compiler: IAR *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 +*** Port Info: Advanced kernel mode *** Platform: STM32 Performance Line Medium Density *** Test Board: Olimex STM32-P103 @@ -98,55 +100,55 @@ Compiler: IAR C/C++ Compiler for ARM 6.10.1.32143 --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 237880 msgs/S, 475760 ctxswc/S +--- Score : 243531 msgs/S, 487062 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 206437 msgs/S, 412874 ctxswc/S +--- Score : 208238 msgs/S, 416476 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 204672 msgs/S, 409344 ctxswc/S +--- Score : 211298 msgs/S, 422596 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 861664 ctxswc/S +--- Score : 839040 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 149986 threads/S +--- Score : 145142 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 228798 threads/S +--- Score : 221062 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 68159 reschedules/S, 408954 ctxswc/S +--- Score : 66643 reschedules/S, 399858 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 459052 ctxswc/S +--- Score : 459060 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 523436 bytes/S +--- Score : 668300 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 674558 timers/S +--- Score : 704334 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 1056488 wait+signal/S +--- Score : 1052652 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 621992 lock+unlock/S +--- Score : 623376 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) ---- System: 360 bytes +--- System: 368 bytes --- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes diff --git a/docs/reports/STM32F103-72-RVCT.txt b/docs/reports/STM32F103-72-RVCT.txt index 0a1ab838c..1b0183a33 100644 --- a/docs/reports/STM32F103-72-RVCT.txt +++ b/docs/reports/STM32F103-72-RVCT.txt @@ -6,9 +6,11 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. *** ChibiOS/RT test suite *** -*** Kernel: 2.1.7unstable +*** Kernel: 2.3.4unstable +*** Compiler: RVCT *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 +*** Port Info: Advanced kernel mode *** Platform: STM32 Performance Line Medium Density *** Test Board: Olimex STM32-P103 @@ -98,55 +100,55 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 230298 msgs/S, 460596 ctxswc/S +--- Score : 244398 msgs/S, 488796 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 202403 msgs/S, 404806 ctxswc/S +--- Score : 214497 msgs/S, 428994 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 201268 msgs/S, 402536 ctxswc/S +--- Score : 214497 msgs/S, 428994 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 818864 ctxswc/S +--- Score : 863120 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 154859 threads/S +--- Score : 156887 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 221776 threads/S +--- Score : 229569 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 67404 reschedules/S, 404424 ctxswc/S +--- Score : 68757 reschedules/S, 412542 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 487136 ctxswc/S +--- Score : 490452 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 547444 bytes/S +--- Score : 612440 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 565768 timers/S +--- Score : 591340 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 876268 wait+signal/S +--- Score : 886992 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 607628 lock+unlock/S +--- Score : 634396 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) ---- System: 360 bytes +--- System: 368 bytes --- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes diff --git a/os/ports/GCC/ARMCMx/chcore.h b/os/ports/GCC/ARMCMx/chcore.h index 42df48a09..5d47a6699 100644 --- a/os/ports/GCC/ARMCMx/chcore.h +++ b/os/ports/GCC/ARMCMx/chcore.h @@ -29,12 +29,18 @@ #ifndef _CHCORE_H_ #define _CHCORE_H_ -#include "nvic.h" - /*===========================================================================*/ -/* Port constants. */ +/* Port constants (common). */ /*===========================================================================*/ +/* Added to make the header stand-alone when included from asm.*/ +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + #define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ #define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ #define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ @@ -69,14 +75,8 @@ */ #define CORTEX_MAXIMUM_PRIORITY 0 -/** - * @brief Disabled value for BASEPRI register. - * @note ARMv7-M architecture only. - */ -#define CORTEX_BASEPRI_DISABLED 0 - /*===========================================================================*/ -/* Port macros. */ +/* Port macros (common). */ /*===========================================================================*/ /** @@ -92,7 +92,7 @@ ((n) << (8 - CORTEX_PRIORITY_BITS)) /*===========================================================================*/ -/* Port configurable parameters. */ +/* Port configurable parameters (common). */ /*===========================================================================*/ /** @@ -156,11 +156,11 @@ #endif /*===========================================================================*/ -/* Port derived parameters. */ +/* Port derived parameters (common). */ /*===========================================================================*/ /*===========================================================================*/ -/* Port exported info. */ +/* Port exported info (common). */ /*===========================================================================*/ /** @@ -177,6 +177,17 @@ /* Port implementation part (common). */ /*===========================================================================*/ +/* Includes the sub-architecture-specific part.*/ +#if (CORTEX_MODEL == CORTEX_M0) || (CORTEX_MODEL == CORTEX_M1) +#include "chcore_v6m.h" +#elif (CORTEX_MODEL == CORTEX_M3) || (CORTEX_MODEL == CORTEX_M4) +#include "chcore_v7m.h" +#endif + +#if !defined(_FROM_ASM_) + +#include "nvic.h" + /** * @brief Stack and memory alignment enforcement. */ @@ -193,11 +204,6 @@ typedef uint32_t stkalign_t __attribute__ ((aligned (4))); #error "invalid stack alignment selected" #endif -/** - * @brief Generic ARM register. - */ -typedef void *regarm_t; - #if defined(__DOXYGEN__) /** * @brief Interrupt saved context. @@ -262,12 +268,7 @@ struct context { */ #define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)] -/* Includes the architecture-specific implementation part.*/ -#if (CORTEX_MODEL == CORTEX_M0) || (CORTEX_MODEL == CORTEX_M1) -#include "chcore_v6m.h" -#elif (CORTEX_MODEL == CORTEX_M3) || (CORTEX_MODEL == CORTEX_M4) -#include "chcore_v7m.h" -#endif +#endif /* _FROM_ASM_ */ #endif /* _CHCORE_H_ */ diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 3154bde56..e6aeabc2d 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -33,21 +33,13 @@ /* Port constants. */ /*===========================================================================*/ -/** - * @brief BASEPRI level within kernel lock. - * @note The ARMv6-M architecture does not implement the BASEPRI register - * so the kernel always masks the whole priority range during - * a kernel lock. - */ -#define CORTEX_BASEPRI_KERNEL 0 - /** * @brief PendSV priority level. - * @note This priority is enforced to be equal to @p CORTEX_BASEPRI_KERNEL, + * @note This priority is enforced to be equal to @p 0, * this handler always have the highest priority that cannot preempt * the kernel. */ -#define CORTEX_PRIORITY_PENDSV CORTEX_BASEPRI_KERNEL +#define CORTEX_PRIORITY_PENDSV 0 /*===========================================================================*/ /* Port configurable parameters. */ @@ -64,7 +56,7 @@ /** * @brief Macro defining the specific ARM architecture. */ -#define CH_ARCHITECTURE_ARM_v7M +#define CH_ARCHITECTURE_ARM_v6M /** * @brief Name of the implemented architecture. @@ -84,6 +76,13 @@ /* Port implementation part. */ /*===========================================================================*/ +#if !defined(_FROM_ASM_) + +/** + * @brief Generic ARM register. + */ +typedef void *regarm_t; + #if !defined(__DOXYGEN__) struct extctx { regarm_t r0; @@ -244,6 +243,8 @@ extern "C" { } #endif +#endif /* _FROM_ASM_ */ + #endif /* _CHCORE_V6M_H_ */ /** @} */ diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index 7a7eaeb53..297bd4e54 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -33,6 +33,11 @@ /* Port constants. */ /*===========================================================================*/ +/** + * @brief Disabled value for BASEPRI register. + */ +#define CORTEX_BASEPRI_DISABLED 0 + /*===========================================================================*/ /* Port configurable parameters. */ /*===========================================================================*/ @@ -88,6 +93,7 @@ /* Port exported info. */ /*===========================================================================*/ +#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__) /** * @brief Macro defining the specific ARM architecture. */ @@ -101,9 +107,11 @@ /** * @brief Name of the architecture variant. */ -#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__) #define CH_CORE_VARIANT_NAME "Cortex-M3" + #elif (CORTEX_MODEL == CORTEX_M4) +#define CH_ARCHITECTURE_ARM_v7ME +#define CH_ARCHITECTURE_NAME "ARMv7-ME" #define CH_CORE_VARIANT_NAME "Cortex-M4" #endif @@ -120,6 +128,13 @@ /* Port implementation part. */ /*===========================================================================*/ +#if !defined(_FROM_ASM_) + +/** + * @brief Generic ARM register. + */ +typedef void *regarm_t; + #if !defined(__DOXYGEN__) struct extctx { regarm_t r0; @@ -315,6 +330,8 @@ extern "C" { } #endif +#endif /* _FROM_ASM_ */ + #endif /* _CHCORE_V7M_H_ */ /** @} */ diff --git a/os/ports/IAR/ARMCMx/chcore.h b/os/ports/IAR/ARMCMx/chcore.h index 9c6a63730..177205fa6 100644 --- a/os/ports/IAR/ARMCMx/chcore.h +++ b/os/ports/IAR/ARMCMx/chcore.h @@ -29,18 +29,22 @@ #ifndef _CHCORE_H_ #define _CHCORE_H_ -#include - -#include "nvic.h" - /*===========================================================================*/ -/* Port constants. */ +/* Port constants (common). */ /*===========================================================================*/ -#define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ -#define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ -#define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ -#define CORTEX_M4 4 /**< @brief Cortex-M4 variant. */ +/* Added to make the header stand-alone when included from asm.*/ +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ +#define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ +#define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ +#define CORTEX_M4 4 /**< @brief Cortex-M4 variant. */ /* Inclusion of the Cortex-Mx implementation specific parameters.*/ #include "cmparams.h" @@ -53,36 +57,26 @@ #error "unknown or unsupported Cortex-M model" #endif -/*===========================================================================*/ -/* Port statically derived parameters. */ -/*===========================================================================*/ - /** * @brief Total priority levels. */ -#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS) +#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS) /** * @brief Minimum priority level. * @details This minimum priority level is calculated from the number of * priority bits supported by the specific Cortex-Mx implementation. */ -#define CORTEX_MINIMUM_PRIORITY (CORTEX_PRIORITY_LEVELS - 1) +#define CORTEX_MINIMUM_PRIORITY (CORTEX_PRIORITY_LEVELS - 1) /** * @brief Maximum priority level. * @details The maximum allowed priority level is always zero. */ -#define CORTEX_MAXIMUM_PRIORITY 0 - -/** - * @brief Disabled value for BASEPRI register. - * @note ARMv7-M architecture only. - */ -#define CORTEX_BASEPRI_DISABLED 0 +#define CORTEX_MAXIMUM_PRIORITY 0 /*===========================================================================*/ -/* Port macros. */ +/* Port macros (common). */ /*===========================================================================*/ /** @@ -98,75 +92,56 @@ ((n) << (8 - CORTEX_PRIORITY_BITS)) /*===========================================================================*/ -/* Port configurable parameters. */ +/* Port configurable parameters (common). */ /*===========================================================================*/ /** - * @brief Enables the use of the WFI instruction in the idle thread loop. + * @brief Stack size for the system idle thread. + * @details This size depends on the idle thread implementation, usually + * the idle thread should take no more space than those reserved + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have + * a stack frame when compiling without optimizations. You may + * reduce this value to zero when compiling with optimizations. */ -#ifndef CORTEX_ENABLE_WFI_IDLE -#define CORTEX_ENABLE_WFI_IDLE FALSE +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** - * @brief SYSTICK handler priority. - * @note The default SYSTICK handler priority is calculated as the priority - * level in the middle of the numeric priorities range. + * @brief Per-thread stack overhead for interrupts servicing. + * @details This constant is used in the calculation of the correct working + * area size. + * This value can be zero on those architecture where there is a + * separate interrupt stack and the stack space between @p intctx and + * @p extctx is known to be zero. + * @note In this port it is conservatively set to 16 because the function + * @p chSchDoRescheduleI() can have a stack frame, expecially with + * compiler optimizations disabled. */ -#ifndef CORTEX_PRIORITY_SYSTICK -#define CORTEX_PRIORITY_SYSTICK (CORTEX_PRIORITY_LEVELS >> 1) -#else -/* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SYSTICK) -#error "invalid priority level specified for CORTEX_PRIORITY_SYSTICK" -#endif +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** - * @brief SVCALL handler priority. - * @note The default SVCALL handler priority is calculated as - * @p CORTEX_MAXIMUM_PRIORITY+1, in the ARMv7-M port this reserves - * the @p CORTEX_MAXIMUM_PRIORITY priority level as fast interrupts - * priority level. - * @note The SVCALL vector is only used in the ARMv7-M port, it is available - * to user in the ARMv6-M port. + * @brief Enables the use of the WFI instruction in the idle thread loop. */ -#ifndef CORTEX_PRIORITY_SVCALL -#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1) -#else -/* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL) -#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL" -#endif +#ifndef CORTEX_ENABLE_WFI_IDLE +#define CORTEX_ENABLE_WFI_IDLE FALSE #endif /** - * @brief PENDSV handler priority. - * @note The default PENDSV handler priority is set at the - * @p CORTEX_MINIMUM_PRIORITY priority level. - * @note The PENDSV vector is only used in the ARMv7-M legacy port, it is - * available to user in the ARMv6-M and ARMv7-M ports. - * @note In the ARMv7-M legacy port this value should be not changed from - * the minimum priority level. + * @brief SYSTICK handler priority. + * @note The default SYSTICK handler priority is calculated as the priority + * level in the middle of the numeric priorities range. */ -#ifndef CORTEX_PRIORITY_PENDSV -#define CORTEX_PRIORITY_PENDSV CORTEX_MINIMUM_PRIORITY +#ifndef CORTEX_PRIORITY_SYSTICK +#define CORTEX_PRIORITY_SYSTICK (CORTEX_PRIORITY_LEVELS >> 1) #else /* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_PENDSV) -#error "invalid priority level specified for CORTEX_PRIORITY_PENDSV" -#endif +#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SYSTICK) +#error "invalid priority level specified for CORTEX_PRIORITY_SYSTICK" #endif - -/** - * @brief BASEPRI level within kernel lock. - * @note This value must not mask the SVCALL priority level or the - * kernel would hard fault. - * @note ARMv7-M architecture only. - */ -#ifndef CORTEX_BASEPRI_KERNEL -#define CORTEX_BASEPRI_KERNEL \ - CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) #endif /** @@ -177,11 +152,15 @@ * @note Allowed values are 32 or 64. */ #ifndef CORTEX_STACK_ALIGNMENT -#define CORTEX_STACK_ALIGNMENT 64 +#define CORTEX_STACK_ALIGNMENT 64 #endif /*===========================================================================*/ -/* Port exported info. */ +/* Port derived parameters (common). */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port exported info (common). */ /*===========================================================================*/ /** @@ -189,62 +168,27 @@ */ #define CH_ARCHITECTURE_ARM -#if defined(__DOXYGEN__) /** - * @brief Macro defining the specific ARM architecture. - * @note This macro is for documentation only, the real name changes - * depending on the selected architecture, the possible names are: - * - CH_ARCHITECTURE_ARM_v6M. - * - CH_ARCHITECTURE_ARM_v7M. - * . + * @brief Name of the compiler supported by this port. */ -#define CH_ARCHITECTURE_ARM_vxm - -/** - * @brief Name of the implemented architecture. - * @note The value is for documentation only, the real value changes - * depending on the selected architecture, the possible values are: - * - "ARMv6-M". - * - "ARMv7-M". - * - "ARMv7-ME". - * . - */ -#define CH_ARCHITECTURE_NAME "ARMvx-M" - -/** - * @brief Name of the architecture variant (optional). - * @note The value is for documentation only, the real value changes - * depending on the selected architecture, the possible values are: - * - "Cortex-M0" - * - "Cortex-M1" - * - "Cortex-M3" - * - "Cortex-M4" - * . - */ -#define CH_CORE_VARIANT_NAME "Cortex-Mx" - -#elif CORTEX_MODEL == CORTEX_M4 -#define CH_ARCHITECTURE_ARM_v7M -#define CH_ARCHITECTURE_NAME "ARMv7-ME" -#define CH_CORE_VARIANT_NAME "Cortex-M4" -#elif CORTEX_MODEL == CORTEX_M3 -#define CH_ARCHITECTURE_ARM_v7M -#define CH_ARCHITECTURE_NAME "ARMv7-M" -#define CH_CORE_VARIANT_NAME "Cortex-M3" -#elif CORTEX_MODEL == CORTEX_M1 -#define CH_ARCHITECTURE_ARM_v6M -#define CH_ARCHITECTURE_NAME "ARMv6-M" -#define CH_CORE_VARIANT_NAME "Cortex-M1" -#elif CORTEX_MODEL == CORTEX_M0 -#define CH_ARCHITECTURE_ARM_v6M -#define CH_ARCHITECTURE_NAME "ARMv6-M" -#define CH_CORE_VARIANT_NAME "Cortex-M0" -#endif +#define CH_COMPILER_NAME "IAR" /*===========================================================================*/ /* Port implementation part (common). */ /*===========================================================================*/ +/* Includes the sub-architecture-specific part.*/ +#if (CORTEX_MODEL == CORTEX_M0) || (CORTEX_MODEL == CORTEX_M1) +#include "chcore_v6m.h" +#elif (CORTEX_MODEL == CORTEX_M3) || (CORTEX_MODEL == CORTEX_M4) +#include "chcore_v7m.h" +#endif + +#if !defined(_FROM_ASM_) + +#include +#include "nvic.h" + /** * @brief Stack and memory alignment enforcement. */ @@ -256,11 +200,6 @@ typedef uint32_t stkalign_t; #error "invalid stack alignment selected" #endif -/** - * @brief Generic ARM register. - */ -typedef void *regarm_t; - #if defined(__DOXYGEN__) /** * @brief Interrupt saved context. @@ -291,6 +230,20 @@ struct context { struct intctx *r13; }; +/** + * @brief Platform dependent part of the @p chThdCreateI() API. + * @details This code usually setup the context switching frame represented + * by an @p intctx structure. + */ +#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ + tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ + wsize - \ + sizeof(struct intctx)); \ + tp->p_ctx.r13->r4 = (void *)pf; \ + tp->p_ctx.r13->r5 = (void *)arg; \ + tp->p_ctx.r13->lr = (void *)_port_thread_start; \ +} + /** * @brief Enforces a correct alignment for a stack area size value. */ @@ -299,9 +252,9 @@ struct context { /** * @brief Computes the thread working area global size. */ -#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ - sizeof(struct intctx) + \ - sizeof(struct extctx) + \ +#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ + sizeof(struct intctx) + \ + sizeof(struct extctx) + \ (n) + (PORT_INT_REQUIRED_STACK)) /** @@ -311,12 +264,7 @@ struct context { */ #define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)] -/* Includes the architecture-specific implementation part.*/ -#if defined(CH_ARCHITECTURE_ARM_v6M) -#include "chcore_v6m.h" -#elif defined(CH_ARCHITECTURE_ARM_v7M) -#include "chcore_v7m.h" -#endif +#endif /* _FROM_ASM_ */ #endif /* _CHCORE_H_ */ diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index 41b656532..8ab9ff583 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -29,10 +29,60 @@ #ifndef _CHCORE_V6M_H_ #define _CHCORE_V6M_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/** + * @brief PendSV priority level. + * @note This priority is enforced to be equal to @p 0, + * this handler always have the highest priority that cannot preempt + * the kernel. + */ +#define CORTEX_PRIORITY_PENDSV 0 + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + +/** + * @brief Macro defining the specific ARM architecture. + */ +#define CH_ARCHITECTURE_ARM_v6M + +/** + * @brief Name of the implemented architecture. + */ +#define CH_ARCHITECTURE_NAME "ARMv6-M" + +/** + * @brief Name of the architecture variant. + */ +#if (CORTEX_MODEL == CORTEX_M0) || defined(__DOXYGEN__) +#define CH_CORE_VARIANT_NAME "Cortex-M0" +#elif (CORTEX_MODEL == CORTEX_M1) +#define CH_CORE_VARIANT_NAME "Cortex-M1" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ +#if !defined(_FROM_ASM_) + +/** + * @brief Generic ARM register. + */ +typedef void *regarm_t; + #if !defined(__DOXYGEN__) struct extctx { regarm_t r0; @@ -58,48 +108,6 @@ struct intctx { }; #endif -/** - * @brief Platform dependent part of the @p chThdInit() API. - * @details This code usually setup the context switching frame represented - * by an @p intctx structure. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ - wsize - \ - sizeof(struct intctx)); \ - tp->p_ctx.r13->r4 = (void *)pf; \ - tp->p_ctx.r13->r5 = arg; \ - tp->p_ctx.r13->lr = (void *)_port_thread_start; \ -} - -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p PORT_INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have - * a stack frame when compiling without optimizations. You may - * reduce this value to zero when compiling with optimizations. - */ -#ifndef PORT_IDLE_THREAD_STACK_SIZE -#define PORT_IDLE_THREAD_STACK_SIZE 16 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - * @note In this port it is conservatively set to 16 because the function - * @p chSchDoRescheduleI() can have a stack frame, expecially with - * compiler optimizations disabled. - */ -#ifndef PORT_INT_REQUIRED_STACK -#define PORT_INT_REQUIRED_STACK 16 -#endif - /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -133,6 +141,8 @@ struct intctx { */ #define port_init() { \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ + NVICSetSystemHandlerPriority(HANDLER_PENDSV, \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_PENDSV)); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ } @@ -230,6 +240,8 @@ extern "C" { } #endif +#endif /* _FROM_ASM_ */ + #endif /* _CHCORE_V6M_H_ */ /** @} */ diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h index 31be9a04a..ac757a563 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.h +++ b/os/ports/IAR/ARMCMx/chcore_v7m.h @@ -29,10 +29,112 @@ #ifndef _CHCORE_V7M_H_ #define _CHCORE_V7M_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/** + * @brief Disabled value for BASEPRI register. + */ +#define CORTEX_BASEPRI_DISABLED 0 + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/** + * @brief Simplified priority handling flag. + * @details Activating this option will make the Kernel work in compact mode. + */ +#ifndef CORTEX_SIMPLIFIED_PRIORITY +#define CORTEX_SIMPLIFIED_PRIORITY FALSE +#endif + +/** + * @brief SVCALL handler priority. + * @note The default SVCALL handler priority is defaulted to + * @p CORTEX_MAXIMUM_PRIORITY+1, this reserves the + * @p CORTEX_MAXIMUM_PRIORITY priority level as fast interrupts + * priority level. + */ +#ifndef CORTEX_PRIORITY_SVCALL +#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1) +#else +/* If it is externally redefined then better perform a validity check on it.*/ +#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL) +#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL" +#endif +#endif + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/** + * @brief BASEPRI level within kernel lock. + * @note In compact kernel mode this constant value is enforced to zero. + */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#define CORTEX_BASEPRI_KERNEL \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) +#else +#define CORTEX_BASEPRI_KERNEL 0 +#endif + +/** + * @brief PendSV priority level. + * @note This priority is enforced to be equal to @p CORTEX_BASEPRI_KERNEL, + * this handler always have the highest priority that cannot preempt + * the kernel. + */ +#define CORTEX_PRIORITY_PENDSV CORTEX_BASEPRI_KERNEL + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + +#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__) +/** + * @brief Macro defining the specific ARM architecture. + */ +#define CH_ARCHITECTURE_ARM_v7M + +/** + * @brief Name of the implemented architecture. + */ +#define CH_ARCHITECTURE_NAME "ARMv7-M" + +/** + * @brief Name of the architecture variant. + */ +#define CH_CORE_VARIANT_NAME "Cortex-M3" + +#elif (CORTEX_MODEL == CORTEX_M4) +#define CH_ARCHITECTURE_ARM_v7ME +#define CH_ARCHITECTURE_NAME "ARMv7-ME" +#define CH_CORE_VARIANT_NAME "Cortex-M4" +#endif + +/** + * @brief Port-specific information string. + */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#define CH_PORT_INFO "Advanced kernel mode" +#else +#define CH_PORT_INFO "Compact kernel mode" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ +#if !defined(_FROM_ASM_) + +/** + * @brief Generic ARM register. + */ +typedef void *regarm_t; + #if !defined(__DOXYGEN__) struct extctx { regarm_t r0; @@ -58,48 +160,6 @@ struct intctx { }; #endif -/** - * @brief Platform dependent part of the @p chThdCreateI() API. - * @details This code usually setup the context switching frame represented - * by an @p intctx structure. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ - wsize - \ - sizeof(struct intctx)); \ - tp->p_ctx.r13->r4 = (void *)pf; \ - tp->p_ctx.r13->r5 = arg; \ - tp->p_ctx.r13->lr = (void *)_port_thread_start; \ -} - -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p PORT_INT_REQUIRED_STACK. - * @note In this port it is set to 16 because the idle thread does have - * a stack frame when compiling without optimizations. You may - * reduce this value to zero when compiling with optimizations. - */ -#ifndef PORT_IDLE_THREAD_STACK_SIZE -#define PORT_IDLE_THREAD_STACK_SIZE 16 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - * @note In this port it is conservatively set to 16 because the function - * @p chSchDoRescheduleI() can have a stack frame, expecially with - * compiler optimizations disabled. - */ -#ifndef PORT_INT_REQUIRED_STACK -#define PORT_INT_REQUIRED_STACK 16 -#endif - /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -135,6 +195,8 @@ struct intctx { SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SVCALL, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL)); \ + NVICSetSystemHandlerPriority(HANDLER_PENDSV, \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_PENDSV)); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ } @@ -145,7 +207,11 @@ struct intctx { * more actions. * @note In this port this it raises the base priority to kernel level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_lock() __set_BASEPRI(CORTEX_BASEPRI_KERNEL) +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_lock() __disable_interrupt() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Kernel-unlock action. @@ -153,7 +219,11 @@ struct intctx { * more actions. * @note In this port this it lowers the base priority to user level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_unlock() __set_BASEPRI(CORTEX_BASEPRI_DISABLED) +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_unlock() __enable_interrupt() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Kernel-lock action from an interrupt handler. @@ -186,19 +256,27 @@ struct intctx { * @note Interrupt sources above kernel level remains enabled. * @note In this port it raises/lowers the base priority to kernel level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_suspend() { \ __set_BASEPRI(CORTEX_BASEPRI_KERNEL); \ __enable_interrupt(); \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_suspend() __disable_interrupt() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Enables all the interrupt sources. * @note In this port it lowers the base priority to user level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_enable() { \ __set_BASEPRI(CORTEX_BASEPRI_DISABLED); \ __enable_interrupt(); \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_enable() __enable_interrupt() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Enters an architecture-dependent IRQ-waiting mode. @@ -246,6 +324,8 @@ extern "C" { } #endif +#endif /* _FROM_ASM_ */ + #endif /* _CHCORE_V7M_H_ */ /** @} */ diff --git a/os/ports/RVCT/ARMCMx/chcore.h b/os/ports/RVCT/ARMCMx/chcore.h index 767f71923..42b397e93 100644 --- a/os/ports/RVCT/ARMCMx/chcore.h +++ b/os/ports/RVCT/ARMCMx/chcore.h @@ -29,16 +29,22 @@ #ifndef _CHCORE_H_ #define _CHCORE_H_ -#include "nvic.h" - /*===========================================================================*/ -/* Port constants. */ +/* Port constants (common). */ /*===========================================================================*/ -#define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ -#define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ -#define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ -#define CORTEX_M4 4 /**< @brief Cortex-M4 variant. */ +/* Added to make the header stand-alone when included from asm.*/ +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#define CORTEX_M0 0 /**< @brief Cortex-M0 variant. */ +#define CORTEX_M1 1 /**< @brief Cortex-M1 variant. */ +#define CORTEX_M3 3 /**< @brief Cortex-M3 variant. */ +#define CORTEX_M4 4 /**< @brief Cortex-M4 variant. */ /* Inclusion of the Cortex-Mx implementation specific parameters.*/ #include "cmparams.h" @@ -51,36 +57,26 @@ #error "unknown or unsupported Cortex-M model" #endif -/*===========================================================================*/ -/* Port statically derived parameters. */ -/*===========================================================================*/ - /** * @brief Total priority levels. */ -#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS) +#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS) /** * @brief Minimum priority level. * @details This minimum priority level is calculated from the number of * priority bits supported by the specific Cortex-Mx implementation. */ -#define CORTEX_MINIMUM_PRIORITY (CORTEX_PRIORITY_LEVELS - 1) +#define CORTEX_MINIMUM_PRIORITY (CORTEX_PRIORITY_LEVELS - 1) /** * @brief Maximum priority level. * @details The maximum allowed priority level is always zero. */ -#define CORTEX_MAXIMUM_PRIORITY 0 - -/** - * @brief Disabled value for BASEPRI register. - * @note ARMv7-M architecture only. - */ -#define CORTEX_BASEPRI_DISABLED 0 +#define CORTEX_MAXIMUM_PRIORITY 0 /*===========================================================================*/ -/* Port macros. */ +/* Port macros (common). */ /*===========================================================================*/ /** @@ -96,75 +92,56 @@ ((n) << (8 - CORTEX_PRIORITY_BITS)) /*===========================================================================*/ -/* Port configurable parameters. */ +/* Port configurable parameters (common). */ /*===========================================================================*/ /** - * @brief Enables the use of the WFI instruction in the idle thread loop. + * @brief Stack size for the system idle thread. + * @details This size depends on the idle thread implementation, usually + * the idle thread should take no more space than those reserved + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have + * a stack frame when compiling without optimizations. You may + * reduce this value to zero when compiling with optimizations. */ -#ifndef CORTEX_ENABLE_WFI_IDLE -#define CORTEX_ENABLE_WFI_IDLE FALSE +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** - * @brief SYSTICK handler priority. - * @note The default SYSTICK handler priority is calculated as the priority - * level in the middle of the numeric priorities range. + * @brief Per-thread stack overhead for interrupts servicing. + * @details This constant is used in the calculation of the correct working + * area size. + * This value can be zero on those architecture where there is a + * separate interrupt stack and the stack space between @p intctx and + * @p extctx is known to be zero. + * @note In this port it is conservatively set to 16 because the function + * @p chSchDoRescheduleI() can have a stack frame, expecially with + * compiler optimizations disabled. */ -#ifndef CORTEX_PRIORITY_SYSTICK -#define CORTEX_PRIORITY_SYSTICK (CORTEX_PRIORITY_LEVELS >> 1) -#else -/* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SYSTICK) -#error "invalid priority level specified for CORTEX_PRIORITY_SYSTICK" -#endif +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** - * @brief SVCALL handler priority. - * @note The default SVCALL handler priority is calculated as - * @p CORTEX_MAXIMUM_PRIORITY+1, in the ARMv7-M port this reserves - * the @p CORTEX_MAXIMUM_PRIORITY priority level as fast interrupts - * priority level. - * @note The SVCALL vector is only used in the ARMv7-M port, it is available - * to user in the ARMv6-M port. + * @brief Enables the use of the WFI instruction in the idle thread loop. */ -#ifndef CORTEX_PRIORITY_SVCALL -#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1) -#else -/* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL) -#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL" -#endif +#ifndef CORTEX_ENABLE_WFI_IDLE +#define CORTEX_ENABLE_WFI_IDLE FALSE #endif /** - * @brief PENDSV handler priority. - * @note The default PENDSV handler priority is set at the - * @p CORTEX_MINIMUM_PRIORITY priority level. - * @note The PENDSV vector is only used in the ARMv7-M legacy port, it is - * available to user in the ARMv6-M and ARMv7-M ports. - * @note In the ARMv7-M legacy port this value should be not changed from - * the minimum priority level. + * @brief SYSTICK handler priority. + * @note The default SYSTICK handler priority is calculated as the priority + * level in the middle of the numeric priorities range. */ -#ifndef CORTEX_PRIORITY_PENDSV -#define CORTEX_PRIORITY_PENDSV CORTEX_MINIMUM_PRIORITY +#ifndef CORTEX_PRIORITY_SYSTICK +#define CORTEX_PRIORITY_SYSTICK (CORTEX_PRIORITY_LEVELS >> 1) #else /* If it is externally redefined then better perform a validity check on it.*/ -#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_PENDSV) -#error "invalid priority level specified for CORTEX_PRIORITY_PENDSV" -#endif +#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SYSTICK) +#error "invalid priority level specified for CORTEX_PRIORITY_SYSTICK" #endif - -/** - * @brief BASEPRI level within kernel lock. - * @note This value must not mask the SVCALL priority level or the - * kernel would hard fault. - * @note ARMv7-M architecture only. - */ -#ifndef CORTEX_BASEPRI_KERNEL -#define CORTEX_BASEPRI_KERNEL \ - CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) #endif /** @@ -175,11 +152,15 @@ * @note Allowed values are 32 or 64. */ #ifndef CORTEX_STACK_ALIGNMENT -#define CORTEX_STACK_ALIGNMENT 64 +#define CORTEX_STACK_ALIGNMENT 64 #endif /*===========================================================================*/ -/* Port exported info. */ +/* Port derived parameters (common). */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port exported info (common). */ /*===========================================================================*/ /** @@ -187,62 +168,26 @@ */ #define CH_ARCHITECTURE_ARM -#if defined(__DOXYGEN__) -/** - * @brief Macro defining the specific ARM architecture. - * @note This macro is for documentation only, the real name changes - * depending on the selected architecture, the possible names are: - * - CH_ARCHITECTURE_ARM_v6M. - * - CH_ARCHITECTURE_ARM_v7M. - * . - */ -#define CH_ARCHITECTURE_ARM_vxm - /** - * @brief Name of the implemented architecture. - * @note The value is for documentation only, the real value changes - * depending on the selected architecture, the possible values are: - * - "ARMv6-M". - * - "ARMv7-M". - * - "ARMv7-ME". - * . + * @brief Name of the compiler supported by this port. */ -#define CH_ARCHITECTURE_NAME "ARMvx-M" - -/** - * @brief Name of the architecture variant (optional). - * @note The value is for documentation only, the real value changes - * depending on the selected architecture, the possible values are: - * - "Cortex-M0" - * - "Cortex-M1" - * - "Cortex-M3" - * - "Cortex-M4" - * . - */ -#define CH_CORE_VARIANT_NAME "Cortex-Mx" - -#elif CORTEX_MODEL == CORTEX_M4 -#define CH_ARCHITECTURE_ARM_v7M -#define CH_ARCHITECTURE_NAME "ARMv7-ME" -#define CH_CORE_VARIANT_NAME "Cortex-M4" -#elif CORTEX_MODEL == CORTEX_M3 -#define CH_ARCHITECTURE_ARM_v7M -#define CH_ARCHITECTURE_NAME "ARMv7-M" -#define CH_CORE_VARIANT_NAME "Cortex-M3" -#elif CORTEX_MODEL == CORTEX_M1 -#define CH_ARCHITECTURE_ARM_v6M -#define CH_ARCHITECTURE_NAME "ARMv6-M" -#define CH_CORE_VARIANT_NAME "Cortex-M1" -#elif CORTEX_MODEL == CORTEX_M0 -#define CH_ARCHITECTURE_ARM_v6M -#define CH_ARCHITECTURE_NAME "ARMv6-M" -#define CH_CORE_VARIANT_NAME "Cortex-M0" -#endif +#define CH_COMPILER_NAME "RVCT" /*===========================================================================*/ /* Port implementation part (common). */ /*===========================================================================*/ +/* Includes the sub-architecture-specific part.*/ +#if (CORTEX_MODEL == CORTEX_M0) || (CORTEX_MODEL == CORTEX_M1) +#include "chcore_v6m.h" +#elif (CORTEX_MODEL == CORTEX_M3) || (CORTEX_MODEL == CORTEX_M4) +#include "chcore_v7m.h" +#endif + +#if !defined(_FROM_ASM_) + +#include "nvic.h" + /** * @brief Stack and memory alignment enforcement. */ @@ -259,11 +204,6 @@ typedef uint32_t stkalign_t __attribute__ ((aligned (4))); #error "invalid stack alignment selected" #endif -/** - * @brief Generic ARM register. - */ -typedef void *regarm_t; - #if defined(__DOXYGEN__) /** * @brief Interrupt saved context. @@ -294,6 +234,20 @@ struct context { struct intctx *r13; }; +/** + * @brief Platform dependent part of the @p chThdCreateI() API. + * @details This code usually setup the context switching frame represented + * by an @p intctx structure. + */ +#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ + tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ + wsize - \ + sizeof(struct intctx)); \ + tp->p_ctx.r13->r4 = (void *)pf; \ + tp->p_ctx.r13->r5 = (void *)arg; \ + tp->p_ctx.r13->lr = (void *)_port_thread_start; \ +} + /** * @brief Enforces a correct alignment for a stack area size value. */ @@ -302,9 +256,9 @@ struct context { /** * @brief Computes the thread working area global size. */ -#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ - sizeof(struct intctx) + \ - sizeof(struct extctx) + \ +#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ + sizeof(struct intctx) + \ + sizeof(struct extctx) + \ (n) + (PORT_INT_REQUIRED_STACK)) /** @@ -314,12 +268,7 @@ struct context { */ #define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)] -/* Includes the architecture-specific implementation part.*/ -#if defined(CH_ARCHITECTURE_ARM_v6M) -#include "chcore_v6m.h" -#elif defined(CH_ARCHITECTURE_ARM_v7M) -#include "chcore_v7m.h" -#endif +#endif /* _FROM_ASM_ */ #endif /* _CHCORE_H_ */ diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 1c4af7da9..bff8c4fe4 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -29,10 +29,60 @@ #ifndef _CHCORE_V6M_H_ #define _CHCORE_V6M_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/** + * @brief PendSV priority level. + * @note This priority is enforced to be equal to @p 0, + * this handler always have the highest priority that cannot preempt + * the kernel. + */ +#define CORTEX_PRIORITY_PENDSV 0 + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + +/** + * @brief Macro defining the specific ARM architecture. + */ +#define CH_ARCHITECTURE_ARM_v6M + +/** + * @brief Name of the implemented architecture. + */ +#define CH_ARCHITECTURE_NAME "ARMv6-M" + +/** + * @brief Name of the architecture variant. + */ +#if (CORTEX_MODEL == CORTEX_M0) || defined(__DOXYGEN__) +#define CH_CORE_VARIANT_NAME "Cortex-M0" +#elif (CORTEX_MODEL == CORTEX_M1) +#define CH_CORE_VARIANT_NAME "Cortex-M1" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ +#if !defined(_FROM_ASM_) + +/** + * @brief Generic ARM register. + */ +typedef void *regarm_t; + #if !defined(__DOXYGEN__) struct extctx { regarm_t r0; @@ -58,48 +108,6 @@ struct intctx { }; #endif -/** - * @brief Platform dependent part of the @p chThdInit() API. - * @details This code usually setup the context switching frame represented - * by an @p intctx structure. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ - wsize - \ - sizeof(struct intctx)); \ - tp->p_ctx.r13->r4 = (void *)pf; \ - tp->p_ctx.r13->r5 = arg; \ - tp->p_ctx.r13->lr = (void *)_port_thread_start; \ -} - -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p PORT_INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have - * a stack frame when compiling without optimizations. You may - * reduce this value to zero when compiling with optimizations. - */ -#ifndef PORT_IDLE_THREAD_STACK_SIZE -#define PORT_IDLE_THREAD_STACK_SIZE 16 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - * @note In this port it is conservatively set to 16 because the function - * @p chSchDoRescheduleI() can have a stack frame, expecially with - * compiler optimizations disabled. - */ -#ifndef PORT_INT_REQUIRED_STACK -#define PORT_INT_REQUIRED_STACK 16 -#endif - /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -133,6 +141,8 @@ struct intctx { */ #define port_init() { \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ + NVICSetSystemHandlerPriority(HANDLER_PENDSV, \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_PENDSV)); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ } @@ -231,6 +241,8 @@ extern "C" { } #endif +#endif /* _FROM_ASM_ */ + #endif /* _CHCORE_V6M_H_ */ /** @} */ diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index 7f7d8c5be..14b25fd8c 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -29,10 +29,112 @@ #ifndef _CHCORE_V7M_H_ #define _CHCORE_V7M_H_ +/*===========================================================================*/ +/* Port constants. */ +/*===========================================================================*/ + +/** + * @brief Disabled value for BASEPRI register. + */ +#define CORTEX_BASEPRI_DISABLED 0 + +/*===========================================================================*/ +/* Port configurable parameters. */ +/*===========================================================================*/ + +/** + * @brief Simplified priority handling flag. + * @details Activating this option will make the Kernel work in compact mode. + */ +#ifndef CORTEX_SIMPLIFIED_PRIORITY +#define CORTEX_SIMPLIFIED_PRIORITY FALSE +#endif + +/** + * @brief SVCALL handler priority. + * @note The default SVCALL handler priority is defaulted to + * @p CORTEX_MAXIMUM_PRIORITY+1, this reserves the + * @p CORTEX_MAXIMUM_PRIORITY priority level as fast interrupts + * priority level. + */ +#ifndef CORTEX_PRIORITY_SVCALL +#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1) +#else +/* If it is externally redefined then better perform a validity check on it.*/ +#if !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL) +#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL" +#endif +#endif + +/*===========================================================================*/ +/* Port derived parameters. */ +/*===========================================================================*/ + +/** + * @brief BASEPRI level within kernel lock. + * @note In compact kernel mode this constant value is enforced to zero. + */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#define CORTEX_BASEPRI_KERNEL \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) +#else +#define CORTEX_BASEPRI_KERNEL 0 +#endif + +/** + * @brief PendSV priority level. + * @note This priority is enforced to be equal to @p CORTEX_BASEPRI_KERNEL, + * this handler always have the highest priority that cannot preempt + * the kernel. + */ +#define CORTEX_PRIORITY_PENDSV CORTEX_BASEPRI_KERNEL + +/*===========================================================================*/ +/* Port exported info. */ +/*===========================================================================*/ + +#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__) +/** + * @brief Macro defining the specific ARM architecture. + */ +#define CH_ARCHITECTURE_ARM_v7M + +/** + * @brief Name of the implemented architecture. + */ +#define CH_ARCHITECTURE_NAME "ARMv7-M" + +/** + * @brief Name of the architecture variant. + */ +#define CH_CORE_VARIANT_NAME "Cortex-M3" + +#elif (CORTEX_MODEL == CORTEX_M4) +#define CH_ARCHITECTURE_ARM_v7ME +#define CH_ARCHITECTURE_NAME "ARMv7-ME" +#define CH_CORE_VARIANT_NAME "Cortex-M4" +#endif + +/** + * @brief Port-specific information string. + */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) +#define CH_PORT_INFO "Advanced kernel mode" +#else +#define CH_PORT_INFO "Compact kernel mode" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ +#if !defined(_FROM_ASM_) + +/** + * @brief Generic ARM register. + */ +typedef void *regarm_t; + #if !defined(__DOXYGEN__) struct extctx { regarm_t r0; @@ -58,48 +160,6 @@ struct intctx { }; #endif -/** - * @brief Platform dependent part of the @p chThdCreateI() API. - * @details This code usually setup the context switching frame represented - * by an @p intctx structure. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ - wsize - \ - sizeof(struct intctx)); \ - tp->p_ctx.r13->r4 = (void *)pf; \ - tp->p_ctx.r13->r5 = arg; \ - tp->p_ctx.r13->lr = (void *)_port_thread_start; \ -} - -/** - * @brief Stack size for the system idle thread. - * @details This size depends on the idle thread implementation, usually - * the idle thread should take no more space than those reserved - * by @p PORT_INT_REQUIRED_STACK. - * @note In this port it is set to 16 because the idle thread does have - * a stack frame when compiling without optimizations. You may - * reduce this value to zero when compiling with optimizations. - */ -#ifndef PORT_IDLE_THREAD_STACK_SIZE -#define PORT_IDLE_THREAD_STACK_SIZE 16 -#endif - -/** - * @brief Per-thread stack overhead for interrupts servicing. - * @details This constant is used in the calculation of the correct working - * area size. - * This value can be zero on those architecture where there is a - * separate interrupt stack and the stack space between @p intctx and - * @p extctx is known to be zero. - * @note In this port it is conservatively set to 16 because the function - * @p chSchDoRescheduleI() can have a stack frame, expecially with - * compiler optimizations disabled. - */ -#ifndef PORT_INT_REQUIRED_STACK -#define PORT_INT_REQUIRED_STACK 16 -#endif - /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -135,6 +195,8 @@ struct intctx { SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SVCALL, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL)); \ + NVICSetSystemHandlerPriority(HANDLER_PENDSV, \ + CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_PENDSV)); \ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK)); \ } @@ -145,10 +207,14 @@ struct intctx { * more actions. * @note In this port this it raises the base priority to kernel level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_lock() { \ register uint32_t basepri __asm("basepri"); \ basepri = CORTEX_BASEPRI_KERNEL; \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_lock() __disable_irq() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Kernel-unlock action. @@ -156,10 +222,14 @@ struct intctx { * more actions. * @note In this port this it lowers the base priority to user level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_unlock() { \ register uint32_t basepri __asm("basepri"); \ basepri = CORTEX_BASEPRI_DISABLED; \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_unlock() __enable_irq() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Kernel-lock action from an interrupt handler. @@ -192,21 +262,28 @@ struct intctx { * @note Interrupt sources above kernel level remains enabled. * @note In this port it raises/lowers the base priority to kernel level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_suspend() { \ register uint32_t basepri __asm("basepri"); \ basepri = CORTEX_BASEPRI_KERNEL; \ - __enable_irq(); \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_suspend() __disable_irq() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Enables all the interrupt sources. * @note In this port it lowers the base priority to user level. */ +#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__) #define port_enable() { \ register uint32_t basepri __asm("basepri"); \ basepri = CORTEX_BASEPRI_DISABLED; \ __enable_irq(); \ } +#else /* CORTEX_SIMPLIFIED_PRIORITY */ +#define port_enable() __enable_irq() +#endif /* CORTEX_SIMPLIFIED_PRIORITY */ /** * @brief Enters an architecture-dependent IRQ-waiting mode. @@ -255,6 +332,8 @@ extern "C" { } #endif +#endif /* _FROM_ASM_ */ + #endif /* _CHCORE_V7M_H_ */ /** @} */ diff --git a/readme.txt b/readme.txt index 851f2e0b0..c3cbb14ab 100644 --- a/readme.txt +++ b/readme.txt @@ -71,8 +71,12 @@ ***************************************************************************** *** 2.3.4 *** +- FIX: Fixed wrong macro definition in ARMv6-M architecture files (bug + 3310084). - NEW: Now the STM32 SDC driver supports unaligned buffers transparently. Optimized the driver for single block read and write operations. +- NEW: Finished the reorganization of the Cortex-Mx ports, now also the + IAR and RVCT ports support the new Compact mode. *** 2.3.3 *** - FIX: Fixed race condition in output queues (bug 3303908)(backported -- cgit v1.2.3 From a8e9f2ed9c757eb9c33701ae8927dbfbf1121846 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 08:33:51 +0000 Subject: Compact mode working in IAR port. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3006 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103/chconf.h | 2 ++ demos/ARMCM3-STM32F103/iar/ch.ewp | 2 ++ os/ports/IAR/ARMCMx/chcore.h | 2 +- os/ports/IAR/ARMCMx/chcoreasm_v7m.s | 62 ++++++++++++++++++++++++++++--------- 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index c9c4c286a..116bd4058 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -499,6 +499,8 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ +#define CORTEX_SIMPLIFIED_PRIORITY TRUE + #endif /* _CHCONF_H_ */ /** @} */ diff --git a/demos/ARMCM3-STM32F103/iar/ch.ewp b/demos/ARMCM3-STM32F103/iar/ch.ewp index b5733a58c..085175d5f 100644 --- a/demos/ARMCM3-STM32F103/iar/ch.ewp +++ b/demos/ARMCM3-STM32F103/iar/ch.ewp @@ -523,6 +523,7 @@ @@ -1387,6 +1388,7 @@ diff --git a/os/ports/IAR/ARMCMx/chcore.h b/os/ports/IAR/ARMCMx/chcore.h index 177205fa6..5eff85f51 100644 --- a/os/ports/IAR/ARMCMx/chcore.h +++ b/os/ports/IAR/ARMCMx/chcore.h @@ -52,7 +52,7 @@ /* Cortex model check, only M0 and M3 supported right now.*/ #if (CORTEX_MODEL == CORTEX_M0) || (CORTEX_MODEL == CORTEX_M3) #elif (CORTEX_MODEL == CORTEX_M1) || (CORTEX_MODEL == CORTEX_M4) -#warning "untested Cortex-M model" +#error "untested Cortex-M model, manually remove this check in chcore.h" #else #error "unknown or unsupported Cortex-M model" #endif diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v7m.s b/os/ports/IAR/ARMCMx/chcoreasm_v7m.s index db580319e..f64eec746 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v7m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v7m.s @@ -24,27 +24,18 @@ PRESERVE8 /* - * Imports the Cortex-Mx parameters header and performs the same calculations + * Imports the Cortex-Mx configuration header and performs the same calculations * done in chcore.h. */ -#include "cmparams.h" - -#define CORTEX_PRIORITY_MASK(n) ((n) << (8 - CORTEX_PRIORITY_BITS)) - -#ifndef CORTEX_PRIORITY_SVCALL -#define CORTEX_PRIORITY_SVCALL 1 -#endif - -#ifndef CORTEX_BASEPRI_KERNEL -#define CORTEX_BASEPRI_KERNEL CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) -#endif - -#define CORTEX_BASEPRI_DISABLED 0 +#define _FROM_ASM_ +#include "chconf.h" +#include "chcore.h" EXTCTX_SIZE SET 32 CONTEXT_OFFSET SET 12 SCB_ICSR SET 0xE000ED04 ICSR_RETTOBASE SET 0x00000800 +ICSR_PENDSVSET SET 0x10000000 SECTION .text:CODE:NOROOT(2) @@ -60,7 +51,7 @@ ICSR_RETTOBASE SET 0x00000800 PUBLIC _port_switch _port_switch: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} - str sp, [r1, #CONTEXT_OFFSET] + str sp, [r1, #CONTEXT_OFFSET] ldr sp, [r0, #CONTEXT_OFFSET] pop {r4, r5, r6, r7, r8, r9, r10, r11, pc} @@ -70,8 +61,12 @@ _port_switch: */ PUBLIC _port_thread_start _port_thread_start: +#if CORTEX_SIMPLIFIED_PRIORITY + cpsie i +#else movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 +#endif mov r0, r5 blx r4 bl chThdExit @@ -83,22 +78,39 @@ _port_thread_start: PUBLIC _port_switch_from_isr _port_switch_from_isr: bl chSchDoRescheduleI +#if CORTEX_SIMPLIFIED_PRIORITY + mov r3, #LWRD SCB_ICSR + movt r3, #HWRD SCB_ICSR + mov r2, #ICSR_PENDSVSET + str r2, [r3] + cpsie i +.L3: b .L3 +#else svc #0 +#endif /* * Reschedule verification and setup after an IRQ. */ PUBLIC _port_irq_epilogue _port_irq_epilogue: +#if CORTEX_SIMPLIFIED_PRIORITY + cpsid i +#else movs r3, #CORTEX_BASEPRI_KERNEL msr BASEPRI, r3 +#endif mov r3, #LWRD SCB_ICSR movt r3, #HWRD SCB_ICSR ldr r3, [r3, #0] tst r3, #ICSR_RETTOBASE bne .L7 +#if CORTEX_SIMPLIFIED_PRIORITY + cpsie i +#else movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 +#endif bx lr .L7: push {r3, lr} @@ -114,8 +126,12 @@ _port_irq_epilogue: str r2, [r3, #28] pop {r3, pc} .L4: +#if CORTEX_SIMPLIFIED_PRIORITY + cpsie i +#else movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 +#endif pop {r3, pc} /* @@ -123,6 +139,7 @@ _port_irq_epilogue: * Discarding the current exception context and positioning the stack to * point to the real one. */ +#if !CORTEX_SIMPLIFIED_PRIORITY PUBLIC SVCallVector SVCallVector: mrs r3, PSP @@ -131,5 +148,20 @@ SVCallVector: movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 bx lr +#endif + +/* + * PendSV vector. + * Discarding the current exception context and positioning the stack to + * point to the real one. + */ +#if CORTEX_SIMPLIFIED_PRIORITY + PUBLIC PendSVVector +PendSVVector: + mrs r3, PSP + adds r3, r3, #EXTCTX_SIZE + msr PSP, r3 + bx lr +#endif END -- cgit v1.2.3 From 2c02959951403cbf2ed9d2fe425d05bab1b3cea3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 08:59:32 +0000 Subject: Compact mode implemented and tested for RVCT too. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3007 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103/chconf.h | 2 -- demos/ARMCM3-STM32F103/keil/ch.uvproj | 17 +++++++++- os/ports/IAR/ARMCMx/chcoreasm_v7m.s | 3 +- os/ports/RVCT/ARMCMx/chcoreasm_v7m.s | 63 ++++++++++++++++++++++++++--------- 4 files changed, 65 insertions(+), 20 deletions(-) diff --git a/demos/ARMCM3-STM32F103/chconf.h b/demos/ARMCM3-STM32F103/chconf.h index 116bd4058..c9c4c286a 100644 --- a/demos/ARMCM3-STM32F103/chconf.h +++ b/demos/ARMCM3-STM32F103/chconf.h @@ -499,8 +499,6 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ -#define CORTEX_SIMPLIFIED_PRIORITY TRUE - #endif /* _CHCONF_H_ */ /** @} */ diff --git a/demos/ARMCM3-STM32F103/keil/ch.uvproj b/demos/ARMCM3-STM32F103/keil/ch.uvproj index 88c373dcc..3f8ff22bd 100644 --- a/demos/ARMCM3-STM32F103/keil/ch.uvproj +++ b/demos/ARMCM3-STM32F103/keil/ch.uvproj @@ -361,7 +361,7 @@ --cpreproc - ..\..\..\boards\OLIMEX_STM32_P103;..\..\..\os\ports\RVCT\ARMCMx\STM32 + ..\;..\..\..\boards\OLIMEX_STM32_P103;..\..\..\os\ports\RVCT\ARMCMx\STM32 @@ -1031,6 +1031,21 @@ 1 ..\main.c
+ + chconf.h + 5 + ..\chconf.h + + + halconf.h + 5 + ..\halconf.h + + + mcuconf.h + 5 + ..\mcuconf.h + diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v7m.s b/os/ports/IAR/ARMCMx/chcoreasm_v7m.s index f64eec746..65531ff8c 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v7m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v7m.s @@ -24,8 +24,7 @@ PRESERVE8 /* - * Imports the Cortex-Mx configuration header and performs the same calculations - * done in chcore.h. + * Imports the Cortex-Mx configuration headers. */ #define _FROM_ASM_ #include "chconf.h" diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s index dda32eb18..6c7efeb3c 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s @@ -19,27 +19,17 @@ */ /* - * Imports the Cortex-Mx parameters header and performs the same calculations - * done in chcore.h. + * Imports the Cortex-Mx configuration headers. */ -#include "cmparams.h" - -#define CORTEX_PRIORITY_MASK(n) ((n) << (8 - CORTEX_PRIORITY_BITS)) - -#ifndef CORTEX_PRIORITY_SVCALL -#define CORTEX_PRIORITY_SVCALL 1 -#endif - -#ifndef CORTEX_BASEPRI_KERNEL -#define CORTEX_BASEPRI_KERNEL CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1) -#endif - -#define CORTEX_BASEPRI_DISABLED 0 +#define _FROM_ASM_ +#include "chconf.h" +#include "chcore.h" EXTCTX_SIZE EQU 32 CONTEXT_OFFSET EQU 12 SCB_ICSR EQU 0xE000ED04 ICSR_RETTOBASE EQU 0x00000800 +ICSR_PENDSVSET EQU 0x10000000 PRESERVE8 THUMB @@ -66,8 +56,12 @@ _port_switch PROC */ EXPORT _port_thread_start _port_thread_start PROC +#if CORTEX_SIMPLIFIED_PRIORITY + cpsie i +#else movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 +#endif mov r0, r5 blx r4 bl chThdExit @@ -80,7 +74,16 @@ _port_thread_start PROC EXPORT _port_switch_from_isr _port_switch_from_isr PROC bl chSchDoRescheduleI +#if CORTEX_SIMPLIFIED_PRIORITY + mov r3, #SCB_ICSR :AND: 0xFFFF + movt r3, #SCB_ICSR :SHR: 16 + mov r2, #ICSR_PENDSVSET + str r2, [r3, #0] + cpsie i +waithere b waithere +#else svc #0 +#endif ENDP /* @@ -88,15 +91,23 @@ _port_switch_from_isr PROC */ EXPORT _port_irq_epilogue _port_irq_epilogue PROC +#if CORTEX_SIMPLIFIED_PRIORITY + cpsid i +#else movs r3, #CORTEX_BASEPRI_KERNEL msr BASEPRI, r3 +#endif mov r3, #SCB_ICSR :AND: 0xFFFF movt r3, #SCB_ICSR :SHR: 16 ldr r3, [r3, #0] tst r3, #ICSR_RETTOBASE bne skipexit +#if CORTEX_SIMPLIFIED_PRIORITY + cpsie i +#else movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 +#endif bx lr skipexit push {r3, lr} @@ -112,8 +123,12 @@ skipexit str r2, [r3, #28] pop {r3, pc} noreschedule +#if CORTEX_SIMPLIFIED_PRIORITY + cpsie i +#else movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 +#endif pop {r3, pc} ENDP @@ -122,6 +137,7 @@ noreschedule * Discarding the current exception context and positioning the stack to * point to the real one. */ +#if !CORTEX_SIMPLIFIED_PRIORITY EXPORT SVCallVector SVCallVector PROC mrs r3, PSP @@ -131,5 +147,22 @@ SVCallVector PROC msr BASEPRI, r3 bx lr ENDP +#endif + +/* + * PendSV vector. + * Discarding the current exception context and positioning the stack to + * point to the real one. + */ +#if CORTEX_SIMPLIFIED_PRIORITY + EXPORT PendSVVector +PendSVVector PROC + mrs r3, PSP + adds r3, r3, #EXTCTX_SIZE + msr PSP, r3 + bx lr + nop + ENDP +#endif END -- cgit v1.2.3 From afff65d70350fc270a3ff698729c13144141e363 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 09:03:19 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3008 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72-IAR-compact.txt | 164 +++++++++++++++++++++++++++++ docs/reports/STM32F103-72-RVCT-compact.txt | 164 +++++++++++++++++++++++++++++ docs/reports/STM32F107-72-GCC-compact.txt | 163 ++++++++++++++++++++++++++++ 3 files changed, 491 insertions(+) create mode 100644 docs/reports/STM32F103-72-IAR-compact.txt create mode 100644 docs/reports/STM32F103-72-RVCT-compact.txt create mode 100644 docs/reports/STM32F107-72-GCC-compact.txt diff --git a/docs/reports/STM32F103-72-IAR-compact.txt b/docs/reports/STM32F103-72-IAR-compact.txt new file mode 100644 index 000000000..9240e8392 --- /dev/null +++ b/docs/reports/STM32F103-72-IAR-compact.txt @@ -0,0 +1,164 @@ +*************************************************************************** +Options: -Ohs +Settings: SYSCLK=72, ACR=0x12 (2 wait states) +Compiler: IAR C/C++ Compiler for ARM 6.10.1.32143 +*************************************************************************** + +*** ChibiOS/RT test suite +*** +*** Kernel: 2.3.4unstable +*** Compiler: IAR +*** Architecture: ARMv7-M +*** Core Variant: Cortex-M3 +*** Port Info: Compact kernel mode +*** Platform: STM32 Performance Line Medium Density +*** Test Board: Olimex STM32-P103 + +---------------------------------------------------------------------------- +--- Test Case 1.1 (Threads, enqueuing test #1) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.2 (Threads, enqueuing test #2) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.3 (Threads, priority change) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.4 (Threads, delays) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.1 (Semaphores, enqueuing) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.2 (Semaphores, timeout) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.3 (Semaphores, atomic signal-wait) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.4 (Binary Semaphores, functionality) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.1 (Mutexes, priority enqueuing test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.2 (Mutexes, priority inheritance, simple case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.3 (Mutexes, priority inheritance, complex case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.4 (Mutexes, priority return) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.5 (Mutexes, status) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.6 (CondVar, signal test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.7 (CondVar, broadcast test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.8 (CondVar, boost test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 4.1 (Messages, loop) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 5.1 (Mailboxes, queuing and timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.1 (Events, registration and dispatch) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.2 (Events, wait and broadcast) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.3 (Events, timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 7.1 (Heap, allocation and fragmentation test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 8.1 (Memory Pools, queue/dequeue) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.1 (Dynamic APIs, threads creation from heap) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.2 (Dynamic APIs, threads creation from memory pool) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.3 (Dynamic APIs, registry and references) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.1 (Queues, input queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.2 (Queues, output queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.1 (Benchmark, messages #1) +--- Score : 251219 msgs/S, 502438 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.2 (Benchmark, messages #2) +--- Score : 211939 msgs/S, 423878 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.3 (Benchmark, messages #3) +--- Score : 215112 msgs/S, 430224 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.4 (Benchmark, context switch) +--- Score : 842800 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.5 (Benchmark, threads, full cycle) +--- Score : 148759 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.6 (Benchmark, threads, create only) +--- Score : 221758 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) +--- Score : 68491 reschedules/S, 410946 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.8 (Benchmark, round robin context switching) +--- Score : 471140 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.9 (Benchmark, I/O Queues throughput) +--- Score : 680616 bytes/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.10 (Benchmark, virtual timers set/reset) +--- Score : 690848 timers/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.11 (Benchmark, semaphores wait/signal) +--- Score : 1118272 wait+signal/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.12 (Benchmark, mutexes lock/unlock) +--- Score : 645840 lock+unlock/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.13 (Benchmark, RAM footprint) +--- System: 368 bytes +--- Thread: 68 bytes +--- Timer : 20 bytes +--- Semaph: 12 bytes +--- EventS: 4 bytes +--- EventL: 12 bytes +--- Mutex : 16 bytes +--- CondV.: 8 bytes +--- Queue : 32 bytes +--- MailB.: 40 bytes +--- Result: SUCCESS +---------------------------------------------------------------------------- + +Final result: SUCCESS diff --git a/docs/reports/STM32F103-72-RVCT-compact.txt b/docs/reports/STM32F103-72-RVCT-compact.txt new file mode 100644 index 000000000..7e5621e37 --- /dev/null +++ b/docs/reports/STM32F103-72-RVCT-compact.txt @@ -0,0 +1,164 @@ +*************************************************************************** +Options: -O3 -Otime --apcs=interwork +Settings: SYSCLK=72, ACR=0x12 (2 wait states) +Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. +*************************************************************************** + +*** ChibiOS/RT test suite +*** +*** Kernel: 2.3.4unstable +*** Compiler: RVCT +*** Architecture: ARMv7-M +*** Core Variant: Cortex-M3 +*** Port Info: Compact kernel mode +*** Platform: STM32 Performance Line Medium Density +*** Test Board: Olimex STM32-P103 + +---------------------------------------------------------------------------- +--- Test Case 1.1 (Threads, enqueuing test #1) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.2 (Threads, enqueuing test #2) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.3 (Threads, priority change) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.4 (Threads, delays) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.1 (Semaphores, enqueuing) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.2 (Semaphores, timeout) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.3 (Semaphores, atomic signal-wait) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.4 (Binary Semaphores, functionality) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.1 (Mutexes, priority enqueuing test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.2 (Mutexes, priority inheritance, simple case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.3 (Mutexes, priority inheritance, complex case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.4 (Mutexes, priority return) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.5 (Mutexes, status) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.6 (CondVar, signal test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.7 (CondVar, broadcast test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.8 (CondVar, boost test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 4.1 (Messages, loop) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 5.1 (Mailboxes, queuing and timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.1 (Events, registration and dispatch) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.2 (Events, wait and broadcast) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.3 (Events, timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 7.1 (Heap, allocation and fragmentation test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 8.1 (Memory Pools, queue/dequeue) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.1 (Dynamic APIs, threads creation from heap) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.2 (Dynamic APIs, threads creation from memory pool) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.3 (Dynamic APIs, registry and references) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.1 (Queues, input queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.2 (Queues, output queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.1 (Benchmark, messages #1) +--- Score : 246926 msgs/S, 493852 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.2 (Benchmark, messages #2) +--- Score : 214498 msgs/S, 428996 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.3 (Benchmark, messages #3) +--- Score : 214498 msgs/S, 428996 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.4 (Benchmark, context switch) +--- Score : 857992 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.5 (Benchmark, threads, full cycle) +--- Score : 158980 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.6 (Benchmark, threads, create only) +--- Score : 228850 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) +--- Score : 68304 reschedules/S, 409824 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.8 (Benchmark, round robin context switching) +--- Score : 504240 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.9 (Benchmark, I/O Queues throughput) +--- Score : 655812 bytes/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.10 (Benchmark, virtual timers set/reset) +--- Score : 563550 timers/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.11 (Benchmark, semaphores wait/signal) +--- Score : 942344 wait+signal/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.12 (Benchmark, mutexes lock/unlock) +--- Score : 633060 lock+unlock/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.13 (Benchmark, RAM footprint) +--- System: 368 bytes +--- Thread: 68 bytes +--- Timer : 20 bytes +--- Semaph: 12 bytes +--- EventS: 4 bytes +--- EventL: 12 bytes +--- Mutex : 16 bytes +--- CondV.: 8 bytes +--- Queue : 32 bytes +--- MailB.: 40 bytes +--- Result: SUCCESS +---------------------------------------------------------------------------- + +Final result: SUCCESS diff --git a/docs/reports/STM32F107-72-GCC-compact.txt b/docs/reports/STM32F107-72-GCC-compact.txt new file mode 100644 index 000000000..0753de9cf --- /dev/null +++ b/docs/reports/STM32F107-72-GCC-compact.txt @@ -0,0 +1,163 @@ +*************************************************************************** +Options: -O2 -fomit-frame-pointer -mabi=apcs-gnu -falign-functions=16 +Settings: SYSCLK=72, ACR=0x12 (2 wait states) +*************************************************************************** + +*** ChibiOS/RT test suite +*** +*** Kernel: 2.3.4unstable +*** Compiler: GCC 4.5.2 +*** Architecture: ARMv7-M +*** Core Variant: Cortex-M3 +*** Port Info: Compact kernel mode +*** Platform: STM32 Performance Line Medium Density +*** Test Board: Olimex STM32-P103 + +---------------------------------------------------------------------------- +--- Test Case 1.1 (Threads, enqueuing test #1) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.2 (Threads, enqueuing test #2) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.3 (Threads, priority change) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 1.4 (Threads, delays) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.1 (Semaphores, enqueuing) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.2 (Semaphores, timeout) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.3 (Semaphores, atomic signal-wait) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 2.4 (Binary Semaphores, functionality) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.1 (Mutexes, priority enqueuing test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.2 (Mutexes, priority inheritance, simple case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.3 (Mutexes, priority inheritance, complex case) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.4 (Mutexes, priority return) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.5 (Mutexes, status) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.6 (CondVar, signal test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.7 (CondVar, broadcast test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 3.8 (CondVar, boost test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 4.1 (Messages, loop) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 5.1 (Mailboxes, queuing and timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.1 (Events, registration and dispatch) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.2 (Events, wait and broadcast) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 6.3 (Events, timeouts) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 7.1 (Heap, allocation and fragmentation test) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 8.1 (Memory Pools, queue/dequeue) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.1 (Dynamic APIs, threads creation from heap) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.2 (Dynamic APIs, threads creation from memory pool) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 9.3 (Dynamic APIs, registry and references) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.1 (Queues, input queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 10.2 (Queues, output queues) +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.1 (Benchmark, messages #1) +--- Score : 258426 msgs/S, 516852 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.2 (Benchmark, messages #2) +--- Score : 204682 msgs/S, 409364 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.3 (Benchmark, messages #3) +--- Score : 204682 msgs/S, 409364 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.4 (Benchmark, context switch) +--- Score : 831792 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.5 (Benchmark, threads, full cycle) +--- Score : 161453 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.6 (Benchmark, threads, create only) +--- Score : 238693 threads/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) +--- Score : 62418 reschedules/S, 374508 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.8 (Benchmark, round robin context switching) +--- Score : 481380 ctxswc/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.9 (Benchmark, I/O Queues throughput) +--- Score : 602560 bytes/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.10 (Benchmark, virtual timers set/reset) +--- Score : 641534 timers/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.11 (Benchmark, semaphores wait/signal) +--- Score : 842840 wait+signal/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.12 (Benchmark, mutexes lock/unlock) +--- Score : 611492 lock+unlock/S +--- Result: SUCCESS +---------------------------------------------------------------------------- +--- Test Case 11.13 (Benchmark, RAM footprint) +--- System: 368 bytes +--- Thread: 68 bytes +--- Timer : 20 bytes +--- Semaph: 12 bytes +--- EventS: 4 bytes +--- EventL: 12 bytes +--- Mutex : 16 bytes +--- CondV.: 8 bytes +--- Queue : 32 bytes +--- MailB.: 40 bytes +--- Result: SUCCESS +---------------------------------------------------------------------------- + +Final result: SUCCESS -- cgit v1.2.3 From a3ec9940d06bfb5655fc041762f3e9a98e9240e8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 11:49:15 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3009 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h | 2 +- docs/reports/LPC1114-48-GCC.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h index 41a25b6a1..33ecee26a 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/halconf.h @@ -87,7 +87,7 @@ * @brief Enables the MMC_SPI subsystem. */ #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE +#define HAL_USE_MMC_SPI TRUE #endif /** diff --git a/docs/reports/LPC1114-48-GCC.txt b/docs/reports/LPC1114-48-GCC.txt index e5f0a3f3b..fc24856de 100644 --- a/docs/reports/LPC1114-48-GCC.txt +++ b/docs/reports/LPC1114-48-GCC.txt @@ -1,12 +1,12 @@ *************************************************************************** -Options: -O2 -fomit-frame-pointer -mabi=apcs-gnu +Options: -O2 -fomit-frame-pointer Settings: CLK=48, (2 wait states) *************************************************************************** *** ChibiOS/RT test suite *** -*** Kernel: 2.3.0unstable -*** GCC Version: 4.3.3 +*** Kernel: 2.3.4unstable +*** Compiler: GCC 4.3.3 *** Architecture: ARMv6-M *** Core Variant: Cortex-M0 *** Platform: LPC11xx @@ -114,7 +114,7 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 78359 threads/S +--- Score : 78360 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) @@ -130,7 +130,7 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 296256 bytes/S +--- Score : 384968 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) @@ -146,7 +146,7 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) ---- System: 360 bytes +--- System: 368 bytes --- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes -- cgit v1.2.3 From 58cf0fbdc6676bdde7baa6e8f01ab5018b616794 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 11:49:37 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3010 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h index 41a25b6a1..33ecee26a 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/halconf.h @@ -87,7 +87,7 @@ * @brief Enables the MMC_SPI subsystem. */ #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE +#define HAL_USE_MMC_SPI TRUE #endif /** -- cgit v1.2.3 From 5df4a20cbbfd99054582c127963ff0671d9eac62 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 12:05:56 +0000 Subject: Alternate preemption mode implemented in ARMv6-M GCC port. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3011 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/LPC1114-48-GCC.txt | 3 ++- os/ports/GCC/ARMCMx/chcore_v6m.c | 26 +++++++++++++++++++++++++- os/ports/GCC/ARMCMx/chcore_v6m.h | 18 ++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/docs/reports/LPC1114-48-GCC.txt b/docs/reports/LPC1114-48-GCC.txt index fc24856de..1701b16f4 100644 --- a/docs/reports/LPC1114-48-GCC.txt +++ b/docs/reports/LPC1114-48-GCC.txt @@ -9,6 +9,7 @@ Settings: CLK=48, (2 wait states) *** Compiler: GCC 4.3.3 *** Architecture: ARMv6-M *** Core Variant: Cortex-M0 +*** Port Info: Preemption through NMI *** Platform: LPC11xx *** Test Board: Embedded Artists LPCXpresso Base Board + LPC1114 @@ -98,7 +99,7 @@ Settings: CLK=48, (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 126786 msgs/S, 253572 ctxswc/S +--- Score : 126785 msgs/S, 253570 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c index 3574c620f..18082e86f 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.c +++ b/os/ports/GCC/ARMCMx/chcore_v6m.c @@ -44,6 +44,7 @@ CH_IRQ_HANDLER(SysTickVector) { CH_IRQ_EPILOGUE(); } +#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__) /** * @brief NMI vector. * @details The NMI vector is used for exception mode re-entering after a @@ -59,6 +60,24 @@ void NMIVector(void) { asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); port_unlock_from_isr(); } +#endif /* !CORTEX_ALTERNATE_SWITCH */ + +#if CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__) +/** + * @brief PendSV vector. + * @details The PendSV vector is used for exception mode re-entering after a + * context switch. + */ +void PendSVVector(void) { + register struct extctx *ctxp; + + /* Discarding the current exception context and positioning the stack to + point to the real one.*/ + asm volatile ("mrs %0, PSP" : "=r" (ctxp) : : "memory"); + ctxp++; + asm volatile ("msr PSP, %0" : : "r" (ctxp) : "memory"); +} +#endif /* CORTEX_ALTERNATE_SWITCH */ /** * @brief Post-IRQ switch code. @@ -72,8 +91,13 @@ __attribute__((naked)) void _port_switch_from_isr(void) { chSchDoRescheduleI(); +#if CORTEX_ALTERNATE_SWITCH + SCB_ICSR = ICSR_PENDSVSET; + port_unlock(); +#else SCB_ICSR = ICSR_NMIPENDSET; - /* The following loop should never be executed, the NMI will kick in +#endif + /* The following loop should never be executed, the exception will kick in immediately.*/ while (TRUE) ; diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index e6aeabc2d..2141ee468 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -45,6 +45,15 @@ /* Port configurable parameters. */ /*===========================================================================*/ +/** + * @brief Alternate preemption method. + * @details Activating this option will make the Kernel use the PendSV + * handler for preemption instead of the NMI handler. + */ +#ifndef CORTEX_ALTERNATE_SWITCH +#define CORTEX_ALTERNATE_SWITCH FALSE +#endif + /*===========================================================================*/ /* Port derived parameters. */ /*===========================================================================*/ @@ -72,6 +81,15 @@ #define CH_CORE_VARIANT_NAME "Cortex-M1" #endif +/** + * @brief Port-specific information string. + */ +#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__) +#define CH_PORT_INFO "Preemption through NMI" +#else +#define CH_PORT_INFO "Preemption through PendSV" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ -- cgit v1.2.3 From 4618e775e41481cda93ceba2ddd219b1ff39e7bb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 12:10:37 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3012 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/LPC11xx/IRQ_STORM/main.c | 4 ++++ testhal/LPC13xx/IRQ_STORM/main.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/testhal/LPC11xx/IRQ_STORM/main.c b/testhal/LPC11xx/IRQ_STORM/main.c index 7ced998ff..8d7858833 100644 --- a/testhal/LPC11xx/IRQ_STORM/main.c +++ b/testhal/LPC11xx/IRQ_STORM/main.c @@ -245,6 +245,10 @@ int main(void) { print("*** Core Variant: "); println(CH_CORE_VARIANT_NAME); #endif +#ifdef CH_PORT_INFO + print("*** Port Info: "); + println(CH_PORT_INFO); +#endif #ifdef PLATFORM_NAME print("*** Platform: "); println(PLATFORM_NAME); diff --git a/testhal/LPC13xx/IRQ_STORM/main.c b/testhal/LPC13xx/IRQ_STORM/main.c index 9949c35f0..e883d3576 100644 --- a/testhal/LPC13xx/IRQ_STORM/main.c +++ b/testhal/LPC13xx/IRQ_STORM/main.c @@ -245,6 +245,10 @@ int main(void) { print("*** Core Variant: "); println(CH_CORE_VARIANT_NAME); #endif +#ifdef CH_PORT_INFO + print("*** Port Info: "); + println(CH_PORT_INFO); +#endif #ifdef PLATFORM_NAME print("*** Platform: "); println(PLATFORM_NAME); -- cgit v1.2.3 From dabf18ef8cf570519df0aafed80834fc322f00bb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 12:14:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3013 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/LPC11xx/IRQ_STORM/main.c | 6 +++--- testhal/LPC13xx/IRQ_STORM/main.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testhal/LPC11xx/IRQ_STORM/main.c b/testhal/LPC11xx/IRQ_STORM/main.c index 8d7858833..1efc169a4 100644 --- a/testhal/LPC11xx/IRQ_STORM/main.c +++ b/testhal/LPC11xx/IRQ_STORM/main.c @@ -235,9 +235,9 @@ int main(void) { println("***"); print("*** Kernel: "); println(CH_KERNEL_VERSION); -#ifdef __GNUC__ - print("*** GCC Version: "); - println(__VERSION__); +#ifdef CH_COMPILER_NAME + print("*** Compiler: "); + println(CH_COMPILER_NAME); #endif print("*** Architecture: "); println(CH_ARCHITECTURE_NAME); diff --git a/testhal/LPC13xx/IRQ_STORM/main.c b/testhal/LPC13xx/IRQ_STORM/main.c index e883d3576..589184a8e 100644 --- a/testhal/LPC13xx/IRQ_STORM/main.c +++ b/testhal/LPC13xx/IRQ_STORM/main.c @@ -235,9 +235,9 @@ int main(void) { println("***"); print("*** Kernel: "); println(CH_KERNEL_VERSION); -#ifdef __GNUC__ - print("*** GCC Version: "); - println(__VERSION__); +#ifdef CH_COMPILER_NAME + print("*** Compiler: "); + println(CH_COMPILER_NAME); #endif print("*** Architecture: "); println(CH_ARCHITECTURE_NAME); -- cgit v1.2.3 From e5046d1dcb7a6c70cd3fa04ac5131214d067dec3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 14:26:17 +0000 Subject: Alternate preemption mode implemented for RVCT. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3014 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM0-LPC1114-LPCXPRESSO/keil/ch.uvproj | 2 +- docs/reports/LPC1114-48-RVCT.txt | 32 ++++++++++++----------- os/ports/RVCT/ARMCMx/chcore_v6m.h | 18 +++++++++++++ os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 36 +++++++++++++++++++++----- 4 files changed, 65 insertions(+), 23 deletions(-) diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/keil/ch.uvproj b/demos/ARMCM0-LPC1114-LPCXPRESSO/keil/ch.uvproj index f1c299a59..db526ff1b 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/keil/ch.uvproj +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/keil/ch.uvproj @@ -361,7 +361,7 @@ --cpreproc - ..\..\..\boards\EA_LPCXPRESSO_BB_1114;..\..\..\os\ports\RVCT\ARMCMx\LPC11xx + ..\;..\..\..\boards\EA_LPCXPRESSO_BB_1114;..\..\..\os\ports\RVCT\ARMCMx\LPC11xx diff --git a/docs/reports/LPC1114-48-RVCT.txt b/docs/reports/LPC1114-48-RVCT.txt index 53953ee84..143522f39 100644 --- a/docs/reports/LPC1114-48-RVCT.txt +++ b/docs/reports/LPC1114-48-RVCT.txt @@ -6,9 +6,11 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. *** ChibiOS/RT test suite *** -*** Kernel: 2.3.0unstable +*** Kernel: 2.3.4unstable +*** Compiler: RVCT *** Architecture: ARMv6-M *** Core Variant: Cortex-M0 +*** Port Info: Preemption through NMI *** Platform: LPC11xx *** Test Board: Embedded Artists LPCXpresso Base Board + LPC1114 @@ -90,7 +92,7 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. ---------------------------------------------------------------------------- --- Test Case 9.3 (Dynamic APIs, registry and references) --- Result: SUCCESS ---------------------------------------------------------------------------- +---------------------------------------------------------------------------- --- Test Case 10.1 (Queues, input queues) --- Result: SUCCESS ---------------------------------------------------------------------------- @@ -98,55 +100,55 @@ Compiler: RealView C/C++ Compiler V4.1.0.561 [Evaluation]. --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 121347 msgs/S, 242694 ctxswc/S +--- Score : 120730 msgs/S, 241460 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) ---- Score : 102162 msgs/S, 204324 ctxswc/S +--- Score : 103037 msgs/S, 206074 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) ---- Score : 102162 msgs/S, 204324 ctxswc/S +--- Score : 103037 msgs/S, 206074 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) ---- Score : 377584 ctxswc/S +--- Score : 383632 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 78768 threads/S +--- Score : 79025 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 112764 threads/S +--- Score : 112230 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) ---- Score : 33088 reschedules/S, 198528 ctxswc/S +--- Score : 33692 reschedules/S, 202152 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 249336 ctxswc/S +--- Score : 236968 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) ---- Score : 270084 bytes/S +--- Score : 360780 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) ---- Score : 303522 timers/S +--- Score : 311418 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) ---- Score : 603212 wait+signal/S +--- Score : 599396 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) ---- Score : 372744 lock+unlock/S +--- Score : 371284 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) ---- System: 360 bytes +--- System: 368 bytes --- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index bff8c4fe4..347588bbb 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -45,6 +45,15 @@ /* Port configurable parameters. */ /*===========================================================================*/ +/** + * @brief Alternate preemption method. + * @details Activating this option will make the Kernel use the PendSV + * handler for preemption instead of the NMI handler. + */ +#ifndef CORTEX_ALTERNATE_SWITCH +#define CORTEX_ALTERNATE_SWITCH FALSE +#endif + /*===========================================================================*/ /* Port derived parameters. */ /*===========================================================================*/ @@ -72,6 +81,15 @@ #define CH_CORE_VARIANT_NAME "Cortex-M1" #endif +/** + * @brief Port-specific information string. + */ +#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__) +#define CH_PORT_INFO "Preemption through NMI" +#else +#define CH_PORT_INFO "Preemption through PendSV" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index d3239575c..725189996 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -19,12 +19,11 @@ */ /* - * Imports the Cortex-Mx parameters header and performs the same calculations - * done in chcore.h. + * Imports the Cortex-Mx configuration headers. */ -#include "cmparams.h" - -#define CORTEX_PRIORITY_MASK(n) ((n) << (8 - CORTEX_PRIORITY_BITS)) +#define _FROM_ASM_ +#include "chconf.h" +#include "chcore.h" EXTCTX_SIZE EQU 32 CONTEXT_OFFSET EQU 12 @@ -78,6 +77,7 @@ _port_thread_start PROC * The NMI vector is used for exception mode re-entering after a context * switch. */ +#if !CORTEX_ALTERNATE_SWITCH EXPORT NMIVector NMIVector PROC mrs r3, PSP @@ -86,6 +86,22 @@ NMIVector PROC cpsie i bx lr ENDP +#endif + +/* + * NMI vector. + * The NMI vector is used for exception mode re-entering after a context + * switch. + */ +#if CORTEX_ALTERNATE_SWITCH + EXPORT PendSVVector +PendSVVector PROC + mrs r3, PSP + adds r3, r3, #32 + msr PSP, r3 + bx lr + ENDP +#endif /* * Post-IRQ switch code. @@ -94,11 +110,17 @@ NMIVector PROC EXPORT _port_switch_from_isr _port_switch_from_isr PROC bl chSchDoRescheduleI + ldr r2, =SCB_ICSR movs r3, #128 +#if CORTEX_ALTERNATE_SWITCH + lsls r3, r3, #20 + str r3, [r2, #0] + cpsie i +#else lsls r3, r3, #24 - ldr r2, =SCB_ICSR str r3, [r2, #0] -_waitnmi b _waitnmi +#endif +waithere b waithere ENDP /* -- cgit v1.2.3 From 24734a32ef4265716b07675eac24717f7525fca8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 14:35:58 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3015 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index 725189996..a20327c5d 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -113,7 +113,7 @@ _port_switch_from_isr PROC ldr r2, =SCB_ICSR movs r3, #128 #if CORTEX_ALTERNATE_SWITCH - lsls r3, r3, #20 + lsls r3, r3, #21 str r3, [r2, #0] cpsie i #else -- cgit v1.2.3 From d08ed6e93cabe4cad4a99de38f75672e16ad1b8f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 14:49:16 +0000 Subject: Alternate preemption mode added to IAR port too. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3016 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM0-LPC1114-LPCXPRESSO/iar/ch.ewp | 2 ++ os/ports/IAR/ARMCMx/chcore_v6m.h | 18 ++++++++++++++ os/ports/IAR/ARMCMx/chcoreasm_v6m.s | 39 +++++++++++++++++++++++------- os/ports/RVCT/ARMCMx/chcoreasm_v6m.s | 4 +-- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/iar/ch.ewp b/demos/ARMCM0-LPC1114-LPCXPRESSO/iar/ch.ewp index 49d605d0c..20644e255 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/iar/ch.ewp +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/iar/ch.ewp @@ -523,6 +523,7 @@ @@ -1387,6 +1388,7 @@ diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index 8ab9ff583..3eed8bf43 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -45,6 +45,15 @@ /* Port configurable parameters. */ /*===========================================================================*/ +/** + * @brief Alternate preemption method. + * @details Activating this option will make the Kernel use the PendSV + * handler for preemption instead of the NMI handler. + */ +#ifndef CORTEX_ALTERNATE_SWITCH +#define CORTEX_ALTERNATE_SWITCH FALSE +#endif + /*===========================================================================*/ /* Port derived parameters. */ /*===========================================================================*/ @@ -72,6 +81,15 @@ #define CH_CORE_VARIANT_NAME "Cortex-M1" #endif +/** + * @brief Port-specific information string. + */ +#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__) +#define CH_PORT_INFO "Preemption through NMI" +#else +#define CH_PORT_INFO "Preemption through PendSV" +#endif + /*===========================================================================*/ /* Port implementation part. */ /*===========================================================================*/ diff --git a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s index ab40c509a..ef72de53c 100644 --- a/os/ports/IAR/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/IAR/ARMCMx/chcoreasm_v6m.s @@ -24,12 +24,11 @@ PRESERVE8 /* - * Imports the Cortex-Mx parameters header and performs the same calculations - * done in chcore.h. + * Imports the Cortex-Mx configuration headers. */ -#include "cmparams.h" - -#define CORTEX_PRIORITY_MASK(n) ((n) << (8 - CORTEX_PRIORITY_BITS)) +#define _FROM_ASM_ +#include "chconf.h" +#include "chcore.h" EXTCTX_SIZE SET 32 CONTEXT_OFFSET SET 12 @@ -81,13 +80,29 @@ _port_thread_start: * The NMI vector is used for exception mode re-entering after a context * switch. */ - PUBLIC NMIVector +#if !CORTEX_ALTERNATE_SWITCH + PUBLIC NMIVector NMIVector: mrs r3, PSP adds r3, r3, #32 msr PSP, r3 cpsie i bx lr +#endif + +/* + * PendSV vector. + * The PendSV vector is used for exception mode re-entering after a context + * switch. + */ +#if CORTEX_ALTERNATE_SWITCH + PUBLIC PendSVVector +PendSVVector: + mrs r3, PSP + adds r3, r3, #32 + msr PSP, r3 + bx lr +#endif /* * Post-IRQ switch code. @@ -96,12 +111,18 @@ NMIVector: PUBLIC _port_switch_from_isr _port_switch_from_isr: bl chSchDoRescheduleI + ldr r2, =SCB_ICSR movs r3, #128 +#if CORTEX_ALTERNATE_SWITCH + lsls r3, r3, #21 + str r3, [r2, #0] + cpsie i +#else lsls r3, r3, #24 - ldr r2, =SCB_ICSR str r3, [r2, #0] -_waitnmi: - b _waitnmi +#endif +waithere: + b waithere /* * Reschedule verification and setup after an IRQ. diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s index a20327c5d..6cfc89410 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v6m.s @@ -89,8 +89,8 @@ NMIVector PROC #endif /* - * NMI vector. - * The NMI vector is used for exception mode re-entering after a context + * PendSV vector. + * The PendSV vector is used for exception mode re-entering after a context * switch. */ #if CORTEX_ALTERNATE_SWITCH -- cgit v1.2.3 From 8aa98a8b06c7e7aaae1395a9a0020e5526ab0c20 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jun 2011 17:33:57 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3017 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/crt0.c | 2 +- os/ports/GCC/ARMCMx/port.dox | 31 +++++++++++++++++--------- os/ports/IAR/ARMCMx/port.dox | 52 ++++++++++++++++++++++++++++++++----------- os/ports/RVCT/ARMCMx/port.dox | 52 ++++++++++++++++++++++++++++++++----------- readme.txt | 6 +++-- 5 files changed, 104 insertions(+), 39 deletions(-) diff --git a/os/ports/GCC/ARMCMx/crt0.c b/os/ports/GCC/ARMCMx/crt0.c index 685231ed1..0bb88dd83 100644 --- a/os/ports/GCC/ARMCMx/crt0.c +++ b/os/ports/GCC/ARMCMx/crt0.c @@ -21,7 +21,7 @@ * @file ARMCMx/crt0.c * @brief Generic ARMvx-M (Cortex-M0/M1/M3/M4) startup file for ChibiOS/RT. * - * @addtogroup ARMCMx_CORE + * @addtogroup ARMCMx_STARTUP * @{ */ diff --git a/os/ports/GCC/ARMCMx/port.dox b/os/ports/GCC/ARMCMx/port.dox index 689791c2f..8f5efc9aa 100644 --- a/os/ports/GCC/ARMCMx/port.dox +++ b/os/ports/GCC/ARMCMx/port.dox @@ -159,17 +159,24 @@ * - @p IDLE_THREAD_STACK_SIZE, stack area size to be assigned to the IDLE * thread. Usually there is no need to change this value unless inserting * code in the IDLE thread using the @p IDLE_LOOP_HOOK hook macro. - * - @p CORTEX_BASEPRI_KERNEL, this is the @p BASEPRI value for the kernel lock - * code. Code running at higher priority levels must not invoke any OS API. - * This setting is specific to the ARMv7-M architecture. * - @p CORTEX_PRIORITY_SYSTICK, priority of the SYSTICK handler. - * - @p CORTEX_PRIORITY_SVCALL, priority of the SVCALL handler. * - @p CORTEX_PRIORITY_PENDSV, priority of the PENDSV handler. * - @p CORTEX_ENABLE_WFI_IDLE, if set to @p TRUE enables the use of the * @p wfi instruction from within the idle loop. This option is * defaulted to FALSE because it can create problems with some debuggers. * Setting this option to TRUE reduces the system power requirements. * . + * @section ARMCMx_CONF_1 ARMv6-M specific options + * The following options are specific for the ARMv6-M architecture: + * - @p CORTEX_ALTERNATE_SWITCH, when activated makes the OS use the PendSV + * exception instead of NMI as preemption handler. + * . + * @section ARMCMx_CONF_2 ARMv7-M specific options + * The following options are specific for the ARMv6-M architecture: + * - @p CORTEX_PRIORITY_SVCALL, priority of the SVCALL handler. + * - @p CORTEX_SIMPLIFIED_PRIORITY, when enabled activates the Compact kernel + * mode. + * . * @ingroup ARMCMx */ @@ -219,15 +226,19 @@ * @section ARMCMx_STARTUP_2 Expected linker symbols * The startup code starts at the symbol @p ResetHandler and expects the * following symbols to be defined in the linker script: - * - @p __ram_end__ RAM end location +1. + * - @p __ram_end__ End of RAM. * - @p __main_stack_size__ Exception stack size. * - @p __process_stack_size__ Process stack size. This is the stack area used * by the @p main() function. - * - @p _textdata address of the data segment source read only data. - * - @p _data data segment start location. - * - @p _edata data segment end location +1. - * - @p _bss_start BSS start location. - * - @p _bss_end BSS end location +1. + * - @p _textdata Address of the data segment source read only data. + * - @p _data Start of the data segment. + * - @p _edata End of the data segment end location. + * - @p _bss_start Start of the BSS. + * - @p _bss_end End of the BSS segment. + * - @p __init_array_start Start of the constructors array. + * - @p __init_array_end End of the constructors array. + * - @p __fini_array_start Start of the destructors array. + * - @p __fini_array_end End of the destructors array. * . * @ingroup ARMCMx */ diff --git a/os/ports/IAR/ARMCMx/port.dox b/os/ports/IAR/ARMCMx/port.dox index 22bd3cea3..3e10318ce 100644 --- a/os/ports/IAR/ARMCMx/port.dox +++ b/os/ports/IAR/ARMCMx/port.dox @@ -26,9 +26,28 @@ * This port supports all the cores implementing the ARMv6-M and ARMv7-M * architectures. * - * @section IAR_ARMCMx_STATES_A System logical states in ARMv6-M mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in the ARM - * Cortex-M0 port: + * @section IAR_ARMCMx_MODES Kernel Modes + * The Cortex-Mx port supports two distinct kernel modes: + * - Advanced Kernel mode. In this mode the kernel only masks + * interrupt sources with priorities below or equal to the + * @p CORTEX_BASEPRI_KERNEL level. Higher priorities are not affected by + * the kernel critical sections and can be used for fast interrupts. + * This mode is not available in the ARMv6-M architecture which does not + * support priority masking. + * - Compact Kernel mode. In this mode the kernel handles IRQ priorities + * in a simplified way, all interrupt sources are disabled when the kernel + * enters into a critical zone and re-enabled on exit. This is simple and + * adequate for most applications, this mode results in a more compact and + * faster kernel. + * . + * The selection of the mode is performed using the port configuration option + * @p CORTEX_SIMPLIFIED_PRIORITY. Apart from the different handling of + * interrupts there are no other differences between the two modes. The + * kernel API is exactly the same. + * + * @section IAR_ARMCMx_STATES_A System logical states in Compact Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in Compact + * Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a * special hardware state associated. @@ -53,21 +72,21 @@ * mode. * - Serving Fast Interrupt. This state is not implemented in the * ARMv6-M implementation. - * - Serving Non-Maskable Interrupt. The Cortex-M3 has a specific + * - Serving Non-Maskable Interrupt. The Cortex-Mx has a specific * asynchronous NMI vector and several synchronous fault vectors that can * be considered belonging to this category. * - Halted. Implemented as an infinite loop after globally masking all * the maskable interrupt sources. The ARM state is whatever the processor * was running when @p chSysHalt() was invoked. * - * @section IAR_ARMCMx_STATES_B System logical states in ARMv7-M mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in the ARM - * Cortex-M3 port: + * @section IAR_ARMCMx_STATES_B System logical states in Advanced Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in the + * Advanced Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a * special hardware state associated. * - Normal. This is the state the system has after executing - * @p chSysInit(). In this state the ARM Cortex-M3 has the BASEPRI register + * @p chSysInit(). In this state the ARM Cortex-Mx has the BASEPRI register * set at @p CORTEX_BASEPRI_USER level, interrupts are not masked. The * processor is running in thread-privileged mode. * - Suspended. In this state the interrupt sources are not globally @@ -93,7 +112,7 @@ * - Serving Fast Interrupt. It is basically the same of the SRI state * but it is not possible to switch to the I-Locked state because fast * interrupts can preempt the kernel critical zone. - * - Serving Non-Maskable Interrupt. The Cortex-M3 has a specific + * - Serving Non-Maskable Interrupt. The Cortex-Mx has a specific * asynchronous NMI vector and several synchronous fault vectors that can * be considered belonging to this category. * - Halted. Implemented as an infinite loop after globally masking all @@ -140,17 +159,24 @@ * - @p IDLE_THREAD_STACK_SIZE, stack area size to be assigned to the IDLE * thread. Usually there is no need to change this value unless inserting * code in the IDLE thread using the @p IDLE_LOOP_HOOK hook macro. - * - @p CORTEX_BASEPRI_KERNEL, this is the @p BASEPRI value for the kernel lock - * code. Code running at higher priority levels must not invoke any OS API. - * This setting is specific to the ARMv7-M architecture. * - @p CORTEX_PRIORITY_SYSTICK, priority of the SYSTICK handler. - * - @p CORTEX_PRIORITY_SVCALL, priority of the SVCALL handler. * - @p CORTEX_PRIORITY_PENDSV, priority of the PENDSV handler. * - @p CORTEX_ENABLE_WFI_IDLE, if set to @p TRUE enables the use of the * @p wfi instruction from within the idle loop. This option is * defaulted to FALSE because it can create problems with some debuggers. * Setting this option to TRUE reduces the system power requirements. * . + * @section IAR_ARMCMx_CONF_1 ARMv6-M specific options + * The following options are specific for the ARMv6-M architecture: + * - @p CORTEX_ALTERNATE_SWITCH, when activated makes the OS use the PendSV + * exception instead of NMI as preemption handler. + * . + * @section IAR_ARMCMx_CONF_2 ARMv7-M specific options + * The following options are specific for the ARMv6-M architecture: + * - @p CORTEX_PRIORITY_SVCALL, priority of the SVCALL handler. + * - @p CORTEX_SIMPLIFIED_PRIORITY, when enabled activates the Compact kernel + * mode. + * . * @ingroup IAR_ARMCMx */ diff --git a/os/ports/RVCT/ARMCMx/port.dox b/os/ports/RVCT/ARMCMx/port.dox index 83793d5d4..c69fcdd27 100644 --- a/os/ports/RVCT/ARMCMx/port.dox +++ b/os/ports/RVCT/ARMCMx/port.dox @@ -26,9 +26,28 @@ * This port supports all the cores implementing the ARMv6-M and ARMv7-M * architectures. * - * @section RVCT_ARMCMx_STATES_A System logical states in ARMv6-M mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in the ARM - * Cortex-M0 port: + * @section RVCT_ARMCMx_MODES Kernel Modes + * The Cortex-Mx port supports two distinct kernel modes: + * - Advanced Kernel mode. In this mode the kernel only masks + * interrupt sources with priorities below or equal to the + * @p CORTEX_BASEPRI_KERNEL level. Higher priorities are not affected by + * the kernel critical sections and can be used for fast interrupts. + * This mode is not available in the ARMv6-M architecture which does not + * support priority masking. + * - Compact Kernel mode. In this mode the kernel handles IRQ priorities + * in a simplified way, all interrupt sources are disabled when the kernel + * enters into a critical zone and re-enabled on exit. This is simple and + * adequate for most applications, this mode results in a more compact and + * faster kernel. + * . + * The selection of the mode is performed using the port configuration option + * @p CORTEX_SIMPLIFIED_PRIORITY. Apart from the different handling of + * interrupts there are no other differences between the two modes. The + * kernel API is exactly the same. + * + * @section RVCT_ARMCMx_STATES_A System logical states in Compact Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in Compact + * Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a * special hardware state associated. @@ -53,21 +72,21 @@ * mode. * - Serving Fast Interrupt. This state is not implemented in the * ARMv6-M implementation. - * - Serving Non-Maskable Interrupt. The Cortex-M3 has a specific + * - Serving Non-Maskable Interrupt. The Cortex-Mx has a specific * asynchronous NMI vector and several synchronous fault vectors that can * be considered belonging to this category. * - Halted. Implemented as an infinite loop after globally masking all * the maskable interrupt sources. The ARM state is whatever the processor * was running when @p chSysHalt() was invoked. * - * @section RVCT_ARMCMx_STATES_B System logical states in ARMv7-M mode - * The ChibiOS/RT logical @ref system_states are mapped as follow in the ARM - * Cortex-M3 port: + * @section RVCT_ARMCMx_STATES_B System logical states in Advanced Kernel mode + * The ChibiOS/RT logical @ref system_states are mapped as follow in the + * Advanced Kernel mode: * - Init. This state is represented by the startup code and the * initialization code before @p chSysInit() is executed. It has not a * special hardware state associated. * - Normal. This is the state the system has after executing - * @p chSysInit(). In this state the ARM Cortex-M3 has the BASEPRI register + * @p chSysInit(). In this state the ARM Cortex-Mx has the BASEPRI register * set at @p CORTEX_BASEPRI_USER level, interrupts are not masked. The * processor is running in thread-privileged mode. * - Suspended. In this state the interrupt sources are not globally @@ -93,7 +112,7 @@ * - Serving Fast Interrupt. It is basically the same of the SRI state * but it is not possible to switch to the I-Locked state because fast * interrupts can preempt the kernel critical zone. - * - Serving Non-Maskable Interrupt. The Cortex-M3 has a specific + * - Serving Non-Maskable Interrupt. The Cortex-Mx has a specific * asynchronous NMI vector and several synchronous fault vectors that can * be considered belonging to this category. * - Halted. Implemented as an infinite loop after globally masking all @@ -140,17 +159,24 @@ * - @p IDLE_THREAD_STACK_SIZE, stack area size to be assigned to the IDLE * thread. Usually there is no need to change this value unless inserting * code in the IDLE thread using the @p IDLE_LOOP_HOOK hook macro. - * - @p CORTEX_BASEPRI_KERNEL, this is the @p BASEPRI value for the kernel lock - * code. Code running at higher priority levels must not invoke any OS API. - * This setting is specific to the ARMv7-M architecture. * - @p CORTEX_PRIORITY_SYSTICK, priority of the SYSTICK handler. - * - @p CORTEX_PRIORITY_SVCALL, priority of the SVCALL handler. * - @p CORTEX_PRIORITY_PENDSV, priority of the PENDSV handler. * - @p CORTEX_ENABLE_WFI_IDLE, if set to @p TRUE enables the use of the * @p wfi instruction from within the idle loop. This option is * defaulted to FALSE because it can create problems with some debuggers. * Setting this option to TRUE reduces the system power requirements. * . + * @section RVCT_ARMCMx_CONF_1 ARMv6-M specific options + * The following options are specific for the ARMv6-M architecture: + * - @p CORTEX_ALTERNATE_SWITCH, when activated makes the OS use the PendSV + * exception instead of NMI as preemption handler. + * . + * @section RVCT_ARMCMx_CONF_2 ARMv7-M specific options + * The following options are specific for the ARMv6-M architecture: + * - @p CORTEX_PRIORITY_SVCALL, priority of the SVCALL handler. + * - @p CORTEX_SIMPLIFIED_PRIORITY, when enabled activates the Compact kernel + * mode. + * . * @ingroup RVCT_ARMCMx */ diff --git a/readme.txt b/readme.txt index c3cbb14ab..d34771906 100644 --- a/readme.txt +++ b/readme.txt @@ -77,6 +77,8 @@ Optimized the driver for single block read and write operations. - NEW: Finished the reorganization of the Cortex-Mx ports, now also the IAR and RVCT ports support the new Compact mode. +- NEW: Added to the ARMv6-M sub-port an option to use the PendSV exception + instead of NMI for preemption (backported to 2.2.5). *** 2.3.3 *** - FIX: Fixed race condition in output queues (bug 3303908)(backported @@ -86,12 +88,12 @@ - FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420) (backported to 2.2.4). - NEW: Reorganization of the Cortex-Mx ports in order to reduced code and - comments duplication in the various headers. + comments duplication in the various headers (backported to 2.2.5). - NEW: Improved the ARMv7-M sub-port now there are two modes: Compact and Advanced. The advanced mode is equivalent to the previous versions, the compact mode is new and makes the kernel *much* smaller and generally faster but does - not support fast interrupts, see the reports for details. + not support fast interrupts (backported to 2.2.5). - NEW: Now the port layer exports info regarding the compiler and the port options. The info are printed into the test reports. - CHANGE: Renamed the macros IDLE_THREAD_STACK_SIZE and INT_REQUIRED_STACK -- cgit v1.2.3 From 821bc9f643dd2486646e89893eda61346b1b7818 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 4 Jun 2011 07:54:53 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3023 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103-FATFS-GCC/Makefile | 207 ------------ demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld | 130 ------- demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h | 504 ---------------------------- demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 325 ------------------ demos/ARMCM3-STM32F103-FATFS-GCC/main.c | 327 ------------------ demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h | 154 --------- demos/ARMCM3-STM32F103-FATFS-GCC/readme.txt | 33 -- demos/ARMCM3-STM32F103-FATFS/Makefile | 207 ++++++++++++ demos/ARMCM3-STM32F103-FATFS/ch.ld | 130 +++++++ demos/ARMCM3-STM32F103-FATFS/chconf.h | 504 ++++++++++++++++++++++++++++ demos/ARMCM3-STM32F103-FATFS/halconf.h | 325 ++++++++++++++++++ demos/ARMCM3-STM32F103-FATFS/main.c | 327 ++++++++++++++++++ demos/ARMCM3-STM32F103-FATFS/mcuconf.h | 154 +++++++++ demos/ARMCM3-STM32F103-FATFS/readme.txt | 33 ++ 14 files changed, 1680 insertions(+), 1680 deletions(-) delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/Makefile delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/main.c delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h delete mode 100644 demos/ARMCM3-STM32F103-FATFS-GCC/readme.txt create mode 100644 demos/ARMCM3-STM32F103-FATFS/Makefile create mode 100644 demos/ARMCM3-STM32F103-FATFS/ch.ld create mode 100644 demos/ARMCM3-STM32F103-FATFS/chconf.h create mode 100644 demos/ARMCM3-STM32F103-FATFS/halconf.h create mode 100644 demos/ARMCM3-STM32F103-FATFS/main.c create mode 100644 demos/ARMCM3-STM32F103-FATFS/mcuconf.h create mode 100644 demos/ARMCM3-STM32F103-FATFS/readme.txt diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/Makefile b/demos/ARMCM3-STM32F103-FATFS-GCC/Makefile deleted file mode 100644 index f8733c3ae..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/Makefile +++ /dev/null @@ -1,207 +0,0 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable register caching optimization (read documentation). -ifeq ($(USE_CURRP_CACHING),) - USE_CURRP_CACHING = no -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Enable this if you really want to use the STM FWLib. -ifeq ($(USE_FWLIB),) - USE_FWLIB = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Define linker script file here -LDSCRIPT= ch.ld - -# Imported source files -CHIBIOS = ../.. -include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk -include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk -include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk -include $(CHIBIOS)/os/kernel/kernel.mk -include $(CHIBIOS)/test/test.mk -include $(CHIBIOS)/ext/fatfs/fatfs.mk - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(PORTSRC) \ - $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(FATFSSRC) \ - $(CHIBIOS)/os/various/shell.c \ - $(CHIBIOS)/os/various/syscalls.c \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = $(PORTASM) - -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) \ - $(FATFSINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m3 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -OD = $(TRGT)objdump -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of default section -# - -# List all default C defines here, like -D_DEBUG=1 -DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2 - -# List all default ASM defines here, like -D_DEBUG=1 -DADEFS = - -# List all default directories to look for include files here -DINCDIR = - -# List the default directory to look for the libraries here -DLIBDIR = - -# List all default libraries here -DLIBS = - -# -# End of default section -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# -# End of user defines -############################################################################## - -ifeq ($(USE_FWLIB),yes) - include $(CHIBIOS)/ext/stm32lib/stm32lib.mk - CSRC += $(STM32SRC) - INCDIR += $(STM32INC) - USE_OPT += -DUSE_STDPERIPH_DRIVER -endif - -include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld b/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F103 memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; -__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; - -MEMORY -{ - flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 20k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .data : - { - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h deleted file mode 100644 index c9c4c286a..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/chconf.h +++ /dev/null @@ -1,504 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/* Kernel parameters. */ -/*===========================================================================*/ - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) -#define CH_FREQUENCY 1000 -#endif - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - */ -#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) -#define CH_TIME_QUANTUM 20 -#endif - -/** - * @brief Nested locks. - * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() - * operations is allowed.
- * For performance and code size reasons the recommended setting - * is to leave this option disabled.
- * You may use this option if you need to merge ChibiOS/RT with - * external libraries that require nested lock/unlock operations. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) -#define CH_USE_NESTED_LOCKS FALSE -#endif - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_MEMCORE. - */ -#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) -#define CH_MEMCORE_SIZE 0 -#endif - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread automatically. The application has - * then the responsibility to do one of the following: - * - Spawn a custom idle thread at priority @p IDLEPRIO. - * - Change the main() thread priority to @p IDLEPRIO then enter - * an endless loop. In this scenario the @p main() thread acts as - * the idle thread. - * . - * @note Unless an idle thread is spawned the @p main() thread must not - * enter a sleep state. - */ -#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) -#define CH_NO_IDLE_THREAD FALSE -#endif - -/*===========================================================================*/ -/* Performance options. */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) -#define CH_OPTIMIZE_SPEED TRUE -#endif - -/*===========================================================================*/ -/* Subsystem options. */ -/*===========================================================================*/ - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) -#define CH_USE_REGISTRY TRUE -#endif - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) -#define CH_USE_WAITEXIT TRUE -#endif - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES TRUE -#endif - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES_PRIORITY FALSE -#endif - -/** - * @brief Atomic semaphore API. - * @details If enabled then the semaphores the @p chSemSignalWait() API - * is included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) -#define CH_USE_SEMSW TRUE -#endif - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) -#define CH_USE_MUTEXES TRUE -#endif - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MUTEXES. - */ -#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS TRUE -#endif - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_CONDVARS. - */ -#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_CONDVARS_TIMEOUT TRUE -#endif - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) -#define CH_USE_EVENTS TRUE -#endif - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_EVENTS. - */ -#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_EVENTS_TIMEOUT TRUE -#endif - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES TRUE -#endif - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_MESSAGES. - */ -#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES_PRIORITY FALSE -#endif - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) -#define CH_USE_MAILBOXES TRUE -#endif - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) -#define CH_USE_QUEUES TRUE -#endif - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) -#define CH_USE_MEMCORE TRUE -#endif - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or - * @p CH_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) -#define CH_USE_HEAP TRUE -#endif - -/** - * @brief C-runtime allocator. - * @details If enabled the the heap allocator APIs just wrap the C-runtime - * @p malloc() and @p free() functions. - * - * @note The default is @p FALSE. - * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the - * appropriate documentation. - */ -#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) -#define CH_USE_MALLOC_HEAP FALSE -#endif - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) -#define CH_USE_MEMPOOLS TRUE -#endif - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_WAITEXIT. - * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. - */ -#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) -#define CH_USE_DYNAMIC TRUE -#endif - -/*===========================================================================*/ -/* Debug options. */ -/*===========================================================================*/ - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_CHECKS FALSE -#endif - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_ASSERTS FALSE -#endif - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_TRACE FALSE -#endif - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) -#define CH_DBG_ENABLE_STACK_CHECK FALSE -#endif - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) -#define CH_DBG_FILL_THREADS FALSE -#endif - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p Thread structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p TRUE. - * @note This debug option is defaulted to TRUE because it is required by - * some test cases into the test suite. - */ -#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) -#define CH_DBG_THREADS_PROFILING TRUE -#endif - -/*===========================================================================*/ -/* Kernel hooks. */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p Thread structure. - */ -#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) -#define THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ -#endif - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitily from all - * the threads creation APIs. - */ -#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} -#endif - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} -#endif - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) -#define IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} -#endif - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_TICK_EVENT_HOOK() { \ - /* System tick event code here.*/ \ -} -#endif - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define SYSTEM_HALT_HOOK() { \ - /* System halt code here.*/ \ -} -#endif - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h deleted file mode 100644 index 33ecee26a..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ /dev/null @@ -1,325 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI TRUE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI TRUE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Block size for MMC transfers. - */ -#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) -#define MMC_SECTOR_SIZE 512 -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/** - * @brief Number of positive insertion queries before generating the - * insertion event. - */ -#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) -#define MMC_POLLING_INTERVAL 10 -#endif - -/** - * @brief Interval, in milliseconds, between insertion queries. - */ -#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) -#define MMC_POLLING_DELAY 10 -#endif - -/** - * @brief Uses the SPI polled API for small data transfers. - * @details Polled transfers usually improve performance because it - * saves two context switches and interrupt servicing. Note - * that this option has no effect on large transfers which - * are always performed using DMAs/IRQs. - */ -#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) -#define MMC_USE_SPI_POLLING TRUE -#endif - -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intevals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c b/demos/ARMCM3-STM32F103-FATFS-GCC/main.c deleted file mode 100644 index a5bfb13a8..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/main.c +++ /dev/null @@ -1,327 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include -#include - -#include "ch.h" -#include "hal.h" -#include "test.h" -#include "shell.h" -#include "evtimer.h" - -#include "ff.h" - -/*===========================================================================*/ -/* MMC/SPI related. */ -/*===========================================================================*/ - -/** - * @brief FS object. - */ -FATFS MMC_FS; - -/** - * MMC driver instance. - */ -MMCDriver MMCD1; - -/* FS mounted and ready.*/ -static bool_t fs_ready = FALSE; - -/* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).*/ -static SPIConfig hs_spicfg = {NULL, IOPORT2, GPIOB_SPI2NSS, 0}; - -/* Low speed SPI configuration (281.250KHz, CPHA=0, CPOL=0, MSb first).*/ -static SPIConfig ls_spicfg = {NULL, IOPORT2, GPIOB_SPI2NSS, - SPI_CR1_BR_2 | SPI_CR1_BR_1}; - -/* Card insertion verification.*/ -static bool_t mmc_is_inserted(void) {return palReadPad(IOPORT3, GPIOC_MMCCP);} - -/* Card protection verification.*/ -static bool_t mmc_is_protected(void) {return !palReadPad(IOPORT3, GPIOC_MMCWP);} - -/* Generic large buffer.*/ -uint8_t fbuff[1024]; - -static FRESULT scan_files(char *path) -{ - FRESULT res; - FILINFO fno; - DIR dir; - int i; - char *fn; - - res = f_opendir(&dir, path); - if (res == FR_OK) { - i = strlen(path); - for (;;) { - res = f_readdir(&dir, &fno); - if (res != FR_OK || fno.fname[0] == 0) - break; - if (fno.fname[0] == '.') - continue; - fn = fno.fname; - if (fno.fattrib & AM_DIR) { - siprintf(&path[i], "/%s", fn); - res = scan_files(path); - if (res != FR_OK) - break; - path[i] = 0; - } - else { - iprintf("%s/%s\r\n", path, fn); - } - } - } - return res; -} - -/*===========================================================================*/ -/* Command line related. */ -/*===========================================================================*/ - -#define SHELL_WA_SIZE THD_WA_SIZE(2048) -#define TEST_WA_SIZE THD_WA_SIZE(256) - -static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) { - size_t n, size; - char buf[52]; - - (void)argv; - if (argc > 0) { - shellPrintLine(chp, "Usage: mem"); - return; - } - n = chHeapStatus(NULL, &size); - siprintf(buf, "core free memory : %u bytes", chCoreStatus()); - shellPrintLine(chp, buf); - siprintf(buf, "heap fragments : %u", n); - shellPrintLine(chp, buf); - siprintf(buf, "heap free total : %u bytes", size); - shellPrintLine(chp, buf); -} - -static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { - static const char *states[] = { - "READY", - "CURRENT", - "SUSPENDED", - "WTSEM", - "WTMTX", - "WTCOND", - "SLEEPING", - "WTEXIT", - "WTOREVT", - "WTANDEVT", - "SNDMSGQ", - "SNDMSG", - "WTMSG", - "FINAL" - }; - Thread *tp; - char buf[60]; - - (void)argv; - if (argc > 0) { - shellPrintLine(chp, "Usage: threads"); - return; - } - shellPrintLine(chp, " addr stack prio refs state time"); - tp = chRegFirstThread(); - do { - siprintf(buf, "%8lx %8lx %4u %4i %9s %u", - (uint32_t)tp, (uint32_t)tp->p_ctx.r13, - (unsigned int)tp->p_prio, tp->p_refs - 1, - states[tp->p_state], (unsigned int)tp->p_time); - shellPrintLine(chp, buf); - tp = chRegNextThread(tp); - } while (tp != NULL); -} - -static void cmd_test(BaseChannel *chp, int argc, char *argv[]) { - Thread *tp; - - (void)argv; - if (argc > 0) { - shellPrintLine(chp, "Usage: test"); - return; - } - tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(), - TestThread, chp); - if (tp == NULL) { - shellPrintLine(chp, "out of memory"); - return; - } - chThdWait(tp); -} - -static void cmd_tree(BaseChannel *chp, int argc, char *argv[]) { - FRESULT err; - uint32_t clusters; - FATFS *fsp; - - (void)argv; - if (argc > 0) { - shellPrintLine(chp, "Usage: tree"); - return; - } - if (!fs_ready) { - shellPrintLine(chp, "File System not mounted"); - return; - } - err = f_getfree("/", &clusters, &fsp); - if (err != FR_OK) { - shellPrintLine(chp, "FS: f_getfree() failed"); - return; - } - siprintf((void *)fbuff, - "FS: %lu free clusters, %lu sectors per cluster, %lu bytes free", - clusters, (uint32_t)MMC_FS.csize, - clusters * (uint32_t)MMC_FS.csize * (uint32_t)MMC_SECTOR_SIZE); - shellPrintLine(chp, (void *)fbuff); - fbuff[0] = 0; - scan_files((char *)fbuff); -} - -static const ShellCommand commands[] = { - {"mem", cmd_mem}, - {"threads", cmd_threads}, - {"test", cmd_test}, - {"tree", cmd_tree}, - {NULL, NULL} -}; - -static const ShellConfig shell_cfg1 = { - (BaseChannel *)&SD2, - commands -}; - -/* - * Red LEDs blinker thread, times are in milliseconds. - */ -static WORKING_AREA(waThread1, 128); -static msg_t Thread1(void *arg) { - - (void)arg; - while (TRUE) { - palTogglePad(IOPORT3, GPIOC_LED); - if (fs_ready) - chThdSleepMilliseconds(200); - else - chThdSleepMilliseconds(500); - } - return 0; -} - -/* - * MMC card insertion event. - */ -static void InsertHandler(eventid_t id) { - FRESULT err; - - (void)id; - /* - * On insertion MMC initialization and FS mount. - */ - if (mmcConnect(&MMCD1)) { - return; - } - err = f_mount(0, &MMC_FS); - if (err != FR_OK) { - mmcDisconnect(&MMCD1); - return; - } - fs_ready = TRUE; -} - -/* - * MMC card removal event. - */ -static void RemoveHandler(eventid_t id) { - - (void)id; - fs_ready = FALSE; -} - -/* - * Application entry point. - */ -int main(void) { - static const evhandler_t evhndl[] = { - InsertHandler, - RemoveHandler - }; - Thread *shelltp = NULL; - struct EventListener el0, el1; - - /* - * System initializations. - * - HAL initialization, this also initializes the configured device drivers - * and performs the board-specific initializations. - * - Kernel initialization, the main() function becomes a thread and the - * RTOS is active. - */ - halInit(); - chSysInit(); - - /* - * Activates the serial driver 2 using the driver default configuration. - */ - sdStart(&SD2, NULL); - - /* - * Shell manager initialization. - */ - shellInit(); - - /* - * Initializes the MMC driver to work with SPI2. - */ - palSetPadMode(IOPORT2, GPIOB_SPI2NSS, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(IOPORT2, GPIOB_SPI2NSS); - mmcObjectInit(&MMCD1, &SPID2, - &ls_spicfg, &hs_spicfg, - mmc_is_protected, mmc_is_inserted); - mmcStart(&MMCD1, NULL); - - /* - * Creates the blinker thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - - /* - * Normal main() thread activity, in this demo it does nothing except - * sleeping in a loop and listen for events. - */ - chEvtRegister(&MMCD1.inserted_event, &el0, 0); - chEvtRegister(&MMCD1.removed_event, &el1, 1); - while (TRUE) { - if (!shelltp) - shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); - else if (chThdTerminated(shelltp)) { - chThdRelease(shelltp); /* Recovers memory of the previous shell. */ - shelltp = NULL; /* Triggers spawning of a new shell. */ - } - chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS)); - } - return 0; -} diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h deleted file mode 100644 index 8f6199e69..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/mcuconf.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * STM32 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -/* - * HAL driver system settings. - */ -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_USBPRE STM32_USBPRE_DIV1P5 -#define STM32_MCO STM32_MCO_NOCLOCK - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC1_IRQ_PRIORITY 5 -#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 TRUE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 TRUE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED TRUE -#define STM32_PWM_USE_TIM1 TRUE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 TRUE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 TRUE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/readme.txt b/demos/ARMCM3-STM32F103-FATFS-GCC/readme.txt deleted file mode 100644 index 4178478bb..000000000 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/readme.txt +++ /dev/null @@ -1,33 +0,0 @@ -***************************************************************************** -** ChibiOS/RT port for ARM-Cortex-M3 STM32F103. ** -***************************************************************************** - -** TARGET ** - -The demo runs on an Olimex STM32-P103 board. - -** The Demo ** - -This demo shows how to integrate the FatFs file system and use the SPI and MMC -drivers. -The demo flashes the board LED using a thread and monitors the MMC slot for -a card insertion. When a card is inserted then the file system is mounted -and the LED flashes faster. -A command line shell is spawned on SD2, all the interaction with the demo is -performed using the command shell, type "help" for a list of the available -commands. - -** Build Procedure ** - -The demo has been tested by using the free Codesourcery GCC-based toolchain, -YAGARTO and an experimental WinARM build including GCC 4.3.0. -Just modify the TRGT line in the makefile in order to use different GCC ports. - -** Notes ** - -Some files used by the demo are not part of ChibiOS/RT but are copyright of -ST Microelectronics and are licensed under a different license. -Also note that not all the files present in the ST library are distributed -with ChibiOS/RT, you can find the whole library on the ST web site: - - http://www.st.com diff --git a/demos/ARMCM3-STM32F103-FATFS/Makefile b/demos/ARMCM3-STM32F103-FATFS/Makefile new file mode 100644 index 000000000..f8733c3ae --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/Makefile @@ -0,0 +1,207 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable register caching optimization (read documentation). +ifeq ($(USE_CURRP_CACHING),) + USE_CURRP_CACHING = no +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FWLIB),) + USE_FWLIB = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Define linker script file here +LDSCRIPT= ch.ld + +# Imported source files +CHIBIOS = ../.. +include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk +include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk +include $(CHIBIOS)/ext/fatfs/fatfs.mk + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(FATFSSRC) \ + $(CHIBIOS)/os/various/shell.c \ + $(CHIBIOS)/os/various/syscalls.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(PORTASM) + +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(FATFSINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m3 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2 + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +ifeq ($(USE_FWLIB),yes) + include $(CHIBIOS)/ext/stm32lib/stm32lib.mk + CSRC += $(STM32SRC) + INCDIR += $(STM32INC) + USE_OPT += -DUSE_STDPERIPH_DRIVER +endif + +include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk diff --git a/demos/ARMCM3-STM32F103-FATFS/ch.ld b/demos/ARMCM3-STM32F103-FATFS/ch.ld new file mode 100644 index 000000000..4d97e7682 --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/ch.ld @@ -0,0 +1,130 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F103 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; +__stacks_total_size__ = __main_stack_size__ + __process_stack_size__; + +MEMORY +{ + flash : org = 0x08000000, len = 128k + ram : org = 0x20000000, len = 20k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data : + { + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__ - __stacks_total_size__; diff --git a/demos/ARMCM3-STM32F103-FATFS/chconf.h b/demos/ARMCM3-STM32F103-FATFS/chconf.h new file mode 100644 index 000000000..c9c4c286a --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/chconf.h @@ -0,0 +1,504 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 +#endif + +/** + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_MEMCORE. + */ +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 0 +#endif + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API + * is included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) +#define CH_USE_SEMSW TRUE +#endif + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) +#define CH_USE_MUTEXES TRUE +#endif + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS TRUE +#endif + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) +#define CH_USE_EVENTS TRUE +#endif + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES TRUE +#endif + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) +#define CH_USE_QUEUES TRUE +#endif + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_HEAP TRUE +#endif + +/** + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the + * appropriate documentation. + */ +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MALLOC_HEAP FALSE +#endif + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) +#define CH_USE_MEMPOOLS TRUE +#endif + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. + */ +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) +#define CH_USE_DYNAMIC TRUE +#endif + +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_ASSERTS FALSE +#endif + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) +#define CH_DBG_FILL_THREADS FALSE +#endif + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING TRUE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p Thread structure. + */ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ + /* Add threads custom fields here.*/ +#endif + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. + */ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} +#endif + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} +#endif + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ +} +#endif + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103-FATFS/halconf.h b/demos/ARMCM3-STM32F103-FATFS/halconf.h new file mode 100644 index 000000000..33ecee26a --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/halconf.h @@ -0,0 +1,325 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Block size for MMC transfers. + */ +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARMCM3-STM32F103-FATFS/main.c b/demos/ARMCM3-STM32F103-FATFS/main.c new file mode 100644 index 000000000..a5bfb13a8 --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/main.c @@ -0,0 +1,327 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include "ch.h" +#include "hal.h" +#include "test.h" +#include "shell.h" +#include "evtimer.h" + +#include "ff.h" + +/*===========================================================================*/ +/* MMC/SPI related. */ +/*===========================================================================*/ + +/** + * @brief FS object. + */ +FATFS MMC_FS; + +/** + * MMC driver instance. + */ +MMCDriver MMCD1; + +/* FS mounted and ready.*/ +static bool_t fs_ready = FALSE; + +/* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).*/ +static SPIConfig hs_spicfg = {NULL, IOPORT2, GPIOB_SPI2NSS, 0}; + +/* Low speed SPI configuration (281.250KHz, CPHA=0, CPOL=0, MSb first).*/ +static SPIConfig ls_spicfg = {NULL, IOPORT2, GPIOB_SPI2NSS, + SPI_CR1_BR_2 | SPI_CR1_BR_1}; + +/* Card insertion verification.*/ +static bool_t mmc_is_inserted(void) {return palReadPad(IOPORT3, GPIOC_MMCCP);} + +/* Card protection verification.*/ +static bool_t mmc_is_protected(void) {return !palReadPad(IOPORT3, GPIOC_MMCWP);} + +/* Generic large buffer.*/ +uint8_t fbuff[1024]; + +static FRESULT scan_files(char *path) +{ + FRESULT res; + FILINFO fno; + DIR dir; + int i; + char *fn; + + res = f_opendir(&dir, path); + if (res == FR_OK) { + i = strlen(path); + for (;;) { + res = f_readdir(&dir, &fno); + if (res != FR_OK || fno.fname[0] == 0) + break; + if (fno.fname[0] == '.') + continue; + fn = fno.fname; + if (fno.fattrib & AM_DIR) { + siprintf(&path[i], "/%s", fn); + res = scan_files(path); + if (res != FR_OK) + break; + path[i] = 0; + } + else { + iprintf("%s/%s\r\n", path, fn); + } + } + } + return res; +} + +/*===========================================================================*/ +/* Command line related. */ +/*===========================================================================*/ + +#define SHELL_WA_SIZE THD_WA_SIZE(2048) +#define TEST_WA_SIZE THD_WA_SIZE(256) + +static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) { + size_t n, size; + char buf[52]; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: mem"); + return; + } + n = chHeapStatus(NULL, &size); + siprintf(buf, "core free memory : %u bytes", chCoreStatus()); + shellPrintLine(chp, buf); + siprintf(buf, "heap fragments : %u", n); + shellPrintLine(chp, buf); + siprintf(buf, "heap free total : %u bytes", size); + shellPrintLine(chp, buf); +} + +static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { + static const char *states[] = { + "READY", + "CURRENT", + "SUSPENDED", + "WTSEM", + "WTMTX", + "WTCOND", + "SLEEPING", + "WTEXIT", + "WTOREVT", + "WTANDEVT", + "SNDMSGQ", + "SNDMSG", + "WTMSG", + "FINAL" + }; + Thread *tp; + char buf[60]; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: threads"); + return; + } + shellPrintLine(chp, " addr stack prio refs state time"); + tp = chRegFirstThread(); + do { + siprintf(buf, "%8lx %8lx %4u %4i %9s %u", + (uint32_t)tp, (uint32_t)tp->p_ctx.r13, + (unsigned int)tp->p_prio, tp->p_refs - 1, + states[tp->p_state], (unsigned int)tp->p_time); + shellPrintLine(chp, buf); + tp = chRegNextThread(tp); + } while (tp != NULL); +} + +static void cmd_test(BaseChannel *chp, int argc, char *argv[]) { + Thread *tp; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: test"); + return; + } + tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(), + TestThread, chp); + if (tp == NULL) { + shellPrintLine(chp, "out of memory"); + return; + } + chThdWait(tp); +} + +static void cmd_tree(BaseChannel *chp, int argc, char *argv[]) { + FRESULT err; + uint32_t clusters; + FATFS *fsp; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: tree"); + return; + } + if (!fs_ready) { + shellPrintLine(chp, "File System not mounted"); + return; + } + err = f_getfree("/", &clusters, &fsp); + if (err != FR_OK) { + shellPrintLine(chp, "FS: f_getfree() failed"); + return; + } + siprintf((void *)fbuff, + "FS: %lu free clusters, %lu sectors per cluster, %lu bytes free", + clusters, (uint32_t)MMC_FS.csize, + clusters * (uint32_t)MMC_FS.csize * (uint32_t)MMC_SECTOR_SIZE); + shellPrintLine(chp, (void *)fbuff); + fbuff[0] = 0; + scan_files((char *)fbuff); +} + +static const ShellCommand commands[] = { + {"mem", cmd_mem}, + {"threads", cmd_threads}, + {"test", cmd_test}, + {"tree", cmd_tree}, + {NULL, NULL} +}; + +static const ShellConfig shell_cfg1 = { + (BaseChannel *)&SD2, + commands +}; + +/* + * Red LEDs blinker thread, times are in milliseconds. + */ +static WORKING_AREA(waThread1, 128); +static msg_t Thread1(void *arg) { + + (void)arg; + while (TRUE) { + palTogglePad(IOPORT3, GPIOC_LED); + if (fs_ready) + chThdSleepMilliseconds(200); + else + chThdSleepMilliseconds(500); + } + return 0; +} + +/* + * MMC card insertion event. + */ +static void InsertHandler(eventid_t id) { + FRESULT err; + + (void)id; + /* + * On insertion MMC initialization and FS mount. + */ + if (mmcConnect(&MMCD1)) { + return; + } + err = f_mount(0, &MMC_FS); + if (err != FR_OK) { + mmcDisconnect(&MMCD1); + return; + } + fs_ready = TRUE; +} + +/* + * MMC card removal event. + */ +static void RemoveHandler(eventid_t id) { + + (void)id; + fs_ready = FALSE; +} + +/* + * Application entry point. + */ +int main(void) { + static const evhandler_t evhndl[] = { + InsertHandler, + RemoveHandler + }; + Thread *shelltp = NULL; + struct EventListener el0, el1; + + /* + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. + */ + halInit(); + chSysInit(); + + /* + * Activates the serial driver 2 using the driver default configuration. + */ + sdStart(&SD2, NULL); + + /* + * Shell manager initialization. + */ + shellInit(); + + /* + * Initializes the MMC driver to work with SPI2. + */ + palSetPadMode(IOPORT2, GPIOB_SPI2NSS, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(IOPORT2, GPIOB_SPI2NSS); + mmcObjectInit(&MMCD1, &SPID2, + &ls_spicfg, &hs_spicfg, + mmc_is_protected, mmc_is_inserted); + mmcStart(&MMCD1, NULL); + + /* + * Creates the blinker thread. + */ + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + + /* + * Normal main() thread activity, in this demo it does nothing except + * sleeping in a loop and listen for events. + */ + chEvtRegister(&MMCD1.inserted_event, &el0, 0); + chEvtRegister(&MMCD1.removed_event, &el1, 1); + while (TRUE) { + if (!shelltp) + shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); + else if (chThdTerminated(shelltp)) { + chThdRelease(shelltp); /* Recovers memory of the previous shell. */ + shelltp = NULL; /* Triggers spawning of a new shell. */ + } + chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS)); + } + return 0; +} diff --git a/demos/ARMCM3-STM32F103-FATFS/mcuconf.h b/demos/ARMCM3-STM32F103-FATFS/mcuconf.h new file mode 100644 index 000000000..8f6199e69 --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/mcuconf.h @@ -0,0 +1,154 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * STM32 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCO STM32_MCO_NOCLOCK + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 TRUE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 5 +#define STM32_ADC_DMA_ERROR_HOOK(adcp) chSysHalt() + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 TRUE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 TRUE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED TRUE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 6 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 diff --git a/demos/ARMCM3-STM32F103-FATFS/readme.txt b/demos/ARMCM3-STM32F103-FATFS/readme.txt new file mode 100644 index 000000000..4178478bb --- /dev/null +++ b/demos/ARMCM3-STM32F103-FATFS/readme.txt @@ -0,0 +1,33 @@ +***************************************************************************** +** ChibiOS/RT port for ARM-Cortex-M3 STM32F103. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an Olimex STM32-P103 board. + +** The Demo ** + +This demo shows how to integrate the FatFs file system and use the SPI and MMC +drivers. +The demo flashes the board LED using a thread and monitors the MMC slot for +a card insertion. When a card is inserted then the file system is mounted +and the LED flashes faster. +A command line shell is spawned on SD2, all the interaction with the demo is +performed using the command shell, type "help" for a list of the available +commands. + +** Build Procedure ** + +The demo has been tested by using the free Codesourcery GCC-based toolchain, +YAGARTO and an experimental WinARM build including GCC 4.3.0. +Just modify the TRGT line in the makefile in order to use different GCC ports. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distributed +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com -- cgit v1.2.3 From ac3795ec527571f697892d6b0622de7cdd9f6964 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 4 Jun 2011 08:43:00 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3024 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp | 2252 +++++++++++++++++++++++++++++ demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.eww | 10 + demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.icf | 39 + 3 files changed, 2301 insertions(+) create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.eww create mode 100644 demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.icf diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp new file mode 100644 index 000000000..711931abd --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp @@ -0,0 +1,2252 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 18 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 11 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 18 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 26 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 11 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + board + + $PROJ_DIR$\..\..\..\boards\ST_STM3210E_EVAL\board.c + + + $PROJ_DIR$\..\..\..\boards\ST_STM3210E_EVAL\board.h + + + + fatfs + + $PROJ_DIR$\..\..\..\ext\fatfs\src\diskio.c + + + $PROJ_DIR$\..\..\..\ext\fatfs\src\diskio.h + + + $PROJ_DIR$\..\..\..\ext\fatfs\src\ff.c + + + $PROJ_DIR$\..\..\..\ext\fatfs\src\ff.h + + + $PROJ_DIR$\..\..\..\ext\fatfs\src\ffconf.h + + + $PROJ_DIR$\..\..\..\ext\fatfs\src\integer.h + + + $PROJ_DIR$\..\..\..\ext\fatfs\src\option\syncobj.c + + + + os + + hal + + include + + $PROJ_DIR$\..\..\..\os\hal\include\adc.h + + + $PROJ_DIR$\..\..\..\os\hal\include\can.h + + + $PROJ_DIR$\..\..\..\os\hal\include\gpt.h + + + $PROJ_DIR$\..\..\..\os\hal\include\hal.h + + + $PROJ_DIR$\..\..\..\os\hal\include\i2c.h + + + $PROJ_DIR$\..\..\..\os\hal\include\icu.h + + + $PROJ_DIR$\..\..\..\os\hal\include\mac.h + + + $PROJ_DIR$\..\..\..\os\hal\include\mii.h + + + $PROJ_DIR$\..\..\..\os\hal\include\mmc_spi.h + + + $PROJ_DIR$\..\..\..\os\hal\include\pal.h + + + $PROJ_DIR$\..\..\..\os\hal\include\pwm.h + + + $PROJ_DIR$\..\..\..\os\hal\include\sdc.h + + + $PROJ_DIR$\..\..\..\os\hal\include\serial.h + + + $PROJ_DIR$\..\..\..\os\hal\include\serial_usb.h + + + $PROJ_DIR$\..\..\..\os\hal\include\spi.h + + + $PROJ_DIR$\..\..\..\os\hal\include\uart.h + + + $PROJ_DIR$\..\..\..\os\hal\include\usb.h + + + $PROJ_DIR$\..\..\..\os\hal\include\usb_cdc.h + + + + src + + $PROJ_DIR$\..\..\..\os\hal\src\adc.c + + + $PROJ_DIR$\..\..\..\os\hal\src\can.c + + + $PROJ_DIR$\..\..\..\os\hal\src\gpt.c + + + $PROJ_DIR$\..\..\..\os\hal\src\hal.c + + + $PROJ_DIR$\..\..\..\os\hal\src\i2c.c + + + $PROJ_DIR$\..\..\..\os\hal\src\icu.c + + + $PROJ_DIR$\..\..\..\os\hal\src\mac.c + + + $PROJ_DIR$\..\..\..\os\hal\src\mmc_spi.c + + + $PROJ_DIR$\..\..\..\os\hal\src\pal.c + + + $PROJ_DIR$\..\..\..\os\hal\src\pwm.c + + + $PROJ_DIR$\..\..\..\os\hal\src\sdc.c + + + $PROJ_DIR$\..\..\..\os\hal\src\serial.c + + + $PROJ_DIR$\..\..\..\os\hal\src\serial_usb.c + + + $PROJ_DIR$\..\..\..\os\hal\src\spi.c + + + $PROJ_DIR$\..\..\..\os\hal\src\uart.c + + + $PROJ_DIR$\..\..\..\os\hal\src\usb.c + + + + + kernel + + include + + $PROJ_DIR$\..\..\..\os\kernel\include\ch.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chcond.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chdebug.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chdynamic.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chevents.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chheap.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chinline.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chioch.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chlists.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmboxes.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmemcore.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmempools.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmsg.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chmtx.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chqueues.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chregistry.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chschd.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chsem.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chstreams.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chsys.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chthreads.h + + + $PROJ_DIR$\..\..\..\os\kernel\include\chvt.h + + + + src + + $PROJ_DIR$\..\..\..\os\kernel\src\chcond.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chdebug.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chdynamic.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chevents.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chheap.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chlists.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmboxes.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmemcore.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmempools.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmsg.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chmtx.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chqueues.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chregistry.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chschd.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chsem.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chsys.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chthreads.c + + + $PROJ_DIR$\..\..\..\os\kernel\src\chvt.c + + + + + platform + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\adc_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\adc_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\can_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\can_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\core_cm3.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\gpt_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\gpt_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld_f100.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld_f103.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\hal_lld_f105_f107.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\icu_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\icu_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pal_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pal_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pwm_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\pwm_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\sdc_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\sdc_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\serial_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\serial_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\spi_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\spi_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32_dma.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32_dma.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32_usb.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\stm32f10x.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\uart_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\uart_lld.h + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\usb_lld.c + + + $PROJ_DIR$\..\..\..\os\hal\platforms\STM32\usb_lld.h + + + + port + + STM32 + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\STM32\cmparams.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\STM32\vectors.s + + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore.c + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore_v7m.c + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcore_v7m.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chcoreasm_v7m.s + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\chtypes.h + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\cstartup.s + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\nvic.c + + + $PROJ_DIR$\..\..\..\os\ports\IAR\ARMCMx\nvic.h + + + + various + + $PROJ_DIR$\..\..\..\os\various\shell.c + + + $PROJ_DIR$\..\..\..\os\various\shell.h + + + + + test + + $PROJ_DIR$\..\..\..\test\test.c + + + $PROJ_DIR$\..\..\..\test\test.h + + + $PROJ_DIR$\..\..\..\test\testbmk.c + + + $PROJ_DIR$\..\..\..\test\testbmk.h + + + $PROJ_DIR$\..\..\..\test\testdyn.c + + + $PROJ_DIR$\..\..\..\test\testdyn.h + + + $PROJ_DIR$\..\..\..\test\testevt.c + + + $PROJ_DIR$\..\..\..\test\testevt.h + + + $PROJ_DIR$\..\..\..\test\testheap.c + + + $PROJ_DIR$\..\..\..\test\testheap.h + + + $PROJ_DIR$\..\..\..\test\testmbox.c + + + $PROJ_DIR$\..\..\..\test\testmbox.h + + + $PROJ_DIR$\..\..\..\test\testmsg.c + + + $PROJ_DIR$\..\..\..\test\testmsg.h + + + $PROJ_DIR$\..\..\..\test\testmtx.c + + + $PROJ_DIR$\..\..\..\test\testmtx.h + + + $PROJ_DIR$\..\..\..\test\testpools.c + + + $PROJ_DIR$\..\..\..\test\testpools.h + + + $PROJ_DIR$\..\..\..\test\testqueues.c + + + $PROJ_DIR$\..\..\..\test\testqueues.h + + + $PROJ_DIR$\..\..\..\test\testsem.c + + + $PROJ_DIR$\..\..\..\test\testsem.h + + + $PROJ_DIR$\..\..\..\test\testthd.c + + + $PROJ_DIR$\..\..\..\test\testthd.h + + + + $PROJ_DIR$\..\chconf.h + + + $PROJ_DIR$\..\halconf.h + + + $PROJ_DIR$\..\main.c + + + $PROJ_DIR$\..\mcuconf.h + + + + diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.eww b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.eww new file mode 100644 index 000000000..f9b3b2000 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\ch.ewp + + + + + diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.icf b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.icf new file mode 100644 index 000000000..b29e342a9 --- /dev/null +++ b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.icf @@ -0,0 +1,39 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x08000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; +define symbol __ICFEDIT_region_ROM_end__ = 0x08100000; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x400; +define symbol __ICFEDIT_size_heap__ = 0x400; +/**** End of ICF editor section. ###ICF###*/ + +/* Size of the IRQ Stack (Main Stack).*/ +define symbol __ICFEDIT_size_irqstack__ = 0x400; + +define memory mem with size = 4G; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {section CSTACK}; +define block IRQSTACK with alignment = 8, size = __ICFEDIT_size_irqstack__ {}; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {}; +define block SYSHEAP with alignment = 8 {section SYSHEAP}; +define block DATABSS with alignment = 8 {readwrite, zeroinit}; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +keep { section .intvec }; + +place at address mem:__ICFEDIT_intvec_start__ {section .intvec}; +place in ROM_region {readonly}; +place at start of RAM_region {block IRQSTACK}; +place in RAM_region {block DATABSS, block HEAP}; +place in RAM_region {block SYSHEAP}; +place at end of RAM_region {block CSTACK}; -- cgit v1.2.3 From 2d4aff80dcd0db460c00d0efa398a06e9bf522eb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 4 Jun 2011 13:30:13 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3025 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp | 6 +++ demos/ARMCM3-STM32F103ZG-FATFS/main.c | 88 +++++++++++++++++++++++++++++++ os/hal/include/sdc.h | 16 ++++++ 3 files changed, 110 insertions(+) diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp index 711931abd..a66a70295 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp +++ b/demos/ARMCM3-STM32F103ZG-FATFS/iar/ch.ewp @@ -1890,6 +1890,9 @@ $PROJ_DIR$\..\..\..\os\kernel\include\ch.h + + $PROJ_DIR$\..\..\..\os\kernel\include\chbsem.h + $PROJ_DIR$\..\..\..\os\kernel\include\chcond.h @@ -1902,6 +1905,9 @@ $PROJ_DIR$\..\..\..\os\kernel\include\chevents.h + + $PROJ_DIR$\..\..\..\os\kernel\include\chfiles.h + $PROJ_DIR$\..\..\..\os\kernel\include\chheap.h diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index 5e1ac9863..374cf7c4a 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -22,6 +22,89 @@ #include "hal.h" #include "test.h" +/*===========================================================================*/ +/* Card insertion monitor. */ +/*===========================================================================*/ + +#define SDC_POLLING_INTERVAL 10 +#define SDC_POLLING_DELAY 10 + +/** + * @brief Card monitor timer. + */ +static VirtualTimer tmr; + +/** + * @brief Debounce counter. + */ +static unsigned cnt; + +/** + * @brief Card event sources. + */ +static EventSource inserted_event, removed_event; + +/** + * @brief Inserion monitor function. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +static bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { + + return TRUE; +} + +/** + * @brief Inserion monitor timer callback function. + * + * @param[in] p pointer to the @p SDCDriver object + * + * @notapi + */ +static void tmrfunc(void *p) { + SDCDriver *sdcp = p; + + if (cnt > 0) { + if (sdcIsCardInserted(sdcp)) { + if (--cnt == 0) { + chEvtBroadcastI(&inserted_event); + } + } + else + cnt = SDC_POLLING_INTERVAL; + } + else { + if (!sdcIsCardInserted(sdcp)) { + cnt = SDC_POLLING_INTERVAL; + chEvtBroadcastI(&removed_event); + } + } + chVTSetI(&tmr, MS2ST(SDC_POLLING_DELAY), tmrfunc, sdcp); +} + +/** + * @brief Polling monitor start. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +static void tmr_init(SDCDriver *sdcp) { + + chEvtInit(&inserted_event); + chEvtInit(&removed_event); + chSysLock(); + cnt = SDC_POLLING_INTERVAL; + chVTSetI(&tmr, MS2ST(SDC_POLLING_DELAY), tmrfunc, sdcp); + chSysUnlock(); +} + +/*===========================================================================*/ +/* Main and generic code. */ +/*===========================================================================*/ + /* * Red LED blinker thread, times are in milliseconds. */ @@ -65,6 +148,11 @@ int main(void) { */ sdStart(&SD1, NULL); + /* + * Activates the card insertion monitor. + */ + tmr_init(&SDCD1); + /* * Creates the blinker thread. */ diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 3f0634fc5..afc3a6aba 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -173,6 +173,22 @@ typedef enum { */ #define sdcGetDriverState(sdcp) ((sdcp)->state) +/** + * @brief Returns the card insertion status. + * @note This macro wraps a low level function named + * @p sdc_lld_is_card_inserted(), this function must be + * provided by the application because it is not part of the + * SDC driver. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * @return The card state. + * @retval FALSE card not inserted. + * @retval TRUE card inserted. + * + * @api + */ +#define sdcIsCardInserted(sdcp) (sdc_lld_is_card_inserted(sdcp)) + /** * @brief Returns the write protect status. * @note This macro wraps a low level function named -- cgit v1.2.3 From 6fd3079b30076770c96098929b58818fce2aedc1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 4 Jun 2011 15:41:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3026 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 17 +++++++++++++++-- os/hal/platforms/STM32/sdc_lld.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index 374cf7c4a..f8608ffeb 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -51,9 +51,22 @@ static EventSource inserted_event, removed_event; * * @notapi */ -static bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { +bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { - return TRUE; + return !palReadPad(GPIOF, GPIOF_SD_DETECT); +} + +/** + * @brief Protection detection. + * @note Not supported. + * + * @param[in] sdcp pointer to the @p SDCDriver object + * + * @notapi + */ +bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) { + + return FALSE; } /** diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index a856fbf2b..5466eacad 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -190,6 +190,7 @@ extern "C" { uint8_t *buf, uint32_t n); bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, const uint8_t *buf, uint32_t n); + bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp); bool_t sdc_lld_is_write_protected(SDCDriver *sdcp); #ifdef __cplusplus } -- cgit v1.2.3 From 9b147c25513490e959acf299a0fed9beaee04457 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 5 Jun 2011 07:05:29 +0000 Subject: SDC driver state machine improved. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3027 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 207 ++++++++++++++++++++++++++++++++++ os/hal/dox/sdc.dox | 6 +- os/hal/src/sdc.c | 7 +- 3 files changed, 217 insertions(+), 3 deletions(-) diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index f8608ffeb..49fa093f0 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -18,9 +18,16 @@ along with this program. If not, see . */ +#include +#include + #include "ch.h" #include "hal.h" #include "test.h" +#include "shell.h" +#include "evtimer.h" + +#include "ff.h" /*===========================================================================*/ /* Card insertion monitor. */ @@ -114,10 +121,210 @@ static void tmr_init(SDCDriver *sdcp) { chSysUnlock(); } +/*===========================================================================*/ +/* FatFs related. */ +/*===========================================================================*/ + +/** + * @brief FS object. + */ +FATFS SDC_FS; + +/* FS mounted and ready.*/ +static bool_t fs_ready = FALSE; + +/* Generic large buffer.*/ +uint8_t fbuff[1024]; + +static FRESULT scan_files(char *path) +{ + FRESULT res; + FILINFO fno; + DIR dir; + int i; + char *fn; + + res = f_opendir(&dir, path); + if (res == FR_OK) { + i = strlen(path); + for (;;) { + res = f_readdir(&dir, &fno); + if (res != FR_OK || fno.fname[0] == 0) + break; + if (fno.fname[0] == '.') + continue; + fn = fno.fname; + if (fno.fattrib & AM_DIR) { + sprintf(&path[i], "/%s", fn); + res = scan_files(path); + if (res != FR_OK) + break; + path[i] = 0; + } + else { +// iprintf("%s/%s\r\n", path, fn); + } + } + } + return res; +} + + +/*===========================================================================*/ +/* Command line related. */ +/*===========================================================================*/ + +#define SHELL_WA_SIZE THD_WA_SIZE(2048) +#define TEST_WA_SIZE THD_WA_SIZE(256) + +static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) { + size_t n, size; + char buf[52]; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: mem"); + return; + } + n = chHeapStatus(NULL, &size); + sprintf(buf, "core free memory : %u bytes", chCoreStatus()); + shellPrintLine(chp, buf); + sprintf(buf, "heap fragments : %u", n); + shellPrintLine(chp, buf); + sprintf(buf, "heap free total : %u bytes", size); + shellPrintLine(chp, buf); +} + +static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { + static const char *states[] = { + "READY", + "CURRENT", + "SUSPENDED", + "WTSEM", + "WTMTX", + "WTCOND", + "SLEEPING", + "WTEXIT", + "WTOREVT", + "WTANDEVT", + "SNDMSGQ", + "SNDMSG", + "WTMSG", + "FINAL" + }; + Thread *tp; + char buf[60]; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: threads"); + return; + } + shellPrintLine(chp, " addr stack prio refs state time"); + tp = chRegFirstThread(); + do { + sprintf(buf, "%8lx %8lx %4u %4i %9s %u", + (uint32_t)tp, (uint32_t)tp->p_ctx.r13, + (unsigned int)tp->p_prio, tp->p_refs - 1, + states[tp->p_state], (unsigned int)tp->p_time); + shellPrintLine(chp, buf); + tp = chRegNextThread(tp); + } while (tp != NULL); +} + +static void cmd_test(BaseChannel *chp, int argc, char *argv[]) { + Thread *tp; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: test"); + return; + } + tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(), + TestThread, chp); + if (tp == NULL) { + shellPrintLine(chp, "out of memory"); + return; + } + chThdWait(tp); +} + +static void cmd_tree(BaseChannel *chp, int argc, char *argv[]) { + FRESULT err; + DWORD clusters; + FATFS *fsp; + + (void)argv; + if (argc > 0) { + shellPrintLine(chp, "Usage: tree"); + return; + } + if (!fs_ready) { + shellPrintLine(chp, "File System not mounted"); + return; + } + err = f_getfree("/", &clusters, &fsp); + if (err != FR_OK) { + shellPrintLine(chp, "FS: f_getfree() failed"); + return; + } + sprintf((void *)fbuff, + "FS: %lu free clusters, %lu sectors per cluster, %lu bytes free", + clusters, (uint32_t)SDC_FS.csize, + clusters * (uint32_t)SDC_FS.csize * (uint32_t)SDC_BLOCK_SIZE); + shellPrintLine(chp, (void *)fbuff); + fbuff[0] = 0; + scan_files((char *)fbuff); +} + +static const ShellCommand commands[] = { + {"mem", cmd_mem}, + {"threads", cmd_threads}, + {"test", cmd_test}, + {"tree", cmd_tree}, + {NULL, NULL} +}; + +static const ShellConfig shell_cfg1 = { + (BaseChannel *)&SD2, + commands +}; + /*===========================================================================*/ /* Main and generic code. */ /*===========================================================================*/ +/* + * MMC card insertion event. + */ +static void InsertHandler(eventid_t id) { + FRESULT err; + + (void)id; + /* + * On insertion MMC initialization and FS mount. + */ + if (sdcConnect(&SDCD1)) { + return; + } + err = f_mount(0, &SDC_FS); + if (err != FR_OK) { + sdcDisconnect(&SDCD1); + return; + } + fs_ready = TRUE; +} + +/* + * MMC card removal event. + */ +static void RemoveHandler(eventid_t id) { + + (void)id; + sdcDisconnect(&SDCD1); + fs_ready = FALSE; +} + /* * Red LED blinker thread, times are in milliseconds. */ diff --git a/os/hal/dox/sdc.dox b/os/hal/dox/sdc.dox index 2a18977ff..df88796af 100644 --- a/os/hal/dox/sdc.dox +++ b/os/hal/dox/sdc.dox @@ -52,9 +52,10 @@ stop -> stop [label="\nsdcStop()"]; stop -> ready [label="\nsdcStart()"]; ready -> stop [label="\nsdcStop()"]; - ready -> ready [label="\nsdcStart()"]; + ready -> ready [label="\nsdcStart()\nsdcDisconnect()"]; ready -> connecting [label="\nsdcConnect()"]; connecting -> active [label="\nconnection\nsuccessful"]; + connecting -> active [label="\nsdcConnect()", dir="back"]; connecting -> ready [label="\nconnection\nfailed"]; disconnecting -> active [label="\nsdcDisconnect()", dir="back"]; ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"]; @@ -85,9 +86,10 @@ stop -> stop [label="\nsdcStop()"]; stop -> ready [label="\nsdcStart()"]; ready -> stop [label="\nsdcStop()"]; - ready -> ready [label="\nsdcStart()"]; + ready -> ready [label="\nsdcStart()\nsdcDisconnect()"]; ready -> connecting [label="\nsdcConnect()"]; connecting -> active [label="\nconnection\nsuccessful"]; + connecting -> active [label="\nsdcConnect()", dir="back"]; connecting -> ready [label="\nconnection\nfailed"]; disconnecting -> active [label="\nsdcDisconnect()", dir="back"]; ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"]; diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index a7a39c268..08c667df4 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -169,7 +169,8 @@ bool_t sdcConnect(SDCDriver *sdcp) { chDbgCheck(sdcp != NULL, "sdcConnect"); chSysLock(); - chDbgAssert(sdcp->state == SDC_READY, "mmcConnect(), #1", "invalid state"); + chDbgAssert((sdcp->state == SDC_READY) || (sdcp->state == SDC_ACTIVE), + "mmcConnect(), #1", "invalid state"); sdcp->state = SDC_CONNECTING; chSysUnlock(); @@ -302,6 +303,10 @@ bool_t sdcDisconnect(SDCDriver *sdcp) { chSysLock(); chDbgAssert(sdcp->state == SDC_ACTIVE, "sdcDisconnect(), #1", "invalid state"); + if (sdcp->state == SDC_READY) { + chSysUnlock(); + return FALSE; + } sdcp->state = SDC_DISCONNECTING; chSysUnlock(); -- cgit v1.2.3 From 03b4c7ddcb08a565104c91859f51e56e513e3fd0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 5 Jun 2011 08:39:49 +0000 Subject: FatFs demo for the STM32F103ZG using the SDC driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3028 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 40 ++++++++++++++++++++++++-------- demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h | 2 +- os/hal/platforms/STM32/sdc_lld.c | 3 ++- os/hal/src/sdc.c | 6 +++-- readme.txt | 4 +++- 5 files changed, 40 insertions(+), 15 deletions(-) diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index 49fa093f0..fc128abb8 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -286,7 +286,7 @@ static const ShellCommand commands[] = { }; static const ShellConfig shell_cfg1 = { - (BaseChannel *)&SD2, + (BaseChannel *)&SD1, commands }; @@ -302,11 +302,11 @@ static void InsertHandler(eventid_t id) { (void)id; /* - * On insertion MMC initialization and FS mount. + * On insertion SDC initialization and FS mount. */ - if (sdcConnect(&SDCD1)) { + if (sdcConnect(&SDCD1)) return; - } + err = f_mount(0, &SDC_FS); if (err != FR_OK) { sdcDisconnect(&SDCD1); @@ -321,7 +321,8 @@ static void InsertHandler(eventid_t id) { static void RemoveHandler(eventid_t id) { (void)id; - sdcDisconnect(&SDCD1); + if (sdcGetDriverState(&SDCD1) == SDC_ACTIVE) + sdcDisconnect(&SDCD1); fs_ready = FALSE; } @@ -352,6 +353,12 @@ static msg_t Thread1(void *arg) { * Application entry point. */ int main(void) { + static const evhandler_t evhndl[] = { + InsertHandler, + RemoveHandler + }; + Thread *shelltp = NULL; + struct EventListener el0, el1; /* * System initializations. @@ -364,9 +371,16 @@ int main(void) { chSysInit(); /* - * Activates the serial driver 1 using the driver default configuration. + * Activates the serial driver 1 and SDC driver 1 using default + * configuration. */ sdStart(&SD1, NULL); + sdcStart(&SDCD1, NULL); + + /* + * Shell manager initialization. + */ + shellInit(); /* * Activates the card insertion monitor. @@ -380,11 +394,17 @@ int main(void) { /* * Normal main() thread activity, in this demo it does nothing except - * sleeping in a loop and check the button state. + * sleeping in a loop and listen for events. */ + chEvtRegister(&inserted_event, &el0, 0); + chEvtRegister(&removed_event, &el1, 1); while (TRUE) { - if (!palReadPad(GPIOG, GPIOG_USER_BUTTON)) - TestThread(&SD1); - chThdSleepMilliseconds(500); + if (!shelltp) + shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); + else if (chThdTerminated(shelltp)) { + chThdRelease(shelltp); /* Recovers memory of the previous shell. */ + shelltp = NULL; /* Triggers spawning of a new shell. */ + } + chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS)); } } diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h b/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h index 05b5e167d..c8498a9a1 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h +++ b/demos/ARMCM3-STM32F103ZG-FATFS/mcuconf.h @@ -114,7 +114,7 @@ * SERIAL driver system settings. */ #define STM32_SERIAL_USE_USART1 TRUE -#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART2 FALSE #define STM32_SERIAL_USE_USART3 FALSE #define STM32_SERIAL_USE_UART4 FALSE #define STM32_SERIAL_USE_UART5 FALSE diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index c790f49d9..a88ad53fa 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -422,7 +422,8 @@ void sdc_lld_init(void) { /** * @brief Configures and activates the SDC peripheral. * - * @param[in] sdcp pointer to the @p SDCDriver object + * @param[in] sdcp pointer to the @p SDCDriver object, must be @p NULL, + * this driver does not require any configuration * * @notapi */ diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 08c667df4..283a0ee75 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -113,13 +113,15 @@ void sdcObjectInit(SDCDriver *sdcp) { * @brief Configures and activates the SDC peripheral. * * @param[in] sdcp pointer to the @p SDCDriver object - * @param[in] config pointer to the @p SDCConfig object + * @param[in] config pointer to the @p SDCConfig object, can be @p NULL if + * the driver supports a default configuration or + * requires no configuration * * @api */ void sdcStart(SDCDriver *sdcp, const SDCConfig *config) { - chDbgCheck((sdcp != NULL) && (config != NULL), "sdcStart"); + chDbgCheck(sdcp != NULL, "sdcStart"); chSysLock(); chDbgAssert((sdcp->state == SDC_STOP) || (sdcp->state == SDC_READY), diff --git a/readme.txt b/readme.txt index d34771906..f41d627cf 100644 --- a/readme.txt +++ b/readme.txt @@ -73,8 +73,10 @@ *** 2.3.4 *** - FIX: Fixed wrong macro definition in ARMv6-M architecture files (bug 3310084). +- NEW: FatFs demo for the STM32F103ZG using the SDC driver (untested). - NEW: Now the STM32 SDC driver supports unaligned buffers transparently. - Optimized the driver for single block read and write operations. + Optimized the driver for single block read and write operations. Optimized + the driver state machine. - NEW: Finished the reorganization of the Cortex-Mx ports, now also the IAR and RVCT ports support the new Compact mode. - NEW: Added to the ARMv6-M sub-port an option to use the PendSV exception -- cgit v1.2.3 From 079f323649c9adcbb49791903f357fb90681628e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 5 Jun 2011 18:19:05 +0000 Subject: Fixed bug 3311999. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3029 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103/halconf.h | 2 +- os/hal/platforms/STM32/uart_lld.h | 12 ++++++------ readme.txt | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/demos/ARMCM3-STM32F103/halconf.h b/demos/ARMCM3-STM32F103/halconf.h index d36e56ec7..d784e5233 100644 --- a/demos/ARMCM3-STM32F103/halconf.h +++ b/demos/ARMCM3-STM32F103/halconf.h @@ -129,7 +129,7 @@ * @brief Enables the UART subsystem. */ #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE +#define HAL_USE_UART TRUE #endif /** diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h index f24cd7b79..9321df85c 100644 --- a/os/hal/platforms/STM32/uart_lld.h +++ b/os/hal/platforms/STM32/uart_lld.h @@ -69,21 +69,21 @@ /** * @brief USART1 interrupt priority level setting. */ -#if !defined(STM32_UART_USART1_IRQ_PRIO) || defined(__DOXYGEN__) +#if !defined(STM32_UART_USART1_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_UART_USART1_IRQ_PRIORITY 12 #endif /** * @brief USART2 interrupt priority level setting. */ -#if !defined(STM32_UART_USART2_IRQ_PRIO) || defined(__DOXYGEN__) +#if !defined(STM32_UART_USART2_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_UART_USART2_IRQ_PRIORITY 12 #endif /** * @brief USART3 interrupt priority level setting. */ -#if !defined(STM32_UART_USART3_IRQ_PRIO) || defined(__DOXYGEN__) +#if !defined(STM32_UART_USART3_IRQ_PRIORITY) || defined(__DOXYGEN__) #define STM32_UART_USART3_IRQ_PRIORITY 12 #endif @@ -93,7 +93,7 @@ * because of the channels ordering the RX channel has always priority * over the TX channel. */ -#if !defined(STM32_UART_USART1_DMA_PRIO) || defined(__DOXYGEN__) +#if !defined(STM32_UART_USART1_DMA_PRIORITY) || defined(__DOXYGEN__) #define STM32_UART_USART1_DMA_PRIORITY 0 #endif @@ -103,7 +103,7 @@ * because of the channels ordering the RX channel has always priority * over the TX channel. */ -#if !defined(STM32_UART_USART2_DMA_PRIO) || defined(__DOXYGEN__) +#if !defined(STM32_UART_USART2_DMA_PRIORITY) || defined(__DOXYGEN__) #define STM32_UART_USART2_DMA_PRIORITY 0 #endif /** @@ -112,7 +112,7 @@ * because of the channels ordering the RX channel has always priority * over the TX channel. */ -#if !defined(STM32_UART_USART3_DMA_PRIO) || defined(__DOXYGEN__) +#if !defined(STM32_UART_USART3_DMA_PRIORITY) || defined(__DOXYGEN__) #define STM32_UART_USART3_DMA_PRIORITY 0 #endif diff --git a/readme.txt b/readme.txt index f41d627cf..a223679d1 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,8 @@ ***************************************************************************** *** 2.3.4 *** +- FIX: Fixed wrong macro check in STM32 UART driver (bug 3311999)(backported + to 2.2.6). - FIX: Fixed wrong macro definition in ARMv6-M architecture files (bug 3310084). - NEW: FatFs demo for the STM32F103ZG using the SDC driver (untested). -- cgit v1.2.3 From ed8a14e6880b1ec6f065c6267d4ee86ae1cdb745 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 6 Jun 2011 09:33:47 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3031 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile | 2 +- demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 3 - demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h | 9 +++ demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c | 88 ++++++++++++++------- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h | 25 +----- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk | 71 +++++++++-------- demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c | 10 ++- ext/lwip-1.4.0.zip | Bin 0 -> 613916 bytes ext/readme.txt | 4 +- 9 files changed, 117 insertions(+), 95 deletions(-) create mode 100644 ext/lwip-1.4.0.zip diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile b/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile index 4caf96ebf..b181251e7 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile @@ -150,7 +150,7 @@ CPPWARN = -Wall -Wextra # # List all default C defines here, like -D_DEBUG=1 -DDEFS = -DLWIP_PROVIDE_ERRNO +DDEFS = # List all default ASM defines here, like -D_DEBUG=1 DADEFS = diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index 496dcf2ab..202dfc511 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -435,8 +435,6 @@ #define THREAD_EXT_FIELDS \ struct { \ /* Add threads custom fields here.*/ \ - /* Space for the LWIP sys_timeouts structure.*/ \ - void *p_lwipspace[1]; \ }; #endif @@ -450,7 +448,6 @@ struct { \ #if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) #define THREAD_EXT_INIT_HOOK(tp) { \ /* Add threads initialization code here.*/ \ - (tp)->p_lwipspace[0] = NULL; \ } #endif diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h index b90b447e2..ecac81e09 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h @@ -71,5 +71,14 @@ typedef uint32_t mem_ptr_t; } #define BYTE_ORDER LITTLE_ENDIAN +#define LWIP_PROVIDE_ERRNO + +#define PACK_STRUCT_BEGIN +#ifdef PACK_STRUCT_STRUCT +#undef PACK_STRUCT_STRUCT +#endif +#define PACK_STRUCT_STRUCT __attribute__ ((__packed__)) +#define PACK_STRUCT_END +#define PACK_STRUCT_FIELD(x) x #endif /* __CC_H__ */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c index 082f2db4d..7e0212df7 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c @@ -52,6 +52,8 @@ * */ +// see http://lwip.wikia.com/wiki/Porting_for_an_OS for instructions + #include "ch.h" #include "lwip/opt.h" @@ -66,37 +68,39 @@ void sys_init(void) { } -sys_sem_t sys_sem_new(u8_t count) { +err_t sys_sem_new(sys_sem_t *sem, u8_t count) { - sys_sem_t sem = chHeapAlloc(NULL, sizeof(Semaphore)); - if (sem == 0) { + *sem = chHeapAlloc(NULL, sizeof(Semaphore)); + if (*sem == 0) { SYS_STATS_INC(sem.err); + return ERR_MEM; } else { - chSemInit(sem, (cnt_t)count); + chSemInit(*sem, (cnt_t)count); SYS_STATS_INC(sem.used); + return ERR_OK; } - return sem; } -void sys_sem_free(sys_sem_t sem) { +void sys_sem_free(sys_sem_t *sem) { - chHeapFree(sem); + chHeapFree(*sem); + *sem = SYS_SEM_NULL; SYS_STATS_DEC(sem.used); } -void sys_sem_signal(sys_sem_t sem) { +void sys_sem_signal(sys_sem_t *sem) { - chSemSignal(sem); + chSemSignal(*sem); } -u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout) { +u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) { systime_t time, tmo; chSysLock(); tmo = timeout > 0 ? (systime_t)timeout : TIME_INFINITE; time = chTimeNow(); - if (chSemWaitTimeoutS(sem, tmo) != RDY_OK) + if (chSemWaitTimeoutS(*sem, tmo) != RDY_OK) time = SYS_ARCH_TIMEOUT; else time = chTimeNow() - time; @@ -104,44 +108,65 @@ u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout) { return time; } -sys_mbox_t sys_mbox_new(int size) { +int sys_sem_valid(sys_sem_t *sem) { + return *sem != SYS_SEM_NULL; +} + +// typically called within lwIP after freeing a semaphore +// to make sure the pointer is not left pointing to invalid data +void sys_sem_set_invalid(sys_sem_t *sem) { + *sem = SYS_SEM_NULL; +} + +err_t sys_mbox_new(sys_mbox_t *mbox, int size) { - sys_mbox_t mbox = chHeapAlloc(NULL, sizeof(Mailbox) + sizeof(msg_t) * size); - if (mbox == 0) { + *mbox = chHeapAlloc(NULL, sizeof(Mailbox) + sizeof(msg_t) * size); + if (*mbox == 0) { SYS_STATS_INC(mbox.err); + return ERR_MEM; } else { - chMBInit(mbox, (void *)(((uint8_t *)mbox) + sizeof(Mailbox)), size); + chMBInit(*mbox, (void *)(((uint8_t *)*mbox) + sizeof(Mailbox)), size); SYS_STATS_INC(mbox.used); + return ERR_OK; } - return mbox; } -void sys_mbox_free(sys_mbox_t mbox) { +void sys_mbox_free(sys_mbox_t *mbox) { - chHeapFree(mbox); + if (chMBGetUsedCountI(*mbox) != 0) { + // If there are messages still present in the mailbox when the mailbox + // is deallocated, it is an indication of a programming error in lwIP + // and the developer should be notified. + SYS_STATS_INC(mbox.err); + chMBReset(*mbox); + } + chHeapFree(*mbox); + *mbox = SYS_MBOX_NULL; SYS_STATS_DEC(mbox.used); } -void sys_mbox_post(sys_mbox_t mbox, void *msg) { +void sys_mbox_post(sys_mbox_t *mbox, void *msg) { - chMBPost(mbox, (msg_t)msg, TIME_INFINITE); + chMBPost(*mbox, (msg_t)msg, TIME_INFINITE); } -err_t sys_mbox_trypost(sys_mbox_t mbox, void *msg) { +err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg) { - if (chMBPost(mbox, (msg_t)msg, TIME_IMMEDIATE) == RDY_TIMEOUT) + if (chMBPost(*mbox, (msg_t)msg, TIME_IMMEDIATE) == RDY_TIMEOUT) { + SYS_STATS_INC(mbox.err); return ERR_MEM; + } return ERR_OK; } -u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout) { +u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) { systime_t time, tmo; chSysLock(); tmo = timeout > 0 ? (systime_t)timeout : TIME_INFINITE; time = chTimeNow(); - if (chMBFetchS(mbox, (msg_t *)msg, tmo) != RDY_OK) + if (chMBFetchS(*mbox, (msg_t *)msg, tmo) != RDY_OK) time = SYS_ARCH_TIMEOUT; else time = chTimeNow() - time; @@ -149,19 +174,24 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout) { return time; } -u32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg) { +u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) { - if (chMBFetch(mbox, (msg_t *)msg, TIME_IMMEDIATE) == RDY_TIMEOUT) + if (chMBFetch(*mbox, (msg_t *)msg, TIME_IMMEDIATE) == RDY_TIMEOUT) return SYS_MBOX_EMPTY; return 0; } -struct sys_timeouts *sys_arch_timeouts(void) { +int sys_mbox_valid(sys_mbox_t *mbox) { + return *mbox != SYS_MBOX_NULL; +} - return (struct sys_timeouts *)currp->p_lwipspace; +// typically called within lwIP after freeing an mbox +// to make sure the pointer is not left pointing to invalid data +void sys_mbox_set_invalid(sys_mbox_t *mbox) { + *mbox = SYS_MBOX_NULL; } -sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), +sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio) { (void)name; size_t wsz = THD_WA_SIZE(stacksize); diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h index 229ff6638..5c287b243 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h @@ -66,28 +66,7 @@ typedef int sys_prot_t; #define SYS_THREAD_NULL (Thread *)0 #define SYS_SEM_NULL (Semaphore *)0 -void sys_init(void); -sys_sem_t sys_sem_new(u8_t count); -void sys_sem_free(sys_sem_t sem); -void sys_sem_signal(sys_sem_t sem); -u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout); - -sys_mbox_t sys_mbox_new(int size); -void sys_mbox_free(sys_mbox_t mbox); -void sys_mbox_post(sys_mbox_t mbox, void *msg); -err_t sys_mbox_trypost(sys_mbox_t mbox, void *msg); -u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout); -u32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg); - -struct sys_timeouts *sys_arch_timeouts(void); - -sys_thread_t sys_thread_new(char *name, - void (* thread)(void *arg), - void *arg, - int stacksize, - int prio); - -sys_prot_t sys_arch_protect(void); -void sys_arch_unprotect(sys_prot_t pval); +/* let sys.h use binary semaphores for mutexes */ +#define LWIP_COMPAT_MUTEX 1 #endif /* __SYS_ARCH_H__ */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk index 99a046b9d..55a9bf7f4 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk @@ -1,44 +1,47 @@ # List of the required lwIP files. +LWIP = ${CHIBIOS}/ext/lwip-1.4.0 + LWNETIFSRC = \ - ${CHIBIOS}/ext/lwip/src/netif/etharp.c \ - ${CHIBIOS}/ext/lwip/src/netif/loopif.c + ${LWIP}/src/netif/etharp.c LWCORESRC = \ - ${CHIBIOS}/ext/lwip/src/core/dhcp.c \ - ${CHIBIOS}/ext/lwip/src/core/dns.c \ - ${CHIBIOS}/ext/lwip/src/core/init.c \ - ${CHIBIOS}/ext/lwip/src/core/mem.c \ - ${CHIBIOS}/ext/lwip/src/core/memp.c \ - ${CHIBIOS}/ext/lwip/src/core/netif.c \ - ${CHIBIOS}/ext/lwip/src/core/pbuf.c \ - ${CHIBIOS}/ext/lwip/src/core/raw.c \ - ${CHIBIOS}/ext/lwip/src/core/stats.c \ - ${CHIBIOS}/ext/lwip/src/core/sys.c \ - ${CHIBIOS}/ext/lwip/src/core/tcp.c \ - ${CHIBIOS}/ext/lwip/src/core/tcp_in.c \ - ${CHIBIOS}/ext/lwip/src/core/tcp_out.c \ - ${CHIBIOS}/ext/lwip/src/core/udp.c + ${LWIP}/src/core/dhcp.c \ + ${LWIP}/src/core/dns.c \ + ${LWIP}/src/core/init.c \ + ${LWIP}/src/core/mem.c \ + ${LWIP}/src/core/memp.c \ + ${LWIP}/src/core/netif.c \ + ${LWIP}/src/core/pbuf.c \ + ${LWIP}/src/core/raw.c \ + ${LWIP}/src/core/stats.c \ + ${LWIP}/src/core/sys.c \ + ${LWIP}/src/core/tcp.c \ + ${LWIP}/src/core/tcp_in.c \ + ${LWIP}/src/core/tcp_out.c \ + ${LWIP}/src/core/udp.c LWIPV4SRC = \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/autoip.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/icmp.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/igmp.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/inet.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/inet_chksum.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/ip.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/ip_addr.c \ - ${CHIBIOS}/ext/lwip/src/core/ipv4/ip_frag.c + ${LWIP}/src/core/ipv4/autoip.c \ + ${LWIP}/src/core/ipv4/icmp.c \ + ${LWIP}/src/core/ipv4/igmp.c \ + ${LWIP}/src/core/ipv4/inet.c \ + ${LWIP}/src/core/ipv4/inet_chksum.c \ + ${LWIP}/src/core/ipv4/ip.c \ + ${LWIP}/src/core/ipv4/ip_addr.c \ + ${LWIP}/src/core/ipv4/ip_frag.c \ + ${LWIP}/src/core/def.c \ + ${LWIP}/src/core/timers.c LWAPISRC = \ - ${CHIBIOS}/ext/lwip/src/api/api_lib.c \ - ${CHIBIOS}/ext/lwip/src/api/api_msg.c \ - ${CHIBIOS}/ext/lwip/src/api/err.c \ - ${CHIBIOS}/ext/lwip/src/api/netbuf.c \ - ${CHIBIOS}/ext/lwip/src/api/netdb.c \ - ${CHIBIOS}/ext/lwip/src/api/netifapi.c \ - ${CHIBIOS}/ext/lwip/src/api/sockets.c \ - ${CHIBIOS}/ext/lwip/src/api/tcpip.c + ${LWIP}/src/api/api_lib.c \ + ${LWIP}/src/api/api_msg.c \ + ${LWIP}/src/api/err.c \ + ${LWIP}/src/api/netbuf.c \ + ${LWIP}/src/api/netdb.c \ + ${LWIP}/src/api/netifapi.c \ + ${LWIP}/src/api/sockets.c \ + ${LWIP}/src/api/tcpip.c LWINC = \ - ${CHIBIOS}/ext/lwip/src/include \ - ${CHIBIOS}/ext/lwip/src/include/ipv4 + ${LWIP}/src/include \ + ${LWIP}/src/include/ipv4 diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c index bc8984459..3430fc5b6 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c @@ -47,12 +47,13 @@ static void http_server_serve(struct netconn *conn) { struct netbuf *inbuf; char *buf; u16_t buflen; + err_t err; /* Read the data from the port, blocking if nothing yet there. We assume the request (the part we care about) is in one netbuf */ - inbuf = netconn_recv(conn); + err = netconn_recv(conn, &inbuf); - if (netconn_err(conn) == ERR_OK) { + if (err == ERR_OK) { netbuf_data(inbuf, (void **)&buf, &buflen); /* Is this an HTTP GET command? (only check the first 5 chars, since @@ -92,6 +93,7 @@ WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE); */ msg_t http_server(void *p) { struct netconn *conn, *newconn; + err_t err; (void)p; @@ -109,7 +111,9 @@ msg_t http_server(void *p) { chThdSetPriority(WEB_THREAD_PRIORITY); while(1) { - newconn = netconn_accept(conn); + err = netconn_accept(conn, &newconn); + if (err != ERR_OK) + continue; http_server_serve(newconn); netconn_delete(newconn); } diff --git a/ext/lwip-1.4.0.zip b/ext/lwip-1.4.0.zip new file mode 100644 index 000000000..3dbe92da4 Binary files /dev/null and b/ext/lwip-1.4.0.zip differ diff --git a/ext/readme.txt b/ext/readme.txt index f1715c1ca..5c8a76b2e 100644 --- a/ext/readme.txt +++ b/ext/readme.txt @@ -10,7 +10,7 @@ instructions contained in the various distributions. The currently included items are: 1. uip-1.0, a minimal TCP/IP implementation: http://www.sics.se/~adam/uip/ -2. lwip-1.3.1, lightweight TCP/IP stack: http://savannah.nongnu.org/projects/lwip/ +2. lwip-1.4.0, lightweight TCP/IP stack: http://savannah.nongnu.org/projects/lwip/ 3. STM32 firmware library 3.3.0 (partial, library only) the full download is available from http://www.st.com 4. FatFS 0.7e (patched), the original version is available from @@ -21,7 +21,7 @@ and without any modification, in order to use the libraries unpack them under ./ext as: ./ext/uip-1.0 -./ext/lwip +./ext/lwip-1.4.0 ./ext/stm32lib ./ext/fatfs -- cgit v1.2.3 From d553080cd9142be3c97cfa17299f32c5c7409a57 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 6 Jun 2011 17:17:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3032 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/Makefile | 5 ++++- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 32 +++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/Makefile b/demos/ARMCM3-STM32F103ZG-FATFS/Makefile index d7a8b7490..ad79ee3e8 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/Makefile +++ b/demos/ARMCM3-STM32F103ZG-FATFS/Makefile @@ -73,8 +73,10 @@ CSRC = $(PORTSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ + $(FATFSSRC) \ $(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/syscalls.c \ + $(CHIBIOS)/os/various/shell.c \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -106,6 +108,7 @@ ASMSRC = $(PORTASM) INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(FATFSINC) \ $(CHIBIOS)/os/various # @@ -154,7 +157,7 @@ CPPWARN = -Wall -Wextra # # List all default C defines here, like -D_DEBUG=1 -DDEFS = +DDEFS = -DSTDOUT_SD=SD1 -DSTDIN_SD=SD1 # List all default ASM defines here, like -D_DEBUG=1 DADEFS = diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index fc128abb8..2ef7a40cc 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -60,6 +60,7 @@ static EventSource inserted_event, removed_event; */ bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { + (void)sdcp; return !palReadPad(GPIOF, GPIOF_SD_DETECT); } @@ -73,6 +74,7 @@ bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { */ bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) { + (void)sdcp; return FALSE; } @@ -155,14 +157,14 @@ static FRESULT scan_files(char *path) continue; fn = fno.fname; if (fno.fattrib & AM_DIR) { - sprintf(&path[i], "/%s", fn); + siprintf(&path[i], "/%s", fn); res = scan_files(path); if (res != FR_OK) break; path[i] = 0; } else { -// iprintf("%s/%s\r\n", path, fn); + iprintf("%s/%s\r\n", path, fn); } } } @@ -187,11 +189,11 @@ static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) { return; } n = chHeapStatus(NULL, &size); - sprintf(buf, "core free memory : %u bytes", chCoreStatus()); + siprintf(buf, "core free memory : %u bytes", chCoreStatus()); shellPrintLine(chp, buf); - sprintf(buf, "heap fragments : %u", n); + siprintf(buf, "heap fragments : %u", n); shellPrintLine(chp, buf); - sprintf(buf, "heap free total : %u bytes", size); + siprintf(buf, "heap free total : %u bytes", size); shellPrintLine(chp, buf); } @@ -223,10 +225,10 @@ static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) { shellPrintLine(chp, " addr stack prio refs state time"); tp = chRegFirstThread(); do { - sprintf(buf, "%8lx %8lx %4u %4i %9s %u", - (uint32_t)tp, (uint32_t)tp->p_ctx.r13, - (unsigned int)tp->p_prio, tp->p_refs - 1, - states[tp->p_state], (unsigned int)tp->p_time); + siprintf(buf, "%8lx %8lx %4u %4i %9s %u", + (uint32_t)tp, (uint32_t)tp->p_ctx.r13, + (unsigned int)tp->p_prio, tp->p_refs - 1, + states[tp->p_state], (unsigned int)tp->p_time); shellPrintLine(chp, buf); tp = chRegNextThread(tp); } while (tp != NULL); @@ -268,10 +270,10 @@ static void cmd_tree(BaseChannel *chp, int argc, char *argv[]) { shellPrintLine(chp, "FS: f_getfree() failed"); return; } - sprintf((void *)fbuff, - "FS: %lu free clusters, %lu sectors per cluster, %lu bytes free", - clusters, (uint32_t)SDC_FS.csize, - clusters * (uint32_t)SDC_FS.csize * (uint32_t)SDC_BLOCK_SIZE); + siprintf((void *)fbuff, + "FS: %lu free clusters, %lu sectors per cluster, %lu bytes free", + clusters, (uint32_t)SDC_FS.csize, + clusters * (uint32_t)SDC_FS.csize * (uint32_t)SDC_BLOCK_SIZE); shellPrintLine(chp, (void *)fbuff); fbuff[0] = 0; scan_files((char *)fbuff); @@ -295,7 +297,7 @@ static const ShellConfig shell_cfg1 = { /*===========================================================================*/ /* - * MMC card insertion event. + * SD card insertion event. */ static void InsertHandler(eventid_t id) { FRESULT err; @@ -316,7 +318,7 @@ static void InsertHandler(eventid_t id) { } /* - * MMC card removal event. + * SD card removal event. */ static void RemoveHandler(eventid_t id) { -- cgit v1.2.3 From 7e6b563be04bf76ffedf20c8bcd4f0e946875007 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 6 Jun 2011 17:53:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3033 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index a223679d1..e2878c4bb 100644 --- a/readme.txt +++ b/readme.txt @@ -75,7 +75,7 @@ to 2.2.6). - FIX: Fixed wrong macro definition in ARMv6-M architecture files (bug 3310084). -- NEW: FatFs demo for the STM32F103ZG using the SDC driver (untested). +- NEW: FatFs demo for the STM32F103ZG using the SDC driver. - NEW: Now the STM32 SDC driver supports unaligned buffers transparently. Optimized the driver for single block read and write operations. Optimized the driver state machine. -- cgit v1.2.3 From aec912f13f9aa85cd677353fa556f679c3832970 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 6 Jun 2011 18:15:38 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3034 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ext/ff007e-patched.zip | Bin 634222 -> 634416 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ext/ff007e-patched.zip b/ext/ff007e-patched.zip index e6aab7a8b..37a014cdf 100644 Binary files a/ext/ff007e-patched.zip and b/ext/ff007e-patched.zip differ -- cgit v1.2.3
-
ChibiOS/RT 2.3.1
+
ChibiOS/RT
2.3.1
+
+ +