diff options
author | bnewbold <bnewbold@robocracy.org> | 2010-08-05 21:43:41 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2010-08-05 21:43:58 -0400 |
commit | ccd9833f264d6e20a9f2c81baebe162f07eec996 (patch) | |
tree | c6d1d3077cf92b864297bf74230221b90c01f34a /wirish | |
parent | d0e353ca9f3a0986c54beab3948117bdaade700e (diff) | |
download | librambutan-ccd9833f264d6e20a9f2c81baebe162f07eec996.tar.gz librambutan-ccd9833f264d6e20a9f2c81baebe162f07eec996.zip |
Some refactoring
Diffstat (limited to 'wirish')
-rw-r--r-- | wirish/wirish.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/wirish/wirish.c b/wirish/wirish.c index e21f792..28e7130 100644 --- a/wirish/wirish.c +++ b/wirish/wirish.c @@ -27,21 +27,40 @@ */ #include "wirish.h" -#include "rcc.h" #include "systick.h" #include "gpio.h" #include "nvic.h" #include "usb.h" +#include "rcc.h" +#include "flash.h" + +static void inline maple_flash_init(void) { + flash_enable_prefetch(); + flash_set_latency(FLASH_WAIT_STATE_2); +} + +static void inline maple_rcc_init(void) { + struct rcc_device maple_rcc_dev = { + .apb1_prescale = RCC_APB1_HCLK_DIV_2, + .apb2_prescale = RCC_APB2_HCLK_DIV_1, + .ahb_prescale = RCC_AHB_SYSCLK_DIV_1, + .sysclk_src = RCC_CLKSRC_PLL, + .pll_src = RCC_PLLSRC_HSE, + .pll_mul = RCC_PLLMUL_9 + }; + rcc_init(&maple_rcc_dev); +} void init(void) { - rcc_init(); + maple_flash_init(); + maple_rcc_init(); nvic_init(); systick_init(); gpio_init(); - adc_init(); - timer_init(1, 1); - timer_init(2, 1); - timer_init(3, 1); - timer_init(4, 1); - setupUSB(); +// adc_init(); +// timer_init(1, 1); +// timer_init(2, 1); +// timer_init(3, 1); +// timer_init(4, 1); +// setupUSB(); } |