File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,16 @@ void ets_intr_unlock();
146
146
#define __STRINGIFY (a ) #a
147
147
#endif
148
148
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
+
149
159
// these low level routines provide a replacement for SREG interrupt save that AVR uses
150
160
// but are esp8266 specific. A normal use pattern is like
151
161
//
@@ -165,6 +175,7 @@ void ets_intr_unlock();
165
175
#define interrupts () xt_rsil(0 )
166
176
#define noInterrupts () xt_rsil(15 )
167
177
178
+ #endif // !CORE_MOCK
168
179
169
180
#define clockCyclesPerMicrosecond () ( F_CPU / 1000000L )
170
181
#define clockCyclesToMicroseconds (a ) ( (a) / clockCyclesPerMicrosecond() )
Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ bool schedule_function_us(mFuncT fn, uint32_t repeat_us)
47
47
}
48
48
item->mFunc = fn;
49
49
50
- noInterrupts ();
50
+ uint32_t savedPS = xt_rsil ( 0 ); // noInterrupts();
51
51
item->mNext = sFirst ;
52
52
sFirst = item;
53
- interrupts ();
53
+ xt_wsr_ps (savedPS); // interrupts();
54
54
55
55
if (repeat_us)
56
56
item->callNow .reset (repeat_us);
@@ -70,10 +70,10 @@ void run_scheduled_functions()
70
70
toCall = item->mNext ;
71
71
if (item->callNow && !item->mFunc ())
72
72
{
73
- noInterrupts ();
73
+ uint32_t savedPS = xt_rsil ( 0 ); // noInterrupts();
74
74
if (sFirst == item)
75
75
sFirst = item->mNext ;
76
- interrupts ();
76
+ xt_wsr_ps (savedPS); // interrupts();
77
77
78
78
item->mFunc = mFuncT ();
79
79
recycle_fn (item);
You can’t perform that action at this time.
0 commit comments