Skip to content

Commit 7a10808

Browse files
committed
Add default SWO pin number and config if not defined in Ambiq target
1 parent fabe70c commit 7a10808

File tree

1 file changed

+15
-4
lines changed
  • targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device

1 file changed

+15
-4
lines changed

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/itm_api.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,24 @@
2525

2626
/* SWO frequency: 1000 kHz */
2727

28-
// As SWO has to be accessible everywhere, including ISRs, we can't easily
29-
// communicate the dependency on clocks etc. to other components - so this
30-
// function checks that things appear to be set up, and if not re-configures
31-
// everything
28+
#ifndef AM_BSP_GPIO_ITM_SWO
29+
#define AM_GPIO_ITM_SWO 22
30+
31+
const am_hal_gpio_pincfg_t g_AM_GPIO_ITM_SWO =
32+
{
33+
.uFuncSel = AM_HAL_PIN_22_SWO,
34+
.eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA
35+
};
36+
#endif
37+
38+
3239
void itm_init(void)
3340
{
41+
#ifdef AM_BSP_GPIO_ITM_SWO
3442
am_bsp_itm_printf_enable();
43+
#else
44+
am_bsp_itm_printf_enable(AM_GPIO_ITM_SWO,g_AM_GPIO_ITM_SWO);
45+
#endif
3546
}
3647

3748
#endif

0 commit comments

Comments
 (0)