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

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

Re: [avr-libc-dev] power.h addition


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] power.h addition
Date: Thu, 22 Jul 2010 07:33:34 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

As Frédéric Nadeau wrote:

> For the command clock_prescale_set() and clock_prescale_get(),
> devices ATmega128/128A & 64/64A are not covered since they seems to
> be the only ones that make uses of XDIV rather than CLKPR.

That's correct, the current implementation is only targetted for
devices having a CLKPR register.

> Attached patch is for discussion purposes.

Basically looks good, assuming the documentation part also mentions
that ATmega64/128 implement that using XDIV (I see some operating
restrictions for XDIV mentioned in the datasheet, so users should be
aware).

> I'm not much of an assembler guru, so functions are in plain C.

That's fine here.  The inline assembly implementation for CLKPR is
only necessary as writing CLKPR requires a timed sequence which could
not be guaranteed when writing it in C (in case compiler optimizations
are turned off).  This does not appear to be the case for XDIV.

> +#elif defined(XDIV)

This is not consistent with the rest of the file which explicitly
checks the MCU type macros for each possible candidate.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

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