X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/229935184b3ca7eda9edd6b7d7851f53b2441a65..83e293a6ec98c7faad1b76dd312b31b86cbeecc1:/Projects/XPLAINBridge/Lib/SoftUART.h?ds=inline diff --git a/Projects/XPLAINBridge/Lib/SoftUART.h b/Projects/XPLAINBridge/Lib/SoftUART.h index a107d48a8..d0b03c04b 100644 --- a/Projects/XPLAINBridge/Lib/SoftUART.h +++ b/Projects/XPLAINBridge/Lib/SoftUART.h @@ -42,9 +42,6 @@ #include "LightweightRingBuff.h" /* Macros: */ - #define BAUD 9600 - #define BIT_TIME ((F_CPU / BAUD) - 1) - #define SRX PD0 #define SRXPIN PIND #define SRXPORT PORTD @@ -53,6 +50,15 @@ #define STXPORT PORTD #define STXDDR DDRD + /* Inline Functions: */ + static inline void SoftUART_SetBaud(const uint32_t Baud) + { + uint16_t BitTime = ((F_CPU / Baud) - 1); + + OCR1A = BitTime; + OCR3A = BitTime; + } + /* Function Prototypes: */ void SoftUART_Init(void);