summaryrefslogtreecommitdiffstats
path: root/app/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.c')
-rw-r--r--app/main.c34
1 files changed, 34 insertions, 0 deletions
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;
+}
+