summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-15 18:13:12 +0700
committerhathach <[email protected]>2019-05-15 18:16:48 +0700
commit6e9324e29c3c2cc7ae36c0d7cbdb037e92ec9614 (patch)
tree01c7d3ee839746922ddade2a372310c6fa055999
parent22d8479299bbae73fef0a52d1c1452b1244158d7 (diff)
clean up
-rw-r--r--hw/bsp/ea4357/board_ea4357.c43
-rw-r--r--hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c9
2 files changed, 23 insertions, 29 deletions
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; i<BOARD_BUTTON_COUNT; i++)
- {
- scu_pinmux(buttons[i].mux_port, buttons[i].mux_pin, GPIO_NOPULL, FUNC0);
- GPIO_SetDir(buttons[i].gpio_port, TU_BIT(buttons[i].gpio_pin), 0);
- }
-
//------------- UART -------------//
scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN, FUNC1);
scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN | MD_EZI | MD_ZI, FUNC1);
diff --git a/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c b/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c
index d2d3c5ab9..c5695733c 100644
--- a/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c
+++ b/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c
@@ -34,6 +34,8 @@ void board_init(void)
RCC->AHB1ENR |= 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;