Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sys/ztimer/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#define WIDTH_TO_MAXVAL(width) (UINT32_MAX >> (32 - width))

#define FREQ_1MHZ 1000000LU
#define FREQ_500KHZ 500000LU
#define FREQ_250KHZ 250000LU
#define FREQ_1KHZ 1000LU
#define FREQ_1HZ 1LU
Expand Down Expand Up @@ -219,6 +220,9 @@
# elif (ZTIMER_TIMER_FREQ == 250000LU) && !(CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION)
static ztimer_convert_shift_t _ztimer_convert_shift_usec;
ztimer_clock_t *const ZTIMER_USEC = &_ztimer_convert_shift_usec.super.super;
# elif (ZTIMER_TIMER_FREQ == 500000LU) && !(CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION)
static ztimer_convert_shift_t _ztimer_convert_shift_usec;
ztimer_clock_t *const ZTIMER_USEC = &_ztimer_convert_shift_usec.super.super;
# else
static ztimer_convert_frac_t _ztimer_convert_frac_usec;
ztimer_clock_t *const ZTIMER_USEC = &_ztimer_convert_frac_usec.super.super;
Expand Down Expand Up @@ -346,13 +350,22 @@
# if (ZTIMER_TIMER_FREQ != FREQ_1MHZ) || CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION
# if (ZTIMER_TIMER_FREQ == FREQ_250KHZ) && !(CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION)
if (IS_ACTIVE(DEVELHELP) && ((periph_timer_freq < 237500) || (periph_timer_freq > 262500))) {
LOG_WARNING("ZTIMER_USEC from %" PRIu32 " Hz clock with \"left-shift by 2\" frequency conversion\n",

Check warning on line 353 in sys/ztimer/init.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
periph_timer_freq);
}
LOG_DEBUG("ztimer_init(): ZTIMER_USEC convert_shift %lu to 1000000\n",
periph_timer_freq);

Check warning on line 357 in sys/ztimer/init.c

View workflow job for this annotation

GitHub Actions / static-tests

Uncrustify proposes the following patch: --- a/sys/ztimer/init.c +++ b/sys/ztimer/init.c @@ -350,8 +350,9 @@ void ztimer_init(void) # if (ZTIMER_TIMER_FREQ != FREQ_1MHZ) || CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION # if (ZTIMER_TIMER_FREQ == FREQ_250KHZ) && !(CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION) if (IS_ACTIVE(DEVELHELP) && ((periph_timer_freq < 237500) || (periph_timer_freq > 262500))) { - LOG_WARNING("ZTIMER_USEC from %" PRIu32 " Hz clock with \"left-shift by 2\" frequency conversion\n", - periph_timer_freq); + LOG_WARNING( + "ZTIMER_USEC from %" PRIu32 " Hz clock with \"left-shift by 2\" frequency conversion\n", + periph_timer_freq); } LOG_DEBUG("ztimer_init(): ZTIMER_USEC convert_shift %lu to 1000000\n", periph_timer_freq);
ztimer_convert_shift_up_init(&_ztimer_convert_shift_usec,
ZTIMER_USEC_BASE, 2);
# elif (ZTIMER_TIMER_FREQ == FREQ_500KHZ) && !(CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION)
if (IS_ACTIVE(DEVELHELP) && ((periph_timer_freq < 487500) || (periph_timer_freq > 512500))) {
LOG_WARNING("ZTIMER_USEC from %" PRIu32 " Hz clock with \"left-shift by 1\" frequency conversion\n",

Check warning on line 362 in sys/ztimer/init.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
periph_timer_freq);
}
LOG_DEBUG("ztimer_init(): ZTIMER_USEC convert_shift %lu to 1000000\n",
periph_timer_freq);

Check warning on line 366 in sys/ztimer/init.c

View workflow job for this annotation

GitHub Actions / static-tests

Uncrustify proposes the following patch: --- sys/ztimer/init.c +++ sys/ztimer/init.c @@ -359,8 +360,9 @@ void ztimer_init(void) ZTIMER_USEC_BASE, 2); # elif (ZTIMER_TIMER_FREQ == FREQ_500KHZ) && !(CONFIG_ZTIMER_PERIPH_TIMER_FORCE_CONVERSION) if (IS_ACTIVE(DEVELHELP) && ((periph_timer_freq < 487500) || (periph_timer_freq > 512500))) { - LOG_WARNING("ZTIMER_USEC from %" PRIu32 " Hz clock with \"left-shift by 1\" frequency conversion\n", - periph_timer_freq); + LOG_WARNING( + "ZTIMER_USEC from %" PRIu32 " Hz clock with \"left-shift by 1\" frequency conversion\n", + periph_timer_freq); } LOG_DEBUG("ztimer_init(): ZTIMER_USEC convert_shift %lu to 1000000\n", periph_timer_freq);
ztimer_convert_shift_up_init(&_ztimer_convert_shift_usec,
ZTIMER_USEC_BASE, 1);
# else
LOG_DEBUG("ztimer_init(): ZTIMER_USEC convert_frac %lu to 1000000\n",
ZTIMER_TIMER_FREQ);
Expand Down