diff --git a/conf/Makefile.stm32 b/conf/Makefile.stm32 index ca0e5de326..2bbcc2e69a 100644 --- a/conf/Makefile.stm32 +++ b/conf/Makefile.stm32 @@ -25,9 +25,11 @@ # This is the common Makefile for the stm32-target. # +SRC_ARCH = stm32 + # Pretty Printer # Call with "make Q=''" to get full command display -Q=@ +#Q=@ MCU = cortex-m3 #DEBUG = dwarf-2 diff --git a/conf/airframes/AirborneCodeReorg/LisaFw.xml b/conf/airframes/AirborneCodeReorg/LisaFw.xml index 08154f8f45..bdc6283220 100644 --- a/conf/airframes/AirborneCodeReorg/LisaFw.xml +++ b/conf/airframes/AirborneCodeReorg/LisaFw.xml @@ -160,7 +160,7 @@ - + @@ -173,7 +173,7 @@ - + diff --git a/conf/airframes/AirborneCodeReorg/TinyFw.xml b/conf/airframes/AirborneCodeReorg/TinyFw.xml index 90e362242c..be35417935 100644 --- a/conf/airframes/AirborneCodeReorg/TinyFw.xml +++ b/conf/airframes/AirborneCodeReorg/TinyFw.xml @@ -161,12 +161,12 @@ - + diff --git a/conf/airframes/Poine/booz2_a8.xml b/conf/airframes/Poine/booz2_a8.xml index ce4b96f78e..20e274acdf 100644 --- a/conf/airframes/Poine/booz2_a8.xml +++ b/conf/airframes/Poine/booz2_a8.xml @@ -190,7 +190,7 @@ - + - + diff --git a/conf/airframes/airframe.dtd b/conf/airframes/airframe.dtd index 4470e05e99..e81427915e 100644 --- a/conf/airframes/airframe.dtd +++ b/conf/airframes/airframe.dtd @@ -32,7 +32,8 @@ name CDATA #REQUIRED> +board CDATA #REQUIRED +processor CDATA #IMPLIED> - + diff --git a/conf/autopilot/fixedwing.makefile b/conf/autopilot/fixedwing.makefile index 3ff6b9c1d3..5c0b11b08e 100644 --- a/conf/autopilot/fixedwing.makefile +++ b/conf/autopilot/fixedwing.makefile @@ -4,6 +4,7 @@ # + CFG_FIXEDWING=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/fixedwing @@ -14,8 +15,9 @@ SRC_FIXEDWING_TEST=$(SRC_FIXEDWING)/ FIXEDWING_INC = -I$(SRC_FIXEDWING) -I$(SRC_FIXEDWING_ARCH) - - # Standard Fixed Wing Code include $(CFG_FIXEDWING)/autopilot.makefile + + + diff --git a/conf/autopilot/subsystems/fixedwing/actuators_4015.makefile b/conf/autopilot/subsystems/fixedwing/actuators_4015.makefile index 4873c53056..8bc9241f0f 100644 --- a/conf/autopilot/subsystems/fixedwing/actuators_4015.makefile +++ b/conf/autopilot/subsystems/fixedwing/actuators_4015.makefile @@ -1,5 +1,6 @@ # for Tiny v1.1 -ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT -ap.srcs += $(SRC_FIXEDWING_ARCH)/servos_4015_MAT_hw.c $(SRC_FIXEDWING)/actuators.c +ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT +ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c +ap.srcs += $(SRC_FIXEDWING)/actuators.c diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile index 1d3c3d22ed..714c28f6c0 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile @@ -4,6 +4,6 @@ ap.CFLAGS += -DGPS -DUBX ap.CFLAGS += -DGPS_LINK=Uart$(GPS_UART_NR) ap.CFLAGS += -DUSE_UART$(GPS_UART_NR) -ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=B$(GPS_BAUD) +ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=$(GPS_BAUD) ap.srcs += $(SRC_FIXEDWING)/gps_ubx.c $(SRC_FIXEDWING)/gps.c $(SRC_FIXEDWING)/latlong.c diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile index 218d1ce9eb..bb8e17ae39 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile @@ -4,6 +4,6 @@ ap.CFLAGS += -DGPS -DUBX -DGPS_USE_LATLONG ap.CFLAGS += -DGPS_LINK=Uart$(GPS_UART_NR) ap.CFLAGS += -DUSE_UART$(GPS_UART_NR) -ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=B$(GPS_BAUD) +ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=$(GPS_BAUD) ap.srcs += $(SRC_FIXEDWING)/gps_ubx.c $(SRC_FIXEDWING)/gps.c $(SRC_FIXEDWING)/latlong.c diff --git a/conf/autopilot/subsystems/fixedwing/joystick.makefile b/conf/autopilot/subsystems/fixedwing/joystick.makefile index 9061b64223..bdbba85b10 100644 --- a/conf/autopilot/subsystems/fixedwing/joystick.makefile +++ b/conf/autopilot/subsystems/fixedwing/joystick.makefile @@ -1,7 +1,5 @@ # joystick for fixedwings -ap.srcs += joystick.c -ap.CFLAGS += -DUSE_JOYSTICK +$(TARGET).srcs += joystick.c +$(TARGET).CFLAGS += -DUSE_JOYSTICK -sim.srcs += joystick.c -sim.CFLAGS += -DUSE_JOYSTICK diff --git a/conf/autopilot/subsystems/fixedwing/radio_control_ppm.makefile b/conf/autopilot/subsystems/fixedwing/radio_control_ppm.makefile index 0c9820f8cb..def5d7562b 100644 --- a/conf/autopilot/subsystems/fixedwing/radio_control_ppm.makefile +++ b/conf/autopilot/subsystems/fixedwing/radio_control_ppm.makefile @@ -1,2 +1,4 @@ + + ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile index 785ea77802..6ad33ef3c8 100644 --- a/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile +++ b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile @@ -1,7 +1,7 @@ ap.CFLAGS += -DUSE_UART$(MODEM_UART_NR) -ap.CFLAGS += -DUART$(MODEM_UART_NR)_BAUD=B$(MODEM_BAUD) +ap.CFLAGS += -DUART$(MODEM_UART_NR)_BAUD=$(MODEM_BAUD) MODEM_UART = Uart$(MODEM_UART_NR) diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile index 6efdc34733..1263c24044 100644 --- a/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile +++ b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile @@ -1,7 +1,7 @@ # XBee modems in API mode ap.CFLAGS += -DUSE_UART$(MODEM_UART_NR) -ap.CFLAGS += -DUART$(MODEM_UART_NR)_BAUD=B$(MODEM_BAUD) +ap.CFLAGS += -DUART$(MODEM_UART_NR)_BAUD=$(MODEM_BAUD) MODEM_UART = Uart$(MODEM_UART_NR) diff --git a/conf/boards/lisa_l_1.0.makefile b/conf/boards/lisa_l_1.0.makefile index 55987c00f8..1a86cc2c0a 100644 --- a/conf/boards/lisa_l_1.0.makefile +++ b/conf/boards/lisa_l_1.0.makefile @@ -4,11 +4,30 @@ # http://paparazzi.enac.fr/wiki/User/LisaL # -ARCH=stm32 -ARCHI=stm32 -BOARD=lisa_l -BOARD_VERSION=1.0 -BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + +# ----------------------------------------------------------------------- +ifeq ($(BOARD_PROCESSOR),'omap') + + ARCHI = omap + $(TARGET).LDFLAGS += -levent -lm + +# ----------------------------------------------------------------------- +else + + ARCH=stm32 + ARCHI=stm32 + BOARD=lisa_l + BOARD_VERSION=1.0 + BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + + $(TARGET).ARCHDIR = $(ARCHI) +# not needed? +# $(TARGET).ARCH = arm7tdmi + $(TARGET).TARGET = $(TARGET) + $(TARGET).TARGETDIR = $(TARGET) + +endif +# ----------------------------------------------------------------------- ifndef FLASH_MODE FLASH_MODE = JTAG @@ -33,3 +52,5 @@ AHRS_ALIGNER_LED = 7 GPS_PORT=UART1 GPS_BAUD=B38400 GPS_LED = 3 + + diff --git a/conf/boards/tiny_2.11.makefile b/conf/boards/tiny_2.11.makefile index 3a9752d04f..8cb13cd9c4 100644 --- a/conf/boards/tiny_2.11.makefile +++ b/conf/boards/tiny_2.11.makefile @@ -14,20 +14,15 @@ FLASH_MODE = IAP endif -$(TARGET).ARCHDIR = $(ARCHI) -$(TARGET).ARCH = arm7tdmi -$(TARGET).TARGET = $(TARGET) -$(TARGET).TARGETDIR = $(TARGET) - LPC21ISP_BAUD = 38400 LPC21ISP_XTAL = 12000 ### default settings for tiny_2 and twog GPS_UART_NR = 0 -GPS_BAUD = 38400 +GPS_BAUD = B38400 MODEM_UART_NR = 1 -MODEM_BAUD = 57600 +MODEM_BAUD = B57600 ADC_IR_TOP = ADC_0 ADC_IR1 = ADC_1 @@ -38,3 +33,9 @@ ADC_GYRO_PITCH = ADC_4 ADC_GYRO_NB_SAMPLES = 16 +# All targets on the TINY board run on the same processor achitecture +$(TARGET).ARCHDIR = $(ARCHI) +$(TARGET).ARCH = arm7tdmi +$(TARGET).TARGET = $(TARGET) +$(TARGET).TARGETDIR = $(TARGET) + diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml index 7369155f79..c176d6e7bc 100644 --- a/sw/tools/gen_aircraft.ml +++ b/sw/tools/gen_aircraft.ml @@ -191,8 +191,19 @@ let parse_targets = fun makefile_ac tag target -> (Xml.attrib c "value") end) in List.iter print_if_subsystem (Xml.children target); + let has_processor = ref false in + begin try + has_processor := not (String.compare (Xml.attrib target "processor") "" = 0) + with _ -> () end; + if !has_processor then + fprintf makefile_ac "BOARD_PROCESSOR = %s\n" + (Xml.attrib target "processor"); fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/boards/%s.makefile\n" (Xml.attrib target "board"); - fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/autopilot/%s.makefile\n" (Xml.attrib tag "name"); +(** fprintf makefile_ac "%s.ARCHDIR = $(ARCHI)\n%s.ARCH = $(ARCH)\n%s.TARGET = %s\n%s.TARGETDIR = %s\n" + (Xml.attrib target "name") (Xml.attrib target "name") + (Xml.attrib target "name") (Xml.attrib target "name") + (Xml.attrib target "name") (Xml.attrib target "name"); +**) fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/autopilot/%s.makefile\n" (Xml.attrib tag "name"); let print_if_subsystem = (fun d -> if ExtXml.tag_is d "define" then begin fprintf makefile_ac "%s.CFLAGS += -D%s\n" diff --git a/sw/tools/gen_airframe.ml b/sw/tools/gen_airframe.ml index 05948845dd..0cb4db3e5b 100644 --- a/sw/tools/gen_airframe.ml +++ b/sw/tools/gen_airframe.ml @@ -217,7 +217,7 @@ let parse_ap_only_commands = fun ap_only -> printf " commands[COMMAND_%s] = ap_commands[COMMAND_%s];\\\n" com com | _ -> xml_error "copy" - +(** let parse_subsystem_defines = fun options -> match Xml.tag options with "param" -> @@ -235,7 +235,7 @@ let parse_subsystems = fun subsystem -> printf "// -%s:\n" (ExtXml.attrib subsystem "name"); List.iter parse_subsystem_defines (Xml.children subsystem) | _ -> xml_error "subsystem" - +**) let parse_command = fun command no -> let command_name = "COMMAND_"^ExtXml.attrib command "name" in @@ -300,10 +300,6 @@ let parse_section = fun s -> | "makefile" -> () (** Ignoring this section *) - | "target" -> - printf "// Subsystems \n"; - List.iter parse_subsystems (Xml.children s); - printf "// End Subsystems\n\n" | _ -> ()