fix support for the esp8266
This commit is contained in:
parent
106c124c58
commit
539b088e82
2 changed files with 19 additions and 0 deletions
|
@ -35,6 +35,8 @@ static constexpr auto VECTKEY_MASK = (0x0000ffffUL);
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
// should use uinstd.h to define sbrk but Due causes a conflict
|
// should use uinstd.h to define sbrk but Due causes a conflict
|
||||||
extern "C" char* sbrk(int incr);
|
extern "C" char* sbrk(int incr);
|
||||||
|
#elif defined(ESP8266) // esp8266
|
||||||
|
#define SYSTEM_STACK_END_ADDRESS 0x3FFFC000
|
||||||
#else // __ARM__
|
#else // __ARM__
|
||||||
extern char *__brkval;
|
extern char *__brkval;
|
||||||
#endif // __arm__
|
#endif // __arm__
|
||||||
|
@ -44,6 +46,9 @@ static int freeMemory() {
|
||||||
char top;
|
char top;
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
return &top - reinterpret_cast<char*>(sbrk(0));
|
return &top - reinterpret_cast<char*>(sbrk(0));
|
||||||
|
#elif defined(ESP8266) // ESP8266
|
||||||
|
register volatile uint32_t stackAddress asm("a1");
|
||||||
|
return stackAddress-SYSTEM_STACK_END_ADDRESS;
|
||||||
#elif defined(CORE_TEENSY) || (ARDUINO > 103 && ARDUINO != 151)
|
#elif defined(CORE_TEENSY) || (ARDUINO > 103 && ARDUINO != 151)
|
||||||
return &top - __brkval;
|
return &top - __brkval;
|
||||||
#else // __arm__
|
#else // __arm__
|
||||||
|
|
|
@ -358,6 +358,18 @@ public:
|
||||||
/** @brief Returns a reference to the client object stored in this class. Take care not to break it. */
|
/** @brief Returns a reference to the client object stored in this class. Take care not to break it. */
|
||||||
Client& getClient() { return m_client; }
|
Client& getClient() { return m_client; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the timeout when waiting for an SSL response.
|
||||||
|
* @param t The timeout value, in milliseconds (defaults to 30 seconds if not set). Do not set to zero.
|
||||||
|
*/
|
||||||
|
void setTimeout(unsigned int t) { m_timeout = t; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the timeout when waiting for an SSL response.
|
||||||
|
* @returns The timeout value in milliseconds.
|
||||||
|
*/
|
||||||
|
unsigned int getTimeout() const { return m_timeout; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** @brief Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl */
|
/** @brief Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl */
|
||||||
Client& get_arduino_client() { return m_client; }
|
Client& get_arduino_client() { return m_client; }
|
||||||
|
@ -419,6 +431,8 @@ private:
|
||||||
const DebugLevel m_debug;
|
const DebugLevel m_debug;
|
||||||
// store if we are connected in bearssl or not
|
// store if we are connected in bearssl or not
|
||||||
bool m_is_connected;
|
bool m_is_connected;
|
||||||
|
// store the timeout for SSL internals
|
||||||
|
unsigned int m_timeout;
|
||||||
// store the context values required for SSL
|
// store the context values required for SSL
|
||||||
br_ssl_client_context m_sslctx;
|
br_ssl_client_context m_sslctx;
|
||||||
br_x509_minimal_context m_x509ctx;
|
br_x509_minimal_context m_x509ctx;
|
||||||
|
|
Loading…
Reference in a new issue