summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--stmhal/irq.h5
-rw-r--r--stmhal/mphalport.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/stmhal/irq.h b/stmhal/irq.h
index a56f23652e..35187520a0 100644
--- a/stmhal/irq.h
+++ b/stmhal/irq.h
@@ -24,6 +24,9 @@
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_STMHAL_IRQ_H
+#define MICROPY_INCLUDED_STMHAL_IRQ_H
+
// these states correspond to values from query_irq, enable_irq and disable_irq
#define IRQ_STATE_DISABLED (0x00000001)
#define IRQ_STATE_ENABLED (0x00000000)
@@ -147,4 +150,4 @@ MP_DECLARE_CONST_FUN_OBJ_0(pyb_irq_stats_obj);
#define IRQ_PRI_RTC_WKUP 15
#define IRQ_SUBPRI_RTC_WKUP 0
-
+#endif // MICROPY_INCLUDED_STMHAL_IRQ_H
diff --git a/stmhal/mphalport.h b/stmhal/mphalport.h
index 77cb0204d0..8dd95c470c 100644
--- a/stmhal/mphalport.h
+++ b/stmhal/mphalport.h
@@ -27,6 +27,10 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
// timing functions
+#include "stmhal/irq.h"
+
+#define mp_hal_quiet_timing_enter() raise_irq_pri(1)
+#define mp_hal_quiet_timing_exit(irq_state) restore_irq_pri(irq_state)
#define mp_hal_delay_us_fast(us) mp_hal_delay_us(us)
extern bool mp_hal_ticks_cpu_enabled;