Skip to content

Commit aa4f87e

Browse files
committed
fix emulation on host
1 parent 545dd35 commit aa4f87e

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

cores/esp8266/Arduino.h

-12
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,6 @@ void ets_intr_unlock();
146146
#define __STRINGIFY(a) #a
147147
#endif
148148

149-
#if CORE_MOCK
150-
151-
#define xt_rsil(level) (level)
152-
#define xt_wsr_ps(state) do { (void)(state); } while (0)
153-
154-
#define interrupts() do { (void)0; } while (0)
155-
#define noInterrupts() do { (void)0; } while (0)
156-
157-
#else // !CORE_MOCK
158-
159149
// these low level routines provide a replacement for SREG interrupt save that AVR uses
160150
// but are esp8266 specific. A normal use pattern is like
161151
//
@@ -175,8 +165,6 @@ void ets_intr_unlock();
175165
#define interrupts() xt_rsil(0)
176166
#define noInterrupts() xt_rsil(15)
177167

178-
#endif // !CORE_MOCK
179-
180168
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
181169
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
182170
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )

tests/host/common/Arduino.h

+2-17
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,11 @@ extern "C" {
143143
#define __STRINGIFY(a) #a
144144
#endif
145145

146-
// these low level routines provide a replacement for SREG interrupt save that AVR uses
147-
// but are esp8266 specific. A normal use pattern is like
148-
//
149-
//{
150-
// uint32_t savedPS = xt_rsil(1); // this routine will allow level 2 and above
151-
// // do work here
152-
// xt_wsr_ps(savedPS); // restore the state
153-
//}
154-
//
155-
// level (0-15), interrupts of the given level and above will be active
156-
// level 15 will disable ALL interrupts,
157-
// level 0 will enable ALL interrupts,
158-
//
159-
#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state)); state;}))
160-
#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory")
161-
146+
#define xt_rsil(level) (level)
147+
#define xt_wsr_ps(state) do { (void)(state); } while (0)
162148
#define interrupts() xt_rsil(0)
163149
#define noInterrupts() xt_rsil(15)
164150

165-
166151
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
167152
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
168153
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )

0 commit comments

Comments
 (0)