From 87e61d21e5ce588c9701d92def188fa97674c3cd Mon Sep 17 00:00:00 2001 From: root Date: Sun, 2 Nov 2014 13:45:44 +0000 Subject: ifhs --- src/main.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 655a0bc..6b13a82 100644 --- a/src/main.c +++ b/src/main.c @@ -2,7 +2,9 @@ void sys_tick_handler(void) { - hid_test(); + keyboard_test(); + mouse_test(); + tablet_test(); } int main(void) @@ -11,13 +13,21 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_periph_clock_enable(RCC_GPIOC); + rcc_periph_clock_enable(RCC_GPIOA); + rcc_periph_clock_enable(RCC_AFIO); + rcc_periph_clock_enable(RCC_USART1); + + + uart_init(); + usb_init(); systick_set_clocksource(STK_CSR_CLKSOURCE_AHB_DIV8); - /* SysTick interrupt every N clock pulses: set reload to N-1 */ - systick_set_reload(99999); + /* 48MHz / 8 = > 6Mhz */ + systick_set_reload(3000000); + /* 6MHz / 3000000 => 2Hz */ + systick_interrupt_enable(); systick_counter_enable(); @@ -25,8 +35,8 @@ int main(void) gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO11); + - usb_init(); for (i = 0; i < 0x80000; i++) __asm__("nop"); -- cgit v1.2.3