summaryrefslogtreecommitdiffstats
path: root/app/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.c')
-rw-r--r--app/main.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/app/main.c b/app/main.c
index 22ee23e..d5b5ec4 100644
--- a/app/main.c
+++ b/app/main.c
@@ -221,7 +221,7 @@ static void ptp_clock_start (void)
static void clock_setup (void)
{
-static uint32_t fail;
+ static uint32_t fail;
/*
* Caution, The PLL is somewhat rubbish, and causes all sorts of misery
* so sysclk isn't really a reference, if we use it, however not using it
@@ -240,16 +240,16 @@ static uint32_t fail;
/* confiure HSE as input not oscillator */
- rcc_osc_bypass_enable (HSE);
+ rcc_osc_bypass_enable (HSE);
rcc_osc_on (HSE);
while ((RCC_CR & RCC_CR_HSERDY) == 0) {
- if (fail++ == 4000000) {
- /*No external clock, try seeing if we have a crystal */
- rcc_osc_off (HSE);
- rcc_osc_bypass_disable (HSE);
- rcc_osc_on (HSE);
- }
+ if (fail++ == 4000000) {
+ /*No external clock, try seeing if we have a crystal */
+ rcc_osc_off (HSE);
+ rcc_osc_bypass_disable (HSE);
+ rcc_osc_on (HSE);
+ }
}
/* turn off SSC */
@@ -372,6 +372,7 @@ board_setup (void)
nvic_set_priority (NVIC_USART2_IRQ, 0x30);
nvic_set_priority (NVIC_ETH_IRQ, 0x40);
nvic_set_priority (NVIC_SYSTICK_IRQ, 0x50);
+ nvic_set_priority (NVIC_OTG_FS_IRQ, 0x60);
// nvic_enable_irq (NVIC_EXTI15_10_IRQ);
@@ -382,32 +383,42 @@ board_setup (void)
static void
system_init (void)
{
+ cdcacm_rings_init();
+ usart_rings_init();
board_setup();
timer_setup();
led_init();
+
ticker_init();
usart_init();
+ usb_init();
+
msf_init();
dcf77_init();
+
+ steth_calculate_mac();
printf ("LWIP\r\n");
start_lwip();
printf ("STETH\r\n");
+
+
steth_init();
ptp_clock_start();
max7219_init (1, 8);
+
gps_init();
ntp_init();
- usb_init();
+
}
@@ -456,7 +467,7 @@ main (void)
dispatch_lwip();
max7219_dispatch();
- cdcacm_dispatch();
+
}