diff options
author | Karl Palsson <karlp@tweak.net.au> | 2021-09-20 23:32:15 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-01-26 23:40:29 +0100 |
commit | 9cdb6ccf05015fe5c4b87e975a86740677584a2a (patch) | |
tree | dd6ccbd90ef9ad1f22fa8323905038869bd12d11 /cortex_m | |
parent | e141ef35b9a93ed174f206bf8cdae0c34c0a7fd2 (diff) |
cortex-debug: support itm blocking for char too
less end user casting, more back end c++ magic
Diffstat (limited to 'cortex_m')
-rw-r--r-- | cortex_m/debug.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cortex_m/debug.h b/cortex_m/debug.h index 8134829..7117309 100644 --- a/cortex_m/debug.h +++ b/cortex_m/debug.h @@ -20,6 +20,14 @@ struct ITM_reg_t { volatile uint32_t LSR; // FIXME - only supports first 32 stimulus ports + void stim_blocking(unsigned stim, char data) { + if (!(this->TER[0] & (1<<stim))) { + return; + } + while (!(this->STIM[stim].u8 & 1)) + ; + this->STIM[stim].u8 = data; + } void stim_blocking(unsigned stim, uint8_t data) { if (!(this->TER[0] & (1<<stim))) { return; |