mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-07 16:23:38 +03:00
define in header
remove extern from cpp files
This commit is contained in:
parent
0b2fb8d3ee
commit
17de2d7a4e
@ -39,6 +39,7 @@ extern "C" {
|
|||||||
#include "twi.h"
|
#include "twi.h"
|
||||||
|
|
||||||
void yield(void);
|
void yield(void);
|
||||||
|
void optimistic_yield(void);
|
||||||
|
|
||||||
#define HIGH 0x1
|
#define HIGH 0x1
|
||||||
#define LOW 0x0
|
#define LOW 0x0
|
||||||
|
@ -551,8 +551,6 @@ bool HardwareSerial::isRxEnabled(void) {
|
|||||||
return _uart->rxEnabled;
|
return _uart->rxEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void optimistic_yield();
|
|
||||||
|
|
||||||
int HardwareSerial::available(void) {
|
int HardwareSerial::available(void) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ extern "C" void __yield() {
|
|||||||
}
|
}
|
||||||
extern "C" void yield(void) __attribute__ ((weak, alias("__yield")));
|
extern "C" void yield(void) __attribute__ ((weak, alias("__yield")));
|
||||||
|
|
||||||
extern "C" void optimistic_yield() {
|
extern "C" void optimistic_yield(void) {
|
||||||
if (!ETS_INTR_WITHINISR() &&
|
if (!ETS_INTR_WITHINISR() &&
|
||||||
(system_get_time() - g_micros_at_last_task_yield) > OPTIMISTIC_YIELD_TIME_US)
|
(system_get_time() - g_micros_at_last_task_yield) > OPTIMISTIC_YIELD_TIME_US)
|
||||||
{
|
{
|
||||||
|
@ -177,8 +177,6 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
|
|||||||
return _client->write(reinterpret_cast<const char*>(buf), size);
|
return _client->write(reinterpret_cast<const char*>(buf), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void optimistic_yield();
|
|
||||||
|
|
||||||
int WiFiClient::available()
|
int WiFiClient::available()
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
@ -89,8 +89,6 @@ bool WiFiServer::hasClient(){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void optimistic_yield();
|
|
||||||
|
|
||||||
WiFiClient WiFiServer::available(byte* status)
|
WiFiClient WiFiServer::available(byte* status)
|
||||||
{
|
{
|
||||||
if (_unclaimed)
|
if (_unclaimed)
|
||||||
|
@ -113,8 +113,6 @@ uint8_t WiFiUDP::beginMulticast(IPAddress interfaceAddr, IPAddress multicast, ui
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void optimistic_yield();
|
|
||||||
|
|
||||||
/* return number of bytes available in the current packet,
|
/* return number of bytes available in the current packet,
|
||||||
will return zero if parsePacket hasn't been called yet */
|
will return zero if parsePacket hasn't been called yet */
|
||||||
int WiFiUDP::available() {
|
int WiFiUDP::available() {
|
||||||
|
@ -160,8 +160,6 @@ size_t TwoWire::write(const uint8_t *data, size_t quantity){
|
|||||||
return quantity;
|
return quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void optimistic_yield();
|
|
||||||
|
|
||||||
int TwoWire::available(void){
|
int TwoWire::available(void){
|
||||||
int result = rxBufferLength - rxBufferIndex;
|
int result = rxBufferLength - rxBufferIndex;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user