From 259ee0e7022ce15f4f2c8294a4fc3de7005d7fab Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 29 Apr 2019 07:30:28 +0100 Subject: working with one set of stripes --- app/main.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/main.c (limited to 'app/main.c') diff --git a/app/main.c b/app/main.c new file mode 100644 index 0000000..06644bd --- /dev/null +++ b/app/main.c @@ -0,0 +1,34 @@ +#include "project.h" + + + + + +int main (void) +{ + /*set up pll */ + rcc_clock_setup_in_hse_8mhz_out_72mhz(); + /*turn on clocks to periferals */ + rcc_periph_clock_enable (RCC_GPIOA); + rcc_periph_clock_enable (RCC_GPIOB); + rcc_periph_clock_enable (RCC_GPIOC); + rcc_periph_clock_enable (RCC_USART1); + rcc_periph_clock_enable (RCC_AFIO); + nvic_set_priority (NVIC_SYSTICK_IRQ, 0x80); + nvic_set_priority (NVIC_USART1_IRQ, 0x40); + gpio_set_mode (LED_BANK, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, LED_GPIO); + + timex_init(); + ticker_init(); + usart_init(); + + usb_init(); + + printf ("Morning chaps!\r\n"); + + for (;;) + usbd_poll (usbd_dev); + + return 0; +} + -- cgit v1.2.3