1.优化错误码,默认为负。
This commit is contained in:
12
device/pwm.c
12
device/pwm.c
@@ -14,7 +14,7 @@
|
||||
|
||||
static mr_err_t err_io_pwm_configure(mr_pwm_t pwm, mr_pwm_config_t config)
|
||||
{
|
||||
return -MR_ERR_IO;
|
||||
return MR_ERR_IO;
|
||||
}
|
||||
|
||||
static void err_io_pwm_write(mr_pwm_t pwm, mr_off_t channel, mr_uint32_t duty)
|
||||
@@ -61,7 +61,7 @@ static mr_err_t mr_pwm_ioctl(mr_device_t device, int cmd, void *args)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return -MR_ERR_INVALID;
|
||||
return MR_ERR_INVALID;
|
||||
}
|
||||
|
||||
case MR_DEVICE_CTRL_GET_CONFIG:
|
||||
@@ -72,11 +72,11 @@ static mr_err_t mr_pwm_ioctl(mr_device_t device, int cmd, void *args)
|
||||
*config = pwm->config;
|
||||
return MR_ERR_OK;
|
||||
}
|
||||
return -MR_ERR_INVALID;
|
||||
return MR_ERR_INVALID;
|
||||
}
|
||||
|
||||
default:
|
||||
return -MR_ERR_UNSUPPORTED;
|
||||
return MR_ERR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ static mr_err_t mr_pwm_read(mr_device_t device, mr_off_t pos, void *buffer, mr_s
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
return -MR_ERR_INVALID;
|
||||
return MR_ERR_INVALID;
|
||||
}
|
||||
|
||||
while ((read_size += sizeof(*read_buffer)) <= size)
|
||||
@@ -108,7 +108,7 @@ static mr_err_t mr_pwm_write(mr_device_t device, mr_off_t pos, const void *buffe
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
return -MR_ERR_INVALID;
|
||||
return MR_ERR_INVALID;
|
||||
}
|
||||
|
||||
while ((write_size += sizeof(*write_buffer)) <= size)
|
||||
|
||||
Reference in New Issue
Block a user