projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed ISR definition conflict in the XPLAIN bridge between the software UART and...
[pub/USBasp.git]
/
Projects
/
XPLAINBridge
/
Lib
/
SoftUART.h
diff --git
a/Projects/XPLAINBridge/Lib/SoftUART.h
b/Projects/XPLAINBridge/Lib/SoftUART.h
index
a9401da
..
923631b
100644
(file)
--- a/
Projects/XPLAINBridge/Lib/SoftUART.h
+++ b/
Projects/XPLAINBridge/Lib/SoftUART.h
@@
-30,6
+30,11
@@
this software.
*/
this software.
*/
+/** \file
+ *
+ * Header file for SoftUART.c.
+ */
+
#ifndef _SOFT_UART_
#define _SOFT_UART_
#ifndef _SOFT_UART_
#define _SOFT_UART_
@@
-42,9
+47,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,7
+55,16
@@
#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);
+
+ ICR1 = BitTime;
+ ICR3 = BitTime;
+ }
+
/* Function Prototypes: */
/* Function Prototypes: */
- void
SoftUART_Init(void);
+ void SoftUART_Init(void);
#endif
\ No newline at end of file
#endif
\ No newline at end of file