From f4e4af8ae17db271d6f50323f70142054f970c28 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 18 Feb 2023 15:28:08 -0800 Subject: [PATCH] samd21: Use TM v4.0 LEDs to debug samd21 clock bits red on at top of clock routine. green on after XOSC is running. red off at bottom of clock routine. Signed-off-by: Keith Packard --- src/samd21/ao_timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/samd21/ao_timer.c b/src/samd21/ao_timer.c index 2b431d38..91d74b12 100644 --- a/src/samd21/ao_timer.c +++ b/src/samd21/ao_timer.c @@ -122,6 +122,7 @@ ao_clock_init(void) ; #ifdef AO_XOSC + ao_enable_output(&samd21_port_b, 10, 1); /* Enable xosc (external xtal oscillator) */ samd21_sysctrl.xosc = ((SAMD21_SYSCTRL_XOSC_STARTUP_8192 << SAMD21_SYSCTRL_XOSC_STARTUP) | (0 << SAMD21_SYSCTRL_XOSC_AMPGC) | @@ -135,6 +136,8 @@ ao_clock_init(void) while ((samd21_sysctrl.pclksr & (1 << SAMD21_SYSCTRL_PCLKSR_XOSCRDY)) == 0) ; + ao_enable_output(&samd21_port_b, 11, 1); + /* program DPLL */ /* Divide down */ @@ -289,4 +292,6 @@ ao_clock_init(void) /* Disable automatic NVM write operations */ samd21_nvmctrl.ctrlb |= (1UL << SAMD21_NVMCTRL_CTRLB_MANW); + + ao_gpio_set(&samd21_port_b, 10, 0); } -- 2.30.2