avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Bug in struct definition of __reg_UCSR1C and __reg_UCSR0C


From: vac
Subject: [avr-libc-dev] Bug in struct definition of __reg_UCSR1C and __reg_UCSR0C in iom128rfa1.h
Date: Wed, 13 Aug 2014 11:18:57 +0200
User-agent: RoundCube Webmail/0.8.4

There is a bug in iom128rfa1.h file.

Struct definition of __reg_UCSR1C got 10 bits instead of 8:

struct __reg_UCSR1C {
        unsigned int ucpol1 : 1;        /* Clock Polarity */
        unsigned int ucsz1 : 2; /* Character Size */
        unsigned int ucpha1 : 1;        /* Clock Phase */
        unsigned int udord1 : 1;        /* Data Order */
        unsigned int usbs1 : 1; /* Stop Bit Select */
        unsigned int upm1 : 2;  /* Parity Mode */
        unsigned int umsel1 : 2;        /* USART Mode Select */
};

There are two extra bits (ucpha1 and udord1) in definition of register which are used only in MSPIM mode of USART. Setting for example parity mode (upm1) in result is setting wrong bits: bit 6 and 7 is set insted of bit 4 and 5.

Same applies to __reg_UCSR0C struct.
--
Best regards
Wojtek vac Gajda



reply via email to

[Prev in Thread] Current Thread [Next in Thread]