From 2637db20ce7cdd14cb5285d4f3580073076214fc Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Thu, 6 Jun 2019 15:22:09 +0200 Subject: [PATCH 1/3] Fix for host test builds --- tests/host/common/interrupts.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/host/common/interrupts.h b/tests/host/common/interrupts.h index e69de29bb2..f5ea28d497 100644 --- a/tests/host/common/interrupts.h +++ b/tests/host/common/interrupts.h @@ -0,0 +1,19 @@ +#ifndef INTERRUPTS_H +#define INTERRUPTS_H + +class InterruptLock { +public: + uint32_t savedInterruptLevel() const { + return 0x0f; + } +}; + +#define AutoInterruptLock(intrLevel) \ +class _AutoDisableIntr { \ +public: \ + _AutoDisableIntr() {} \ + ~_AutoDisableIntr() {} \ + }; \ +_AutoDisableIntr _autoDisableIntr + +#endif //INTERRUPTS_H From 37040a0fbcc1287735eba6c39c72de4e98f0da93 Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Thu, 6 Jun 2019 21:54:27 +0200 Subject: [PATCH 2/3] Fight "error: unused variable" --- tests/host/common/interrupts.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/host/common/interrupts.h b/tests/host/common/interrupts.h index f5ea28d497..94c895eb6c 100644 --- a/tests/host/common/interrupts.h +++ b/tests/host/common/interrupts.h @@ -3,9 +3,20 @@ class InterruptLock { public: + InterruptLock() { + _state = 0x00; + } + + ~InterruptLock() { + _state = 0x0f; + } + uint32_t savedInterruptLevel() const { - return 0x0f; + return _state & 0x0f; } + +protected: + uint32_t _state; }; #define AutoInterruptLock(intrLevel) \ From f851a685c788321b65e6916d7f8e866e8ba0a36f Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Fri, 21 Jun 2019 16:25:28 +0200 Subject: [PATCH 3/3] Per suggestion in https://github.com/esp8266/Arduino/pull/6217#issuecomment-504421729 (cherry picked from commit e37a3ef0b237b23c8cd0db8fa9c496ddcde9ce1b) --- tests/host/common/interrupts.h | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 tests/host/common/interrupts.h diff --git a/tests/host/common/interrupts.h b/tests/host/common/interrupts.h deleted file mode 100644 index 94c895eb6c..0000000000 --- a/tests/host/common/interrupts.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef INTERRUPTS_H -#define INTERRUPTS_H - -class InterruptLock { -public: - InterruptLock() { - _state = 0x00; - } - - ~InterruptLock() { - _state = 0x0f; - } - - uint32_t savedInterruptLevel() const { - return _state & 0x0f; - } - -protected: - uint32_t _state; -}; - -#define AutoInterruptLock(intrLevel) \ -class _AutoDisableIntr { \ -public: \ - _AutoDisableIntr() {} \ - ~_AutoDisableIntr() {} \ - }; \ -_AutoDisableIntr _autoDisableIntr - -#endif //INTERRUPTS_H