Skip to content

Commit

Permalink
Added URSEL flag to fix ATMEGA8 functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
aidancrowther committed Oct 4, 2024
1 parent 4674529 commit 0fb4504
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit 0fb4504

Please sign in to comment.