From db8607216cf2d75fdf77aec524c6af91984ca48d Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 24 Sep 2021 10:24:08 +0000 Subject: debug: add overload for writing floats to stimulus ports Overload all the things! Signed-off-by: Karl Palsson --- cortex_m/debug.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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[stim].u32 & 1)) + ; + this->STIM[stim].f32 = data; + } }; struct DWT_reg_t { -- cgit v1.2.3