diff options
| author | Meco Man <[email protected]> | 2021-02-11 09:45:49 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-11 09:45:49 -0600 |
| commit | f0805a7973ffe62e459da7748cbada62bccf98b9 (patch) | |
| tree | 9150992340323657482d81a2bedd9497e9d429ab /components/drivers | |
| parent | 852d7d7552bd3fe898115ea16ba401970b0d1fad (diff) | |
| parent | a4dd106d49667aed3ca5e7a7fa3ef8f650070f45 (diff) | |
Merge pull request #16 from RT-Thread/master
pr
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/include/drivers/hwtimer.h | 2 | ||||
| -rw-r--r-- | components/drivers/misc/pin.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/components/drivers/include/drivers/hwtimer.h b/components/drivers/include/drivers/hwtimer.h index cbfeec2bf8..d00dbd8a13 100644 --- a/components/drivers/include/drivers/hwtimer.h +++ b/components/drivers/include/drivers/hwtimer.h @@ -70,7 +70,7 @@ typedef struct rt_hwtimer_device rt_int32_t freq; /* counting frequency set by the user */ rt_int32_t overflow; /* timer overflows */ - float period_sec; + float period_sec; rt_int32_t cycles; /* how many times will generate a timeout event after overflow */ rt_int32_t reload; /* reload cycles(using in period mode) */ rt_hwtimer_mode_t mode; /* timing mode(oneshot/period) */ diff --git a/components/drivers/misc/pin.c b/components/drivers/misc/pin.c index 2750f5105a..6f27fe516d 100644 --- a/components/drivers/misc/pin.c +++ b/components/drivers/misc/pin.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2015-01-20 Bernard the first version + * 2021-02-06 Meco Man fix RT_ENOSYS code in negative */ #include <drivers/pin.h> @@ -108,7 +109,7 @@ rt_err_t rt_pin_attach_irq(rt_int32_t pin, rt_uint32_t mode, { return _hw_pin.ops->pin_attach_irq(&_hw_pin.parent, pin, mode, hdr, args); } - return RT_ENOSYS; + return -RT_ENOSYS; } rt_err_t rt_pin_detach_irq(rt_int32_t pin) { @@ -117,7 +118,7 @@ rt_err_t rt_pin_detach_irq(rt_int32_t pin) { return _hw_pin.ops->pin_detach_irq(&_hw_pin.parent, pin); } - return RT_ENOSYS; + return -RT_ENOSYS; } rt_err_t rt_pin_irq_enable(rt_base_t pin, rt_uint32_t enabled) @@ -127,7 +128,7 @@ rt_err_t rt_pin_irq_enable(rt_base_t pin, rt_uint32_t enabled) { return _hw_pin.ops->pin_irq_enable(&_hw_pin.parent, pin, enabled); } - return RT_ENOSYS; + return -RT_ENOSYS; } /* RT-Thread Hardware PIN APIs */ |
