From 43fa3bcfa79b58b361ea0f0941d39a64f6e4ada9 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sun, 14 Apr 2024 20:26:19 +0200 Subject: [PATCH] boards/olimex-msp430-h2618: fix ztimer config The MSP430 timer prescaler can device the 16 MHz clock down to (16 / 2^x) MHz, with 0 <= x < 4. So no slower than 2 MHz. With the current ztimer config the clock would run at twice the speed. --- boards/olimex-msp430-h2618/include/board.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/boards/olimex-msp430-h2618/include/board.h b/boards/olimex-msp430-h2618/include/board.h index f7f660f1d270..b918b1ca16dd 100644 --- a/boards/olimex-msp430-h2618/include/board.h +++ b/boards/olimex-msp430-h2618/include/board.h @@ -22,6 +22,7 @@ #define BOARD_H #include "cpu.h" +#include "macros/units.h" #ifdef __cplusplus extern "C" { @@ -35,11 +36,12 @@ extern "C" { #endif /** - * @name Xtimer configuration + * @name ztimer configuration * @{ */ -#define XTIMER_WIDTH (16) -#define XTIMER_BACKOFF (40) +#define CONFIG_ZTIMER_USEC_WIDTH 16 /**< running on a 16-bit timer */ +#define CONFIG_ZTIMER_USEC_BASE_FREQ MHZ(2) /**< Cannot divide 16 MHz clock + to 1 MHz, go for 2 MHz instead */ /** @} */ #ifdef __cplusplus