Commit Graph

85 Commits

Author SHA1 Message Date
Lucas De Marchi 973c3c6bc6 AP_HAL_FLYMAPLE: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 7ceffb1e2b Replace use of vprintf_P() with vprintf() 2015-10-30 14:35:23 +09:00
Lucas De Marchi 6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
Lucas De Marchi a964ac38ec Replace use of print_P() with print() 2015-10-30 14:35:21 +09:00
Lucas De Marchi 84d5fb006f Remove use of Util::{v,}snprintf_P()
These are now the same function as Util::snprintf().
2015-10-30 14:35:05 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Lucas De Marchi 9eaf7c5660 AP_HAL: add format attribute to panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 3650eb468f AP_HAL_FLYMAPLE: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi ad61a93c14 AP_HAL: turn panic() into a variadic method
Change the declaration on all HAL implementations so panic() in future
may implement a printf-like interface.
2015-10-24 14:26:35 +11:00
Caio Marcelo de Oliveira Filho 19b4ca60c4 AP_HAL: provide AP_HAL_MAIN()
Move the macros to a single place and reduce the variations not based on
board, but based on

- The name of the entry-point function, specified by AP_MAIN;
- Whether it contains argc/argv arguments or not.

The goal here is that programs (vehicles and examples) don't need to
include all possible boards to define a main function. Further patches
will change the programs.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho 1649104382 AP_HAL_FLYMAPLE: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 51bc25a2ab AP_HAL_FLYMAPLE: implement HAL::run() 2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Lucas De Marchi 9b4be3bf74 AP_HAL_FLYMAPLE: remove unused write method 2015-09-29 11:53:44 +09:00
Lucas De Marchi a5cc0be531 AP_HAL_FLYMAPLE: remove the only user of multiwrite
This is the only place where this variant of RCOutput::write() is
called. Remove it so to use the common interface. It can be added back
later when there's support for asynchronous write.
2015-09-29 11:53:36 +09:00
mirkix 038ad31f81 AP_HAL_FLYMAPLE: Add support for using SPI devices of the same type. 2015-09-18 09:15:09 +10:00
Gustavo Jose de Sousa 458f587656 AP_HAL_FLYMAPLE: SPI: adapt to the new signature of transaction()
A default behaviour was added here.
2015-09-01 20:26:05 +10:00
Gustavo Jose de Sousa 9f357ca812 AP_HAL_FLYMAPLE: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Julien BERAUD 7275e33e79 AP_HAL: add the possibility to have more than 1 i2c
Bebop drone has 3 i2c
2015-07-10 14:23:17 +10:00
Andrew Tridgell c44ab01be8 AP_HAL: use noreturn attribute on panic
should reduce coverity warnings
2015-06-08 21:09:08 +10:00
Andrew Tridgell f9aa1d1a8b AP_HAL_FLYMAPLE: convert example from .pde to .cpp 2015-06-01 17:03:44 +10:00
Andrew Tridgell e589ca9b80 HAL_Flymaple: fixed functor comparison 2015-05-26 15:16:51 +10:00
Lucas De Marchi 9b7c1d8f93 AP_HAL_FLYMAPLE: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:53 +10:00
Andrew Tridgell df21c6c68d AP_HAL: support micros64() and millis64() on all platforms
this will allow for 64 bit timestamps in DF logs (Peter is working on
that)
2015-04-30 12:17:34 +10:00
Tom Pittenger 11951dbf48 HAL_Flymaple: fix compile warnings re float constants 2015-04-24 12:48:20 +09:00
Andrew Tridgell 5bb57a31f7 AP_Baro: split into frontend/backend
this allows for support of multiple sensors on a board
2015-01-09 11:50:54 +11:00
Andrew Tridgell baa5aeea81 HAL_FLYMAPLE: fixed example build 2014-08-13 21:48:35 +10:00
Andrew Tridgell d40d0f6aec AP_HAL: removed old storage type read/write functions
not needed any more
2014-08-13 18:46:44 +10:00
Andrew Tridgell 02dec5634f AP_HAL: fixed example builds 2014-07-25 17:52:01 +10:00
Andrew Tridgell 563f516f6b HAL_FLYMAPLE: rename flash_stm32.c to .cpp
this avoids a compiler hang on Ubuntu when not building for flymaple
2014-07-14 09:44:36 +10:00
Andrew Tridgell 805d79debe HAL_FLYMAPLE: fix for HAL_GPIO_* 2014-06-02 10:42:35 +10:00
Andrew Tridgell 6eee2421cc AP_HAL: removed RCInput valid_channels() and added new_input() and num_channels()
the valid_channels() method was inconsistently implemented between
boards, and served two quite different purposes. It is clearer as two
functions
2014-03-25 14:39:41 +11:00
Andrew Tridgell d36989f6a1 AP_HAL: fixed example build 2014-03-19 12:14:06 +09:00
Mike McCauley c90d3ff59e Flymaple: RCOUtput disable_ch() now supports disabling outputs 2014-03-08 21:55:57 +11:00
Andrew Tridgell 836f473db2 HAL_FLYMAPLE: no uartE 2014-02-26 08:19:20 +11:00
Mike McCauley bd768a0c0c AP_HAL_FLYMAPLE RCOutput.cpp: enable_ch no longer resets servo
FLYMAPLERCOutput::enable_ch incorrectly reset the servo to 0, which caused
servo twitching once per second when RC_Channel_aux::enable_aux_servos
enabled each channel.
2014-02-18 09:25:08 +11:00
Mike McCauley 4f9f87a8c6 AP_HAL_FLYMAPLE: Add notes to FlymaplePortingNotes.txt re GPS selection. 2014-02-17 05:56:37 +11:00
Mike McCauley 54a0b04c12 AP_HAL_FLYMAPLE: RCInput detects stale input readings better. Update test
code.
2014-02-17 05:56:37 +11:00
Mike McCauley f1533aa350 AP_HAL_FLYAPLE: update documentation in FlymaplePortingNotes.txt 2014-02-17 05:56:37 +11:00
Mike McCauley 81791bdc43 AP_HAL_FLYMAPLE: Added documentation about alternative orientations to FlymaplePortingNotes.txt 2014-02-17 05:56:37 +11:00
Mike McCauley 95bea052d2 AP_HAL_FLYMAPLE: update documentation in FlymaplePortingNotes.txt 2014-02-17 05:56:37 +11:00
Mike McCauley 4dc33c8de8 AP_HAL_FLYMAPLE: updated FlymaplePortingNotes.txt 2014-02-17 05:56:37 +11:00
Andrew Tridgell 1849db7074 AP_HAL: added board_voltage AnalogIn method
this makes it easier to get the board voltage from any library,
without having to allocate another analog channel object
2014-02-14 21:25:38 +11:00
Andrew Tridgell 87cc95dd7f AP_HAL: removed unused enable_mask and disable_mask functions 2014-01-16 17:16:17 +11:00
Andrew Tridgell ea649e036b AP_HAL: added HAL_CPU_CLASS define for selecting algorithms
this will make it easier to select the appropiate level of algorithm
for a CPU
2013-12-31 10:28:37 +11:00
Andrew Tridgell e321ad65f4 AP_HAL: fixed example build 2013-12-17 11:51:37 +11:00