From 16f622d90728e3ea60af7748774c50badc23d1d2 Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Wed, 26 Aug 2026 11:45:05 +0800 Subject: [PATCH] Update comment for StopTicks() --- common_arm/ticks/ticks_hw_at91.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/common_arm/ticks/ticks_hw_at91.c b/common_arm/ticks/ticks_hw_at91.c index 987bc95fd..e085803e5 100644 --- a/common_arm/ticks/ticks_hw_at91.c +++ b/common_arm/ticks/ticks_hw_at91.c @@ -413,7 +413,23 @@ void ResetTicks(void) { void StopTicks(void) { AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS; AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS; - AT91C_BASE_TC2->TC_CCR = AT91C_TC_CLKDIS; // TODO StartTicks() did not use TC2, is this code worthless? + AT91C_BASE_TC2->TC_CCR = AT91C_TC_CLKDIS; + + // TODO DXL StartTicks() did not use TC2, is this code worthless? + // In some places, StartCountSspClk() is called after StopTicks(), so it seems necessary to disable timers completely. + // In that case, the role of StopTicks() is not limited to being paired with StartTicks(), + // but is a general release function for all ticks modules. + // --- + // Do we need to provide a StopXXX for each StartXXXX? + // Such as: + // * StartTicks -> StopTicks + // * StartCountSspClk -> StopCountSspClk + // * StartTickCount -> StopTickCount + // * StartCountUS -> StopCountUS + // * StartPrecisionCounter -> StopPrecisionCounter + // * StartLoEdgeCapture -> StopLoEdgeCapture + // * StartTimestamp -> StopTimestamp + // It seems best for everyone(api) to do their own job. } uint32_t GetTicks(void) {