Added ability to set the serial baud rate via the user's terminal in the XPLAINBridge project.

This commit is contained in:
Dean Camera 2010-07-15 11:01:31 +00:00
parent 40631e9fe5
commit dfe50ff349
9 changed files with 40 additions and 15 deletions

View file

@ -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);