avrdudes / avr-libc

The AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
https://avrdudes.github.io/avr-libc/
Other
261 stars 56 forks source link

[patch #8557] Proposing to remove device specific xmega macros from sleep.h #797

Closed avrs-admin closed 2 years ago

avrs-admin commented 2 years ago

Tue 14 Oct 2014 09:22:26 PM CEST

Hi,

The sleep.h file has a list of conditions using device (xmega in particular) macros, that is used to define the appropriate sleep modes and implement the set_sleep_mode macro.

It seems that ALL the xmega devices have the same set of sleep modes (and corresponding bit positions) and the set_sleep_mode implementation. The attached patch (remove_xmega_specifics.patch) removes the individual device macros and adds the _AVRXMEGA macro instead.

Note : Attached ChangeLog to preserve formatting.

Requesting to review the change and approve/comment.

Thanks Soundararajan

file #32275: ChangeLog file #32274: remove_xmega_specifics.patch file #32286: remove_xmega_specifics_all_headers.patch

This issue was migrated from https://savannah.nongnu.org/patch/?8557

avrs-admin commented 2 years ago

Soundararajan Dhakshinamoorthy Wed 15 Oct 2014 09:29:39 AM CEST

Alternatively can we move all the SLEEP_MODE macros to the respective device header file ?

This should help us reduce some of the conditions defined in sleep.h. After this, we can generalize the set_sleep_mode() macro based on more simpler conditions (like if HAVE_THIS). But there are specific cases (e.x ATmega161) which we have to live with !

avrs-admin commented 2 years ago

Joerg Wunsch Wed 15 Oct 2014 09:36:36 PM CEST

Without reviewing the patch in detail, I basically like the idea behind it.

avrs-admin commented 2 years ago

Senthil Kumar Selvaraj Tue 06 Oct 2015 12:05:39 PM CEST

Committed in svn rev 2455

http://svn.savannah.nongnu.org/viewvc?view=rev&root=avr-libc&revision=2455