From 9951d5cba0919e969f8b460ab11701aa9ed6fbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AA=E6=9C=89=E4=BD=A0=E4=BB=AC?= <815678396@qq.com> Date: Fri, 26 Mar 2021 15:50:51 +0800 Subject: [PATCH] update rt-thread-version/rt-thread-standard/programming-manual/device/hwtimer/hwtimer.md. --- .../programming-manual/device/hwtimer/hwtimer.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rt-thread-version/rt-thread-standard/programming-manual/device/hwtimer/hwtimer.md b/rt-thread-version/rt-thread-standard/programming-manual/device/hwtimer/hwtimer.md index ee42eca..171dfa0 100644 --- a/rt-thread-version/rt-thread-standard/programming-manual/device/hwtimer/hwtimer.md +++ b/rt-thread-version/rt-thread-standard/programming-manual/device/hwtimer/hwtimer.md @@ -116,6 +116,8 @@ static int hwtimer_sample(int argc, char *argv[]) rt_device_open(hw_dev, RT_DEVICE_OFLAG_RDWR); /* 设置超时回调函数 */ rt_device_set_rx_indicate(hw_dev, timeout_cb); + + return 0; } ``` @@ -189,6 +191,7 @@ static int hwtimer_sample(int argc, char *argv[]) /* 设置模式为周期性定时器 */ mode = HWTIMER_MODE_PERIOD; rt_device_control(hw_dev, HWTIMER_CTRL_MODE_SET, &mode); + return 0; } ``` @@ -253,6 +256,8 @@ static int hwtimer_sample(int argc, char *argv[]) timeout_s.sec = 5; /* 秒 */ timeout_s.usec = 0; /* 微秒 */ rt_device_write(hw_dev, 0, &timeout_s, sizeof(timeout_s)); + + return 0; } ``` -- Gitee