Working on auto generating cpp files for sketch.
Just have to add prototypes now and #defines for debugging.
This commit is contained in:
parent
2561ef3a84
commit
71789ab796
@ -1,25 +0,0 @@
|
||||
#line 1 "/home/jgoppert/Projects/ardupilotone/ArduBoat/ArduBoat.pde"
|
||||
// Libraries
|
||||
#include <FastSerial.h>
|
||||
#include <AP_Common.h>
|
||||
#include <APM_RC.h>
|
||||
#include <AP_RangeFinder.h>
|
||||
#include <GCS_MAVLink.h>
|
||||
#include <AP_ADC.h>
|
||||
#include <AP_DCM.h>
|
||||
#include <AP_Compass.h>
|
||||
#include <Wire.h>
|
||||
#include <AP_GPS.h>
|
||||
#include <AP_IMU.h>
|
||||
#include <APM_BMP085.h>
|
||||
#include <ModeFilter.h>
|
||||
#include <APO.h>
|
||||
|
||||
// Vehicle Configuration
|
||||
#include "BoatGeneric.h"
|
||||
|
||||
// ArduPilotOne Default Setup
|
||||
#include "APO_DefaultSetup.h"
|
||||
// vim:ts=4:sw=4:expandtab
|
||||
#line 1 "autogenerated"
|
||||
#include "WProgram.h"
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,27 +0,0 @@
|
||||
#line 1 "/home/jgoppert/Projects/ardupilotone/ArduRover/ArduRover.pde"
|
||||
// Libraries
|
||||
#include <Wire.h>
|
||||
#include <FastSerial.h>
|
||||
#include <AP_Common.h>
|
||||
#include <APM_RC.h>
|
||||
#include <AP_RangeFinder.h>
|
||||
#include <GCS_MAVLink.h>
|
||||
#include <AP_ADC.h>
|
||||
#include <AP_DCM.h>
|
||||
#include <AP_Compass.h>
|
||||
#include <Wire.h>
|
||||
#include <AP_GPS.h>
|
||||
#include <AP_IMU.h>
|
||||
#include <APM_BMP085.h>
|
||||
#include <ModeFilter.h>
|
||||
#include <APO.h>
|
||||
#include <WProgram.h>
|
||||
|
||||
// Vehicle Configuration
|
||||
#include "CarStampede.h"
|
||||
//#include "TankGeneric.h"
|
||||
|
||||
// ArduPilotOne Default Setup
|
||||
#include "APO_DefaultSetup.h"
|
||||
#line 1 "autogenerated"
|
||||
#include "WProgram.h"
|
@ -78,26 +78,37 @@ if (NOT DEFINED BOARD)
|
||||
endif()
|
||||
message(STATUS "Board configured as: ${BOARD}")
|
||||
|
||||
set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde)
|
||||
|
||||
# standard apm project setup
|
||||
macro(apm_project PROJECT_NAME BOARD SRCS)
|
||||
message(STATUS "creating apo project ${PROJECT_NAME}")
|
||||
set(${PROJECT_NAME}_BOARD ${BOARD})
|
||||
set(${PROJECT_NAME}_PORT ${PORT})
|
||||
set(${PROJECT_NAME}_SRCS ${SRCS})
|
||||
set(${PROJECT_NAME}_LIBS m c)
|
||||
generate_arduino_firmware(${PROJECT_NAME})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
|
||||
# add a sketch
|
||||
macro(add_sketch SKETCH_NAME BOARD PORT)
|
||||
message(STATUS "Generating sketch ${SKETCH_NAME}")
|
||||
set(SKETCH_CPP ${CMAKE_CURRENT_BINARY_DIR}/${SKETCH_NAME}/${SKETCH_NAME}.cpp)
|
||||
set(SKETCH_PDE ${SKETCH_NAME}/${SKETCH_NAME}.pde)
|
||||
set(${SKETCH_NAME}_BOARD ${BOARD})
|
||||
set(${SKETCH_NAME}_PORT ${PORT})
|
||||
set(${SKETCH_NAME}_SRCS ${SKETCH_CPP})
|
||||
set(${SKETCH_NAME}_LIBS m c)
|
||||
file(GLOB PDE_SOURCES ${SKETCH_NAME}/*.pde)
|
||||
file(READ ${SKETCH_PDE} FILE)
|
||||
file(WRITE ${SKETCH_CPP} ${FILE})
|
||||
file(APPEND ${SKETCH_CPP} "#include \"WProgram.h\"")
|
||||
list(REMOVE_ITEM PDE_SOURCES ${SKETCH_PDE})
|
||||
list(SORT PDE_SOURCES)
|
||||
foreach(PDE ${PDE_SOURCES})
|
||||
file(READ ${PDE} FILE)
|
||||
file(APPEND ${SKETCH_CPP} ${FILE})
|
||||
endforeach()
|
||||
include_directories(${SKETCH_NAME})
|
||||
generate_arduino_firmware(${SKETCH_NAME})
|
||||
set_target_properties(${SKETCH_NAME} PROPERTIES LINKER_LANGUAGE CXX)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.hex
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${SKETCH_NAME}.hex
|
||||
DESTINATION bin
|
||||
)
|
||||
endmacro()
|
||||
|
||||
# projects
|
||||
apm_project(apo ${BOARD} apo/apo.cpp)
|
||||
apm_project(ArduRover ${BOARD} ArduRover/ArduRover.cpp)
|
||||
apm_project(ArduBoat ${BOARD} ArduBoat/ArduBoat.cpp)
|
||||
apm_project(ArduPlane ${BOARD} ArduPlane/ArduPlane.cpp)
|
||||
apm_project(ArduCopter ${BOARD} ArduCopter/ArduCopter.cpp)
|
||||
add_sketch(apo ${BOARD} ${PORT})
|
||||
add_sketch(ArduRover ${BOARD} ${PORT})
|
||||
add_sketch(ArduBoat ${BOARD} ${PORT})
|
||||
#add_sketch(ArduPlane ${BOARD} ${PORT})
|
||||
#add_sketch(ArduCopter ${BOARD} ${PORT})
|
||||
|
Loading…
Reference in New Issue
Block a user