Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rt_err_t 回傳值有規範嗎? #3440

Closed
wosayttn opened this issue Mar 11, 2020 · 2 comments
Closed

rt_err_t 回傳值有規範嗎? #3440

wosayttn opened this issue Mar 11, 2020 · 2 comments

Comments

@wosayttn
Copy link
Contributor

請問回傳值 是 RT_ENOSYS 正數,還是 -(RT_ENOSYS) 負數?

rt_err_t rt_pin_irq_enable(rt_base_t pin, rt_uint32_t enabled)
{
RT_ASSERT(_hw_pin.ops != RT_NULL);
if(_hw_pin.ops->pin_irq_enable)
{
return _hw_pin.ops->pin_irq_enable(&_hw_pin.parent, pin, enabled);
}
return RT_ENOSYS;
}

@BernardXiong
Copy link
Member

RTT自己定义的一般都是负数,POSIX的是正数。

后续逐步过渡到,返回值都是负数,errno是正数,向POSIX靠拢

@mysterywolf
Copy link
Member

谢谢你的issue 已经提pr解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants