added flash utility

This commit is contained in:
Bernd Herzog 2023-03-28 14:39:00 +02:00
parent 8840a6e894
commit f5d4fce945
14 changed files with 605 additions and 4 deletions

View file

@ -36,6 +36,7 @@ inline uint32_t get_free_stack_space(){
return stack_space_left;
}
/* Executes a breakpoint only when a debugger is attached. */
#define HALT_IF_DEBUGGING() \
do { \
if ((*(volatile uint32_t *)0xE000EDF0) & (1 << 0)) { \
@ -43,4 +44,9 @@ inline uint32_t get_free_stack_space(){
} \
} while (0)
/* Stops execution until a debugger is attached. */
#define HALT_UNTIL_DEBUGGING() \
while (!((*(volatile uint32_t *)0xE000EDF0) & (1 << 0))) {} \
__asm__ __volatile__("bkpt 1")
#endif/*__DEBUG_H__*/