Make XPLAINBridge serial bridge much more reliable for the reception of characters...
[pub/USBasp.git] / Projects / XPLAINBridge / Lib / SoftUART.h
index 416490d..a685a6d 100644 (file)
                #include <avr/io.h>
                #include <avr/interrupt.h>
                #include <stdbool.h>
                #include <avr/io.h>
                #include <avr/interrupt.h>
                #include <stdbool.h>
+               
+               #include "../XPLAINBridge.h"
+               #include "LightweightRingBuff.h"
 
        /* Macros: */
                #define BAUD       9600
 
        /* Macros: */
                #define BAUD       9600
-               #define BIT_TIME   (uint16_t)((F_CPU + (BAUD / 2)) / BAUD)
+               #define BIT_TIME   ((F_CPU + (BAUD / 2)) / BAUD)
 
                #define SRX        PD0
                #define SRXPIN     PIND
 
                #define SRX        PD0
                #define SRXPIN     PIND
                #define STXPORT    PORTD
                #define STXDDR     DDRD
 
                #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: */
        /* Function Prototypes: */
-               void    SoftUART_TxByte(uint8_t c);
-               uint8_t SoftUART_RxByte(void);
                void    SoftUART_Init(void);
 
 #endif
\ No newline at end of file
                void    SoftUART_Init(void);
 
 #endif
\ No newline at end of file