Skip to content

Commit c47fb07

Browse files
committed
Suffix constant "clock_freq" with "clock_freq_Hz" to make clear the unit of this constant.
1 parent b6a73f8 commit c47fb07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/time.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ void startAgt() {
2828
// in 1 ms (period) is an integer number and below the 16-bit counter limit
2929
// on the Uno R4 the AGT clock is 24 MHz / 8 -> 3000 ticks per ms
3030
// on the Portenta C33 the AGT clock is 50 Mhz / 8 -> 6250 ticks per ms
31-
const uint32_t clock_freq = R_FSP_SystemClockHzGet(FSP_PRIV_CLOCK_PCLKB);
32-
const uint32_t period = clock_freq / ((1 << TIMER_SOURCE_DIV_8) * 1000UL);
31+
const uint32_t clock_freq_Hz = R_FSP_SystemClockHzGet(FSP_PRIV_CLOCK_PCLKB);
32+
const uint32_t period = clock_freq_Hz / ((1 << TIMER_SOURCE_DIV_8) * 1000UL);
3333
agt_timer.begin(TIMER_MODE_PERIODIC, AGT_TIMER, 0, period, 1, TIMER_SOURCE_DIV_8, timer_micros_callback);;
3434
agt_timer.setup_overflow_irq(8);
3535
agt_timer.open();

0 commit comments

Comments
 (0)