Skip to content

Commit

Permalink
[bsp] Modify the RT_Exxx error return value to a negative number
Browse files Browse the repository at this point in the history
  • Loading branch information
Z8MAN8 authored and mysterywolf committed Mar 30, 2023
1 parent 4aa38e3 commit 0cdf72f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bsp/mm32f327x/drivers/drv_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static rt_uint8_t mm32_adc_get_resolution(struct rt_adc_device *device)
static rt_int16_t mm32_adc_get_vref(struct rt_adc_device *device)
{
if(device == RT_NULL)
return RT_ERROR;
return -RT_ERROR;

return 3300;
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/raspberry-pi/raspi4-64/drivers/drv_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static rt_err_t bcmgenet_eth_init(rt_device_t device)
major = 1;

rt_kprintf("Uns upported GENETv%d.%d\n", major, (hw_reg >> 16) & 0x0f);
return RT_ERROR;
return -RT_ERROR;
}
/* set interface */
ret = bcmgenet_interface_set();
Expand Down
4 changes: 2 additions & 2 deletions bsp/raspberry-pi/raspi4-64/drivers/drv_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0)
{
rt_kprintf("EMMC: Set clock: timeout waiting for inhibit flags. Status %08x.\n",read32(pdat->virt + EMMC_STATUS));
return RT_ERROR;
return -RT_ERROR;
}

// Switch clock off.
Expand Down Expand Up @@ -471,7 +471,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0)
{
rt_kprintf("EMMC: ERROR: failed to get stable clock %d.\n", clock);
return RT_ERROR;
return -RT_ERROR;
}

mmcsd_dbg("set stable clock %d.\n", clock);
Expand Down
2 changes: 1 addition & 1 deletion bsp/raspberry-pi/raspi4-64/drivers/drv_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me
(config.mode & RT_SPI_CS_HIGH)?prev_raspi_pin_write(cs_pin, 0):prev_raspi_pin_write(cs_pin, 1);
}
if (res != RT_EOK)
return RT_ERROR;
return -RT_ERROR;

return message->length;
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/raspberry-pi/raspi4-64/drivers/drv_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static rt_err_t raspi_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
raspi_watchdog_stop();
break;
default:
return RT_EIO;
return -RT_EIO;
}
return RT_EOK;
}
Expand Down

0 comments on commit 0cdf72f

Please sign in to comment.