diff --git a/hw/bsp/board.h b/hw/bsp/board.h index 2a946025..92c5f285 100644 --- a/hw/bsp/board.h +++ b/hw/bsp/board.h @@ -52,20 +52,6 @@ #include "ansi_escape.h" -//--------------------------------------------------------------------+ -// PRINTF TARGET DEFINE -//--------------------------------------------------------------------+ -/** \defgroup group_printf Printf Retarget - * \brief Retarget the standard stdio printf/getchar to other IOs - * @{ */ -#define PRINTF_TARGET_SEMIHOST 1 ///< Using the semihost support from toolchain, requires no hardware but is the slowest -#define PRINTF_TARGET_UART 2 ///< Using UART as stdio, this is the default for most of the board -#define PRINTF_TARGET_SWO 3 ///< Using non-instructive serial wire output (SWO), is the best option since it does not slow down MCU but requires supported from debugger and IDE -#define PRINTF_TARGET_NONE 4 ///< Using none at all. -/** @} */ - -#define PRINTF(...) printf(__VA_ARGS__) - #if defined BOARD_LPCXPRESSO11U14 #include "lpcxpresso11u14/board_lpcxpresso11u14.h" #elif defined BOARD_LPCXPRESSO11U68 diff --git a/hw/bsp/lpcxpresso/board_lpcxpresso11u14.h b/hw/bsp/lpcxpresso/board_lpcxpresso11u14.h index 5da48c33..ce46cb93 100644 --- a/hw/bsp/lpcxpresso/board_lpcxpresso11u14.h +++ b/hw/bsp/lpcxpresso/board_lpcxpresso11u14.h @@ -47,9 +47,6 @@ #include "lpc11uxx_gpio.h" #include "lpc11uxx_uart.h" -//#define CFG_PRINTF_TARGET PRINTF_TARGET_SEMIHOST -#define CFG_PRINTF_TARGET PRINTF_TARGET_UART - #ifdef __cplusplus } #endif diff --git a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.h b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.h index fa62315e..6296a6d2 100644 --- a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.h +++ b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.h @@ -47,9 +47,6 @@ #include "lpc11uxx_gpio.h" #include "lpc11uxx_uart.h" -//#define CFG_PRINTF_TARGET PRINTF_TARGET_SEMIHOST -#define CFG_PRINTF_TARGET PRINTF_TARGET_UART - #ifdef __cplusplus } #endif diff --git a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c index 6c29298c..edbe7c8f 100644 --- a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c +++ b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c @@ -37,15 +37,18 @@ /**************************************************************************/ #include "bsp/board.h" -#include "tusb.h" #ifdef BOARD_LPCXPRESSO1769 #include "LPC17xx.h" +#include "lpc17xx_clkpwr.h" +#include "lpc17xx_gpio.h" +#include "lpc17xx_uart.h" #include "lpc17xx_pinsel.h" -#define BOARD_LED_PORT (0) -#define BOARD_LED_PIN (22) +#include "tusb.h" + +#define BOARD_LED0_PORT (0) static const struct { uint8_t port; @@ -73,10 +76,13 @@ void board_init(void) #if CFG_TUSB_OS == OPT_OS_NONE // TODO may move to main.c SysTick_Config(SystemCoreClock / BOARD_TICKS_HZ); // 1 msec tick timer +#elif CFG_TUSB_OS == OPT_OS_FREERTOS + // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher ) + NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); #endif //------------- LED -------------// - GPIO_SetDir(BOARD_LED_PORT, BIT_(BOARD_LED_PIN), 1); + GPIO_SetDir(BOARD_LED0_PORT, BIT_(BOARD_LED0), 1); //------------- BUTTON -------------// for(uint8_t i=0; i