mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Added serialRead and serialAvailable.
This commit is contained in:
@ -220,6 +220,16 @@ void serialWrite(unsigned char c)
|
|||||||
uartSendByte(c);
|
uartSendByte(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int serialAvailable()
|
||||||
|
{
|
||||||
|
return uartGetRxBuffer()->datalength;
|
||||||
|
}
|
||||||
|
|
||||||
|
int serialRead()
|
||||||
|
{
|
||||||
|
return uartGetByte();
|
||||||
|
}
|
||||||
|
|
||||||
void printMode(int mode)
|
void printMode(int mode)
|
||||||
{
|
{
|
||||||
// do nothing, we only support serial printing, not lcd.
|
// do nothing, we only support serial printing, not lcd.
|
||||||
|
@ -67,6 +67,8 @@ void setup(void);
|
|||||||
void loop(void);
|
void loop(void);
|
||||||
void beginSerial(int);
|
void beginSerial(int);
|
||||||
void serialWrite(unsigned char);
|
void serialWrite(unsigned char);
|
||||||
|
int serialAvailable();
|
||||||
|
int serialRead();
|
||||||
void print(const char *, ...);
|
void print(const char *, ...);
|
||||||
void printMode(int);
|
void printMode(int);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user