mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Fix NO_GLOBAL_INSTANCES for Serial ports (#8184)
This commit is contained in:
parent
09c4e33106
commit
c9f27410f7
@ -35,9 +35,6 @@
|
|||||||
|
|
||||||
// SerialEvent functions are weak, so when the user doesn't define them,
|
// SerialEvent functions are weak, so when the user doesn't define them,
|
||||||
// the linker just sets their address to 0 (which is checked below).
|
// the linker just sets their address to 0 (which is checked below).
|
||||||
// The Serialx_available is just a wrapper around Serialx.available(),
|
|
||||||
// but we can refer to it weakly so we don't pull in the entire
|
|
||||||
// HardwareSerial instance if the user doesn't also refer to it.
|
|
||||||
void serialEvent() __attribute__((weak));
|
void serialEvent() __attribute__((weak));
|
||||||
|
|
||||||
HardwareSerial::HardwareSerial(int uart_nr)
|
HardwareSerial::HardwareSerial(int uart_nr)
|
||||||
|
@ -233,8 +233,12 @@ protected:
|
|||||||
size_t _rx_size;
|
size_t _rx_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
|
||||||
extern HardwareSerial Serial;
|
extern HardwareSerial Serial;
|
||||||
|
#endif
|
||||||
|
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL1)
|
||||||
extern HardwareSerial Serial1;
|
extern HardwareSerial Serial1;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void serialEventRun(void) __attribute__((weak));
|
extern void serialEventRun(void) __attribute__((weak));
|
||||||
|
|
||||||
|
@ -849,6 +849,10 @@ bool HTTPClient::connect(void)
|
|||||||
{
|
{
|
||||||
if(_reuse && _canReuse && connected()) {
|
if(_reuse && _canReuse && connected()) {
|
||||||
DEBUG_HTTPCLIENT("[HTTP-Client] connect: already connected, reusing connection\n");
|
DEBUG_HTTPCLIENT("[HTTP-Client] connect: already connected, reusing connection\n");
|
||||||
|
|
||||||
|
#if defined(NO_GLOBAL_INSTANCES) || defined(NO_GLOBAL_STREAMDEV)
|
||||||
|
StreamNull devnull;
|
||||||
|
#endif
|
||||||
_client->sendAvailable(devnull); // clear _client's output (all of it, no timeout)
|
_client->sendAvailable(devnull); // clear _client's output (all of it, no timeout)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user