Using CMSIS AIRCR defines in swd_host.c if available.
Wrapped defines in #if so that CMSIS-Core defines are used if they are
available, otherwise use the local copy (for CM0/+).
#include "DAP_config.h"
#include "DAP.h"
#include "target_family.h"
+#include "device.h"
// Default NVIC and Core debug base addresses
// TODO: Read these addresses from ROM.
#define MAX_SWD_RETRY 100//10
#define MAX_TIMEOUT 1000000 // Timeout for syscalls on target
-#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
+// Use the CMSIS-Core definition if available.
+#if !defined(SCB_AIRCR_PRIGROUP_Pos)
+#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */
#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
+#endif
typedef struct {
uint32_t select;
