-
Notifications
You must be signed in to change notification settings - Fork 3k
Make ESP8266 compatible with bare metal profile #12022
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
#ifndef ESP8266_H | ||
#define ESP8266_H | ||
|
||
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT) | ||
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_API_PRESENT) | ||
#include <stdint.h> | ||
|
||
#include "drivers/UARTSerial.h" | ||
|
@@ -27,8 +27,8 @@ | |
#include "platform/ATCmdParser.h" | ||
#include "platform/Callback.h" | ||
#include "platform/mbed_error.h" | ||
#include "rtos/ConditionVariable.h" | ||
#include "rtos/Mutex.h" | ||
#include "rtos/ThisThread.h" | ||
|
||
// Various timeouts for different ESP8266 operations | ||
#ifndef ESP8266_CONNECT_TIMEOUT | ||
|
@@ -428,7 +428,6 @@ class ESP8266 { | |
PinName _serial_rts; | ||
PinName _serial_cts; | ||
rtos::Mutex _smutex; // Protect serial port access | ||
rtos::Mutex _rmutex; // Reset protection | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I helped prepare this.
The piece of code waiting for reset is inside |
||
|
||
// AT Command Parser | ||
mbed::ATCmdParser _parser; | ||
|
@@ -479,7 +478,6 @@ class ESP8266 { | |
bool _closed; | ||
bool _error; | ||
bool _busy; | ||
rtos::ConditionVariable _reset_check; | ||
bool _reset_done; | ||
|
||
// Modem's address info | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
#ifndef ESP8266_INTERFACE_H | ||
#define ESP8266_INTERFACE_H | ||
|
||
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT) | ||
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_API_PRESENT) | ||
#include "drivers/DigitalOut.h" | ||
#include "drivers/Timer.h" | ||
#include "ESP8266/ESP8266.h" | ||
|
@@ -30,7 +30,9 @@ | |
#include "features/netsocket/WiFiAccessPoint.h" | ||
#include "features/netsocket/WiFiInterface.h" | ||
#include "platform/Callback.h" | ||
#if MBED_CONF_RTOS_PRESENT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? same MACRO guardian is already in that header file. And if the header file does not compile as such (includes rtos headers outside MACRO) those headers should be moved inside MBED_CONF_RTOS_PRESENT macro. |
||
#include "rtos/ConditionVariable.h" | ||
#endif | ||
#include "rtos/Mutex.h" | ||
|
||
#define ESP8266_SOCKET_COUNT 5 | ||
|
@@ -452,7 +454,9 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface { | |
struct _channel_info _ch_info; | ||
|
||
bool _if_blocking; // NetworkInterface, blocking or not | ||
#if MBED_CONF_RTOS_PRESENT | ||
rtos::ConditionVariable _if_connected; | ||
#endif | ||
|
||
// connect status reporting | ||
nsapi_error_t _conn_status_to_error(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting this as PlatformMutex would be the right solution.Scratch that. RTOS Mutex is rendered out in brametal builds. This code should be kept.