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

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

Re: [avr-libc-dev] New device support


From: Bob Paddock
Subject: Re: [avr-libc-dev] New device support
Date: Sat, 14 Jul 2007 06:36:14 -0400
User-agent: KMail/1.9.5

On Friday 13 July 2007 17:55, Joerg Wunsch wrote:


>  Given that users have been asking for symbolic
> register access anyway, I'm all in favour of a bit-field solution for
> this.  So, for the example of TCCR0B of an ATmega1281, we could do
> something like
> 
> union tccr0b {
>       uint8_t byte;
>       struct {
>               uint8_t cs0: 3;
>               uint8_t wgm02: 1;
>               uint8_t : 2;
>               uint8_t foc0b: 1;
>               uint8_t foc0a: 1;
>       } bits;
> };


I don't know how many people here actually care, besides me, about the 
MISRA guide lines,

http://www.misra.org.uk/

just thought I'd point out:

MISRA-2004 rule 6.4: "Bit fields shall only be defined to be of type unsigned 
int or signed int."
Rule 6.5: "Bit fields of type signed int shall be at least two bits long".

I do hope that the existing format will be supported along with this new bit 
field
format?  Anything that prevents old code from being compiled is not good.
It means it is one more old compiler that I have to maintain, when the new
one is no longer backwards compatible.

Doing software validation can be a expensive and time consuming process,
especially if the product is governed by some regulator agency, which
makes changing existing source code impractical at times.


-- 
                http://www.wearablesmartsensors.com/
 http://www.softwaresafety.net/ http://www.designer-iii.com/
                 http://www.unusualresearch.com/




reply via email to

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