summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2015-04-01 18:05:00 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2015-04-01 18:05:00 +0200
commitc6aa4d99c23c605b116ffa6492852f953e717705 (patch)
tree9a6b627c588e7cc64436ffc3a04fd9af8686d4eb /src
parent7acc6fe474766788687a5257be21ac549bed77f3 (diff)
downloadsecure-hid-c6aa4d99c23c605b116ffa6492852f953e717705.tar.gz
secure-hid-c6aa4d99c23c605b116ffa6492852f953e717705.tar.bz2
secure-hid-c6aa4d99c23c605b116ffa6492852f953e717705.zip
demo: rcc_peripheral_enable_clock->rcc_periph_clock_enable
Instead of 2 argument call, use function with one argument. It is more clear, and safer for inexperienced users with libopencm3. Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/demo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/demo.c b/src/demo.c
index f4ef456..34c2f5b 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -52,15 +52,15 @@ static void clock_setup(void)
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
// GPIO
- rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPAEN); // OTG_FS + button
- rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPBEN); // OTG_HS
- rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPCEN); // USART + OTG_FS charge pump
- rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN); // LEDS
+ rcc_periph_clock_enable(RCC_GPIOA); // OTG_FS + button
+ rcc_periph_clock_enable(RCC_GPIOB); // OTG_HS
+ rcc_periph_clock_enable(RCC_GPIOC); // USART + OTG_FS charge pump
+ rcc_periph_clock_enable(RCC_GPIOD); // LEDS
// periphery
- rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART6EN);// USART
- rcc_peripheral_enable_clock(&RCC_AHB2ENR, RCC_AHB2ENR_OTGFSEN);
- rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_OTGHSEN);
+ rcc_periph_clock_enable(RCC_USART6); // USART
+ rcc_periph_clock_enable(RCC_OTGFS); // OTG_FS
+ rcc_periph_clock_enable(RCC_OTGHS); // OTG_HS
}
static void gpio_setup(void)