From 5367c5993cca2ce961293962dd342479947ff698 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 30 Nov 2015 15:21:25 -0600 Subject: [PATCH] SAMV7: Add some conditional logic to handle the case where the board has no 32.768KHz crystal installed --- arch/arm/src/samv7/sam_clockconfig.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/samv7/sam_clockconfig.c b/arch/arm/src/samv7/sam_clockconfig.c index a15f06933e..f45304ce3e 100644 --- a/arch/arm/src/samv7/sam_clockconfig.c +++ b/arch/arm/src/samv7/sam_clockconfig.c @@ -131,7 +131,11 @@ static inline void sam_wdtsetup(void) static inline void sam_supcsetup(void) { - /* Check if the 32-kHz is already selected */ +#ifdef BOARD_HAVE_SLOWXTAL + /* Check if the 32-kHz is already selected. The slow clock defaults to + * the RC oscillator, but the software can enable the crystal oscillator + * and select it as the slow clock source. + */ if ((getreg32(SAM_SUPC_SR) & SUPC_SR_OSCSEL) == 0) { @@ -142,6 +146,7 @@ static inline void sam_supcsetup(void) (getreg32(SAM_SUPC_SR) & SUPC_SR_OSCSEL) == 0 && delay < UINT32_MAX; delay++); } +#endif } /****************************************************************************