summaryrefslogtreecommitdiffstats
path: root/app/tims_keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/tims_keyboard.c')
-rw-r--r--app/tims_keyboard.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/app/tims_keyboard.c b/app/tims_keyboard.c
new file mode 100644
index 0000000..e6a4aae
--- /dev/null
+++ b/app/tims_keyboard.c
@@ -0,0 +1,44 @@
+#include "project.h"
+extern uint32_t dfu_flag;
+
+int
+main (void)
+{
+
+
+// rcc_clock_setup_in_hsi_out_48mhz ();
+ //nvic_set_priority_grouping(NVIC_PriorityGroup_4);
+
+ /*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_AFIO);
+ rcc_periph_clock_enable (RCC_USART1);
+ rcc_periph_clock_enable (RCC_USART1);
+ dwt_enable_cycle_counter();
+
+ /*Change interrupt priorities so that USART trumps everything else */
+ nvic_set_priority(NVIC_USART1_IRQ, 0x40);
+ nvic_set_priority(NVIC_EXTI0_IRQ, 0xff);
+ nvic_set_priority(NVIC_SYSTICK_IRQ, 0xff);
+
+ usart_init();
+
+ ticker_init();
+
+
+ printf("Hello world!\r\n");
+
+ atkbd_init();
+
+ usb_init ();
+
+
+ usb_run ();
+
+ return 0;
+}