diff --git a/Makefile b/Makefile index 6044b42f05..b4c88c3627 100644 --- a/Makefile +++ b/Makefile @@ -233,11 +233,11 @@ fast_deb: $(MAKE) deb OCAMLC=ocamlc.opt DEBFLAGS=-b clean: - rm -fr dox build-stamp configure-stamp conf/%gconf.xml debian/files debian/paparazzi-arm7 debian/paparazzi-avr debian/paparazzi-base debian/paparazzi-bin debian/paparazzi-dev - rm -f $(MESSAGES_H) $(MESSAGES2_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(DL_PROTOCOL_H) - find . -mindepth 2 -name Makefile -exec sh -c '$(MAKE) -C `dirname {}` $@' \; - find . -name '*~' -exec rm -f {} \; - rm -f paparazzi sw/simulator/launchsitl + $(Q)rm -fr dox build-stamp configure-stamp conf/%gconf.xml debian/files debian/paparazzi-base debian/paparazzi-bin + $(Q)rm -f $(MESSAGES_H) $(MESSAGES2_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(DL_PROTOCOL_H) + $(Q)find . -mindepth 2 -name Makefile -exec sh -c 'echo "Cleaning {}"; $(MAKE) -C `dirname {}` $@' \; + $(Q)find . -name '*~' -exec rm -f {} \; + $(Q)rm -f paparazzi sw/simulator/launchsitl cleanspaces: find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \; @@ -247,9 +247,14 @@ cleanspaces: find ./conf -name '*.xml' -exec sed -i {} -e 's/[ \t]*$$//' ';' distclean : dist_clean -dist_clean : clean - rm -r conf/srtm_data - rm -r conf/maps_data conf/maps.xml +dist_clean : + @echo "Warning: This removes all non-repository files. This means you will loose your aircraft list, your maps, your logfiles, ... if you want this, then run: make dist_clean_irreversible" + +dist_clean_irreversible: clean + rm -rf conf/srtm_data + rm -rf conf/maps_data conf/maps.xml + rm -rf conf/conf.xml conf/controlpanel.xml + rm -rf var ab_clean: find sw/airborne -name '*~' -exec rm -f {} \; @@ -260,6 +265,9 @@ test_all_example_airframes: $(MAKE) AIRCRAFT=Tiny_IMU clean_ac ap $(MAKE) AIRCRAFT=EasyStar_ETS clean_ac ap sim +test_all_example_airframes2: + for ap in `grep name conf/conf.xml.example | sed -e 's/.*name=\"//' | sed -e 's/"//'`; do echo "Making $$ap"; make -C ./ AIRCRAFT=$$ap clean_ac ap.compile; done + commands: paparazzi sw/simulator/launchsitl paparazzi: diff --git a/conf/Makefile.lpc21 b/conf/Makefile.lpc21 index d29c7f2157..eca613941d 100644 --- a/conf/Makefile.lpc21 +++ b/conf/Makefile.lpc21 @@ -221,18 +221,17 @@ printcommands: @echo "Using DMP = $(OBJDUMP)" @echo "Using NM = $(NM)" @echo "Using SIZE = $(SIZE)" - @echo "Using OOCD = $(OOCD)" @echo "GCC version:" @$(CC) --version | head -1 ifeq ("$(MULTILIB)","yes") printmultilib: @echo "*** Using multilib ***" - @echo "--------------------------" + @echo "--------------------------------------" else printmultilib: @echo "*** NOT using multilib ***" - @echo "--------------------------" + @echo "--------------------------------------" endif build: elf hex lss sym @@ -247,10 +246,10 @@ sym: $(OBJDIR)/$(TARGET).sym HEXSIZE = $(SIZE) --target=$(FORMAT) $(OBJDIR)/$(TARGET).hex ELFSIZE = $(SIZE) -A $(OBJDIR)/$(TARGET).elf sizebefore: - @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; $(ELFSIZE); echo; fi + @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; echo "Previous size:"; $(ELFSIZE); fi sizeafter: - @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; $(ELFSIZE); echo; fi + @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; echo "Current size:"; $(ELFSIZE); fi # Program the device. @@ -258,6 +257,7 @@ load upload program: $(OBJDIR)/$(TARGET).hex ifeq ($(FLASH_MODE),IAP) $(SUDO) $(LPC21IAP) $(OBJDIR)/$(TARGET).elf else ifeq ($(FLASH_MODE),JTAG) + @echo "Using OOCD = $(OOCD)" @echo -e " OOCD\t$<" $(Q)$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \ -f board/$(OOCD_TARGET).cfg \ diff --git a/conf/Makefile.stm32 b/conf/Makefile.stm32 index 284ac27cdb..00f1cb6913 100644 --- a/conf/Makefile.stm32 +++ b/conf/Makefile.stm32 @@ -44,6 +44,10 @@ TOOLCHAIN_DIR=$(shell dirname $(TOOLCHAIN)) GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib +# Detect if we are using the new libopencm3 or the old libopenstm32 +LIBOPENCM3_LIB=$(shell if [ -e "$(GCC_LIB_DIR)/libopencm3_stm32f1.a" ]; then echo "opencm3_stm32f1"; else echo "opencm3_stm32"; fi) +LIBOPENCM3_DEFS=$(shell if [ -e "$(GCC_LIB_DIR)/libopencm3_stm32f1.a" ]; then echo "-DSTM32F1"; fi) + # Define programs and commands. GCC_BIN_PREFIX=$(GCC_BIN_DIR)/arm-none-eabi CC = $(GCC_BIN_PREFIX)-gcc @@ -133,6 +137,7 @@ CFLAGS += -Wmissing-prototypes CFLAGS += -Wstrict-prototypes CFLAGS += -Wmissing-declarations CFLAGS += -Wswitch-default +CFLAGS += $(LIBOPENCM3_DEFS) CFLAGS += $($(TARGET).CFLAGS) @@ -148,7 +153,7 @@ else LDFLAGS = -D__thumb2__ -T$(LDSCRIPT) -nostartfiles -L$(GCC_LIB_DIR) -O$(OPT) --gc-sections endif LDFLAGS += -Wl,-Map=$(OBJDIR)/$(TARGET).map,--cref,--gc-sections -LDLIBS += -lc -lm -lgcc -lcmsis -lstm32 -lopencm3_stm32 +LDLIBS += -lc -lm -lgcc -lcmsis -lstm32 -l$(LIBOPENCM3_LIB) CPFLAGS = -j .isr_vector -j .text -j .data CPFLAGS_BIN = -Obinary @@ -168,18 +173,17 @@ printcommands: @echo "Using DMP = $(DMP)" @echo "Using NM = $(NM)" @echo "Using SIZE = $(SIZE)" - @echo "Using OOCD = $(OOCD)" @echo "GCC version:" @$(CC) --version | head -1 - @echo "OOCD version:" - @$(OOCD) --version | head -1 ifeq ("$(MULTILIB)","yes") printmultilib: @echo "*** Using multilib ***" + @echo "--------------------------------------" else printmultilib: @echo "*** NOT using multilib ***" + @echo "--------------------------------------" endif build: elf bin hex @@ -194,10 +198,10 @@ sym: $(OBJDIR)/$(TARGET).sym # Display size of file. ELFSIZE = $(SIZE) -A $(OBJDIR)/$(TARGET).elf sizebefore: - @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; $(ELFSIZE); echo; fi + @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; echo "Previous size:"; $(ELFSIZE); fi sizeafter: - @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; $(ELFSIZE); echo; fi + @if [ -f $(OBJDIR)/$(TARGET).elf ]; then echo; echo "Current size:"; $(ELFSIZE); fi @@ -246,6 +250,7 @@ upload: $(OBJDIR)/$(TARGET).bin $(LOADER) -p /dev/ttyUSB0 -b 115200 -e -w -v $^ else ifeq ($(FLASH_MODE),JTAG) upload: $(OBJDIR)/$(TARGET).elf + @echo "Using OOCD = $(OOCD)" @echo " OOCD\t$<" $(Q)$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \ -f board/$(OOCD_BOARD).cfg \ diff --git a/conf/airframes/TU_Delft/skywalker.xml b/conf/airframes/TU_Delft/skywalker.xml index e53deba4db..66eec6c4eb 100644 --- a/conf/airframes/TU_Delft/skywalker.xml +++ b/conf/airframes/TU_Delft/skywalker.xml @@ -7,7 +7,7 @@ - + @@ -17,8 +17,8 @@ - + @@ -103,8 +103,8 @@
- - + +
@@ -120,6 +120,9 @@ + + +
diff --git a/conf/airframes/TU_Delft/skywalkerfiber.xml b/conf/airframes/TU_Delft/skywalkerfiber.xml index fdd3976c3a..000a3c7c25 100644 --- a/conf/airframes/TU_Delft/skywalkerfiber.xml +++ b/conf/airframes/TU_Delft/skywalkerfiber.xml @@ -1,25 +1,91 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - + + + - - - - + + + + + @@ -30,6 +96,15 @@ + + +
@@ -41,7 +116,7 @@ - + @@ -66,8 +141,8 @@ - - + + @@ -91,9 +166,11 @@
- + + - + +
@@ -102,10 +179,11 @@ - - - - + + + + + @@ -115,12 +193,12 @@ - - + + - - - + + + @@ -128,8 +206,8 @@ - - + + @@ -154,6 +232,10 @@
+ + + + @@ -162,11 +244,13 @@ +
+
@@ -188,6 +272,8 @@
+ +
@@ -208,6 +294,7 @@
+
@@ -219,6 +306,7 @@
+
@@ -229,62 +317,10 @@
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml index c5dee5b8a7..944c68f774 100644 --- a/conf/airframes/microjet_example.xml +++ b/conf/airframes/microjet_example.xml @@ -19,6 +19,7 @@ + @@ -120,7 +121,8 @@
- + + @@ -195,6 +197,9 @@ + + + diff --git a/data/maps/Makefile b/data/maps/Makefile index 9a676c715c..995c5bb98b 100644 --- a/data/maps/Makefile +++ b/data/maps/Makefile @@ -3,11 +3,15 @@ Q=@ all: $(DATADIR)/maps.google.com $(PAPARAZZI_HOME)/conf/maps.xml +clean: + + $(DATADIR): mkdir $(DATADIR) $(DATADIR)/maps.google.com: $(DATADIR) FORCE - wget -O $(@) http://maps.google.com/ + @echo "DOWNLOAD: google maps version code"; + $(Q)wget -q -O $(@) http://maps.google.com/ $(PAPARAZZI_HOME)/conf/maps.xml: $(DATADIR)/maps.google.com $(Q)echo "" > $(@) diff --git a/data/srtm/Makefile b/data/srtm/Makefile index 0e24687031..80ac333eee 100644 --- a/data/srtm/Makefile +++ b/data/srtm/Makefile @@ -3,6 +3,9 @@ Q=@ SRTMData: $(DATADIR)/Africa $(DATADIR)/Australia $(DATADIR)/Eurasia $(DATADIR)/Islands $(DATADIR)/North_America $(DATADIR)/South_America +clean: + + $(DATADIR): mkdir $(DATADIR) @@ -29,3 +32,4 @@ $(DATADIR)/South_America: $(DATADIR) %.hgt.zip: SRTMData $(Q)wget -c -nv -N http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(shell grep -l $(@F) $(DATADIR)/* | sed -e s#$(DATADIR)/##)/$(@F) + diff --git a/githelper.sh b/githelper.sh index ae5f7c3386..d46c4674e6 100755 --- a/githelper.sh +++ b/githelper.sh @@ -95,7 +95,7 @@ case "$choice" in echo -e "-Now use one of your tags: \033[1mgit checkout TAG_NAME\033[0m (find the available TAG_NAMEs using \033[1mgit tag\033[0m ) (note that after this command you will be in detached head state which means that you are using a older revision and you can not commit changes here. If you want to make changes you have to make a branch from your tag)" exit; ;; - 4 ) clear; exit 1 ;; + 5 ) clear; exit 1 ;; esac done diff --git a/sw/airborne/arch/stm32/mcu_arch.c b/sw/airborne/arch/stm32/mcu_arch.c index 4ab5202c37..22ea358a60 100644 --- a/sw/airborne/arch/stm32/mcu_arch.c +++ b/sw/airborne/arch/stm32/mcu_arch.c @@ -32,7 +32,11 @@ #include #include #ifdef USE_OPENCM3 -#include +# if defined(STM32F1) || defined(STM32F2) || defined(STM32F4) +# include +# else +# include +# endif #endif diff --git a/sw/airborne/firmwares/rotorcraft/autopilot.c b/sw/airborne/firmwares/rotorcraft/autopilot.c index 6cc818a313..125937e453 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot.c +++ b/sw/airborne/firmwares/rotorcraft/autopilot.c @@ -287,6 +287,8 @@ static inline void autopilot_check_motors_on( void ) { if (!(THROTTLE_STICK_DOWN() && YAW_STICK_PUSHED())) // wait until stick released autopilot_check_motor_status = STATUS_MOTORS_OFF; break; + default: + break; }; } diff --git a/sw/airborne/modules/digital_cam/dc.c b/sw/airborne/modules/digital_cam/dc.c index a572f5c575..9e7f4e5f2e 100644 --- a/sw/airborne/modules/digital_cam/dc.c +++ b/sw/airborne/modules/digital_cam/dc.c @@ -145,7 +145,7 @@ uint8_t dc_survey(float interval, float x, float y) { dc_gps_x = x; dc_gps_y = y; } - dc_gps_next_dist = interval; + dc_gps_next_dist = 0; dc_info(); return 0; } diff --git a/sw/ground_segment/misc/Makefile b/sw/ground_segment/misc/Makefile index 9e15b25a0f..d7cf0118fb 100644 --- a/sw/ground_segment/misc/Makefile +++ b/sw/ground_segment/misc/Makefile @@ -10,7 +10,7 @@ endif all: davis2ivy kestrel2ivy clean: - rm *.o davis2ivy kestrel2ivy + rm -f *.o davis2ivy kestrel2ivy davis2ivy: davis2ivy.o g++ -o davis2ivy davis2ivy.o $(LIBRARYS) -livy diff --git a/sw/ground_segment/tmtc/GSM/Makefile b/sw/ground_segment/tmtc/GSM/Makefile index e731282280..697b8399d9 100644 --- a/sw/ground_segment/tmtc/GSM/Makefile +++ b/sw/ground_segment/tmtc/GSM/Makefile @@ -4,4 +4,4 @@ SMS_GS: SMS_Ground_UDtest_final.c gcc -g -O2 -Wall `pkg-config --cflags glib-2.0 gtk+-2.0` -L/usr/lib -lglibivy -o SMS_GS SMS_Ground_UDtest_final.c `pkg-config --libs glib-2.0 gtk+-2.0` -lglibivy clean: - rm SMS_GS + rm -f SMS_GS diff --git a/sw/ground_segment/tmtc/ivy_serial_bridge.c b/sw/ground_segment/tmtc/ivy_serial_bridge.c index 5dade2b7fb..1a49ee6433 100644 --- a/sw/ground_segment/tmtc/ivy_serial_bridge.c +++ b/sw/ground_segment/tmtc/ivy_serial_bridge.c @@ -110,6 +110,7 @@ static void on_Estimator(IvyClientPtr app, void *user_data, int argc, char *argv */ + local_uav.utm_z = (( atof(argv[0]) ) * 1000.0f); local_uav.climb = atof(argv[1]); } @@ -168,7 +169,6 @@ static void on_Gps(IvyClientPtr app, void *user_data, int argc, char *argv[]) local_uav.utm_east = atoi(argv[1]); local_uav.utm_north = atoi(argv[2]); - local_uav.utm_z = atoi(argv[4]); local_uav.utm_zone = atoi(argv[9]); local_uav.speed = atoi(argv[5]); @@ -268,7 +268,7 @@ void send_ivy(void) */ - IvySendMsg("%d NAVIGATION %d 0 0 0 0 0 0 0 \n", remote_uav.ac_id, remote_uav.block); +// IvySendMsg("%d NAVIGATION %d 0 0 0 0 0 0 0 \n", remote_uav.ac_id, remote_uav.block); /* @@ -310,7 +310,7 @@ void send_ivy(void) delayer++; if (delayer > 5) { - IvySendMsg("%d NAVIGATION_REF %d %d %d\n", remote_uav.ac_id, remote_uav.utm_east, remote_uav.utm_north, remote_uav.utm_zone); +// IvySendMsg("%d NAVIGATION_REF %d %d %d\n", remote_uav.ac_id, remote_uav.utm_east, remote_uav.utm_north, remote_uav.utm_zone); delayer = 0; } diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index 34cc714840..a360146c6c 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -447,6 +447,18 @@ let check_md5sum = fun ac_name alive_md5sum aircraft_conf_dir -> done | _ -> failwith "Array expected here" with _ -> + try + match alive_md5sum with + Pprz.Array array -> + let n = Array.length array in + assert(n = String.length md5sum / 2); + for i = 0 to n - 1 do + let x = 0 in + assert (x = Pprz.int_of_value array.(i)) + done; + fprintf stderr "MD5 is ZERO, be carefull with configurations\n%!" + | _ -> failwith "Array expected here" + with _ -> let error_message = sprintf "WARNING: live md5 signature for %s does not match current configuration, please reload your code (disable check with -no_md5_check option)" ac_name in if !no_md5_check then fprintf stderr "%s; continuing anyway as requested\n%!" error_message diff --git a/sw/in_progress/ir_calibration/gui.c b/sw/in_progress/ir_calibration/gui.c index 2211f57d90..0f30479014 100644 --- a/sw/in_progress/ir_calibration/gui.c +++ b/sw/in_progress/ir_calibration/gui.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #define NB_POINTS 121 diff --git a/sw/in_progress/satcom/Makefile b/sw/in_progress/satcom/Makefile index 339fb51001..0c780f676d 100644 --- a/sw/in_progress/satcom/Makefile +++ b/sw/in_progress/satcom/Makefile @@ -10,4 +10,4 @@ tcp2ivy_generic: tcp2ivy_generic.c gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -I../../../var/${AIRCRAFT} -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy -lm clean: - rm email2udp udp2tcp tcp2ivy + rm -f email2udp udp2tcp tcp2ivy diff --git a/sw/in_progress/videolizer/wis-go7007-linux/kernel/Makefile b/sw/in_progress/videolizer/wis-go7007-linux/kernel/Makefile index 6719a89748..a84508cb59 100644 --- a/sw/in_progress/videolizer/wis-go7007-linux/kernel/Makefile +++ b/sw/in_progress/videolizer/wis-go7007-linux/kernel/Makefile @@ -5,6 +5,9 @@ obj-m += go7007.o go7007-usb.o snd-go7007.o wis-saa7115.o wis-tw9903.o \ wis-tw2804.o go7007-objs := go7007-v4l2.o go7007-driver.o go7007-i2c.o go7007-fw.o +clean: + rm -f $(obj-m) + ifneq ($(SAA7134_BUILD),) obj-m += saa7134-go7007.o endif diff --git a/sw/lib/ocaml/ivy/Makefile b/sw/lib/ocaml/ivy/Makefile index abacbdf640..24613416c7 100644 --- a/sw/lib/ocaml/ivy/Makefile +++ b/sw/lib/ocaml/ivy/Makefile @@ -122,4 +122,6 @@ clean: .depend: $(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend +ifneq ($(MAKECMDGOALS),clean) include .depend +endif diff --git a/sw/lib/ocaml/ivy/examples/Makefile b/sw/lib/ocaml/ivy/examples/Makefile index 2d4c27fc44..53fa3ae7c4 100644 --- a/sw/lib/ocaml/ivy/examples/Makefile +++ b/sw/lib/ocaml/ivy/examples/Makefile @@ -26,4 +26,6 @@ clean: .depend: $(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend +ifneq ($(MAKECMDGOALS),clean) include .depend +endif diff --git a/sw/simulator/old_booz/tests/Makefile b/sw/simulator/old_booz/tests/Makefile index 35c5ec7f91..13d0e57905 100644 --- a/sw/simulator/old_booz/tests/Makefile +++ b/sw/simulator/old_booz/tests/Makefile @@ -68,3 +68,6 @@ TEST_SENSORS_SRCS = test_sensors.c \ test_sensors : $(TEST_SENSORS_SRCS) gcc $(CFLAGS) -o $@ $^ $(LDFLAGS) + +clean: + diff --git a/sw/simulator/scilab/q3d/fonts/Makefile b/sw/simulator/scilab/q3d/fonts/Makefile index 9ec1ddeda5..f99fbddd80 100644 --- a/sw/simulator/scilab/q3d/fonts/Makefile +++ b/sw/simulator/scilab/q3d/fonts/Makefile @@ -4,3 +4,7 @@ GLIB_LDFLAGS = `pkg-config glib-2.0 --libs` -lglibivy -lpcre ttx2scilab: ttx2scilab.c $(CC) -Wall $(GLIB_CFLAGS) -o $@ $< $(GLIB_LDFLAGS) + +clean: + rm -f ttx2scilab + diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml index 72b25931d4..7e0f1efaba 100644 --- a/sw/tools/gen_aircraft.ml +++ b/sw/tools/gen_aircraft.ml @@ -232,7 +232,12 @@ let parse_firmware = fun makefile_ac firmware -> (* print makefile for this target *) fprintf makefile_ac "\n###########\n# -target: '%s'\n" (Xml.attrib target "name"); fprintf makefile_ac "ifeq ($(TARGET), %s)\n" (Xml.attrib target "name"); - try fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor") with _ -> (); + let has_processor = + try + not (String.compare (Xml.attrib target "processor") "" = 0) + with _ -> false in + if has_processor then + fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor"); List.iter (print_firmware_configure makefile_ac) config; List.iter (print_firmware_configure makefile_ac) t_config; List.iter (print_firmware_define makefile_ac) defines;