summaryrefslogtreecommitdiff
path: root/cortex_m
diff options
context:
space:
mode:
Diffstat (limited to 'cortex_m')
-rw-r--r--cortex_m/debug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cortex_m/debug.h b/cortex_m/debug.h
index 7117309..d935d7b 100644
--- a/cortex_m/debug.h
+++ b/cortex_m/debug.h
@@ -6,6 +6,7 @@
struct ITM_reg_t {
union {
+ volatile float f32;
volatile uint32_t u32;
volatile uint16_t u16;
volatile uint8_t u8;
@@ -52,6 +53,14 @@ struct ITM_reg_t {
;
this->STIM[stim].u32 = data;
}
+ void stim_blocking(unsigned stim, float data) {
+ if (!(this->TER[0] & (1<<stim))) {
+ return;
+ }
+ while (!(this->STIM[stim].u32 & 1))
+ ;
+ this->STIM[stim].f32 = data;
+ }
};
struct DWT_reg_t {