2011-05-14 21:23:02 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
2013-05-19 16:37:30 +02:00
|
|
|
* @file pios.h
|
2015-12-20 11:08:15 +01:00
|
|
|
* @author The LibrePilot Project, http://www.librepilot.org, Copyright (c) 2015
|
2013-03-15 07:19:33 +01:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010-2013
|
2012-12-12 04:36:18 +01:00
|
|
|
* @author PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
|
2013-03-15 07:19:33 +01:00
|
|
|
* @brief Main PiOS header.
|
2011-05-14 21:23:02 +02:00
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*****************************************************************************/
|
2013-05-19 16:37:30 +02:00
|
|
|
/*
|
|
|
|
* This program 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 3 of the License, or
|
2011-05-14 21:23:02 +02:00
|
|
|
* (at your option) any later version.
|
2013-05-19 16:37:30 +02:00
|
|
|
*
|
|
|
|
* This program 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
|
2011-05-14 21:23:02 +02:00
|
|
|
* for more details.
|
2013-05-19 16:37:30 +02:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2011-05-14 21:23:02 +02:00
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/*
|
|
|
|
* To add new PIOS options, drivers or functions please insert their
|
|
|
|
* includes below into a corresponding group. If new driver has optional
|
|
|
|
* features, add them as comments before including the driver header.
|
|
|
|
* Finally update all pios_config.h files for every board in the same order
|
|
|
|
* as in this file. Include new definition and all options, but comment
|
|
|
|
* out unused ones.
|
|
|
|
*/
|
2011-05-14 21:23:02 +02:00
|
|
|
|
|
|
|
#ifndef PIOS_H
|
|
|
|
#define PIOS_H
|
2013-03-15 07:19:33 +01:00
|
|
|
|
2015-02-13 02:56:04 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-04-09 01:07:59 +02:00
|
|
|
#include <pios_helpers.h>
|
2013-05-02 23:31:14 +02:00
|
|
|
#include <pios_math.h>
|
|
|
|
#include <pios_constants.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
|
2013-02-24 18:33:29 +01:00
|
|
|
#ifdef USE_SIM_POSIX
|
2013-03-15 07:19:33 +01:00
|
|
|
/* SimPosix version of this file. This will probably be removed later */
|
2013-02-24 18:33:29 +01:00
|
|
|
#include <pios_sim_posix.h>
|
|
|
|
#else
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* C Lib includes */
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <stdio.h>
|
2014-03-30 12:17:18 +02:00
|
|
|
#include <stdint.h>
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* STM32 Std Peripherals Lib */
|
2013-05-03 19:50:46 +02:00
|
|
|
#if defined(STM32F10X)
|
|
|
|
#include <stm32f10x.h>
|
|
|
|
#elif defined(STM32F4XX)
|
2013-03-15 07:19:33 +01:00
|
|
|
#include <stm32f4xx.h>
|
|
|
|
#include <stm32f4xx_rcc.h>
|
2014-03-30 12:17:18 +02:00
|
|
|
#elif defined(STM32F0)
|
|
|
|
#include <stm32f0xx.h>
|
|
|
|
#else
|
|
|
|
#error "No Architecture defined"
|
2011-08-07 02:35:25 +02:00
|
|
|
#endif
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS board specific feature selection */
|
|
|
|
#include "pios_config.h"
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS board specific device configuration */
|
|
|
|
#include "pios_board.h"
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS debug interface */
|
|
|
|
/* #define PIOS_INCLUDE_DEBUG_CONSOLE */
|
|
|
|
/* #define DEBUG_LEVEL 0 */
|
2013-04-26 16:59:52 +02:00
|
|
|
/* #define PIOS_ENABLE_DEBUG_PINS */
|
2013-03-15 07:19:33 +01:00
|
|
|
#include <pios_debug.h>
|
2013-11-17 18:04:47 +01:00
|
|
|
#include <pios_debuglog.h>
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS common functions */
|
|
|
|
#include <pios_crc.h>
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 11:32:06 +01:00
|
|
|
/* PIOS FreeRTOS support */
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_FREERTOS
|
|
|
|
#include "FreeRTOS.h"
|
|
|
|
#include "task.h"
|
|
|
|
#include "queue.h"
|
|
|
|
#include "semphr.h"
|
|
|
|
#endif
|
2013-07-17 06:09:48 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2014-06-11 15:13:29 +02:00
|
|
|
#include <pios_mem.h>
|
|
|
|
|
2013-07-02 19:26:39 +02:00
|
|
|
#include <pios_architecture.h>
|
|
|
|
|
2013-05-02 23:31:14 +02:00
|
|
|
#ifdef PIOS_INCLUDE_TASK_MONITOR
|
|
|
|
#ifndef PIOS_INCLUDE_FREERTOS
|
|
|
|
#error PiOS Task Monitor requires PIOS_INCLUDE_FREERTOS to be defined
|
|
|
|
#endif
|
|
|
|
#include <pios_task_monitor.h>
|
|
|
|
#endif
|
|
|
|
|
2014-02-02 20:31:37 +01:00
|
|
|
/* PIOS CallbackScheduler */
|
|
|
|
#ifdef PIOS_INCLUDE_CALLBACKSCHEDULER
|
|
|
|
#ifndef PIOS_INCLUDE_FREERTOS
|
|
|
|
#error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined
|
|
|
|
#endif
|
|
|
|
#include <pios_callbackscheduler.h>
|
|
|
|
#endif
|
|
|
|
|
Final step: lot of small fixes, last commit in this commit series
This is the first cleanup pass through makefiles and pios.
Probably it is difficult to track changes due to the nature of them.
I would recommend to look at resulting files and compiled code instead.
NOTE: original branch was rebased and lot of conflicts were fixed on
the way. So do not expect that every commit in this series will be
buildable (unlike original branch). Only final result was tested.
The main goal was to remove as much duplication of code (and copy/paste
errors) as possible, moving common parts out of Makefiles. It still is
not perfect, and mostly no code changes made - Makefiles and #ifdefs only.
But please while testing make sure that all code works as before, and no
modules/options are missed by accident.
Brief list of changes:
- Moved common parts of Makefiles into the set of *.mk files.
- Changed method of passing common vars from top Makefile to lower ones.
- Some pios cleanup, mostly #ifdefs, and all pios_config.h files.
- Many obsolete files removed (for instance, AHRS files, op_config.h).
- Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS).
- Unified pios_config.h template. Please don't remove lines for board
configs, only comment/uncomment them. Adding new PIOS options, please
propagate them to all board files keeping the same order.
- Some formatting, spacing, indentation (no line endings change yet).
- Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows).
- Added some library.mk files to move libs into AR achives later.
- EntireFlash target now uses cross-platform python script to generate bin
files. So it works on all supported platforms: Linux, OSX, Windows.
- Top level packaging is completely rewritten. Now it is a part of top
Makefile. As such, all dependencies are checked and accounted, no
more 'make -j' problems should occur.
- Default GCS_BUILD_CONF is release now, may be changed if necessary
using 'make GCS_BUILD_CONF=debug gcs'.
- GCS build paths are separated into debug and release, so no more obj
file clashes. Packaging system supports only release builds.
- New target is introduced: 'clean_package'. Now 'make package' does not
clean build directory. Use clean_package instead for distributable builds.
- Targets like 'all', 'opfw_resource', etc now will print extra contex
in parallel builds too.
- If any of 'package', 'clean_package', 'opfw_resource' targets are given
on command line, GCS build will depend on the resource, so all fw_*.opfw
targets will be built and embedded into GCS. By default GCS does not
depend on resource, and will be built w/o firmware (unless the resource
files already exist and the Qt resource file is generated).
- fw_simposix (ELF executable) is now packaged for linux. Run'n'play!
- Make help is refined and is now up to date.
Still broken:
- UnitTests, should be fixed
- SimPosix: buildable, but should be reworked.
Next planned passes to do:
- toolchain bootstrapping and packaging (including windows - WIP)
- CMSIS/StdPeriph lib cleanup
- more PIOS cleanup
- move libs into AR archives to save build time
- sim targets refactir and cleanup
- move android-related directories under <top>/android
- unit test targets fix
- source code line ending changes (there are many different, were not changed)
- coding style
Merging this, please use --no-ff git option to make it the real commit point
Conflicts:
A lot of... :-)
2013-03-24 12:02:08 +01:00
|
|
|
/* PIOS bootloader helper */
|
|
|
|
#ifdef PIOS_INCLUDE_BL_HELPER
|
|
|
|
/* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */
|
|
|
|
#include <pios_bl_helper.h>
|
|
|
|
#endif
|
|
|
|
|
2013-03-15 11:32:06 +01:00
|
|
|
/* PIOS system functions */
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_DELAY
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_delay.h>
|
2014-02-04 19:05:17 +01:00
|
|
|
#include <pios_deltatime.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_INITCALL
|
|
|
|
#include "pios_initcall.h"
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_SYS
|
|
|
|
#include <pios_sys.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* PIOS hardware peripherals */
|
|
|
|
#ifdef PIOS_INCLUDE_IRQ
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_irq.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_RTC
|
2011-05-29 13:52:22 +02:00
|
|
|
#include <pios_rtc.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_TIM
|
|
|
|
#include <pios_tim.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_USART
|
|
|
|
#include <pios_usart.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_ADC
|
|
|
|
#include <pios_adc.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_I2C
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_i2c.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_SPI
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_spi.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_GPIO
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_gpio.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_EXTI
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_exti.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_WDG
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_wdg.h>
|
2013-03-15 07:19:33 +01:00
|
|
|
#endif
|
2011-05-14 21:23:02 +02:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS USB functions */
|
|
|
|
#ifdef PIOS_INCLUDE_USB
|
|
|
|
/* #define PIOS_INCLUDE_USB_HID */
|
|
|
|
/* #define PIOS_INCLUDE_USB_CDC */
|
|
|
|
/* #define PIOS_INCLUDE_USB_RCTX */
|
|
|
|
#include <pios_usb.h>
|
|
|
|
#ifdef PIOS_INCLUDE_USB_HID
|
|
|
|
#include <pios_usb_hid.h>
|
2012-07-08 21:46:59 +02:00
|
|
|
#endif
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_USB_RCTX
|
|
|
|
#include <pios_usb_rctx.h>
|
2012-07-08 21:46:59 +02:00
|
|
|
#endif
|
2011-05-14 21:23:02 +02:00
|
|
|
#endif
|
2013-03-15 07:19:33 +01:00
|
|
|
|
|
|
|
#ifdef PIOS_INCLUDE_MPXV
|
|
|
|
/* MPXV5004, MPXV7002 based Airspeed Sensor */
|
|
|
|
#include <pios_mpxv.h>
|
2011-11-14 02:11:06 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_ETASV3
|
|
|
|
/* Eagle Tree Systems Airspeed MicroSensor V3 */
|
|
|
|
#include <pios_etasv3.h>
|
2011-11-17 17:13:34 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2014-03-25 09:18:25 +01:00
|
|
|
#ifdef PIOS_INCLUDE_MS4525DO
|
|
|
|
/* PixHawk Airspeed Sensor based on MS4525DO */
|
|
|
|
#include <pios_ms4525do.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_HCSR04
|
|
|
|
/* HC-SR04 Ultrasonic Sensor */
|
|
|
|
#include <pios_hcsr04.h>
|
2012-01-05 02:47:57 +01:00
|
|
|
#endif
|
2013-03-15 07:19:33 +01:00
|
|
|
|
|
|
|
/* PIOS receiver drivers */
|
|
|
|
#ifdef PIOS_INCLUDE_PWM
|
|
|
|
#include <pios_pwm.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_PPM
|
|
|
|
#include <pios_ppm.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
Final step: lot of small fixes, last commit in this commit series
This is the first cleanup pass through makefiles and pios.
Probably it is difficult to track changes due to the nature of them.
I would recommend to look at resulting files and compiled code instead.
NOTE: original branch was rebased and lot of conflicts were fixed on
the way. So do not expect that every commit in this series will be
buildable (unlike original branch). Only final result was tested.
The main goal was to remove as much duplication of code (and copy/paste
errors) as possible, moving common parts out of Makefiles. It still is
not perfect, and mostly no code changes made - Makefiles and #ifdefs only.
But please while testing make sure that all code works as before, and no
modules/options are missed by accident.
Brief list of changes:
- Moved common parts of Makefiles into the set of *.mk files.
- Changed method of passing common vars from top Makefile to lower ones.
- Some pios cleanup, mostly #ifdefs, and all pios_config.h files.
- Many obsolete files removed (for instance, AHRS files, op_config.h).
- Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS).
- Unified pios_config.h template. Please don't remove lines for board
configs, only comment/uncomment them. Adding new PIOS options, please
propagate them to all board files keeping the same order.
- Some formatting, spacing, indentation (no line endings change yet).
- Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows).
- Added some library.mk files to move libs into AR achives later.
- EntireFlash target now uses cross-platform python script to generate bin
files. So it works on all supported platforms: Linux, OSX, Windows.
- Top level packaging is completely rewritten. Now it is a part of top
Makefile. As such, all dependencies are checked and accounted, no
more 'make -j' problems should occur.
- Default GCS_BUILD_CONF is release now, may be changed if necessary
using 'make GCS_BUILD_CONF=debug gcs'.
- GCS build paths are separated into debug and release, so no more obj
file clashes. Packaging system supports only release builds.
- New target is introduced: 'clean_package'. Now 'make package' does not
clean build directory. Use clean_package instead for distributable builds.
- Targets like 'all', 'opfw_resource', etc now will print extra contex
in parallel builds too.
- If any of 'package', 'clean_package', 'opfw_resource' targets are given
on command line, GCS build will depend on the resource, so all fw_*.opfw
targets will be built and embedded into GCS. By default GCS does not
depend on resource, and will be built w/o firmware (unless the resource
files already exist and the Qt resource file is generated).
- fw_simposix (ELF executable) is now packaged for linux. Run'n'play!
- Make help is refined and is now up to date.
Still broken:
- UnitTests, should be fixed
- SimPosix: buildable, but should be reworked.
Next planned passes to do:
- toolchain bootstrapping and packaging (including windows - WIP)
- CMSIS/StdPeriph lib cleanup
- more PIOS cleanup
- move libs into AR archives to save build time
- sim targets refactir and cleanup
- move android-related directories under <top>/android
- unit test targets fix
- source code line ending changes (there are many different, were not changed)
- coding style
Merging this, please use --no-ff git option to make it the real commit point
Conflicts:
A lot of... :-)
2013-03-24 12:02:08 +01:00
|
|
|
#ifdef PIOS_INCLUDE_PPM_FLEXI
|
|
|
|
/* PPM on CC flexi port */
|
|
|
|
#endif
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_DSM
|
|
|
|
#include <pios_dsm.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_SBUS
|
|
|
|
#include <pios_sbus.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2015-12-20 11:08:15 +01:00
|
|
|
#ifdef PIOS_INCLUDE_HOTT
|
|
|
|
#include <pios_hott.h>
|
|
|
|
#endif
|
|
|
|
|
2016-01-10 10:12:54 +01:00
|
|
|
#ifdef PIOS_INCLUDE_EXBUS
|
|
|
|
#include <pios_exbus.h>
|
|
|
|
#endif
|
|
|
|
|
2015-04-26 14:35:35 +02:00
|
|
|
#ifdef PIOS_INCLUDE_SRXL
|
|
|
|
#include <pios_srxl.h>
|
|
|
|
#endif
|
|
|
|
|
Final step: lot of small fixes, last commit in this commit series
This is the first cleanup pass through makefiles and pios.
Probably it is difficult to track changes due to the nature of them.
I would recommend to look at resulting files and compiled code instead.
NOTE: original branch was rebased and lot of conflicts were fixed on
the way. So do not expect that every commit in this series will be
buildable (unlike original branch). Only final result was tested.
The main goal was to remove as much duplication of code (and copy/paste
errors) as possible, moving common parts out of Makefiles. It still is
not perfect, and mostly no code changes made - Makefiles and #ifdefs only.
But please while testing make sure that all code works as before, and no
modules/options are missed by accident.
Brief list of changes:
- Moved common parts of Makefiles into the set of *.mk files.
- Changed method of passing common vars from top Makefile to lower ones.
- Some pios cleanup, mostly #ifdefs, and all pios_config.h files.
- Many obsolete files removed (for instance, AHRS files, op_config.h).
- Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS).
- Unified pios_config.h template. Please don't remove lines for board
configs, only comment/uncomment them. Adding new PIOS options, please
propagate them to all board files keeping the same order.
- Some formatting, spacing, indentation (no line endings change yet).
- Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows).
- Added some library.mk files to move libs into AR achives later.
- EntireFlash target now uses cross-platform python script to generate bin
files. So it works on all supported platforms: Linux, OSX, Windows.
- Top level packaging is completely rewritten. Now it is a part of top
Makefile. As such, all dependencies are checked and accounted, no
more 'make -j' problems should occur.
- Default GCS_BUILD_CONF is release now, may be changed if necessary
using 'make GCS_BUILD_CONF=debug gcs'.
- GCS build paths are separated into debug and release, so no more obj
file clashes. Packaging system supports only release builds.
- New target is introduced: 'clean_package'. Now 'make package' does not
clean build directory. Use clean_package instead for distributable builds.
- Targets like 'all', 'opfw_resource', etc now will print extra contex
in parallel builds too.
- If any of 'package', 'clean_package', 'opfw_resource' targets are given
on command line, GCS build will depend on the resource, so all fw_*.opfw
targets will be built and embedded into GCS. By default GCS does not
depend on resource, and will be built w/o firmware (unless the resource
files already exist and the Qt resource file is generated).
- fw_simposix (ELF executable) is now packaged for linux. Run'n'play!
- Make help is refined and is now up to date.
Still broken:
- UnitTests, should be fixed
- SimPosix: buildable, but should be reworked.
Next planned passes to do:
- toolchain bootstrapping and packaging (including windows - WIP)
- CMSIS/StdPeriph lib cleanup
- more PIOS cleanup
- move libs into AR archives to save build time
- sim targets refactir and cleanup
- move android-related directories under <top>/android
- unit test targets fix
- source code line ending changes (there are many different, were not changed)
- coding style
Merging this, please use --no-ff git option to make it the real commit point
Conflicts:
A lot of... :-)
2013-03-24 12:02:08 +01:00
|
|
|
/* PIOS abstract receiver interface */
|
|
|
|
#ifdef PIOS_INCLUDE_RCVR
|
|
|
|
#include <pios_rcvr.h>
|
|
|
|
#endif
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS common peripherals */
|
|
|
|
#ifdef PIOS_INCLUDE_LED
|
|
|
|
#include <pios_led.h>
|
2011-11-27 07:36:01 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_IAP
|
2011-05-14 21:23:02 +02:00
|
|
|
#include <pios_iap.h>
|
2012-01-15 23:56:42 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_SERVO
|
|
|
|
#include <pios_servo.h>
|
2011-05-14 21:23:02 +02:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_I2C_ESC
|
|
|
|
#include <pios_i2c_esc.h>
|
2012-01-23 19:16:02 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_OVERO
|
|
|
|
/* #define PIOS_OVERO_SPI */
|
|
|
|
#include <pios_overo.h>
|
2012-02-12 21:29:42 +01:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_SDCARD
|
|
|
|
/* #define LOG_FILENAME "startup.log" */
|
|
|
|
#include <dosfs.h>
|
|
|
|
#include <pios_sdcard.h>
|
2012-07-15 20:43:44 +02:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_FLASH
|
2013-05-15 23:16:34 +02:00
|
|
|
/* #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS */
|
2013-03-15 07:19:33 +01:00
|
|
|
/* #define FLASH_FREERTOS */
|
2012-12-12 04:36:18 +01:00
|
|
|
#include <pios_flash.h>
|
|
|
|
#include <pios_flashfs.h>
|
2011-05-14 21:23:02 +02:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-05-15 23:16:34 +02:00
|
|
|
/* driver for storage on internal flash */
|
|
|
|
/* #define PIOS_INCLUDE_FLASH_INTERNAL */
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_FLASH_EEPROM
|
2014-12-03 00:50:09 +01:00
|
|
|
#include <pios_flash_eeprom.h>
|
2011-05-14 21:23:02 +02:00
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
Final step: lot of small fixes, last commit in this commit series
This is the first cleanup pass through makefiles and pios.
Probably it is difficult to track changes due to the nature of them.
I would recommend to look at resulting files and compiled code instead.
NOTE: original branch was rebased and lot of conflicts were fixed on
the way. So do not expect that every commit in this series will be
buildable (unlike original branch). Only final result was tested.
The main goal was to remove as much duplication of code (and copy/paste
errors) as possible, moving common parts out of Makefiles. It still is
not perfect, and mostly no code changes made - Makefiles and #ifdefs only.
But please while testing make sure that all code works as before, and no
modules/options are missed by accident.
Brief list of changes:
- Moved common parts of Makefiles into the set of *.mk files.
- Changed method of passing common vars from top Makefile to lower ones.
- Some pios cleanup, mostly #ifdefs, and all pios_config.h files.
- Many obsolete files removed (for instance, AHRS files, op_config.h).
- Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS).
- Unified pios_config.h template. Please don't remove lines for board
configs, only comment/uncomment them. Adding new PIOS options, please
propagate them to all board files keeping the same order.
- Some formatting, spacing, indentation (no line endings change yet).
- Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows).
- Added some library.mk files to move libs into AR achives later.
- EntireFlash target now uses cross-platform python script to generate bin
files. So it works on all supported platforms: Linux, OSX, Windows.
- Top level packaging is completely rewritten. Now it is a part of top
Makefile. As such, all dependencies are checked and accounted, no
more 'make -j' problems should occur.
- Default GCS_BUILD_CONF is release now, may be changed if necessary
using 'make GCS_BUILD_CONF=debug gcs'.
- GCS build paths are separated into debug and release, so no more obj
file clashes. Packaging system supports only release builds.
- New target is introduced: 'clean_package'. Now 'make package' does not
clean build directory. Use clean_package instead for distributable builds.
- Targets like 'all', 'opfw_resource', etc now will print extra contex
in parallel builds too.
- If any of 'package', 'clean_package', 'opfw_resource' targets are given
on command line, GCS build will depend on the resource, so all fw_*.opfw
targets will be built and embedded into GCS. By default GCS does not
depend on resource, and will be built w/o firmware (unless the resource
files already exist and the Qt resource file is generated).
- fw_simposix (ELF executable) is now packaged for linux. Run'n'play!
- Make help is refined and is now up to date.
Still broken:
- UnitTests, should be fixed
- SimPosix: buildable, but should be reworked.
Next planned passes to do:
- toolchain bootstrapping and packaging (including windows - WIP)
- CMSIS/StdPeriph lib cleanup
- more PIOS cleanup
- move libs into AR archives to save build time
- sim targets refactir and cleanup
- move android-related directories under <top>/android
- unit test targets fix
- source code line ending changes (there are many different, were not changed)
- coding style
Merging this, please use --no-ff git option to make it the real commit point
Conflicts:
A lot of... :-)
2013-03-24 12:02:08 +01:00
|
|
|
/* PIOS radio modules */
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_RFM22B
|
Final step: lot of small fixes, last commit in this commit series
This is the first cleanup pass through makefiles and pios.
Probably it is difficult to track changes due to the nature of them.
I would recommend to look at resulting files and compiled code instead.
NOTE: original branch was rebased and lot of conflicts were fixed on
the way. So do not expect that every commit in this series will be
buildable (unlike original branch). Only final result was tested.
The main goal was to remove as much duplication of code (and copy/paste
errors) as possible, moving common parts out of Makefiles. It still is
not perfect, and mostly no code changes made - Makefiles and #ifdefs only.
But please while testing make sure that all code works as before, and no
modules/options are missed by accident.
Brief list of changes:
- Moved common parts of Makefiles into the set of *.mk files.
- Changed method of passing common vars from top Makefile to lower ones.
- Some pios cleanup, mostly #ifdefs, and all pios_config.h files.
- Many obsolete files removed (for instance, AHRS files, op_config.h).
- Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS).
- Unified pios_config.h template. Please don't remove lines for board
configs, only comment/uncomment them. Adding new PIOS options, please
propagate them to all board files keeping the same order.
- Some formatting, spacing, indentation (no line endings change yet).
- Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows).
- Added some library.mk files to move libs into AR achives later.
- EntireFlash target now uses cross-platform python script to generate bin
files. So it works on all supported platforms: Linux, OSX, Windows.
- Top level packaging is completely rewritten. Now it is a part of top
Makefile. As such, all dependencies are checked and accounted, no
more 'make -j' problems should occur.
- Default GCS_BUILD_CONF is release now, may be changed if necessary
using 'make GCS_BUILD_CONF=debug gcs'.
- GCS build paths are separated into debug and release, so no more obj
file clashes. Packaging system supports only release builds.
- New target is introduced: 'clean_package'. Now 'make package' does not
clean build directory. Use clean_package instead for distributable builds.
- Targets like 'all', 'opfw_resource', etc now will print extra contex
in parallel builds too.
- If any of 'package', 'clean_package', 'opfw_resource' targets are given
on command line, GCS build will depend on the resource, so all fw_*.opfw
targets will be built and embedded into GCS. By default GCS does not
depend on resource, and will be built w/o firmware (unless the resource
files already exist and the Qt resource file is generated).
- fw_simposix (ELF executable) is now packaged for linux. Run'n'play!
- Make help is refined and is now up to date.
Still broken:
- UnitTests, should be fixed
- SimPosix: buildable, but should be reworked.
Next planned passes to do:
- toolchain bootstrapping and packaging (including windows - WIP)
- CMSIS/StdPeriph lib cleanup
- more PIOS cleanup
- move libs into AR archives to save build time
- sim targets refactir and cleanup
- move android-related directories under <top>/android
- unit test targets fix
- source code line ending changes (there are many different, were not changed)
- coding style
Merging this, please use --no-ff git option to make it the real commit point
Conflicts:
A lot of... :-)
2013-03-24 12:02:08 +01:00
|
|
|
/* #define PIOS_INCLUDE_PPM_OUT */
|
|
|
|
/* #define PIOS_RFM22B_DEBUG_ON_TELEM */
|
2013-03-15 11:32:06 +01:00
|
|
|
#include <pios_rfm22b.h>
|
2012-10-26 23:25:41 +02:00
|
|
|
#ifdef PIOS_INCLUDE_RFM22B_COM
|
|
|
|
#include <pios_rfm22b_com.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
#endif /* PIOS_INCLUDE_RFM22B */
|
|
|
|
|
|
|
|
/* PIOS misc peripherals */
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_VIDEO
|
|
|
|
#include <pios_video.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_WAVE
|
|
|
|
#include <pios_wavplay.h>
|
|
|
|
#endif
|
2013-03-15 11:32:06 +01:00
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
#ifdef PIOS_INCLUDE_UDP
|
|
|
|
#include <pios_udp.h>
|
2012-10-26 23:25:41 +02:00
|
|
|
#endif
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* PIOS abstract comms interface with options */
|
|
|
|
#ifdef PIOS_INCLUDE_COM
|
|
|
|
/* #define PIOS_INCLUDE_COM_MSG */
|
|
|
|
/* #define PIOS_INCLUDE_TELEMETRY_RF */
|
|
|
|
/* #define PIOS_INCLUDE_COM_TELEM */
|
|
|
|
/* #define PIOS_INCLUDE_COM_FLEXI */
|
|
|
|
/* #define PIOS_INCLUDE_COM_AUX */
|
|
|
|
/* #define PIOS_TELEM_PRIORITY_QUEUE */
|
|
|
|
/* #define PIOS_INCLUDE_GPS */
|
|
|
|
/* #define PIOS_GPS_MINIMAL */
|
|
|
|
/* #define PIOS_INCLUDE_GPS_NMEA_PARSER */
|
|
|
|
/* #define PIOS_INCLUDE_GPS_UBX_PARSER */
|
|
|
|
/* #define PIOS_GPS_SETS_HOMELOCATION */
|
|
|
|
#include <pios_com.h>
|
|
|
|
#endif
|
|
|
|
|
Final step: lot of small fixes, last commit in this commit series
This is the first cleanup pass through makefiles and pios.
Probably it is difficult to track changes due to the nature of them.
I would recommend to look at resulting files and compiled code instead.
NOTE: original branch was rebased and lot of conflicts were fixed on
the way. So do not expect that every commit in this series will be
buildable (unlike original branch). Only final result was tested.
The main goal was to remove as much duplication of code (and copy/paste
errors) as possible, moving common parts out of Makefiles. It still is
not perfect, and mostly no code changes made - Makefiles and #ifdefs only.
But please while testing make sure that all code works as before, and no
modules/options are missed by accident.
Brief list of changes:
- Moved common parts of Makefiles into the set of *.mk files.
- Changed method of passing common vars from top Makefile to lower ones.
- Some pios cleanup, mostly #ifdefs, and all pios_config.h files.
- Many obsolete files removed (for instance, AHRS files, op_config.h).
- Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS).
- Unified pios_config.h template. Please don't remove lines for board
configs, only comment/uncomment them. Adding new PIOS options, please
propagate them to all board files keeping the same order.
- Some formatting, spacing, indentation (no line endings change yet).
- Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows).
- Added some library.mk files to move libs into AR achives later.
- EntireFlash target now uses cross-platform python script to generate bin
files. So it works on all supported platforms: Linux, OSX, Windows.
- Top level packaging is completely rewritten. Now it is a part of top
Makefile. As such, all dependencies are checked and accounted, no
more 'make -j' problems should occur.
- Default GCS_BUILD_CONF is release now, may be changed if necessary
using 'make GCS_BUILD_CONF=debug gcs'.
- GCS build paths are separated into debug and release, so no more obj
file clashes. Packaging system supports only release builds.
- New target is introduced: 'clean_package'. Now 'make package' does not
clean build directory. Use clean_package instead for distributable builds.
- Targets like 'all', 'opfw_resource', etc now will print extra contex
in parallel builds too.
- If any of 'package', 'clean_package', 'opfw_resource' targets are given
on command line, GCS build will depend on the resource, so all fw_*.opfw
targets will be built and embedded into GCS. By default GCS does not
depend on resource, and will be built w/o firmware (unless the resource
files already exist and the Qt resource file is generated).
- fw_simposix (ELF executable) is now packaged for linux. Run'n'play!
- Make help is refined and is now up to date.
Still broken:
- UnitTests, should be fixed
- SimPosix: buildable, but should be reworked.
Next planned passes to do:
- toolchain bootstrapping and packaging (including windows - WIP)
- CMSIS/StdPeriph lib cleanup
- more PIOS cleanup
- move libs into AR archives to save build time
- sim targets refactir and cleanup
- move android-related directories under <top>/android
- unit test targets fix
- source code line ending changes (there are many different, were not changed)
- coding style
Merging this, please use --no-ff git option to make it the real commit point
Conflicts:
A lot of... :-)
2013-03-24 12:02:08 +01:00
|
|
|
/* Stabilization options */
|
|
|
|
/* #define PIOS_QUATERNION_STABILIZATION */
|
|
|
|
|
2013-03-15 07:19:33 +01:00
|
|
|
/* Performance counters */
|
|
|
|
/* #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 */
|
|
|
|
|
|
|
|
#endif /* USE_SIM_POSIX */
|
2015-02-13 02:56:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // closing brace for extern "C"
|
|
|
|
#endif
|
|
|
|
|
2011-05-14 21:23:02 +02:00
|
|
|
#endif /* PIOS_H */
|