Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added URSEL flag to fix ATMEGA8 functionality #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/DMXSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,22 @@ typedef enum {
// receiver must accept 88 us break and 8 us MAB
#define BREAKSPEED 100000L

#if !defined(DMX_USE_PORT1) && defined(USART_RXC_vect)

// ATMEGA8 requires that URSEL be set to 1 when writing to register UCSRC
// This definition appends the required bit to the serial definition

#define BREAKFORMAT (SERIAL_8E2 | (1<<URSEL))
#define DMXFORMAT (SERIAL_8N2 | (1<<URSEL))
#define DMXREADFORMAT (SERIAL_8N1 | (1<<URSEL))

#else

#define BREAKFORMAT SERIAL_8E2
#define DMXFORMAT SERIAL_8N2
#define DMXREADFORMAT SERIAL_8N1

#endif

// ----- include processor specific definitions and functions.

Expand Down