[stm32] replace remaining rcc_peripheral_enable_clock

by less error prone rcc_periph_clock_enable
This commit is contained in:
Felix Ruess
2014-11-18 15:18:42 +01:00
parent dcea7274c5
commit 80953a8498
2 changed files with 3 additions and 7 deletions
+2 -3
View File
@@ -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, \
+1 -4
View File
@@ -28,7 +28,6 @@
#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
@@ -36,7 +35,6 @@
#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
@@ -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);