From ff82d50ee085222eec1ca114708aa2902a208fcb Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Fri, 23 May 2014 23:56:18 +0200 Subject: [PATCH] OP-1275 add an APP_MINIMAL flag that optionally omits most of the stuffs (flight related stuffs and sensors for example) --- flight/modules/FirmwareIAP/firmwareiap.c | 3 ++- make/apps-defs.mk | 24 +++++++++++++++--------- make/boot-defs.mk | 8 +++++++- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/flight/modules/FirmwareIAP/firmwareiap.c b/flight/modules/FirmwareIAP/firmwareiap.c index f2e23e033..0d8b1c900 100644 --- a/flight/modules/FirmwareIAP/firmwareiap.c +++ b/flight/modules/FirmwareIAP/firmwareiap.c @@ -176,6 +176,7 @@ static void FirmwareIAPCallback(UAVObjEvent *ev) case IAP_STATE_STEP_2: if (data.Command == IAP_CMD_STEP_3) { if (delta > iap_time_3_low_end && delta < iap_time_3_high_end) { +#ifndef PIOS_APPS_MINIMAL FlightStatusData flightStatus; FlightStatusGet(&flightStatus); @@ -184,7 +185,7 @@ static void FirmwareIAPCallback(UAVObjEvent *ev) iap_state = IAP_STATE_READY; break; } - +#endif // we've met the three sequence of command numbers // we've met the time requirements. PIOS_IAP_SetRequest1(); diff --git a/make/apps-defs.mk b/make/apps-defs.mk index a44dfb99f..8b5489b58 100644 --- a/make/apps-defs.mk +++ b/make/apps-defs.mk @@ -57,7 +57,7 @@ endif # List C source files here (C dependencies are automatically generated). # Use file-extension c for "c-only"-files - +ifneq ($(PIOS_APPS_MINIMAL),YES) ## PIOS Hardware (Common Peripherals) SRC += $(PIOSCOMMON)/pios_adxl345.c SRC += $(PIOSCOMMON)/pios_bma180.c @@ -76,22 +76,25 @@ SRC += $(PIOSCOMMON)/pios_ms5611.c SRC += $(PIOSCOMMON)/pios_oplinkrcvr.c SRC += $(PIOSCOMMON)/pios_video.c SRC += $(PIOSCOMMON)/pios_wavplay.c +SRC += $(PIOSCOMMON)/pios_rfm22b.c +SRC += $(PIOSCOMMON)/pios_rfm22b_com.c +SRC += $(PIOSCOMMON)/pios_rcvr.c +SRC += $(PIOSCOMMON)/pios_sbus.c +SRC += $(PIOSCOMMON)/pios_sdcard.c ## PIOS Hardware (Common) +SRC += $(PIOSCOMMON)/pios_flashfs_logfs.c +SRC += $(PIOSCOMMON)/pios_flash_jedec.c +SRC += $(PIOSCOMMON)/pios_debuglog.c +endif + SRC += $(PIOSCOMMON)/pios_iap.c SRC += $(PIOSCOMMON)/pios_com.c SRC += $(PIOSCOMMON)/pios_com_msg.c SRC += $(PIOSCOMMON)/pios_crc.c -SRC += $(PIOSCOMMON)/pios_flashfs_logfs.c -SRC += $(PIOSCOMMON)/pios_flash_jedec.c -SRC += $(PIOSCOMMON)/pios_debuglog.c SRC += $(PIOSCOMMON)/pios_deltatime.c -SRC += $(PIOSCOMMON)/pios_rcvr.c -SRC += $(PIOSCOMMON)/pios_rfm22b.c -SRC += $(PIOSCOMMON)/pios_rfm22b_com.c -SRC += $(PIOSCOMMON)/pios_sbus.c -SRC += $(PIOSCOMMON)/pios_sdcard.c SRC += $(PIOSCOMMON)/pios_led.c + ifneq ($(PIOS_OMITS_USB),YES) ## PIOS USB related files SRC += $(PIOSCOMMON)/pios_usb_desc_hid_cdc.c @@ -187,6 +190,9 @@ ifeq ($(MCU),cortex-m3) LDFLAGS += -T$(LINKER_SCRIPTS_PATH)/link_$(BOARD)_sections.ld else ifeq ($(MCU),cortex-m4) LDFLAGS += $(addprefix -T,$(LINKER_SCRIPTS_APP)) +else ifeq ($(MCU),cortex-m0) + LDFLAGS += -T$(LINKER_SCRIPTS_PATH)/link_$(BOARD)_memory.ld + LDFLAGS += -T$(LINKER_SCRIPTS_PATH)/link_$(BOARD)_sections.ld endif # Add jtag targets (program and wipe) diff --git a/make/boot-defs.mk b/make/boot-defs.mk index 88503b15c..ecb7df1ca 100644 --- a/make/boot-defs.mk +++ b/make/boot-defs.mk @@ -47,7 +47,7 @@ endif # Use file-extension c for "c-only"-files ## Bootloader Core -SRC += ../pios_usb_board_data.c + SRC += $(OPSYSTEM)/main.c SRC += $(OPSYSTEM)/pios_board.c @@ -55,8 +55,11 @@ SRC += $(OPSYSTEM)/pios_board.c SRC += $(PIOSCOMMON)/pios_board_info.c SRC += $(PIOSCOMMON)/pios_com_msg.c SRC += $(PIOSCOMMON)/pios_iap.c +ifneq ($(PIOS_OMITS_USB),YES) +SRC += ../pios_usb_board_data.c SRC += $(PIOSCOMMON)/pios_usb_desc_hid_only.c SRC += $(PIOSCOMMON)/pios_usb_util.c +endif SRC += $(PIOSCOMMON)/pios_led.c ## Misc library functions @@ -119,6 +122,9 @@ ifeq ($(MCU),cortex-m3) LDFLAGS += -T$(LINKER_SCRIPTS_PATH)/link_$(BOARD)_BL_sections.ld else ifeq ($(MCU),cortex-m4) LDFLAGS += $(addprefix -T,$(LINKER_SCRIPTS_BL)) +else ifeq ($(MCU),cortex-m0) + LDFLAGS += -T$(LINKER_SCRIPTS_PATH)/link_$(BOARD)_memory.ld + LDFLAGS += -T$(LINKER_SCRIPTS_PATH)/link_$(BOARD)_BL_sections.ld endif # Add jtag targets (program and wipe)