summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c64
1 files changed, 35 insertions, 29 deletions
diff --git a/src/main.c b/src/main.c
index 6b13a82..3058108 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,49 +1,55 @@
#include "project.h"
-void sys_tick_handler(void)
+void
+sys_tick_handler (void)
{
- keyboard_test();
- mouse_test();
- tablet_test();
+#if 0
+ printf ("fish\r\n");
+ keyboard_test ();
+ mouse_test ();
+ tablet_test ();
+#endif
}
-int main(void)
+int
+main (void)
{
- int i;
+ int i;
- 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);
+ 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();
+ usart_init ();
- usb_init();
+ usb_init ();
- systick_set_clocksource(STK_CSR_CLKSOURCE_AHB_DIV8);
- /* 48MHz / 8 = > 6Mhz */
- systick_set_reload(3000000);
- /* 6MHz / 3000000 => 2Hz */
+ systick_set_clocksource (STK_CSR_CLKSOURCE_AHB_DIV8);
+ /* 48MHz / 8 = > 6Mhz */
+ systick_set_reload (3000000);
+ /* 6MHz / 3000000 => 2Hz */
- systick_interrupt_enable();
- systick_counter_enable();
+ systick_interrupt_enable ();
+ systick_counter_enable ();
- gpio_set(GPIOC, GPIO11);
- gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
+ gpio_set (GPIOC, GPIO11);
+ gpio_set_mode (GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
-
- for (i = 0; i < 0x80000; i++)
- __asm__("nop");
- gpio_clear(GPIOC, GPIO11);
+ for (i = 0; i < 0x80000; i++)
+ __asm__ ("nop");
- usb_run();
+ gpio_clear (GPIOC, GPIO11);
- return 0;
-}
+ printf ("Hello world\r\n");
+
+ usb_run ();
+ return 0;
+}