Added serialRead and serialAvailable.

This commit is contained in:
David A. Mellis 2005-09-19 10:57:06 +00:00
parent 15ae9ab1b0
commit 59adc64ba6
2 changed files with 12 additions and 0 deletions

View File

@ -220,6 +220,16 @@ void serialWrite(unsigned char c)
uartSendByte(c);
}
int serialAvailable()
{
return uartGetRxBuffer()->datalength;
}
int serialRead()
{
return uartGetByte();
}
void printMode(int mode)
{
// do nothing, we only support serial printing, not lcd.

View File

@ -67,6 +67,8 @@ void setup(void);
void loop(void);
void beginSerial(int);
void serialWrite(unsigned char);
int serialAvailable();
int serialRead();
void print(const char *, ...);
void printMode(int);