File tree Expand file tree Collapse file tree 1 file changed +0
-10
lines changed
Expand file tree Collapse file tree 1 file changed +0
-10
lines changed Original file line number Diff line number Diff line change 2222/* 定时器超时回调函数 */
2323static rt_err_t timeout_cb (rt_device_t dev , rt_size_t size )
2424{
25- rt_kprintf ("this is hwtimer timeout callback fucntion!\n" );
2625 rt_kprintf ("tick is :%d !\n" , rt_tick_get ());
2726
2827 return 0 ;
@@ -34,7 +33,6 @@ static int hwtimer_sample(int argc, char *argv[])
3433 rt_hwtimerval_t timeout_s ; /* 定时器超时值 */
3534 rt_device_t hw_dev = RT_NULL ; /* 定时器设备句柄 */
3635 rt_hwtimer_mode_t mode ; /* 定时器模式 */
37- rt_uint32_t freq = 10000 ; /* 计数频率 */
3836
3937 /* 查找定时器设备 */
4038 hw_dev = rt_device_find (HWTIMER_DEV_NAME );
@@ -55,14 +53,6 @@ static int hwtimer_sample(int argc, char *argv[])
5553 /* 设置超时回调函数 */
5654 rt_device_set_rx_indicate (hw_dev , timeout_cb );
5755
58- /* 设置计数频率(默认1Mhz或支持的最小计数频率) */
59- ret = rt_device_control (hw_dev , HWTIMER_CTRL_FREQ_SET , & freq );
60- if (ret != RT_EOK )
61- {
62- rt_kprintf ("set frequency failed! ret is :%d\n" , ret );
63- return ret ;
64- }
65-
6656 /* 设置模式为周期性定时器 */
6757 mode = HWTIMER_MODE_PERIOD ;
6858 ret = rt_device_control (hw_dev , HWTIMER_CTRL_MODE_SET , & mode );
You can’t perform that action at this time.
0 commit comments