mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 19:47:50 +08:00
[stm32] replace remaining rcc_peripheral_enable_clock
by less error prone rcc_periph_clock_enable
This commit is contained in:
@@ -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, \
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user