add more comments
This commit is contained in:
@@ -318,6 +318,14 @@ static rt_err_t rt_hwtimer_control(struct rt_device *dev, int cmd, void *args)
|
||||
rt_hw_interrupt_enable(level);
|
||||
}
|
||||
break;
|
||||
case HWTIMER_CTRL_COUNT_GET:
|
||||
{
|
||||
if (timer->ops->count_get != RT_NULL) {
|
||||
rt_uint32_t cnt = timer->ops->count_get(timer);
|
||||
*(rt_uint32_t *)args = cnt;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (timer->ops->control != RT_NULL)
|
||||
|
||||
@@ -21,7 +21,8 @@ typedef enum
|
||||
HWTIMER_CTRL_FREQ_SET = RT_DEVICE_CTRL_BASE(Timer) + 0x01, /* set the count frequency */
|
||||
HWTIMER_CTRL_STOP = RT_DEVICE_CTRL_BASE(Timer) + 0x02, /* stop timer */
|
||||
HWTIMER_CTRL_INFO_GET = RT_DEVICE_CTRL_BASE(Timer) + 0x03, /* get a timer feature information */
|
||||
HWTIMER_CTRL_MODE_SET = RT_DEVICE_CTRL_BASE(Timer) + 0x04 /* Setting the timing mode(oneshot/period) */
|
||||
HWTIMER_CTRL_MODE_SET = RT_DEVICE_CTRL_BASE(Timer) + 0x04, /* Setting the timing mode(oneshot/period) */
|
||||
HWTIMER_CTRL_COUNT_GET = RT_DEVICE_CTRL_BASE(Timer) + 0x05 /* get hwtimer count */
|
||||
} rt_hwtimer_ctrl_t;
|
||||
|
||||
/* Timing Mode */
|
||||
|
||||
Reference in New Issue
Block a user