[errno code][-RT_EINVAL] fix that use RT_EINVAL without -

This commit is contained in:
Meco Man 2023-03-16 00:44:05 -04:00 committed by Man, Jianting (Meco)
parent e4e88b2f3e
commit dfddd79b24
136 changed files with 316 additions and 324 deletions

View File

@ -153,7 +153,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
return drv_pwm_get(htim, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -96,7 +96,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device,
RT_ASSERT(configuration != RT_NULL);
rt_uint32_t spi_id = device->bus->parent.user_data;
rt_uint8_t mode = configuration->mode & (RT_SPI_CPHA | RT_SPI_CPOL);
if (configuration->mode & RT_SPI_SLAVE) return RT_EINVAL;
if (configuration->mode & RT_SPI_SLAVE) return -RT_EINVAL;
switch(spi_id)
{
case 0:

View File

@ -171,7 +171,7 @@ static rt_err_t air32_hwtimer_control(struct rt_hwtimer_device *device, rt_uint3
}
else
{
result = RT_EINVAL;
result = -RT_EINVAL;
}
}
break;

View File

@ -211,7 +211,7 @@ rt_err_t cpu_set_pll_clk(int clk)
int p = 0, k = 1, m = 1, n = 0;
if (clk == 0)
return RT_EINVAL;
return -RT_EINVAL;
if (clk > 1152000000)
{
@ -244,7 +244,7 @@ rt_err_t audio_set_pll_clk(int clk)
int m_temp = _24MHZ_ * 2;
if ((clk > 200000000) || (clk < 20000000))
return RT_EINVAL;
return -RT_EINVAL;
if (clk == 0)
{
@ -288,7 +288,7 @@ rt_err_t video_set_pll_clk(int clk)
int m_temp = _24MHZ_;
if ((clk > 600000000) || (clk < 30000000))
return RT_EINVAL;
return -RT_EINVAL;
if (clk == 0)
{
@ -333,7 +333,7 @@ rt_err_t ve_set_pll_clk(int clk)
int m_temp = _24MHZ_;
if ((clk > 600000000) || (clk < 30000000))
return RT_EINVAL;
return -RT_EINVAL;
if (clk == 0)
{
@ -377,7 +377,7 @@ rt_err_t periph_set_pll_clk(int clk)
int n = 0, k = 0;
if ((clk > 1800000000) || (clk < 200000000) || (clk == 0) || (clk % _24MHZ_ != 0))
return RT_EINVAL;
return -RT_EINVAL;
n = clk / _24MHZ_;
@ -413,7 +413,7 @@ rt_err_t periph_set_pll_clk(int clk)
rt_err_t cpu_set_clk(int clk)
{
if (clk < _24MHZ_)
return RT_EINVAL;
return -RT_EINVAL;
if (clk == cpu_get_clk())
return RT_EOK;
@ -446,7 +446,7 @@ rt_err_t bus_gate_clk_enalbe(enum bus_gate bus)
else if (gate_reg == 0x02)
CCU->bus_clk_gating2 |= (0x1 << offset);
else
return RT_EINVAL;
return -RT_EINVAL;
return RT_EOK;
}
@ -466,7 +466,7 @@ rt_err_t bus_gate_clk_disalbe(enum bus_gate bus)
else if (gate_reg == 0x02)
CCU->bus_clk_gating2 &= ~(0x1 << offset);
else
return RT_EINVAL;
return -RT_EINVAL;
return RT_EOK;
}
@ -486,7 +486,7 @@ rt_err_t bus_software_reset_disalbe(enum bus_gate bus)
else if (gate_reg == 0x02)
CCU->bus_soft_rst2 |= (0x1 << offset);
else
return RT_EINVAL;
return -RT_EINVAL;
return RT_EOK;
}
@ -506,7 +506,7 @@ rt_err_t bus_software_reset_enalbe(enum bus_gate bus)
else if (gate_reg == 0x02)
CCU->bus_soft_rst2 &= ~(0x1 << offset);
else
return RT_EINVAL;
return -RT_EINVAL;
return RT_EOK;
}
@ -519,7 +519,7 @@ rt_err_t mmc_set_clk(enum mmc_clk_id clk_id, int hz)
if (hz < 0)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (hz == 0)

View File

@ -25,7 +25,7 @@
/*********************************************************
** IO
*********************************************************/
int gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func)
rt_err_t gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func)
{
rt_uint32_t addr;
rt_uint32_t offset;
@ -37,7 +37,7 @@ int gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func)
if (func & 0x8)
{
LOG_W("[line]:%d There is a warning with parameter input", __LINE__);
return RT_EINVAL;
return -RT_EINVAL;
}
addr = GPIOn_CFG_ADDR(port) + (pin / 8) * 4;
@ -64,7 +64,7 @@ int gpio_set_value(enum gpio_port port, enum gpio_pin pin, rt_uint8_t value)
if (value & 0xE)
{
LOG_W("[line]:%d There is a warning with parameter input", __LINE__);
return RT_EINVAL;
return -RT_EINVAL;
}
addr = GPIOn_DATA_ADDR(port);
@ -109,7 +109,7 @@ int gpio_set_pull_mode(enum gpio_port port, enum gpio_pin pin, enum gpio_pull p
if (pull & 0xC)
{
LOG_W("[line]:%d There is a warning with parameter input", __LINE__);
return RT_EINVAL;
return -RT_EINVAL;
}
addr = GPIOn_PUL_ADDR(port);
@ -137,7 +137,7 @@ int gpio_set_drive_level(enum gpio_port port, enum gpio_pin pin, enum gpio_drv_l
if (level & 0xC)
{
LOG_W("[line]:%d There is a warning with parameter input", __LINE__);
return RT_EINVAL;
return -RT_EINVAL;
}
addr = GPIOn_DRV_ADDR(port);

View File

@ -212,7 +212,7 @@ typedef struct tina_gpio *tina_gpio_t;
#define GPIO ((tina_gpio_t)GPIO_BASE_ADDR)
int gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func);
rt_err_t gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func);
int gpio_set_value(enum gpio_port port, enum gpio_pin pin, rt_uint8_t value);
int gpio_get_value(enum gpio_port port, enum gpio_pin pin);
int gpio_set_pull_mode(enum gpio_port port, enum gpio_pin pin, enum gpio_pull pull);

View File

@ -583,7 +583,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return drv_pwm_get(tmr, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -423,7 +423,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return drv_pwm_get(tmr_x, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -305,7 +305,7 @@ static rt_err_t es32f0_hwtimer_control(rt_hwtimer_t *timer,
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -80,7 +80,7 @@ static rt_err_t es32f0_pwm_control(struct rt_device_pwm *device, int cmd, void *
_ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC4EN_MSK;
}
else
return RT_EINVAL;
return -RT_EINVAL;
switch (cmd)
{

View File

@ -301,7 +301,7 @@ static rt_err_t es32f3_hwtimer_control(rt_hwtimer_t *timer,
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -81,7 +81,7 @@ static rt_err_t es32f3_pwm_control(struct rt_device_pwm *device, int cmd, void *
_ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC4EN_MSK;
}
else
return RT_EINVAL;
return -RT_EINVAL;
switch (cmd)
{

View File

@ -243,7 +243,7 @@ static void rthw_sdctrl_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req
if (pkg.cmd->cmd_code == 5 || pkg.cmd->cmd_code == 1)
{
rt_kprintf("cmd_code is not vaild %x \r\n", pkg.cmd->cmd_code);
pkg.cmd->err = RT_EINVAL;
pkg.cmd->err = -RT_EINVAL;
goto _exit;
}

View File

@ -325,12 +325,12 @@ static rt_err_t _pin_attach_irq(struct rt_device *device, rt_int32_t pin,
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -364,12 +364,12 @@ static rt_err_t _pin_detach_irq(struct rt_device *device, rt_int32_t pin)
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -397,20 +397,20 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (enabled == PIN_IRQ_ENABLE)
{
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
if (pin_irq_hdr_tab[hdr_index].pin == -1)
{
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
irqmap = &pin_irq_map[hdr_index];
@ -427,7 +427,7 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint
break;
default:
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
rcu_periph_clock_enable(RCU_AF);
@ -449,13 +449,13 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint
irqmap = get_pin_irq_map(index->pin);
if (irqmap == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
nvic_irq_disable(irqmap->irqno);
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -325,12 +325,12 @@ static rt_err_t _pin_attach_irq(struct rt_device *device, rt_int32_t pin,
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -364,12 +364,12 @@ static rt_err_t _pin_detach_irq(struct rt_device *device, rt_int32_t pin)
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -397,20 +397,20 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (enabled == PIN_IRQ_ENABLE)
{
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
if (pin_irq_hdr_tab[hdr_index].pin == -1)
{
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
irqmap = &pin_irq_map[hdr_index];
@ -427,7 +427,7 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint
break;
default:
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
rcu_periph_clock_enable(RCU_AF);
@ -449,13 +449,13 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint
irqmap = get_pin_irq_map(index->pin);
if (irqmap == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
nvic_irq_disable(irqmap->irqno);
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -350,12 +350,12 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -389,12 +389,12 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -422,20 +422,20 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (enabled == PIN_IRQ_ENABLE)
{
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
if (pin_irq_hdr_tab[hdr_index].pin == -1)
{
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
irqmap = &pin_irq_map[hdr_index];
@ -452,7 +452,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
break;
default:
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
rcu_periph_clock_enable(RCU_AF);
@ -474,13 +474,13 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
irqmap = get_pin_irq_map(index->pin);
if (irqmap == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
nvic_irq_disable(irqmap->irqno);
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -272,13 +272,13 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -313,13 +313,13 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -348,7 +348,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (enabled == PIN_IRQ_ENABLE)
@ -356,14 +356,14 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
if (pin_irq_hdr_tab[hdr_index].pin == -1)
{
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
irqmap = &pin_irq_map[hdr_index];
@ -381,7 +381,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
break;
default:
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
rcu_periph_clock_enable(RCU_CFGCMP);
@ -403,13 +403,13 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
irqmap = get_pin_irq_map(index->pin);
if (irqmap == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
nvic_irq_disable(irqmap->irqno);
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -245,12 +245,12 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -284,12 +284,12 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
@ -317,20 +317,20 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
index = get_pin(pin);
if (index == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (enabled == PIN_IRQ_ENABLE)
{
hdr_index = bit2bitno(index->pin);
if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map))
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
if (pin_irq_hdr_tab[hdr_index].pin == -1)
{
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
irqmap = &pin_irq_map[hdr_index];
@ -347,7 +347,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
break;
default:
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
//rcu_periph_clock_enable(RCU_AF);
@ -369,13 +369,13 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
irqmap = get_pin_irq_map(index->pin);
if (irqmap == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
nvic_irq_disable(irqmap->irqno);
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -160,7 +160,7 @@ static rt_err_t _can_config(struct rt_can_device *can, struct can_configure *cfg
int32_t ret = CAN_Init(p_can_dev->instance, &p_can_dev->ll_init);
if (ret != LL_OK)
{
rt_ret = RT_EINVAL;
rt_ret = -RT_EINVAL;
}
return rt_ret;

View File

@ -209,7 +209,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return drv_pwm_get(TMRAx, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -156,7 +156,7 @@ static rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configurat
/* SI/SO pin shared */
if (cfg->mode & RT_SPI_3WIRE)
{
return RT_EINVAL;
return -RT_EINVAL;
}
else
{

View File

@ -297,7 +297,7 @@ static rt_err_t hpm_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_u
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -86,7 +86,7 @@ static rt_err_t hpm_rtc_control(rt_device_t dev, int cmd, void *args)
hpm_rtc_set_timestamp(*(time_t *)args);
break;
default:
err = RT_EINVAL;
err = -RT_EINVAL;
break;
}

View File

@ -73,7 +73,7 @@ static rt_err_t hpm_spi_configure(struct rt_spi_device *device, struct rt_spi_co
if (cfg->data_width != 8 && cfg->data_width != 16 && cfg->data_width != 32)
{
return RT_EINVAL;
return -RT_EINVAL;
}
spi_master_get_default_timing_config(&timing_config);

View File

@ -93,7 +93,7 @@ rt_err_t hpm_usb_control(rt_device_t dev, int cmd, void *args)
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -207,7 +207,7 @@ static rt_err_t hpm_wdog_control(rt_watchdog_t *wdt, int cmd, void *args)
hpm_wdog_close(wdt);
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -774,7 +774,7 @@ static rt_err_t imxrt_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt
}
else
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -144,7 +144,7 @@ static rt_err_t imxrt_drv_pwm_control(struct rt_device_pwm *device, int cmd, voi
case PWM_CMD_GET:
return imxrt_drv_pwm_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}
@ -422,7 +422,7 @@ static rt_err_t imxrt_drv_qtmr_control(struct rt_device_pwm *device, int cmd, vo
case PWM_CMD_GET:
return imxrt_drv_qtmr_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -279,7 +279,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device, struct rt_spi_config
if(cfg->data_width != 8 && cfg->data_width != 16 && cfg->data_width != 32)
{
return RT_EINVAL;
return -RT_EINVAL;
}
LPSPI_MasterGetDefaultConfig(&masterConfig);

View File

@ -139,7 +139,7 @@ static rt_err_t imxrt_hp_wdog3_control(rt_watchdog_t *wdt, int cmd, void *args)
}
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;
@ -274,7 +274,7 @@ static rt_err_t imxrt_hp_wdog_control(rt_watchdog_t *wdt, int cmd, void *args)
}
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -107,7 +107,7 @@ static rt_err_t loongson_pwm_ioctl(struct rt_device_pwm *device, int cmd, void *
rc = RT_ENOSYS;
break;
default:
rc = RT_EINVAL;
rc = -RT_EINVAL;
break;
}
return rc;

View File

@ -239,7 +239,7 @@ static rt_err_t lpc_drv_pwm_control(struct rt_device_pwm *device, int cmd, void
case PWM_CMD_GET:
return lpc_drv_pwm_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -116,7 +116,7 @@ static rt_err_t lpc_rtc_control(rt_device_t dev, int cmd, void *args)
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -204,7 +204,7 @@ static rt_err_t lpc_wwdt_control(rt_watchdog_t *wdt, int cmd, void *args)
}
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -92,7 +92,7 @@ static rt_err_t n32_adc_enabled(struct rt_adc_device *device, rt_uint32_t channe
{
if (channel > ADC_CH_18)
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;
}
@ -104,7 +104,7 @@ static rt_err_t n32_adc_convert(struct rt_adc_device *device, rt_uint32_t channe
if (channel > ADC_CH_18)
{
return RT_EINVAL;
return -RT_EINVAL;
}
config = (struct n32_adc_config *)(device->parent.user_data);

View File

@ -151,7 +151,7 @@ static rt_err_t n32_wdt_control(rt_watchdog_t *wdt, int cmd, void *args)
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -314,7 +314,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return drv_pwm_get(pwm_dev, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -356,7 +356,7 @@ const static struct rt_pin_ops _nrf5x_pin_ops =
RT_NULL,
};
int rt_hw_pin_init(void)
rt_err_t rt_hw_pin_init(void)
{
nrfx_err_t err_code;
@ -366,11 +366,11 @@ int rt_hw_pin_init(void)
switch(err_code)
{
case NRFX_ERROR_INVALID_STATE:
return RT_EINVAL;
return -RT_EINVAL;
case NRFX_SUCCESS:
return RT_EOK;
default:
return RT_ERROR;;
return -RT_ERROR;;
}
}

View File

@ -35,18 +35,10 @@ struct pin_index
{
int index;
NRF_GPIO_Type *gpio;//NRF_P0 or NRF_P1
uint32_t pin;
rt_base_t pin;
};
static void nrf5x_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value);
static int nrf5x_pin_read(rt_device_t dev, rt_base_t pin);
static void nrf5x_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode);
static rt_err_t nrf5x_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
rt_uint32_t mode, void (*hdr)(void *args), void *args);
static rt_err_t nrf5x_pin_dettach_irq(struct rt_device *device, rt_int32_t pin);
static rt_err_t nrf5x_pin_irq_enable(struct rt_device *device, rt_base_t pin,
rt_uint32_t enabled);
int rt_hw_pin_init(void);
rt_err_t rt_hw_pin_init(void);
#endif /* __DRV_GPIO_H__ */

View File

@ -212,7 +212,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return drv_pwm_get(p_mcu, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -66,7 +66,7 @@ static rt_err_t gd32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chann
{
if (channel > ADC_CHANNEL_17)
{
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;
}
@ -78,7 +78,7 @@ static rt_err_t gd32_adc_convert(struct rt_adc_device *device, rt_uint32_t chann
if (channel > ADC_CHANNEL_17)
{
return RT_EINVAL;
return -RT_EINVAL;
}
config = (struct gd32_adc_config *)(device->parent.user_data);

View File

@ -379,7 +379,7 @@ static rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin,
break;
default:
rt_hw_interrupt_enable(level);
return RT_EINVAL;
return -RT_EINVAL;
}
/* connect EXTI line to GPIO pin */
@ -404,7 +404,7 @@ static rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin,
irqmap = get_pin_irq_map(index->pin);
if (irqmap == RT_NULL)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if ((irqmap->pinbit >= GPIO_PIN_5) && (irqmap->pinbit <= GPIO_PIN_9))
{

View File

@ -71,7 +71,7 @@ static rt_err_t gd32_pwm_enable(struct rt_device_pwm *device, struct rt_pwm_conf
if (configuration->channel > GD32_MAX_PWM_CHANNELS)
{
return RT_EINVAL;
return -RT_EINVAL;
}
if (!enable)
{
@ -143,12 +143,12 @@ static rt_err_t gd32_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configu
if (configuration->channel > GD32_MAX_PWM_CHANNELS)
{
LOG_I("max channel supported is %d\n", GD32_MAX_PWM_CHANNELS);
return RT_EINVAL;
return -RT_EINVAL;
}
if (configuration->period < configuration->pulse)
{
LOG_I("period should > pulse \n");
return RT_EINVAL;
return -RT_EINVAL;
}
pwmclk = gd32_get_pwm_clk(config->periph);
@ -157,12 +157,12 @@ static rt_err_t gd32_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configu
period_cmp = (uint64_t)(1000000000 / pwmclk) * 10;
if (configuration->period < period_cmp)
{
return RT_EINVAL;
return -RT_EINVAL;
}
period_cmp = (uint64_t)(1000000000 / (pwmclk / 65536 / 4)) * 65536;
if (configuration->period > period_cmp)
{
return RT_EINVAL;
return -RT_EINVAL;
}
period_cmp = (uint64_t) pwmclk * configuration->period / 1000000000;
@ -252,7 +252,7 @@ static rt_err_t gd32_pwm_control(struct rt_device_pwm *device, int cmd, void *ar
case PWM_CMD_GET:
return gd32_pwm_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -127,7 +127,7 @@ static rt_err_t gd32_rtc_control(rt_device_t dev, int cmd, void *args)
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -124,7 +124,7 @@ static rt_err_t gd32_wdog_control(rt_watchdog_t *wdt, int cmd, void *args)
}
break;
default:
return RT_EINVAL;
return -RT_EINVAL;
}
return RT_EOK;

View File

@ -205,7 +205,7 @@ static rt_err_t nu_bpwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return nu_bpwm_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -284,7 +284,7 @@ exit_pdma_channel_terminate:
static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!(nu_pdma_chn_mask & (1 << i32ChannID)))
goto exit_nu_pdma_timeout_set;
@ -355,7 +355,7 @@ exit_nu_pdma_channel_allocate:
rt_err_t nu_pdma_channel_free(int i32ChannID)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (! nu_pdma_inited)
goto exit_nu_pdma_channel_free;
@ -373,7 +373,7 @@ exit_nu_pdma_channel_free:
rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_cb_handler_t pfnHandler, void *pvUserData, uint32_t u32EventFilter)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!(nu_pdma_chn_mask & (1 << i32ChannID)))
goto exit_nu_pdma_callback_register;
@ -461,7 +461,7 @@ exit_nu_pdma_channel_memctrl_get:
rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos];
@ -518,7 +518,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3
uint32_t u32SrcCtl = 0;
uint32_t u32DstCtl = 0;
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!dma_desc)
goto exit_nu_pdma_desc_setup;
@ -714,7 +714,7 @@ static void _nu_pdma_transfer(int i32ChannID, uint32_t u32Peripheral, nu_pdma_de
rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, int32_t i32TransferCnt, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
@ -744,7 +744,7 @@ exit_nu_pdma_transfer:
rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
if (!head)

View File

@ -111,7 +111,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_qspi_bus_configure;
}

View File

@ -130,7 +130,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_spi_bus_configure;
}

View File

@ -191,7 +191,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -442,7 +442,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported data length\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -459,7 +459,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported stop bit\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -480,7 +480,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported parity\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}

View File

@ -168,7 +168,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
if (!(configuration->data_width == 8 ||
configuration->data_width == 16))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uspi_bus_configure;
}

View File

@ -224,7 +224,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -241,7 +241,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -262,7 +262,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
/* Reset this module */

View File

@ -371,7 +371,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -385,7 +385,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (wanted_sec == 0)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -396,7 +396,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -205,7 +205,7 @@ static rt_err_t nu_bpwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return nu_bpwm_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -285,7 +285,7 @@ exit_pdma_channel_terminate:
static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
PDMA_T *PDMA = NULL;
if (!(nu_pdma_chn_mask & (1 << i32ChannID)))
@ -359,7 +359,7 @@ exit_nu_pdma_channel_allocate:
rt_err_t nu_pdma_channel_free(int i32ChannID)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (! nu_pdma_inited)
goto exit_nu_pdma_channel_free;
@ -377,7 +377,7 @@ exit_nu_pdma_channel_free:
rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_cb_handler_t pfnHandler, void *pvUserData, uint32_t u32EventFilter)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!(nu_pdma_chn_mask & (1 << i32ChannID)))
goto exit_nu_pdma_callback_register;
@ -469,7 +469,7 @@ exit_nu_pdma_channel_memctrl_get:
rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos];
@ -527,7 +527,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3
uint32_t u32SrcCtl = 0;
uint32_t u32DstCtl = 0;
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!dma_desc)
goto exit_nu_pdma_desc_setup;
@ -727,7 +727,7 @@ static void _nu_pdma_transfer(int i32ChannID, uint32_t u32Peripheral, nu_pdma_de
rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, int32_t i32TransferCnt, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID);
@ -759,7 +759,7 @@ exit_nu_pdma_transfer:
rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
if (!head)

View File

@ -111,7 +111,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_qspi_bus_configure;
}

View File

@ -213,7 +213,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, struct seri
default:
LOG_E("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -230,7 +230,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, struct seri
default:
LOG_E("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -251,7 +251,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, struct seri
default:
LOG_E("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}

View File

@ -190,7 +190,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_spi_bus_configure;
}

View File

@ -198,7 +198,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -396,7 +396,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported data length\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -413,7 +413,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported stop bit\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -434,7 +434,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported parity\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}

View File

@ -168,7 +168,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
if (!(configuration->data_width == 8 ||
configuration->data_width == 16))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uspi_bus_configure;
}

View File

@ -233,7 +233,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -250,7 +250,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -271,7 +271,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
/* Reset this module */

View File

@ -370,7 +370,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -384,7 +384,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (wanted_sec == 0)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -395,7 +395,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -118,7 +118,7 @@ static rt_err_t nu_dac_convert(struct rt_dac_device *device, rt_uint32_t channel
if (channel >= psNuDAC->max_chn_num)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_dac_convert;
}

View File

@ -131,7 +131,7 @@ static rt_err_t nu_get_eadc_value(struct rt_adc_device *device, rt_uint32_t chan
if (channel >= psNuEADC->max_chn_num)
{
*value = 0xFFFFFFFF;
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_get_eadc_value;
}

View File

@ -341,7 +341,7 @@ exit_pdma_channel_terminate:
static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
PDMA_T *PDMA = NULL;
uint32_t u32ModChannId;
@ -425,7 +425,7 @@ exit_nu_pdma_channel_allocate:
rt_err_t nu_pdma_channel_free(int i32ChannID)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (! nu_pdma_inited)
goto exit_nu_pdma_channel_free;
@ -446,7 +446,7 @@ exit_nu_pdma_channel_free:
rt_err_t nu_pdma_filtering_set(int i32ChannID, uint32_t u32EventFilter)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (nu_pdma_check_is_nonallocated(i32ChannID))
goto exit_nu_pdma_filtering_set;
@ -473,7 +473,7 @@ exit_nu_pdma_filtering_get:
rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_chn_cb_t psChnCb)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_cb_t psChnCb_Current = RT_NULL;
RT_ASSERT(psChnCb != RT_NULL);
@ -595,7 +595,7 @@ exit_nu_pdma_channel_memctrl_get:
rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos];
if (nu_pdma_check_is_nonallocated(i32ChannID))
@ -652,7 +652,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3
uint32_t u32SrcCtl = 0;
uint32_t u32DstCtl = 0;
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!dma_desc)
goto exit_nu_pdma_desc_setup;
@ -925,7 +925,7 @@ exit__nu_pdma_transfer_chain:
rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, uint32_t u32TransferCnt, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID);
nu_pdma_desc_t head;
nu_pdma_chn_t *psPdmaChann;
@ -966,7 +966,7 @@ exit_nu_pdma_transfer:
rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
if (!head)

View File

@ -129,7 +129,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_qspi_bus_configure;
}

View File

@ -186,7 +186,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported data length\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -203,7 +203,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported stop bit\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -224,7 +224,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported parity\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}

View File

@ -334,7 +334,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_spi_bus_configure;
}

View File

@ -122,7 +122,7 @@ static void nu_timer_init(rt_hwtimer_t *timer, rt_uint32_t state)
static rt_err_t nu_timer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
rt_uint32_t u32OpMode;
nu_timer_t psNuTmr = NU_TIMER_DEVICE(timer);
@ -205,7 +205,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -577,7 +577,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported data length\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -594,7 +594,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported stop bit\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -615,7 +615,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported parity\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}

View File

@ -147,7 +147,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
if (!(configuration->data_width == 8 ||
configuration->data_width == 16))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uspi_bus_configure;
}

View File

@ -196,7 +196,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -213,7 +213,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported stop bit\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -234,7 +234,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported parity\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
/* Reset this module */

View File

@ -385,7 +385,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -399,7 +399,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (wanted_sec == 0)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -410,7 +410,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -205,7 +205,7 @@ static rt_err_t nu_bpwm_control(struct rt_device_pwm *device, int cmd, void *arg
case PWM_CMD_GET:
return nu_bpwm_get(device, configuration);
default:
return RT_EINVAL;
return -RT_EINVAL;
}
}

View File

@ -314,7 +314,7 @@ exit_pdma_channel_terminate:
static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!(nu_pdma_chn_mask & (1 << i32ChannID)))
goto exit_nu_pdma_timeout_set;
@ -385,7 +385,7 @@ exit_nu_pdma_channel_allocate:
rt_err_t nu_pdma_channel_free(int i32ChannID)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (! nu_pdma_inited)
goto exit_nu_pdma_channel_free;
@ -403,7 +403,7 @@ exit_nu_pdma_channel_free:
rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_cb_handler_t pfnHandler, void *pvUserData, uint32_t u32EventFilter)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!(nu_pdma_chn_mask & (1 << i32ChannID)))
goto exit_nu_pdma_callback_register;
@ -491,7 +491,7 @@ exit_nu_pdma_channel_memctrl_get:
rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos];
@ -548,7 +548,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3
uint32_t u32SrcCtl = 0;
uint32_t u32DstCtl = 0;
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!dma_desc)
goto exit_nu_pdma_desc_setup;
@ -744,7 +744,7 @@ static void _nu_pdma_transfer(int i32ChannID, uint32_t u32Peripheral, nu_pdma_de
rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, int32_t i32TransferCnt, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
@ -774,7 +774,7 @@ exit_nu_pdma_transfer:
rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
if (!head)

View File

@ -130,7 +130,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_qspi_bus_configure;
}

View File

@ -213,7 +213,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -230,7 +230,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -251,7 +251,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}

View File

@ -190,7 +190,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_spi_bus_configure;
}

View File

@ -190,7 +190,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -474,7 +474,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported data length\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -491,7 +491,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported stop bit\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -512,7 +512,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported parity\n");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}

View File

@ -168,7 +168,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
if (!(configuration->data_width == 8 ||
configuration->data_width == 16))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uspi_bus_configure;
}

View File

@ -233,7 +233,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -250,7 +250,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
@ -271,7 +271,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria
default:
rt_kprintf("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uuart_configure;
}
/* Reset this module */

View File

@ -367,7 +367,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -381,7 +381,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (wanted_sec == 0)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -392,7 +392,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -329,7 +329,7 @@ static void nu_adc_touch_smpl(void *p)
static rt_err_t _nu_adc_control(rt_device_t dev, int cmd, void *args)
{
rt_err_t ret = RT_EINVAL ;
rt_err_t ret = -RT_EINVAL ;
nu_adc_t psNuAdc = (nu_adc_t)dev;
ADC_T *adc = psNuAdc->base;
@ -563,7 +563,7 @@ static rt_err_t nu_adc_convert(struct rt_adc_device *device, rt_uint32_t channel
if (channel >= ADC_CH_NUM)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_adc_convert;
}
else if ((ret = _nu_adc_control((rt_device_t)device, SWITCH_CH, (void *)channel)) != RT_EOK)

View File

@ -330,7 +330,7 @@ static inline void nu_pdma_channel_reset(int i32ChannID)
static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
PDMA_T *PDMA = NULL;
uint32_t u32ModChannId;
@ -435,7 +435,7 @@ exit_nu_pdma_channel_allocate:
rt_err_t nu_pdma_channel_free(int i32ChannID)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (! nu_pdma_inited)
goto exit_nu_pdma_channel_free;
@ -456,7 +456,7 @@ exit_nu_pdma_channel_free:
rt_err_t nu_pdma_filtering_set(int i32ChannID, uint32_t u32EventFilter)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (nu_pdma_check_is_nonallocated(i32ChannID))
goto exit_nu_pdma_filtering_set;
@ -483,7 +483,7 @@ exit_nu_pdma_filtering_get:
rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_chn_cb_t psChnCb)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_cb_t psChnCb_Current = RT_NULL;
RT_ASSERT(psChnCb != RT_NULL);
@ -630,7 +630,7 @@ exit_nu_pdma_channel_memctrl_get:
rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos];
if (nu_pdma_check_is_nonallocated(i32ChannID))
@ -686,7 +686,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3
uint32_t u32SrcCtl = 0;
uint32_t u32DstCtl = 0;
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
if (!dma_desc)
goto exit_nu_pdma_desc_setup;
@ -949,7 +949,7 @@ exit__nu_pdma_transfer_chain:
rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, uint32_t u32TransferCnt, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID);
nu_pdma_desc_t head;
nu_pdma_chn_t *psPdmaChann;
@ -990,7 +990,7 @@ exit_nu_pdma_transfer:
rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
nu_pdma_periph_ctl_t *psPeriphCtl = NULL;
if (!head)

View File

@ -128,7 +128,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_qspi_bus_configure;
}

View File

@ -146,7 +146,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -163,7 +163,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -184,7 +184,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}

View File

@ -185,7 +185,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_spi_bus_configure;
}

View File

@ -171,7 +171,7 @@ static void nu_timer_init(rt_hwtimer_t *timer, rt_uint32_t state)
static rt_err_t nu_timer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
rt_uint32_t u32OpMode;
nu_timer_t psNuTmr = NU_TIMER_DEVICE(timer);
@ -254,7 +254,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -639,7 +639,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
LOG_E("Unsupported data length.");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -656,7 +656,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
LOG_E("Unsupported stop bit.");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -677,7 +677,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
LOG_E("Unsupported parity.");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}

View File

@ -257,7 +257,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -269,7 +269,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -277,7 +277,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (wanted_sec == 0)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}
@ -289,7 +289,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args)
if (args == RT_NULL)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -330,7 +330,7 @@ static void nu_adc_touch_smpl(void *p)
static rt_err_t _nu_adc_control(rt_device_t dev, int cmd, void *args)
{
rt_err_t ret = RT_EINVAL ;
rt_err_t ret = -RT_EINVAL ;
nu_adc_t psNuAdc = (nu_adc_t)dev;
ADC_T *adc = psNuAdc->base;
@ -564,7 +564,7 @@ static rt_err_t nu_adc_convert(struct rt_adc_device *device, rt_uint32_t channel
if (channel >= ADC_CH_NUM)
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_adc_convert;
}
else if ((ret = _nu_adc_control((rt_device_t)device, SWITCH_CH, (void *)channel)) != RT_EOK)

View File

@ -147,7 +147,7 @@ static void nu_etimer_init(rt_hwtimer_t *timer, rt_uint32_t state)
static rt_err_t nu_etimer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
rt_uint32_t u32OpMode;
nu_etimer_t psNuETmr = NU_TIMER_DEVICE(timer);
@ -230,7 +230,7 @@ static rt_err_t nu_etimer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *ar
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -223,7 +223,7 @@ uint32_t nu_pwm_config(uint32_t u32PwmBaseAddr, uint32_t u32ChannelNum, uint32_t
static rt_err_t nu_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configuration *config)
{
nu_pwm_t psNuPWM = (nu_pwm_t)device;
rt_err_t result = RT_EINVAL;
rt_err_t result = -RT_EINVAL;
rt_uint32_t u32FreqInHz; /* unit:Hz */
rt_uint32_t u32PulseInHz; /* unit:% */

View File

@ -137,7 +137,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
configuration->data_width == 24 ||
configuration->data_width == 32))
{
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_qspi_bus_configure;
}

View File

@ -156,7 +156,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -173,7 +173,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}
@ -194,7 +194,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial,
default:
LOG_E("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_scuart_configure;
}

View File

@ -150,7 +150,7 @@ static void nu_timer_init(rt_hwtimer_t *timer, rt_uint32_t state)
static rt_err_t nu_timer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode)
{
rt_err_t ret = RT_EINVAL;
rt_err_t ret = -RT_EINVAL;
rt_uint32_t u32OpMode;
nu_timer_t psNuTmr = NU_TIMER_DEVICE(timer);
@ -233,7 +233,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg
break;
default:
ret = RT_EINVAL;
ret = -RT_EINVAL;
break;
}

View File

@ -300,7 +300,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported data length");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -317,7 +317,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported stop bit");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}
@ -338,7 +338,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial
default:
rt_kprintf("Unsupported parity");
ret = RT_EINVAL;
ret = -RT_EINVAL;
goto exit_nu_uart_configure;
}

Some files were not shown because too many files have changed in this diff Show More