diff --git a/conf/autopilot/lisa_passthrough.makefile b/conf/autopilot/lisa_passthrough.makefile index d3a8188afd..c1d5901e66 100644 --- a/conf/autopilot/lisa_passthrough.makefile +++ b/conf/autopilot/lisa_passthrough.makefile @@ -106,13 +106,6 @@ stm_passthrough.srcs += $(SRC_CSC)/csc_protocol.c # Battery monitor - - - - - - - # # # @@ -137,3 +130,19 @@ overo_test_passthrough.srcs += $(SRC_FMS)/fms_gs_com.c overo_test_passthrough.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=UdpTransport overo_test_passthrough.srcs += $(SRC_FMS)/udp_transport2.c downlink.c overo_test_passthrough.srcs += $(SRC_FMS)/fms_network.c + +# +# use the passthrough to calibrate throttle range for castle creations motor pwm motor controller +# +overo_blmc_calibrate.ARCHDIR = omap +overo_blmc_calibrate.LDFLAGS += -levent -lm +overo_blmc_calibrate.CFLAGS += -I$(ACINCLUDE) -I. -I$(PAPARAZZI_HOME)/var/include +overo_blmc_calibrate.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessagePTUp -DOVERO_LINK_MSG_DOWN=AutopilotMessagePTDown +overo_blmc_calibrate.srcs = $(SRC_FMS)/overo_blmc_calibrate.c +overo_blmc_calibrate.CFLAGS += -DFMS_PERIODIC_FREQ=512 +overo_blmc_calibrate.srcs += $(SRC_FMS)/fms_periodic.c +overo_blmc_calibrate.srcs += $(SRC_FMS)/fms_spi_link.c +#overo_blmc_calibrate.srcs += $(SRC_FMS)/fms_gs_com.c +#overo_blmc_calibrate.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=UdpTransport +#overo_blmc_calibrate.srcs += $(SRC_FMS)/udp_transport2.c downlink.c +overo_blmc_calibrate.srcs += $(SRC_FMS)/fms_network.c diff --git a/sw/airborne/fms/overo_blmc_calibrate.c b/sw/airborne/fms/overo_blmc_calibrate.c new file mode 100644 index 0000000000..936ddc6d3b --- /dev/null +++ b/sw/airborne/fms/overo_blmc_calibrate.c @@ -0,0 +1,126 @@ +/* + * $Id$ + * + * Copyright (C) 2010 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#include +#include +#include +#include +#include + +#include + +#include "fms/overo_blmc_calibrate.h" + +#include "std.h" +#include "fms_debug.h" +#include "fms_periodic.h" + +/* stuff for io processor link */ +#include "fms_spi_link.h" +#include "fms_autopilot_msg.h" + +struct OveroBLMCCalibrate blmc_calibrate; + +static void parse_command_line(int argc, char** argv); +static void main_init(void); +static void main_periodic(int my_sig_num); +static void dialog_with_io_proc(void); + + +int main(int argc, char *argv[]) { + + parse_command_line(argc, argv); + + main_init(); + TRACE(TRACE_DEBUG, "%s", "Entering mainloop\n"); + + /* Enter our mainloop */ + event_dispatch(); + + TRACE(TRACE_DEBUG, "%s", "leaving mainloop... goodbye!\n"); + + return 0; + +} + +static void main_periodic(int my_sig_num) { + + static uint32_t counter = 0; + dialog_with_io_proc(); + + if (counter <= 4096) { + counter++; + } else if (counter > 4096) { + for (uint8_t i=0; i 8192) { + for (uint8_t i=0; i