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

This commit is contained in:
Meco Man
2023-03-17 00:12:16 -04:00
committed by Man, Jianting (Meco)
parent de963feef4
commit 0f461e870c
272 changed files with 639 additions and 644 deletions

View File

@@ -198,7 +198,7 @@ static rt_err_t timer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg)
if (result != CY_RSLT_SUCCESS)
{
LOG_E("cyhal_timer_set_frequency error\r\n");
return RT_ERROR;
return -RT_ERROR;
}
}
break;
@@ -301,7 +301,7 @@ int hwtimer_sample()
if (hw_dev == RT_NULL)
{
rt_kprintf("hwtimer sample run failed! can't find %s device!\n", HWTIMER_DEV_NAME);
return RT_ERROR;
return -RT_ERROR;
}
ret = rt_device_open(hw_dev, RT_DEVICE_OFLAG_RDWR);
@@ -329,7 +329,7 @@ int hwtimer_sample()
if (rt_device_write(hw_dev, 0, &timeout_s, sizeof(timeout_s)) != sizeof(timeout_s))
{
rt_kprintf("set timeout value failed\n");
return RT_ERROR;
return -RT_ERROR;
}
while (1)

View File

@@ -243,7 +243,7 @@ static int pwm_sample(int argc, char *argv[])
if (pwm_dev == RT_NULL)
{
rt_kprintf("pwm sample run failed! can't find %s device!\n", PWM_DEV_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_pwm_set(pwm_dev, PWM_DEV_CHANNEL, period, pulse);

View File

@@ -153,7 +153,7 @@ static int rt_hw_rtc_init(void)
if (rt_hw_rtc_register(&ifx32_rtc_dev, "rtc", RT_DEVICE_FLAG_RDWR, RT_NULL) != RT_EOK)
{
LOG_E("rtc init failed");
result = RT_ERROR;
result = -RT_ERROR;
}
else
{

View File

@@ -60,7 +60,7 @@ static void ifx_spi_init(struct ifx_spi *ifx_spi)
result = cyhal_spi_init(ifx_spi->spi_obj, ifx_spi->mosi_pin, ifx_spi->miso_pin, ifx_spi->sck_pin,
NC, NULL, ifx_spi->spi_obj->data_bits, ifx_spi->spi_obj->mode, false);
RT_ASSERT(result != RT_ERROR);
RT_ASSERT(result == RT_EOK);
rt_kprintf("[%s] Freq:[%d]HZ\n", ifx_spi->bus_name, ifx_spi->freq);

View File

@@ -182,7 +182,7 @@ static rt_err_t ifx_configure(struct rt_serial_device *serial, struct serial_con
result = cyhal_uart_set_baud(uart->config->uart_obj, cfg->baud_rate, NULL);
}
RT_ASSERT(result != RT_ERROR);
RT_ASSERT(result == RT_EOK);
return RT_EOK;
}

View File

@@ -60,7 +60,7 @@ static rt_err_t wdt_control(rt_watchdog_t *wdt_device, int cmd, void *arg)
/* Initialize the WDT */
int result = cyhal_wdt_init(cfg->WDTx, (rt_uint32_t)timeout_ms);
/* WDT initialization failed. Stop program execution */
RT_ASSERT(result != RT_ERROR);
RT_ASSERT(result == RT_EOK);
}
break;

View File

@@ -234,7 +234,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -234,7 +234,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -234,7 +234,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -235,7 +235,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -234,7 +234,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -235,7 +235,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -235,7 +235,7 @@ int Slider_ctrl_sample(void)
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;

View File

@@ -32,7 +32,7 @@ static int rt_spi_device_init(void)
if (RT_NULL == spi_dev)
{
rt_kprintf("spi sample run failed! can't find %s device!\n", SPI_NAME);
return RT_ERROR;
return -RT_ERROR;
}
rt_spi_configure(spi_dev, &cfg);

View File

@@ -30,14 +30,14 @@ static int wdt_feed_init(void)
if (!wdg_dev)
{
rt_kprintf("find %s failed!\n", device_name);
return RT_ERROR;
return -RT_ERROR;
}
ret = rt_device_control(wdg_dev, RT_DEVICE_CTRL_WDT_SET_TIMEOUT, &timeout);
if (ret != RT_EOK)
{
rt_kprintf("set %s timeout failed!\n", device_name);
return RT_ERROR;
return -RT_ERROR;
}
ret = rt_device_control(wdg_dev, RT_DEVICE_CTRL_WDT_START, RT_NULL);
if (ret != RT_EOK)

View File

@@ -85,7 +85,7 @@ static rt_ssize_t air105_i2c_slv_xfer(struct rt_i2c_bus_device *bus,
struct rt_i2c_msg msgs[],
rt_uint32_t num)
{
return RT_ERROR;
return -RT_ENOSYS;
}
static rt_err_t air105_i2c_bus_control(struct rt_i2c_bus_device *bus,
rt_uint32_t cmd,

View File

@@ -232,7 +232,7 @@ static rt_err_t air105_control(struct rt_serial_device *serial, int cmd, void *a
}
break;
default:
return RT_ERROR;
return -RT_EINVAL;
}
return RT_EOK;

View File

@@ -51,7 +51,7 @@ static rt_err_t hal_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
if (ret < 0)
{
rt_kprintf("gpio to irq error, irq num:%lu error num: %d", irq, ret);
return RT_ERROR;
return -RT_ERROR;
}
level = rt_hw_interrupt_disable();
@@ -61,7 +61,7 @@ static rt_err_t hal_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
{
rt_hw_interrupt_enable(level);
rt_kprintf("request irq error, irq num:%lu error num: %d", irq, ret);
return RT_ERROR;
return -RT_ERROR;
}
rt_hw_interrupt_enable(level);
@@ -78,7 +78,7 @@ static rt_err_t hal_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
if (ret < 0)
{
rt_kprintf("gpio to irq error, irq num:%lu error num: %d", irq, ret);
return RT_ERROR;
return -RT_ERROR;
}
level = rt_hw_interrupt_disable();
@@ -87,7 +87,7 @@ static rt_err_t hal_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
rt_hw_interrupt_enable(level);
rt_kprintf("free irq error, error num: %d", ret);
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;
}
@@ -101,7 +101,7 @@ static rt_err_t hal_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_u
if (ret < 0)
{
rt_kprintf("gpio to irq error, irq num:%lu error num: %d", irq, ret);
return RT_ERROR;
return -RT_ERROR;
}
if (enabled == PIN_IRQ_ENABLE)
@@ -110,7 +110,7 @@ static rt_err_t hal_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_u
if (ret < 0)
{
rt_kprintf("request irq error, error num: %d", ret);
return RT_ERROR;
return -RT_ERROR;
}
}
else
@@ -119,7 +119,7 @@ static rt_err_t hal_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_u
if (ret < 0)
{
rt_kprintf("disable irq error, irq num:%lu, error num: %d", irq, ret);
return RT_ERROR;
return -RT_ERROR;
}
}

View File

@@ -262,7 +262,7 @@ int is_enough_desc_available(struct dma_desc *entry)
if(desc->desc0.tx.own != 0)
{
printf("desc %08x desc0 %08x desc1 %08x\n",desc,desc->desc0,desc->desc1);
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;
@@ -284,7 +284,7 @@ int wait_tx_completed(struct dma_desc *entry)
if(timeout_cnt > 1000)
{
printf("emac send data timeout \n");
return RT_ERROR;
return -RT_ERROR;
}
}
desc_tag_clean(desc);
@@ -307,13 +307,13 @@ static rt_err_t rt_geth_xmit(rt_device_t dev, struct pbuf *p)
unsigned int i = 0;
unsigned int copy_offset = 0;
if (!rt_geth_dev.phy_link_status) return RT_ERROR;
if (!rt_geth_dev.phy_link_status) return -RT_ERROR;
first = rt_geth_dev.get_buffer_config.dma_desc_tx + tx_dirty;
ret = is_enough_desc_available(first);
if(ret < 0)
{
return RT_ERROR;
return -RT_ERROR;
}
copy_offset = 0;
@@ -326,7 +326,7 @@ static rt_err_t rt_geth_xmit(rt_device_t dev, struct pbuf *p)
if(copy_offset >= ((1 << 11) - 1))
{
printf("send data exceed max len copy_offset %d\n",copy_offset);
return RT_ERROR;
return -RT_ERROR;
}
}

View File

@@ -230,7 +230,7 @@ rt_err_t cpu_set_pll_clk(int clk)
//PLL1 rate = ((24000000 * n * k) >> 0) / m (p is ignored)
CCU->pll_cpu_ctrl = (0x1 << 31) | (m << 0) | (k << 4) | (n << 8) | (p << 16);
if (wait_pll_stable((rt_uint32_t)(&CCU->pll_cpu_ctrl)))
return RT_ERROR;
return -RT_ERROR;
CCU->cpu_clk_src = cpu_src << 16;
@@ -267,7 +267,7 @@ rt_err_t audio_set_pll_clk(int clk)
n = clk / n_temp;
m = _24MHZ_ * 2 / m_temp;
if ((n > 128) || (m > 32) || (clk != (_24MHZ_ * n * 2) / m))
return RT_ERROR;
return -RT_ERROR;
CCU->pll_audio_ctrl &= ~(0x1 << 31);
n = (n - 1) & 0x7f;
@@ -276,7 +276,7 @@ rt_err_t audio_set_pll_clk(int clk)
CCU->pll_audio_ctrl = (0x1 << 31) | (0x0 << 24) | (n << 8) | m;
if (wait_pll_stable((rt_uint32_t)(&CCU->pll_audio_ctrl)))
return RT_ERROR;
return -RT_ERROR;
else
return RT_EOK;
}
@@ -312,7 +312,7 @@ rt_err_t video_set_pll_clk(int clk)
m = _24MHZ_ / m_temp;
if ((n > 128) || (m > 16) || (clk != (_24MHZ_ * n) / m))
return RT_ERROR;
return -RT_ERROR;
CCU->pll_video_ctrl &= ~(0x1 << 31);
n = (n - 1) & 0x7f;
@@ -321,7 +321,7 @@ rt_err_t video_set_pll_clk(int clk)
CCU->pll_video_ctrl = (0x1 << 31) | (0x0 << 30) | (0x1 << 24) | (n << 8) | m;
if (wait_pll_stable((rt_uint32_t)(&CCU->pll_video_ctrl)))
return RT_ERROR;
return -RT_ERROR;
else
return RT_EOK;
}
@@ -357,7 +357,7 @@ rt_err_t ve_set_pll_clk(int clk)
m = _24MHZ_ / m_temp;
if ((n > 128) || (m > 16) || (clk != (_24MHZ_ * n) / m))
return RT_ERROR;
return -RT_ERROR;
CCU->pll_ve_ctrl &= ~(0x1 << 31);
n = (n - 1) & 0x7f;
@@ -365,7 +365,7 @@ rt_err_t ve_set_pll_clk(int clk)
//clk = (24 * n) / m
CCU->pll_ve_ctrl = (0x1 << 31) | (0x1 << 24) | (n << 8) | m;
if (wait_pll_stable((rt_uint32_t)(&CCU->pll_ve_ctrl)))
return RT_ERROR;
return -RT_ERROR;
else
return RT_EOK;
}
@@ -388,7 +388,7 @@ rt_err_t periph_set_pll_clk(int clk)
}
if ((n > 32) || (k > 4) || (clk != (_24MHZ_ * n * k)))
return RT_ERROR;
return -RT_ERROR;
temp_data = CCU->ahb_apb_hclkc_cfg;
clk_src = (temp_data >> 12) & 0x3;
temp_data &= ~(0x3 << 12);
@@ -400,7 +400,7 @@ rt_err_t periph_set_pll_clk(int clk)
//clk = 24 * n *k
CCU->pll_periph_ctrl = (0x1 << 31) | (0x1 << 18) | (n << 8) | (k << 4) || (0x1);
if (wait_pll_stable((rt_uint32_t)(&CCU->pll_periph_ctrl)))
return RT_ERROR;
return -RT_ERROR;
temp_data = CCU->ahb_apb_hclkc_cfg;
temp_data &= ~(0x3 << 12);
@@ -423,7 +423,7 @@ rt_err_t cpu_set_clk(int clk)
return RT_EOK;
if (cpu_set_pll_clk(clk))
return RT_ERROR;
return -RT_ERROR;
CCU->ahb_apb_hclkc_cfg &= ~(0x3 << 16);
CCU->cpu_clk_src = CLK_PLL_SRC << 16;

View File

@@ -469,7 +469,7 @@ static rt_err_t pin_attach_irq(struct rt_device *device, rt_int32_t pin, rt_uint
if ((pin > PIN_NUM(pin_index)) || (pin_index[pin].magic != PIN_MAGIC))
{
LOG_E("pin:%d value wrongful", pin);
return RT_ERROR;
return -RT_ERROR;
}
gpio_set_irq_callback(pin_index[pin].pin_port, pin_index[pin].pin, hdr, args);
@@ -481,7 +481,7 @@ static rt_err_t pin_detach_irq(struct rt_device *device, rt_int32_t pin)
if ((pin > PIN_NUM(pin_index)) || (pin_index[pin].magic != PIN_MAGIC))
{
LOG_E("pin:%d value wrongful", pin);
return RT_ERROR;
return -RT_ERROR;
}
gpio_clear_irq_callback(pin_index[pin].pin_port, pin_index[pin].pin);
@@ -494,7 +494,7 @@ rt_err_t pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_t ena
if ((pin > PIN_NUM(pin_index)) || (pin_index[pin].magic != PIN_MAGIC))
{
LOG_E("pin:%d value wrongful", pin);
return RT_ERROR;
return -RT_ERROR;
}
if (enabled)

View File

@@ -774,7 +774,7 @@ err:
rt_free(host);
}
return RT_ERROR;
return -RT_ERROR;
}
INIT_APP_EXPORT(tina_sdio_init);
#endif

View File

@@ -680,7 +680,7 @@ rt_err_t tina_spi_bus_register(SPI_T *spi, const char *spi_bus_name)
LOG_D("%s -> %d", __FUNCTION__, __LINE__);
return RT_ERROR;
return -RT_ERROR;
}
int rt_hw_spi_init(void)

View File

@@ -27,12 +27,9 @@
#define DEBUG_PRINTF(...)
#endif
#ifdef TINA_USING_SPI_FLASH
#if defined(TINA_USING_SPI_FLASH) && defined(RT_USING_SFUD)
#include "spi_flash.h"
#if defined(RT_USING_SFUD)
#include "spi_flash_sfud.h"
#include <spi_flash_sfud.h>
rt_spi_flash_device_t spi_device;
int rt_hw_spi_flash_with_sfud_init(void)
{
@@ -41,14 +38,11 @@ int rt_hw_spi_flash_with_sfud_init(void)
if (spi_device == NULL)
{
DEBUG_PRINTF("%s -> %d\n", __FUNCTION__, __LINE__);
return RT_ERROR;
return -RT_ERROR;
};
DEBUG_PRINTF("%s -> %d\n", __FUNCTION__, __LINE__);
return RT_EOK;
}
INIT_PREV_EXPORT(rt_hw_spi_flash_with_sfud_init);
#endif
#endif
#endif /* defined(TINA_USING_SPI_FLASH) && defined(RT_USING_SFUD) */

View File

@@ -301,7 +301,7 @@ static int rt_hw_rtc_init(void)
if (rt_hw_rtc_register(&apm32_rtc_dev, "rtc", RT_DEVICE_FLAG_RDWR, RT_NULL) != RT_EOK)
{
LOG_E("rtc init failed");
result = RT_ERROR;
result = -RT_ERROR;
}
else
{

View File

@@ -93,7 +93,7 @@ static int uart_sample(int argc, char *argv[])
if (!serial)
{
rt_kprintf("find %s failed!\n", uart_name);
return RT_ERROR;
return -RT_ERROR;
}
rt_sem_init(&rx_sem, "rx_sem", 0, RT_IPC_FLAG_FIFO);
@@ -110,7 +110,7 @@ static int uart_sample(int argc, char *argv[])
}
else
{
ret = RT_ERROR;
ret = -RT_ERROR;
}
return ret;
@@ -253,14 +253,14 @@ static int wdt_sample(int argc, char *argv[])
if (!wdt_dev)
{
rt_kprintf("find %s failed!\n", device_name);
return RT_ERROR;
return -RT_ERROR;
}
ret = rt_device_control(wdt_dev, RT_DEVICE_CTRL_WDT_SET_TIMEOUT, &timeout);
if (ret != RT_EOK)
{
rt_kprintf("set %s timeout failed!\n", device_name);
return RT_ERROR;
return -RT_ERROR;
}
ret = rt_device_control(wdt_dev, RT_DEVICE_CTRL_WDT_START, RT_NULL);
@@ -351,7 +351,7 @@ int can_sample(int argc, char *argv[])
if (!can_dev)
{
rt_kprintf("find %s failed!\n", can_name);
return RT_ERROR;
return -RT_ERROR;
}
rt_sem_init(&rx_sem, "rx_sem", 0, RT_IPC_FLAG_FIFO);
@@ -500,7 +500,7 @@ static int hwtimer_sample(int argc, char *argv[])
if (hw_dev == RT_NULL)
{
rt_kprintf("hwtimer sample run failed! can't find %s device!\n", HWTIMER_DEV_NAME);
return RT_ERROR;
return -RT_ERROR;
}
ret = rt_device_open(hw_dev, RT_DEVICE_OFLAG_RDWR);
@@ -526,7 +526,7 @@ static int hwtimer_sample(int argc, char *argv[])
if (rt_device_write(hw_dev, 0, &timeout_s, sizeof(timeout_s)) != sizeof(timeout_s))
{
rt_kprintf("set timeout value failed\n");
return RT_ERROR;
return -RT_ERROR;
}
rt_thread_mdelay(1000);

View File

@@ -455,7 +455,7 @@ static rt_err_t rt_at32_emac_control(rt_device_t dev, int cmd, void *args)
*/
rt_err_t rt_at32_emac_tx(rt_device_t dev, struct pbuf *p)
{
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
struct pbuf *q;
rt_uint32_t offset;

View File

@@ -445,7 +445,7 @@ static rt_err_t efm_spiSd_writeBlock(void *buffer, rt_uint8_t token)
rt_uint8_t buf_res[8]; /* Expect a byte for data response */
rt_uint8_t i;
ret = RT_ERROR;
ret = -RT_ERROR;
sdcard_debug("SPISD: Write block\n");
do
{

View File

@@ -112,7 +112,7 @@ static rt_ssize_t es32f0_master_xfer(struct rt_i2c_bus_device *bus,
{
struct rt_i2c_msg *msg;
rt_uint32_t i;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
for (i = 0; i < num; i++)
{

View File

@@ -162,7 +162,7 @@ rt_err_t spi_configure(struct rt_spi_device *device,
return RT_EOK;
}
static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
static rt_ssize_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
{
rt_err_t res;
spi_handle_t *hspi;
@@ -208,7 +208,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
}
if (res != RT_EOK)
return RT_ERROR;
return -RT_ERROR;
else
return message->length;

View File

@@ -271,7 +271,7 @@ static rt_ssize_t es32f3_master_xfer(struct rt_i2c_bus_device *bus,
{
struct rt_i2c_msg *msg;
rt_uint32_t i;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
for (i = 0; i < num; i++)
{

View File

@@ -162,7 +162,7 @@ rt_err_t spi_configure(struct rt_spi_device *device,
return RT_EOK;
}
static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
static rt_ssize_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
{
rt_err_t res;
spi_handle_t *hspi;
@@ -208,7 +208,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
}
if (res != RT_EOK)
return RT_ERROR;
return -RT_ERROR;
else
return message->length;

View File

@@ -62,7 +62,7 @@ static rt_err_t ft2004_cmdOperation(struct ft2004_qspi_bus *qspi_bus_p, struct r
if (qspi_message->instruction.qspi_lines == 0)
{
LOG_E("instruction is not valid");
return RT_ERROR;
return -RT_ERROR;
}
cmd_pack.cmd = qspi_message->instruction.content;
@@ -130,13 +130,13 @@ static rt_err_t ft2004_cmdOperation(struct ft2004_qspi_bus *qspi_bus_p, struct r
}
#endif
return (ret == FQSPI_SUCCESS) ? RT_EOK : RT_ERROR;
return (ret == FQSPI_SUCCESS) ? RT_EOK : -RT_ERROR;
}
static rt_uint32_t ft2004_qspi_xfer(struct ft2004_qspi_bus *qspi_bus_p, struct rt_spi_message *message)
static rt_ssize_t ft2004_qspi_xfer(struct ft2004_qspi_bus *qspi_bus_p, struct rt_spi_message *message)
{
struct rt_qspi_message *qspi_message = (struct rt_qspi_message *)message;
rt_uint32_t ret_length = 0;
rt_ssize_t ret_length = 0;
const rt_uint8_t *sndb = message->send_buf;
rt_uint8_t *rcvb = message->recv_buf;
rt_int32_t length = message->length;
@@ -159,7 +159,7 @@ static rt_uint32_t ft2004_qspi_xfer(struct ft2004_qspi_bus *qspi_bus_p, struct r
if (qspi_config_p->channel >= FT_QSPI_MAX_CS_NUM)
{
LOG_E("invalid channel[%x] ", qspi_config_p->channel);
return RT_ERROR;
return -RT_ERROR;
}
switch (cmd)
{

View File

@@ -38,7 +38,7 @@ static rt_err_t _sdcard_mount(void)
if (mmcsd_wait_cd_changed(rt_tick_from_millisecond(5000)) == -RT_ETIMEOUT)
{
rt_kprintf("timeout \r\n");
return RT_ERROR;
return -RT_ERROR;
}
device = rt_device_find("sd0");
}
@@ -54,7 +54,7 @@ static rt_err_t _sdcard_mount(void)
else
{
LOG_W("sd card mount to '/' failed!");
return RT_ERROR;
return -RT_ERROR;
}
}

View File

@@ -408,7 +408,7 @@ static rt_err_t uart03_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.ESBL = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set data bits */
@@ -440,7 +440,7 @@ static rt_err_t uart03_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.L2 = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set parity */
@@ -458,7 +458,7 @@ static rt_err_t uart03_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.P = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set bit order */
@@ -471,7 +471,7 @@ static rt_err_t uart03_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->SMR_f.BDS = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set NRZ mode */
@@ -484,7 +484,7 @@ static rt_err_t uart03_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.INV = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
uart->uart_regs->SCR = SCR_RXE | SCR_TXE | SCR_RIE;
@@ -588,7 +588,7 @@ static rt_err_t uart47_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.ESBL = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set data bits */
@@ -620,7 +620,7 @@ static rt_err_t uart47_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.L2 = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set parity */
@@ -638,7 +638,7 @@ static rt_err_t uart47_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.P = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set bit order */
@@ -651,7 +651,7 @@ static rt_err_t uart47_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->SMR_f.BDS = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* set NRZ mode */
@@ -664,7 +664,7 @@ static rt_err_t uart47_configure(struct rt_serial_device *serial, struct serial_
uart->uart_regs->ESCR_f.INV = 1;
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
/* configure fifo */

View File

@@ -59,7 +59,7 @@ static int rt_hw_spi_flash_with_sfud_init(void)
{
if (RT_NULL == rt_sfud_flash_probe(SPI_FLASH_CHIP, SPI_FLASH_DEVICE_NAME))
{
return RT_ERROR;
return -RT_ERROR;
};
return RT_EOK;

View File

@@ -229,7 +229,7 @@ static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg
{
struct rt_i2c_msg *msg;
rt_uint32_t i;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
struct gd32_i2c_bus *gd32_i2c = (struct gd32_i2c_bus *)bus;

View File

@@ -43,7 +43,7 @@ static int rt_hw_spi_flash_with_sfud_init(void)
{
if (RT_NULL == rt_sfud_flash_probe(SPI_FLASH_DEVICE_NAME, SPI_DEVICE_NAME))
{
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;

View File

@@ -229,7 +229,7 @@ static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg
{
struct rt_i2c_msg *msg;
rt_uint32_t i;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
struct gd32_i2c_bus *gd32_i2c = (struct gd32_i2c_bus *)bus;

View File

@@ -43,7 +43,7 @@ static int rt_hw_spi_flash_with_sfud_init(void)
{
if (RT_NULL == rt_sfud_flash_probe(SPI_FLASH_DEVICE_NAME, SPI_DEVICE_NAME))
{
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;

View File

@@ -230,7 +230,7 @@ static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg
{
struct rt_i2c_msg *msg;
rt_uint32_t i;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
struct gd32_i2c_bus *gd32_i2c = (struct gd32_i2c_bus *)bus;

View File

@@ -44,7 +44,7 @@ static int rt_hw_spi_flash_with_sfud_init(void)
{
if (RT_NULL == rt_sfud_flash_probe(SPI_FLASH_DEVICE_NAME, SPI_DEVICE_NAME))
{
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;

View File

@@ -320,6 +320,6 @@ rt_err_t gd32_spi_bus_register(uint32_t spi_periph,
}
}
return RT_ERROR;
return -RT_ERROR;
}
#endif

View File

@@ -76,7 +76,7 @@ static int rt_hw_spi_flash_with_sfud_init(void)
{
if (RT_NULL == rt_sfud_flash_probe(SPI_FLASH_CHIP, SPI_FLASH_DEVICE_NAME))
{
return RT_ERROR;
return -RT_ERROR;
};
return RT_EOK;

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