aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/XPLAINBridge/Lib/SoftUART.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-05-26 06:15:05 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-05-26 06:15:05 +0000
commit9c037a952f5aaf78c4e13398506cfa2d588bb449 (patch)
treeee69e6a65a6d81851005c977deceded153d5c2af /Projects/XPLAINBridge/Lib/SoftUART.h
parent4a13a5484ae19974a46d3def668aa888d12b8f13 (diff)
downloadlufa-9c037a952f5aaf78c4e13398506cfa2d588bb449.tar.gz
lufa-9c037a952f5aaf78c4e13398506cfa2d588bb449.tar.bz2
lufa-9c037a952f5aaf78c4e13398506cfa2d588bb449.zip
The RingBuff library code has been replaced in the XPLAINBridge project with an ultra lightweight buffer to help improve the reliability of the bridge.
Diffstat (limited to 'Projects/XPLAINBridge/Lib/SoftUART.h')
-rw-r--r--Projects/XPLAINBridge/Lib/SoftUART.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/Projects/XPLAINBridge/Lib/SoftUART.h b/Projects/XPLAINBridge/Lib/SoftUART.h
index 07187c24a..416490d8d 100644
--- a/Projects/XPLAINBridge/Lib/SoftUART.h
+++ b/Projects/XPLAINBridge/Lib/SoftUART.h
@@ -36,7 +36,7 @@
/* Includes: */
#include <avr/io.h>
#include <avr/interrupt.h>
- #include "SoftUART.h"
+ #include <stdbool.h>
/* Macros: */
#define BAUD 9600
@@ -50,10 +50,23 @@
#define STXPORT PORTD
#define STXDDR DDRD
+ /* External Variables: */
+ extern volatile bool srx_done;
+ extern volatile uint8_t stx_count;
+
+ /* Inline Functions: */
+ static inline bool SoftUART_IsReady(void)
+ {
+ return !(stx_count);
+ }
+
+ static inline bool SoftUART_IsReceived(void)
+ {
+ return srx_done;
+ }
+
/* Function Prototypes: */
- uint8_t SoftUART_IsReady(void);
- uint8_t SoftUART_TxByte(uint8_t c);
- uint8_t SoftUART_IsReceived(void);
+ void SoftUART_TxByte(uint8_t c);
uint8_t SoftUART_RxByte(void);
void SoftUART_Init(void);