mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-27 23:38:32 +08:00
[errno code][-RT_ERROR] fix that use RT_ERROR without -
This commit is contained in:
committed by
Man, Jianting (Meco)
parent
de963feef4
commit
0f461e870c
@@ -22,7 +22,7 @@
|
||||
static rt_err_t wm_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled)
|
||||
{
|
||||
if (channel < 1 || channel > 8)
|
||||
return RT_ERROR;
|
||||
return -RT_ERROR;
|
||||
|
||||
if (enabled == RT_TRUE)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ static rt_err_t wm_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel
|
||||
static rt_err_t wm_adc_convert(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value)
|
||||
{
|
||||
if (channel < 1 || channel > 8)
|
||||
return RT_ERROR;
|
||||
return -RT_ERROR;
|
||||
|
||||
*value = adc_get_inputVolt(channel - 1) ;
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ static rt_err_t wm_i2c_bus_control(struct rt_i2c_bus_device *bus,
|
||||
rt_uint32_t cmd,
|
||||
rt_uint32_t arg)
|
||||
{
|
||||
return RT_ERROR;
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
void WM_I2C_IRQHandler(void)
|
||||
|
||||
@@ -83,7 +83,7 @@ static rt_err_t wm_pwm_set(rt_uint8_t channel, struct rt_pwm_configuration *conf
|
||||
}
|
||||
else
|
||||
{
|
||||
return RT_ERROR;
|
||||
return -RT_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,13 +122,13 @@ static rt_err_t wm_pwm_control(struct rt_device_pwm *device, int cmd, void *arg)
|
||||
if (ret == WM_SUCCESS)
|
||||
return RT_EOK;
|
||||
else
|
||||
return RT_ERROR;
|
||||
return -RT_ERROR;
|
||||
case PWM_CMD_DISABLE:
|
||||
ret = tls_pwm_stop(channel);
|
||||
if (ret == WM_SUCCESS)
|
||||
return RT_EOK;
|
||||
else
|
||||
return RT_ERROR;
|
||||
return -RT_ERROR;
|
||||
case PWM_CMD_SET:
|
||||
return wm_pwm_set(channel, configuration);
|
||||
case PWM_CMD_GET:
|
||||
|
||||
@@ -392,7 +392,7 @@ static rt_err_t drv_wlan_softap(struct rt_wlan_device *wlan, struct rt_ap_info *
|
||||
rt_memcpy(ipinfo.dnsname, "local.w60x", sizeof("local.w60x"));
|
||||
int ret = tls_wifi_softap_create(&apinfo, &ipinfo);
|
||||
|
||||
return (ret == WM_SUCCESS) ? RT_EOK : RT_ERROR;
|
||||
return (ret == WM_SUCCESS) ? RT_EOK : -RT_ERROR;
|
||||
}
|
||||
|
||||
static rt_err_t drv_wlan_disconnect(struct rt_wlan_device *wlan)
|
||||
@@ -426,7 +426,7 @@ static rt_err_t drv_wlan_ap_deauth(struct rt_wlan_device *wlan, rt_uint8_t mac[]
|
||||
unsigned short reason = WLAN_REASON_UNSPECIFIED;/* htons */
|
||||
int ret = tls_wifi_send_mgmt(WM_WIFI_MGMT_TYPE_DEAUTH, &machdr, (u8 *)&reason, sizeof(reason), &tx);
|
||||
|
||||
return (0 == ret) ? RT_EOK : RT_ERROR;
|
||||
return (0 == ret) ? RT_EOK : -RT_ERROR;
|
||||
}
|
||||
|
||||
static rt_err_t drv_wlan_scan_stop(struct rt_wlan_device *wlan)
|
||||
|
||||
Reference in New Issue
Block a user