From e053158f9546bbe03fbf8f56ddefcd8b480c0134 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Jul 2014 07:12:36 -0600 Subject: [PATCH] SAMA5D-EK: Correct system timer frequency. Input clock is MCK/2, not MCK --- arch/arm/src/sama5/sam_timerisr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/sama5/sam_timerisr.c b/arch/arm/src/sama5/sam_timerisr.c index 70da7b7bcec..1e247021032 100644 --- a/arch/arm/src/sama5/sam_timerisr.c +++ b/arch/arm/src/sama5/sam_timerisr.c @@ -52,11 +52,16 @@ #include "chip/sam_pit.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ -/* The PIT counter runs at a rate of the main clock (MCK) divided by 16 */ +/* The PIT counter runs at a rate of the main clock (MCK) divided by 16. + * + * On the SAMA5D4, the clocking to the PIC may be divided down from MCK. + * Perhaps because of H32MXDIV? We will let the board.h tell us the correct + * PIT include clock by defining BOARD_PIT_FREQUENCY. + */ -#define PIT_CLOCK (BOARD_MCK_FREQUENCY >> 4) +#define PIT_CLOCK (BOARD_PIT_FREQUENCY >> 4) /* The desired timer interrupt frequency is provided by the definition * CLK_TCK (see include/time.h). CLK_TCK defines the desired number of