projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace internal Pipe_BytesToEPSizeMask() routine with a new version which results...
[pub/USBasp.git]
/
Projects
/
XPLAINBridge
/
Lib
/
SoftUART.h
diff --git
a/Projects/XPLAINBridge/Lib/SoftUART.h
b/Projects/XPLAINBridge/Lib/SoftUART.h
index
a9401da
..
d0b03c0
100644
(file)
--- a/
Projects/XPLAINBridge/Lib/SoftUART.h
+++ b/
Projects/XPLAINBridge/Lib/SoftUART.h
@@
-42,9
+42,6
@@
#include "LightweightRingBuff.h"
/* Macros: */
#include "LightweightRingBuff.h"
/* Macros: */
- #define BAUD 9600
- #define BIT_TIME (uint16_t)((F_CPU + (BAUD / 2.0f)) / BAUD)
-
#define SRX PD0
#define SRXPIN PIND
#define SRXPORT PORTD
#define SRX PD0
#define SRXPIN PIND
#define SRXPORT PORTD
@@
-53,6
+50,15
@@
#define STXPORT PORTD
#define STXDDR DDRD
#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);
/* Function Prototypes: */
void SoftUART_Init(void);