From: asterix Date: Mon, 5 Nov 2007 13:13:39 +0000 (+0000) Subject: Convert clearstatus macro in function. X-Git-Tag: 1.0.0~263 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=1e6fd302fca27fb288343fc74b9f5e212078d5fe;p=bertos.git Convert clearstatus macro in function. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@979 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/ser.c b/drv/ser.c index 11e34c8f..06186d48 100644 --- a/drv/ser.c +++ b/drv/ser.c @@ -378,6 +378,10 @@ void ser_setparity(struct Serial *port, int parity) port->hw->table->setParity(port->hw, parity); } +void ser_clearstatus(struct Serial *port) +{ + ser_setstatus(port, 0); +} /** * Flush both the RX and TX buffers. diff --git a/drv/ser.h b/drv/ser.h index 7e773056..4f69a2af 100644 --- a/drv/ser.h +++ b/drv/ser.h @@ -140,6 +140,7 @@ extern int ser_printf(struct Serial *port, const char *format, ...) FORMAT(__pri extern int ser_gets(struct Serial *port, char *buf, int size); extern int ser_gets_echo(struct Serial *port, char *buf, int size, bool echo); +extern void ser_clearstatus(struct Serial *port); extern void ser_setbaudrate(struct Serial *port, unsigned long rate); extern void ser_setparity(struct Serial *port, int parity); @@ -158,7 +159,6 @@ extern void ser_close(struct Serial *port); */ #define ser_getstatus(h) ((h)->status) #define ser_setstatus(h, x) ((h)->status = (x)) -#define ser_clearstatus(h) ser_setstatus(h, 0) /* \} */ #endif /* DRV_SER_H */