forked from Imagelibrary/rtems
@@ -68,9 +68,11 @@
|
|||||||
/** @defgroup HAL_Exported_Variables HAL Exported Variables
|
/** @defgroup HAL_Exported_Variables HAL Exported Variables
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
#ifndef __rtems__
|
||||||
__IO uint32_t uwTick;
|
__IO uint32_t uwTick;
|
||||||
uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */
|
uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */
|
||||||
HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */
|
HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */
|
||||||
|
#endif /* __rtems__ */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -166,11 +168,13 @@ uint32_t common_system_clock;
|
|||||||
SystemCoreClock = common_system_clock;
|
SystemCoreClock = common_system_clock;
|
||||||
#endif /* DUAL_CORE && CORE_CM4 */
|
#endif /* DUAL_CORE && CORE_CM4 */
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */
|
/* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */
|
||||||
if(HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
|
if(HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/* Init the low level hardware */
|
/* Init the low level hardware */
|
||||||
HAL_MspInit();
|
HAL_MspInit();
|
||||||
@@ -179,6 +183,7 @@ uint32_t common_system_clock;
|
|||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief This function de-Initializes common part of the HAL and stops the systick.
|
* @brief This function de-Initializes common part of the HAL and stops the systick.
|
||||||
* This function is optional.
|
* This function is optional.
|
||||||
@@ -220,7 +225,9 @@ HAL_StatusTypeDef HAL_DeInit(void)
|
|||||||
/* Return function status */
|
/* Return function status */
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the MSP.
|
* @brief Initializes the MSP.
|
||||||
* @retval None
|
* @retval None
|
||||||
@@ -287,6 +294,7 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||||||
/* Return function status */
|
/* Return function status */
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@@ -315,6 +323,7 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief This function is called to increment a global variable "uwTick"
|
* @brief This function is called to increment a global variable "uwTick"
|
||||||
* used as application time base.
|
* used as application time base.
|
||||||
@@ -448,6 +457,7 @@ __weak void HAL_ResumeTick(void)
|
|||||||
/* Enable SysTick Interrupt */
|
/* Enable SysTick Interrupt */
|
||||||
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
|
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the HAL revision
|
* @brief Returns the HAL revision
|
||||||
|
|||||||
@@ -356,8 +356,10 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
/*------------------ MAC, MTL and DMA default Configuration ----------------*/
|
/*------------------ MAC, MTL and DMA default Configuration ----------------*/
|
||||||
ETH_MACDMAConfig(heth);
|
ETH_MACDMAConfig(heth);
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/* SET DSL to 64 bit */
|
/* SET DSL to 64 bit */
|
||||||
MODIFY_REG(heth->Instance->DMACCR, ETH_DMACCR_DSL, ETH_DMACCR_DSL_64BIT);
|
MODIFY_REG(heth->Instance->DMACCR, ETH_DMACCR_DSL, ETH_DMACCR_DSL_64BIT);
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/* Set Receive Buffers Length (must be a multiple of 4) */
|
/* Set Receive Buffers Length (must be a multiple of 4) */
|
||||||
if ((heth->Init.RxBuffLen % 0x4U) != 0x0U)
|
if ((heth->Init.RxBuffLen % 0x4U) != 0x0U)
|
||||||
@@ -427,6 +429,7 @@ HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth)
|
|||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the ETH MSP.
|
* @brief Initializes the ETH MSP.
|
||||||
* @param heth: pointer to a ETH_HandleTypeDef structure that contains
|
* @param heth: pointer to a ETH_HandleTypeDef structure that contains
|
||||||
@@ -441,6 +444,7 @@ __weak void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
|
|||||||
the HAL_ETH_MspInit could be implemented in the user file
|
the HAL_ETH_MspInit could be implemented in the user file
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DeInitializes ETH MSP.
|
* @brief DeInitializes ETH MSP.
|
||||||
@@ -2635,6 +2639,7 @@ static void ETH_MAC_MDIO_ClkConfig(ETH_HandleTypeDef *heth)
|
|||||||
*/
|
*/
|
||||||
static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
|
static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
|
||||||
{
|
{
|
||||||
|
#ifndef __rtems__
|
||||||
ETH_DMADescTypeDef *dmatxdesc;
|
ETH_DMADescTypeDef *dmatxdesc;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
@@ -2661,6 +2666,7 @@ static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
|
|||||||
|
|
||||||
/* Set Transmit Descriptor Tail pointer */
|
/* Set Transmit Descriptor Tail pointer */
|
||||||
WRITE_REG(heth->Instance->DMACTDTPR, (uint32_t) heth->Init.TxDesc);
|
WRITE_REG(heth->Instance->DMACTDTPR, (uint32_t) heth->Init.TxDesc);
|
||||||
|
#endif /* __rtems__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2672,6 +2678,7 @@ static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
|
|||||||
*/
|
*/
|
||||||
static void ETH_DMARxDescListInit(ETH_HandleTypeDef *heth)
|
static void ETH_DMARxDescListInit(ETH_HandleTypeDef *heth)
|
||||||
{
|
{
|
||||||
|
#ifndef __rtems__
|
||||||
ETH_DMADescTypeDef *dmarxdesc;
|
ETH_DMADescTypeDef *dmarxdesc;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
@@ -2704,6 +2711,7 @@ static void ETH_DMARxDescListInit(ETH_HandleTypeDef *heth)
|
|||||||
|
|
||||||
/* Set Receive Descriptor Tail pointer Address */
|
/* Set Receive Descriptor Tail pointer Address */
|
||||||
WRITE_REG(heth->Instance->DMACRDTPR, ((uint32_t)(heth->Init.RxDesc + (((uint32_t)(ETH_RX_DESC_CNT - 1))*sizeof(ETH_DMADescTypeDef)))));
|
WRITE_REG(heth->Instance->DMACRDTPR, ((uint32_t)(heth->Init.RxDesc + (((uint32_t)(ETH_RX_DESC_CNT - 1))*sizeof(ETH_DMADescTypeDef)))));
|
||||||
|
#endif /* __rtems__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -175,6 +175,7 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief Resets the RCC clock configuration to the default reset state.
|
* @brief Resets the RCC clock configuration to the default reset state.
|
||||||
* @note The default reset state of the clock configuration is given below:
|
* @note The default reset state of the clock configuration is given below:
|
||||||
@@ -385,6 +386,7 @@ HAL_StatusTypeDef HAL_RCC_DeInit(void)
|
|||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the RCC Oscillators according to the specified parameters in the
|
* @brief Initializes the RCC Oscillators according to the specified parameters in the
|
||||||
@@ -1195,7 +1197,11 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(const RCC_ClkInitTypeDef *RCC_ClkInitStru
|
|||||||
#endif /* DUAL_CORE && CORE_CM4 */
|
#endif /* DUAL_CORE && CORE_CM4 */
|
||||||
|
|
||||||
/* Configure the source of time base considering new system clocks settings*/
|
/* Configure the source of time base considering new system clocks settings*/
|
||||||
|
#ifndef __rtems__
|
||||||
halstatus = HAL_InitTick (uwTickPrio);
|
halstatus = HAL_InitTick (uwTickPrio);
|
||||||
|
#else /* __rtems__ */
|
||||||
|
halstatus = HAL_OK;
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
return halstatus;
|
return halstatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -649,6 +649,7 @@ HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart)
|
|||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the UART MSP.
|
* @brief Initialize the UART MSP.
|
||||||
* @param huart UART handle.
|
* @param huart UART handle.
|
||||||
@@ -663,6 +664,7 @@ __weak void HAL_UART_MspInit(UART_HandleTypeDef *huart)
|
|||||||
the HAL_UART_MspInit can be implemented in the user file
|
the HAL_UART_MspInit can be implemented in the user file
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DeInitialize the UART MSP.
|
* @brief DeInitialize the UART MSP.
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart)
|
|||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the USART MSP.
|
* @brief Initialize the USART MSP.
|
||||||
* @param husart USART handle.
|
* @param husart USART handle.
|
||||||
@@ -386,6 +387,7 @@ __weak void HAL_USART_MspInit(USART_HandleTypeDef *husart)
|
|||||||
the HAL_USART_MspInit can be implemented in the user file
|
the HAL_USART_MspInit can be implemented in the user file
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DeInitialize the USART MSP.
|
* @brief DeInitialize the USART MSP.
|
||||||
|
|||||||
Reference in New Issue
Block a user