Skip to content

Commit 0b99eee

Browse files
committed
Fix control function in I2C driver.
1 parent f28619f commit 0b99eee

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
9090
RT_ASSERT(bus != RT_NULL);
9191
nu_i2c = (nu_i2c_bus_t *) bus;
9292

93-
switch (RT_I2C_DEV_CTRL_CLK)
93+
switch (u32Cmd)
9494
{
9595
case RT_I2C_DEV_CTRL_CLK:
9696
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
9999
RT_ASSERT(bus != RT_NULL);
100100
nu_i2c = (nu_i2c_bus_t *) bus;
101101

102-
switch (RT_I2C_DEV_CTRL_CLK)
102+
switch (u32Cmd)
103103
{
104104
case RT_I2C_DEV_CTRL_CLK:
105105
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
9999
RT_ASSERT(bus != RT_NULL);
100100
nu_i2c = (nu_i2c_bus_t *) bus;
101101

102-
switch (RT_I2C_DEV_CTRL_CLK)
102+
switch (u32Cmd)
103103
{
104104
case RT_I2C_DEV_CTRL_CLK:
105105
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

bsp/nuvoton/libraries/n9h30/Driver/Include/nu_uart.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,4 +770,8 @@ void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_wid
770770

771771
/*@}*/ /* end of group N9H30_Device_Driver */
772772

773+
#ifdef __cplusplus
774+
}
775+
#endif
776+
773777
#endif

bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
516516
psNuI2cBus = (nu_i2c_bus_t) bus;
517517
psNuI2cDev = &psNuI2cBus->dev;
518518

519-
switch (RT_I2C_DEV_CTRL_CLK)
519+
switch (u32Cmd)
520520
{
521521
case RT_I2C_DEV_CTRL_CLK:
522522
nu_i2c_set_speed(psNuI2cDev, (int32_t)u32Value);

bsp/nuvoton/libraries/n9h30/rtt_port/drv_vpost.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ typedef struct nu_vpost *nu_vpost_t;
4949
static volatile uint32_t g_u32VSyncBlank = 0;
5050
static struct rt_completion vsync_wq;
5151

52-
RT_WEAK void nu_lcd_backlight_on(void) { }
53-
54-
RT_WEAK void nu_lcd_backlight_off(void) { }
55-
5652
static struct nu_vpost nu_fbdev[eVpost_Cnt] =
5753
{
5854
{
@@ -73,6 +69,9 @@ static struct nu_vpost nu_fbdev[eVpost_Cnt] =
7369
#endif
7470
};
7571

72+
RT_WEAK void nu_lcd_backlight_on(void) { }
73+
74+
RT_WEAK void nu_lcd_backlight_off(void) { }
7675
static rt_err_t vpost_layer_open(rt_device_t dev, rt_uint16_t oflag)
7776
{
7877
nu_vpost_t psVpost = (nu_vpost_t)dev;

bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
118118
RT_ASSERT(bus != RT_NULL);
119119
nu_i2c = (nu_i2c_bus_t *) bus;
120120

121-
switch (RT_I2C_DEV_CTRL_CLK)
121+
switch (u32Cmd)
122122
{
123123
case RT_I2C_DEV_CTRL_CLK:
124124
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

bsp/nuvoton/nk-n9h30/board/board_dev.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,11 @@ static void PlayRingTone(void)
252252
#include <drv_gpio.h>
253253

254254
/* defined the LCM_BLEN pin: PH3 */
255-
#define LCM_BLEN NU_GET_PININDEX(NU_PH, 3)
255+
#define LCM_BACKLIGHT_CTRL NU_GET_PININDEX(NU_PH, 3)
256256
#endif
257257

258258
#define PWM_DEV_NAME "pwm0"
259259
#define LCM_PWM_CHANNEL (0)
260-
#define LCM_BACKLIGHT_CTRL NU_GET_PININDEX(NU_PH, 3)
261260

262261
void nu_lcd_backlight_on(void)
263262
{

0 commit comments

Comments
 (0)