summaryrefslogtreecommitdiffstats
path: root/app/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.c')
-rw-r--r--app/main.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/app/main.c b/app/main.c
new file mode 100644
index 0000000..2f25fb6
--- /dev/null
+++ b/app/main.c
@@ -0,0 +1,55 @@
+#include "project.h"
+
+
+static void
+board_setup (void)
+{
+ rcc_clock_setup_hse_3v3 (&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
+ rcc_periph_clock_enable (RCC_SYSCFG);
+ rcc_periph_clock_enable (RCC_GPIOA);
+ rcc_periph_clock_enable (RCC_GPIOB);
+ rcc_periph_clock_enable (RCC_GPIOC);
+ rcc_periph_clock_enable (RCC_GPIOD);
+ rcc_periph_clock_enable (RCC_USART6);
+
+ nvic_set_priority (NVIC_USART6_IRQ, 0xff);
+ nvic_set_priority (NVIC_EXTI0_IRQ, 0x80);
+ nvic_set_priority (NVIC_ETH_IRQ, 0x40);
+ nvic_set_priority (NVIC_SYSTICK_IRQ, 0x40);
+}
+
+
+static void
+system_init (void)
+{
+
+ board_setup();
+ led_init();
+ ticker_init();
+ usart_init();
+
+ radio_init();
+
+ start_lwip();
+ steth_init();
+
+}
+
+int
+main (void)
+{
+
+
+ system_init();
+
+ printf ("Fish\r\n");
+
+
+ while (1) {
+ dispatch_lwip();
+ steth_dispatch();
+
+ }
+
+ return 0;
+}