MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / timeout_cb

Function timeout_cb

bsp/hc32/tests/test_hwtimer.c:46–56  ·  view source on GitHub ↗

定时器超时回调函数 */

Source from the content-addressed store, hash-verified

44
45/* 定时器超时回调函数 */
46static rt_err_t timeout_cb(rt_device_t dev, rt_size_t size)
47{
48 static rt_uint8_t pin_cnt = 0;
49 rt_pin_write(TIMEOUT_TEST_PIN, ++pin_cnt % 2); /* 电平取反 */
50 /* 打印出的tick值由于printf原因可能有误差,可以查看测试IO来精确确认时间 */
51 rt_kprintf("callback successful! ticks = %d \n", rt_tick_get() - tick);
52 tick = rt_tick_get();
53 cb_run = RT_TRUE;
54
55 return 0;
56}
57
58static int hwtimer_sample(int argc, char *argv[])
59{

Callers

nothing calls this directly

Calls 3

rt_kprintfFunction · 0.85
rt_tick_getFunction · 0.85
rt_pin_writeFunction · 0.50

Tested by

no test coverage detected