Skip to content

Commit

Permalink
[stm32] replace remaining rcc_peripheral_enable_clock
Browse files Browse the repository at this point in the history
by less error prone rcc_periph_clock_enable
  • Loading branch information
flixr committed Nov 18, 2014
1 parent dcea727 commit 80953a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions sw/airborne/arch/stm32/led_hw.h
Expand Up @@ -71,9 +71,8 @@ extern uint8_t led_status[NB_LED];
/* PC15 led_data */

#define LED_INIT(_i) { \
rcc_peripheral_enable_clock(&RCC_APB2ENR, \
RCC_APB2ENR_IOPAEN | \
RCC_APB2ENR_IOPCEN); \
rcc_periph_clock_enable(RCC_GPIOA); \
rcc_periph_clock_enable(RCC_GPIOC); \
gpio_set_mode(GPIOA, \
GPIO_MODE_OUTPUT_50_MHZ, \
GPIO_CNF_OUTPUT_PUSHPULL, \
Expand Down
5 changes: 1 addition & 4 deletions sw/airborne/arch/stm32/uart_tunnel.c
Expand Up @@ -28,15 +28,13 @@
#include "led.h"

/* UART1 */
#define A_PERIPH RCC_APB2ENR_IOPAEN
#define A_PORT GPIOA
#define A_RX_PIN GPIO10
#define A_RX_PORT A_PORT
#define A_TX_PIN GPIO9
#define A_TX_PORT A_PORT

/* UART2 */
#define B_PERIPH RCC_APB2ENR_IOPAEN
#define B_PORT GPIOA
#define B_RX_PIN GPIO3
#define B_RX_PORT B_PORT
Expand All @@ -57,8 +55,7 @@ int main(void) {
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);

/* init RCC */
rcc_peripheral_enable_clock(&RCC_APB2ENR, A_PERIPH);
// rccp_perihperal_enable_clock(&RCC_APB2ENR, B_PERIPH);
rcc_periph_clock_enable(RCC_GPIOA);

/* Init GPIO for rx pins */
gpio_set(A_RX_PORT, A_RX_PIN);
Expand Down

0 comments on commit 80953a8

Please sign in to comment.