diff --git a/hw/bsp/ea4357/board_ea4357.c b/hw/bsp/ea4357/board_ea4357.c index e25a29963..2164d3e09 100644 --- a/hw/bsp/ea4357/board_ea4357.c +++ b/hw/bsp/ea4357/board_ea4357.c @@ -38,33 +38,29 @@ #define BUTTON_PIN 13 -static const struct { - uint8_t mux_port; - uint8_t mux_pin; - - uint8_t gpio_port; - uint8_t gpio_pin; -}buttons[] = -{ - {0x0a, 3, 4, 10 }, // Joystick up - {0x09, 1, 4, 13 }, // Joystick down - {0x0a, 2, 4, 9 }, // Joystick left - {0x09, 0, 4, 12 }, // Joystick right - {0x0a, 1, 4, 8 }, // Joystick press - {0x02, 7, 0, 7 }, // SW6 -}; - -enum { - BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0]) -}; +//static const struct { +// uint8_t mux_port; +// uint8_t mux_pin; +// +// uint8_t gpio_port; +// uint8_t gpio_pin; +//}buttons[] = +//{ +// {0x0a, 3, 4, 10 }, // Joystick up +// {0x09, 1, 4, 13 }, // Joystick down +// {0x0a, 2, 4, 9 }, // Joystick left +// {0x09, 0, 4, 12 }, // Joystick right +// {0x0a, 1, 4, 8 }, // Joystick press +// {0x02, 7, 0, 7 }, // SW6 +//}; /*------------------------------------------------------------------*/ /* BOARD API *------------------------------------------------------------------*/ /* System configuration variables used by chip driver */ -const uint32_t ExtRateIn = 0; const uint32_t OscRateIn = 12000000; +const uint32_t ExtRateIn = 0; static const PINMUX_GRP_T pinmuxing[] = { @@ -132,13 +128,6 @@ void board_init(void) Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN); #if 0 - //------------- BUTTON -------------// - for(uint8_t i=0; iAHB1ENR |= RCC_AHB1ENR_GPIODEN; GPIOD->MODER |= GPIO_MODER_MODE14_0; + // TODO Button + // USB Clock init // PLL input- 8 MHz (External oscillator clock; HSI clock tolerance isn't // tight enough- 1%, need 0.25%) @@ -59,10 +61,13 @@ void board_init(void) // Notify runtime of frequency change. SystemCoreClockUpdate(); - #if CFG_TUSB_OS == OPT_OS_NONE +#if CFG_TUSB_OS == OPT_OS_NONE // 1ms tick timer SysTick_Config(SystemCoreClock / 1000); - #endif +#elif CFG_TUSB_OS == OPT_OS_FREERTOS + // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher ) + //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); +#endif RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;