diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-22 18:03:13 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-22 18:03:13 +0000 |
commit | a059004e062322e56a9d5809099c212d40ab4292 (patch) | |
tree | 41752cf13c5bf7facdb0d28106cd31f76ad6d7e1 /nuttx/drivers/power/Make.defs | |
parent | 3d2ac1dd78fbec255823415ef5498d35056b7361 (diff) | |
download | px4-nuttx-a059004e062322e56a9d5809099c212d40ab4292.tar.gz px4-nuttx-a059004e062322e56a9d5809099c212d40ab4292.tar.bz2 px4-nuttx-a059004e062322e56a9d5809099c212d40ab4292.zip |
Create a generic battery driver infrastructure
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4322 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/power/Make.defs')
-rw-r--r-- | nuttx/drivers/power/Make.defs | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/nuttx/drivers/power/Make.defs b/nuttx/drivers/power/Make.defs index 91102c1e9..261e7525c 100644 --- a/nuttx/drivers/power/Make.defs +++ b/nuttx/drivers/power/Make.defs @@ -33,26 +33,53 @@ # ############################################################################ -# Has power management support been initialized? - -ifeq ($(CONFIG_PM),y) +POWER_DEPPATH = +POWER_VPATH = +POWER_CFLAGS = # Include power management sources +ifeq ($(CONFIG_PM),y) + CSRCS += pm_activity.c pm_changestate.c pm_checkstate.c pm_initialize.c pm_register.c pm_update.c -# Add I2C devices +# Include power management in the build + +POWER_DEPPATH := --dep-path power +POWER_VPATH := :power +POWER_CFLAGS := ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power} + +endif + +# Add battery drivers + +ifeq ($(CONFIG_BATTERY),y) + +CSRCS += battery.c + +# Add I2C-based battery drivers ifeq ($(CONFIG_I2C),y) + +# Add the MAX1704x I2C-based battery driver + ifeq ($(CONFIG_I2C_MAX1704X),y) CSRCS += max1704x.c endif + +endif + +# Include battery suport in the build + +POWER_DEPPATH := --dep-path power +POWER_VPATH := :power +POWER_CFLAGS := ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power} + endif # Include power management in the build -DEPPATH += --dep-path power -VPATH += :power -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power} -endif +DEPPATH += $(POWER_DEPPATH) +VPATH += $(POWER_VPATH) +CFLAGS += $(POWER_CFLAGS); |