summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2016-04-15 13:17:27 +0800
committerBernard Xiong <[email protected]>2016-04-15 13:17:27 +0800
commit6d03ce9a7bfd4ff94665465d1c07f6c816fe19a2 (patch)
tree4e6f8a7faf3458605f52dfd58a815c3f72cfba5e /components
parent9c293336cbcfff35d0f4e2963342579929c9c289 (diff)
parent0d63eb5f6d2f94ca3507df72072d50f1c0e94698 (diff)
Merge pull request #624 from gbcwbz/master
fix can baud rate config error in bsp/stm32f10x fix #597
Diffstat (limited to 'components')
-rw-r--r--components/drivers/misc/pin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/drivers/misc/pin.c b/components/drivers/misc/pin.c
index f3577a11d5..0a200af5aa 100644
--- a/components/drivers/misc/pin.c
+++ b/components/drivers/misc/pin.c
@@ -101,18 +101,21 @@ int rt_device_pin_register(const char *name, const struct rt_pin_ops *ops, void
/* RT-Thread Hardware PIN APIs */
void rt_pin_mode(rt_base_t pin, rt_base_t mode)
{
+ RT_ASSERT(_hw_pin.ops != RT_NULL);
_hw_pin.ops->pin_mode(&_hw_pin.parent, pin, mode);
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_pin_mode, pinMode, set hardware pin mode);
void rt_pin_write(rt_base_t pin, rt_base_t value)
{
+ RT_ASSERT(_hw_pin.ops != RT_NULL);
_hw_pin.ops->pin_write(&_hw_pin.parent, pin, value);
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_pin_write, pinWrite, write value to hardware pin);
int rt_pin_read(rt_base_t pin)
{
+ RT_ASSERT(_hw_pin.ops != RT_NULL);
return _hw_pin.ops->pin_read(&_hw_pin.parent, pin);
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_pin_read, pinRead, read status from hardware pin);