diff options
author | root <root@lab.ourano.james.local> | 2021-02-26 12:12:38 +0000 |
---|---|---|
committer | root <root@lab.ourano.james.local> | 2021-02-26 12:12:38 +0000 |
commit | 3d48137c00511b3f2d35511482d1a76f8d06382d (patch) | |
tree | d75c88220cc847007869b0795a240c5077948262 /app/main.c | |
parent | 6d3a824e1cdae6e28146b7de380724b49488f3c2 (diff) | |
download | clock-3d48137c00511b3f2d35511482d1a76f8d06382d.tar.gz clock-3d48137c00511b3f2d35511482d1a76f8d06382d.tar.bz2 clock-3d48137c00511b3f2d35511482d1a76f8d06382d.zip |
works
Diffstat (limited to 'app/main.c')
-rw-r--r-- | app/main.c | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -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(); + } |