mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-09-10 17:15:43 +00:00
Added ability to set the serial baud rate via the user's terminal in the XPLAINBridge project.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user