TARGET_STM32F2 astyle

pull/7351/head
jeromecoutant 2018-06-27 14:31:31 +02:00
parent c8313901fb
commit f9bd4768a5
8 changed files with 150 additions and 147 deletions

View File

@ -130,10 +130,11 @@ static inline void stm_pin_SetAFPin( GPIO_TypeDef *gpio, PinName pin, uint32_t a
{ {
uint32_t ll_pin = ll_pin_defines[STM_PIN(pin)]; uint32_t ll_pin = ll_pin_defines[STM_PIN(pin)];
if (STM_PIN(pin) > 7) if (STM_PIN(pin) > 7) {
LL_GPIO_SetAFPin_8_15(gpio, ll_pin, afnum); LL_GPIO_SetAFPin_8_15(gpio, ll_pin, afnum);
else } else {
LL_GPIO_SetAFPin_0_7(gpio, ll_pin, afnum); LL_GPIO_SetAFPin_0_7(gpio, ll_pin, afnum);
} }
}
#endif #endif

View File

@ -33,8 +33,7 @@
#ifdef DEVICE_PWMOUT #ifdef DEVICE_PWMOUT
const pwm_apb_map_t pwm_apb_map_table[] = const pwm_apb_map_t pwm_apb_map_table[] = {
{
#if defined(TIM2_BASE) #if defined(TIM2_BASE)
{PWM_2, PWMOUT_ON_APB1}, {PWM_2, PWMOUT_ON_APB1},
#endif #endif

View File

@ -526,13 +526,15 @@ uint8_t serial_rx_active(serial_t *obj)
return ((HAL_UART_GetState(huart) == HAL_UART_STATE_BUSY_RX) ? 1 : 0); return ((HAL_UART_GetState(huart) == HAL_UART_STATE_BUSY_RX) ? 1 : 0);
} }
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
if (__HAL_UART_GET_FLAG(huart, UART_FLAG_TC) != RESET) { if (__HAL_UART_GET_FLAG(huart, UART_FLAG_TC) != RESET) {
__HAL_UART_CLEAR_FLAG(huart, UART_FLAG_TC); __HAL_UART_CLEAR_FLAG(huart, UART_FLAG_TC);
} }
} }
void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) { void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
{
if (__HAL_UART_GET_FLAG(huart, UART_FLAG_PE) != RESET) { if (__HAL_UART_GET_FLAG(huart, UART_FLAG_PE) != RESET) {
volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear PE flag volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear PE flag
} else if (__HAL_UART_GET_FLAG(huart, UART_FLAG_FE) != RESET) { } else if (__HAL_UART_GET_FLAG(huart, UART_FLAG_FE) != RESET) {

View File

@ -48,7 +48,8 @@
* Only the frequency is managed in the family specific part * Only the frequency is managed in the family specific part
* the rest of SPI management is common to all STM32 families * the rest of SPI management is common to all STM32 families
*/ */
int spi_get_clock_freq(spi_t *obj) { int spi_get_clock_freq(spi_t *obj)
{
struct spi_s *spiobj = SPI_S(obj); struct spi_s *spiobj = SPI_S(obj);
int spi_hz = 0; int spi_hz = 0;