Skip to content

Put InterruptLock (from interrupts.h) into namespace esp8266 #6225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cores/esp8266/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void EspClass::restart(void)

uint16_t EspClass::getVcc(void)
{
InterruptLock lock;
esp8266::InterruptLock lock;
(void)lock;
return system_get_vdd33();
}
Expand Down
6 changes: 3 additions & 3 deletions cores/esp8266/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool schedule_function_us(std::function<bool(void)>&& fn, uint32_t repeat_us, sc
{
assert(repeat_us < decltype(scheduled_fn_t::callNow)::neverExpires); //~26800000us (26.8s)

InterruptLock lockAllInterruptsInThisScope;
esp8266::InterruptLock lockAllInterruptsInThisScope;

scheduled_fn_t* item = get_fn_unsafe();
if (!item)
Expand Down Expand Up @@ -104,7 +104,7 @@ void run_scheduled_functions(schedule_e policy)

static bool fence = false;
{
InterruptLock lockAllInterruptsInThisScope;
esp8266::InterruptLock lockAllInterruptsInThisScope;
if (fence)
// prevent recursive calls from yield()
return;
Expand Down Expand Up @@ -136,7 +136,7 @@ void run_scheduled_functions(schedule_e policy)
else
{
// function removed from list
InterruptLock lockAllInterruptsInThisScope;
esp8266::InterruptLock lockAllInterruptsInThisScope;

if (sFirst == toCall)
sFirst = sFirst->mNext;
Expand Down
1 change: 0 additions & 1 deletion cores/esp8266/Updater.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "Updater.h"
#include "Arduino.h"
#include "eboot_command.h"
#include <interrupts.h>
#include <esp8266_peri.h>

//#define DEBUG_UPDATER Serial
Expand Down
5 changes: 5 additions & 0 deletions cores/esp8266/interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//}
//

namespace esp8266
{

class InterruptLock {
public:
InterruptLock() {
Expand Down Expand Up @@ -54,4 +57,6 @@ private: \
}; \
_AutoDisableIntr _autoDisableIntr

} // esp8266

#endif //INTERRUPTS_H
2 changes: 1 addition & 1 deletion libraries/SoftwareSerial