Updated to use the new rcc_periph_clock_enable code

This commit is contained in:
cmcmanis
2014-02-20 20:09:02 -08:00
committed by Piotr Esden-Tempski
parent ae9c116e30
commit e4d106dce6
11 changed files with 32 additions and 36 deletions

View File

@@ -134,7 +134,7 @@ int main(void) {
clock_setup(); // initialize our clock
/* MUST enable the GPIO clock in ADDITION to the USART clock */
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN);
rcc_periph_clock_enable(RCC_GPIOD);
/* This example uses PD5 and PD6 for Tx and Rx respectively
* but other pins are available for this role on USART2 (our chosen
@@ -155,7 +155,7 @@ int main(void) {
* attach to different buses, and even some UARTS are attached to
* APB1 and some to APB2, again the data sheet is useful here.
*/
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN);
rcc_periph_clock_enable(RCC_USART2);
/* Set up USART/UART parameters using the libopencm3 helper functions */
usart_set_baudrate(CONSOLE_UART, 115200);