summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkurisaw <[email protected]>2025-07-03 10:02:11 +0800
committerRbb666 <[email protected]>2025-07-03 10:10:36 +0800
commitfcd0b1e6797cbdca987f24d7c24a032709e5e53b (patch)
tree8ae6425bde93d5bb249b12fdd6189b7958a470a3
parenta1e865171b48e5ed4a3b5d8b4e856af3cf445dab (diff)
bsp/renesas: fix the problem of abnormal timer count
-rw-r--r--bsp/renesas/libraries/HAL_Drivers/drv_hwtimer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bsp/renesas/libraries/HAL_Drivers/drv_hwtimer.c b/bsp/renesas/libraries/HAL_Drivers/drv_hwtimer.c
index 6f74ef1b74..f23a371587 100644
--- a/bsp/renesas/libraries/HAL_Drivers/drv_hwtimer.c
+++ b/bsp/renesas/libraries/HAL_Drivers/drv_hwtimer.c
@@ -115,11 +115,11 @@ static rt_uint32_t timer_counter_get(rt_hwtimer_t *timer)
tim = (struct ra_hwtimer *)timer->parent.user_data;
- timer_info_t info;
- if (R_GPT_InfoGet(tim->g_ctrl, &info) != FSP_SUCCESS)
+ timer_status_t status;
+ if (R_GPT_StatusGet(tim->g_ctrl, &status) != FSP_SUCCESS)
return -RT_ERROR;
- return info.period_counts;
+ return status.counter;
}
static rt_err_t timer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg)