From 9b371b5189c368932d4dd15ca6904212cd59e83b Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Mon, 14 Mar 2016 21:34:18 +0000 Subject: fix l4 to run at 48Mhz and with a clock --- tests/adc-power/main-stm32l4-disco.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/adc-power/main-stm32l4-disco.c') diff --git a/tests/adc-power/main-stm32l4-disco.c b/tests/adc-power/main-stm32l4-disco.c index a23266f..ad21fcb 100644 --- a/tests/adc-power/main-stm32l4-disco.c +++ b/tests/adc-power/main-stm32l4-disco.c @@ -7,7 +7,9 @@ #include #include #include +#include #include +#include #include #include "trace.h" @@ -18,6 +20,12 @@ #define LED_DISCO_GREEN_PORT GPIOE #define LED_DISCO_GREEN_PIN GPIO8 +int hack(void) { + pwr_set_vos_scale(PWR_SCALE1); + flash_set_ws(FLASH_ACR_LATENCY_2WS); + rcc_set_msi_range(RCC_CR_MSIRANGE_48MHZ); + return 0; +} int main(void) { @@ -27,6 +35,8 @@ int main(void) rcc_periph_clock_enable(RCC_GPIOE); // led rcc_periph_clock_enable(RCC_GPIOA); // adcs rcc_periph_clock_enable(RCC_GPIOC); // adcs + rcc_periph_clock_enable(RCC_PWR); + hack(); printf("hi guys!\n"); /* green led for ticking */ gpio_mode_setup(LED_DISCO_GREEN_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, -- cgit