diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-10-04 07:57:37 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-10-04 07:57:37 +0000 |
commit | c74da79d45345de8f393a07a64a87f24b01d4049 (patch) | |
tree | a14831422f0153590f4123e47b152d68fd4919d8 | |
parent | d05fb1e4fff0f89de2c6a68ee2b989770f769f24 (diff) | |
download | ChibiOS-c74da79d45345de8f393a07a64a87f24b01d4049.tar.gz ChibiOS-c74da79d45345de8f393a07a64a87f24b01d4049.tar.bz2 ChibiOS-c74da79d45345de8f393a07a64a87f24b01d4049.zip |
Fixed bug #539.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7359 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/include/mac.h | 2 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/mac_lld.c | 22 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/mac_lld.h | 4 | ||||
-rw-r--r-- | os/hal/src/mac.c | 6 |
4 files changed, 17 insertions, 17 deletions
diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h index 40e52c394..e418f5bb8 100644 --- a/os/hal/include/mac.h +++ b/os/hal/include/mac.h @@ -202,7 +202,7 @@ extern "C" { MACReceiveDescriptor *rdp,
systime_t time);
void macReleaseReceiveDescriptor(MACReceiveDescriptor *rdp);
- bool_t macPollLinkStatus(MACDriver *macp);
+ bool macPollLinkStatus(MACDriver *macp);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/ports/STM32/LLD/mac_lld.c b/os/hal/ports/STM32/LLD/mac_lld.c index 67b8a70cf..746eccd78 100644 --- a/os/hal/ports/STM32/LLD/mac_lld.c +++ b/os/hal/ports/STM32/LLD/mac_lld.c @@ -216,7 +216,7 @@ void mac_lld_init(void) { unsigned i;
macObjectInit(ÐD1);
- ETHD1.link_up = FALSE;
+ ETHD1.link_up = false;
/* Descriptor tables are initialized in chained mode, note that the first
word is not initialized here but in mac_lld_start().*/
@@ -252,7 +252,7 @@ void mac_lld_init(void) { rccResetETH();
/* MAC clocks temporary activation.*/
- rccEnableETH(FALSE);
+ rccEnableETH(false);
/* PHY address setup.*/
#if defined(BOARD_PHY_ADDRESS)
@@ -280,7 +280,7 @@ void mac_lld_init(void) { #endif
/* MAC clocks stopped again.*/
- rccDisableETH(FALSE);
+ rccDisableETH(false);
}
/**
@@ -302,7 +302,7 @@ void mac_lld_start(MACDriver *macp) { macp->txptr = (stm32_eth_tx_descriptor_t *)td;
/* MAC clocks activation and commanded reset procedure.*/
- rccEnableETH(FALSE);
+ rccEnableETH(false);
#if defined(STM32_MAC_DMABMR_SR)
ETH->DMABMR |= ETH_DMABMR_SR;
while(ETH->DMABMR & ETH_DMABMR_SR)
@@ -381,7 +381,7 @@ void mac_lld_stop(MACDriver *macp) { ETH->DMASR = ETH->DMASR;
/* MAC clocks stopped.*/
- rccDisableETH(FALSE);
+ rccDisableETH(false);
/* ISR vector disabled.*/
nvicDisableVector(ETH_IRQn);
@@ -549,12 +549,12 @@ void mac_lld_release_receive_descriptor(MACReceiveDescriptor *rdp) { *
* @param[in] macp pointer to the @p MACDriver object
* @return The link status.
- * @retval TRUE if the link is active.
- * @retval FALSE if the link is down.
+ * @retval true if the link is active.
+ * @retval false if the link is down.
*
* @notapi
*/
-bool_t mac_lld_poll_link_status(MACDriver *macp) {
+bool mac_lld_poll_link_status(MACDriver *macp) {
uint32_t maccr, bmsr, bmcr;
maccr = ETH->MACCR;
@@ -571,7 +571,7 @@ bool_t mac_lld_poll_link_status(MACDriver *macp) { /* Auto-negotiation must be finished without faults and link established.*/
if ((bmsr & (BMSR_LSTATUS | BMSR_RFAULT | BMSR_ANEGCOMPLETE)) !=
(BMSR_LSTATUS | BMSR_ANEGCOMPLETE))
- return macp->link_up = FALSE;
+ return macp->link_up = false;
/* Auto-negotiation enabled, checks the LPA register.*/
lpa = mii_read(macp, MII_LPA);
@@ -591,7 +591,7 @@ bool_t mac_lld_poll_link_status(MACDriver *macp) { else {
/* Link must be established.*/
if (!(bmsr & BMSR_LSTATUS))
- return macp->link_up = FALSE;
+ return macp->link_up = false;
/* Check on link speed.*/
if (bmcr & BMCR_SPEED100)
@@ -610,7 +610,7 @@ bool_t mac_lld_poll_link_status(MACDriver *macp) { ETH->MACCR = maccr;
/* Returns the link status.*/
- return macp->link_up = TRUE;
+ return macp->link_up = true;
}
/**
diff --git a/os/hal/ports/STM32/LLD/mac_lld.h b/os/hal/ports/STM32/LLD/mac_lld.h index 0817ac9de..362678ab3 100644 --- a/os/hal/ports/STM32/LLD/mac_lld.h +++ b/os/hal/ports/STM32/LLD/mac_lld.h @@ -260,7 +260,7 @@ struct MACDriver { /**
* @brief Link status flag.
*/
- bool_t link_up;
+ bool link_up;
/**
* @brief PHY address (pre shifted).
*/
@@ -339,7 +339,7 @@ extern "C" { msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp);
void mac_lld_release_receive_descriptor(MACReceiveDescriptor *rdp);
- bool_t mac_lld_poll_link_status(MACDriver *macp);
+ bool mac_lld_poll_link_status(MACDriver *macp);
size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
uint8_t *buf,
size_t size);
diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c index 738a5ad84..66f10131f 100644 --- a/os/hal/src/mac.c +++ b/os/hal/src/mac.c @@ -250,12 +250,12 @@ void macReleaseReceiveDescriptor(MACReceiveDescriptor *rdp) { *
* @param[in] macp pointer to the @p MACDriver object
* @return The link status.
- * @retval TRUE if the link is active.
- * @retval FALSE if the link is down.
+ * @retval true if the link is active.
+ * @retval false if the link is down.
*
* @api
*/
-bool_t macPollLinkStatus(MACDriver *macp) {
+bool macPollLinkStatus(MACDriver *macp) {
osalDbgCheck(macp != NULL);
osalDbgAssert(macp->state == MAC_ACTIVE, "not active");
|