[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] Restructure conditions for power management APIs (power.h
[avr-libc-dev] Restructure conditions for power management APIs (power.h)
Mon, 29 Sep 2014 13:55:55 +0000
Power management APIs in power.h are depends on device macro. Most of the
share same APIs. Irrespective of those common APIs, device name needs to be
to power.h to enable for that device.
If these APIs are enabled based on some condition from device header then these
shall be enabled automatically for new devices.
Add conditions in power.h like:
#if defined __AVR_HAVE_PRTIM0_PRR0
#define power_timer0_enable() PRR0 &= (uint8_t)~(1 << PRTIM0)
#define power_timer0_disable() PRR0 |= (uint8_t)(1 << PRTIM0)
#if defined __AVR_HAVE_PRTIM3_PRR1
#define power_timer3_enable() PRR1 &= (uint8_t)~(1 << PRTIM3)
#define power_timer3_disable() PRR1 |= (uint8_t)(1 << PRTIM3)
Add conditions to device header as follows:
However, power.h may need update if the new device has a different/ new power
register or bitfields.
Will it be useful? Please give your suggestions.
|[Prev in Thread]
||[Next in Thread]|
- [avr-libc-dev] Restructure conditions for power management APIs (power.h),
Sivanupandi, Pitchumani <=