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. ;-) _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev