diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c index e507ca6cbe..7487414dec 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c @@ -90,7 +90,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3 RT_ASSERT(bus != RT_NULL); nu_i2c = (nu_i2c_bus_t *) bus; - switch (RT_I2C_DEV_CTRL_CLK) + switch (u32Cmd) { case RT_I2C_DEV_CTRL_CLK: I2C_SetBusClockFreq(nu_i2c->I2C, u32Value); diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c index fbc38e6e2a..30bffc49bf 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c @@ -99,7 +99,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3 RT_ASSERT(bus != RT_NULL); nu_i2c = (nu_i2c_bus_t *) bus; - switch (RT_I2C_DEV_CTRL_CLK) + switch (u32Cmd) { case RT_I2C_DEV_CTRL_CLK: I2C_SetBusClockFreq(nu_i2c->I2C, u32Value); diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c index d1f71407ac..b7082d1ae4 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c @@ -99,7 +99,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3 RT_ASSERT(bus != RT_NULL); nu_i2c = (nu_i2c_bus_t *) bus; - switch (RT_I2C_DEV_CTRL_CLK) + switch (u32Cmd) { case RT_I2C_DEV_CTRL_CLK: I2C_SetBusClockFreq(nu_i2c->I2C, u32Value); diff --git a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h index 4f24a2d10d..898c181eb5 100644 --- a/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h +++ b/bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h @@ -770,4 +770,8 @@ void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_wid /*@}*/ /* end of group N9H30_Device_Driver */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c index 4fd7f335cc..987f8b3fd5 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c @@ -516,7 +516,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3 psNuI2cBus = (nu_i2c_bus_t) bus; psNuI2cDev = &psNuI2cBus->dev; - switch (RT_I2C_DEV_CTRL_CLK) + switch (u32Cmd) { case RT_I2C_DEV_CTRL_CLK: nu_i2c_set_speed(psNuI2cDev, (int32_t)u32Value); diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_vpost.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_vpost.c index bf5498c8a4..0f5f1e23a3 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_vpost.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_vpost.c @@ -49,10 +49,6 @@ typedef struct nu_vpost *nu_vpost_t; static volatile uint32_t g_u32VSyncBlank = 0; static struct rt_completion vsync_wq; -RT_WEAK void nu_lcd_backlight_on(void) { } - -RT_WEAK void nu_lcd_backlight_off(void) { } - static struct nu_vpost nu_fbdev[eVpost_Cnt] = { { @@ -73,6 +69,9 @@ static struct nu_vpost nu_fbdev[eVpost_Cnt] = #endif }; +RT_WEAK void nu_lcd_backlight_on(void) { } + +RT_WEAK void nu_lcd_backlight_off(void) { } static rt_err_t vpost_layer_open(rt_device_t dev, rt_uint16_t oflag) { nu_vpost_t psVpost = (nu_vpost_t)dev; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c index 423740dfc0..89e80b662f 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c @@ -118,7 +118,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3 RT_ASSERT(bus != RT_NULL); nu_i2c = (nu_i2c_bus_t *) bus; - switch (RT_I2C_DEV_CTRL_CLK) + switch (u32Cmd) { case RT_I2C_DEV_CTRL_CLK: I2C_SetBusClockFreq(nu_i2c->I2C, u32Value); diff --git a/bsp/nuvoton/nk-n9h30/board/board_dev.c b/bsp/nuvoton/nk-n9h30/board/board_dev.c index 7284ef5d58..ba21df17dd 100644 --- a/bsp/nuvoton/nk-n9h30/board/board_dev.c +++ b/bsp/nuvoton/nk-n9h30/board/board_dev.c @@ -252,12 +252,11 @@ static void PlayRingTone(void) #include /* defined the LCM_BLEN pin: PH3 */ - #define LCM_BLEN NU_GET_PININDEX(NU_PH, 3) + #define LCM_BACKLIGHT_CTRL NU_GET_PININDEX(NU_PH, 3) #endif #define PWM_DEV_NAME "pwm0" #define LCM_PWM_CHANNEL (0) -#define LCM_BACKLIGHT_CTRL NU_GET_PININDEX(NU_PH, 3) void nu_lcd_backlight_on(void) {