Commit Graph

91 Commits

Author SHA1 Message Date
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 e30457a84d AP_HAL_VRBRAIN: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho fe1dd1be25 AP_HAL_VRBRAIN: implement HAL::run() 2015-10-21 09:16:08 +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 139b88f544 AP_HAL_VRBRAIN: remove unused write method 2015-09-29 11:53:53 +09:00
Brad Bosch 3ad0188488 HAL_VRBrain: Rework of support for FLOW_CONTROL_AUTO from PX4 HAL 2015-08-19 15:21:19 +10:00
Lucas De Marchi c47df44f44 AP_HAL_VRBRAIN: standardize inclusion of libaries headers
Do the missing header changes due to changing the code before the pr
getting accepted.
2015-08-18 17:12:52 +10:00
Gustavo Jose de Sousa f714540d8b AP_HAL_VRBRAIN: 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
Lucas De Marchi 3f472fb9e1 AP_HAL_VRBRAIN: use ARRAY_SIZE macro 2015-07-21 14:25:05 +09: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 3a9d7363ea HAL_VRBRain: fixed functor comparison 2015-05-26 15:17:06 +10:00
Tom Pittenger d275e6711d AP_HAL_VRBRAIN: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:55 +10:00
Tom Pittenger ee1a415baa HAL_VRBrain: fix compile warning re member init order 2015-04-24 14:14:27 +09:00
Tom Pittenger ae6d44bf82 HAL_VRBrain: fix compile warnings re float constants 2015-04-24 14:03:38 +09:00
Andrew Tridgell db9c8548a5 HAL_VRBrain: call parent Util constructor 2015-02-11 20:57:28 +11:00
Jonathan Challinger 59cf1c29ff AP_HAL_VRBRAIN: attempt to initialize USB while soft-disarmed 2015-02-11 20:57:28 +11:00
Andrew Tridgell 9eb07ffde2 HAL_VRBRAIN: implement updated new_input() semantics 2015-02-09 10:39:14 +11:00
Emile Castelnuovo d78ff43971 AP_HAL_VRBRAIN: code clean up. Deleted unused boards. 2015-02-02 08:44:00 +11:00
LukeMike 6473ae2c37 Storage: updated to the PX4 library 2015-02-02 08:44:00 +11:00
Emile Castelnuovo 92e0bc3a2f AP_HAL_VRBRAIN: updates to libraries for new boards 2015-02-02 08:43:58 +11:00
LukeMike edd0f13845 AP_HAL: mapped the different sizes of storage for all VR boards 2015-02-02 08:43:58 +11:00
LukeMike 7dc5541484 AP_HAL_VRBRAIN: Added analog inputs for ArduPlane on VR Micro Brain 5 2015-02-02 08:43:57 +11:00
Andrew Tridgell 9d3a9c20a8 HAL_VRBrain: use common RingBuffer.h 2015-01-07 08:41:14 +11:00
Andrew Tridgell b3894e8b10 HAL_VRBRAIN: reduce the number of times we split up UART reads and writes 2014-10-09 12:29:25 +11:00
Randy Mackay 6da1420541 HAL_VRBrain: implement force_safety_on 2014-09-18 09:58:48 +09:00
Andrew Tridgell 593a97afd6 HAL_VRBRAIN: fixed storage bug in VRBRAIN too 2014-09-11 18:58:54 +10:00
Emile Castelnuovo 25d2ec1dea AP_HAL_VRBRAIN: enable 2nd GPS for VRBRAIN 5 2014-08-31 10:56:58 +09:00
Emile Castelnuovo 8e42b21bab AP_HAL_VRBRAIN: added management for external relay 1 and 2 2014-08-31 10:56:48 +09:00
Andrew Tridgell e143acd8bf HAL_VRBRAIN: minimise use of hrt_absolute_time() 2014-08-20 09:10:24 +10:00
Andrew Tridgell 071323a736 HAL_VRBRAIN: added millis64() and micros64() 2014-08-20 08:01:44 +10:00
Andrew Tridgell 21ff578cb0 HAL_VRBrain: prevent read past end of buffer 2014-08-19 10:08:17 +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
LukeMike dd1cab3ab8 HAL_VRBRAIN: updated analog drivers and scheduler driver to latest official version 2014-07-15 20:42:11 +10:00
Emile Castelnuovo b420a5c6db AP_HAL_VRBRAIN: removed empty lines 2014-07-03 11:09:20 +10:00
LukeMike f70da39206 VRBRAIN: changed the management of the pwm output 2014-07-01 12:21:36 +02:00
Emile Castelnuovo b2680984a5 AP_HAL_VRRBAIN: added comment 2014-07-01 12:21:34 +02:00
LukeMike 8f552d5758 VRBRAIN: Changed the management of VirtualRobotix's boards. 2014-06-19 11:27:38 +02:00
Emile Castelnuovo 79996986ad VRBRAIN: corrected ADC pins for volt and current sensing. 2014-04-08 16:19:20 +10:00
Emile Castelnuovo 7fe4847b6c VRBRAIN: Added NuttX driver vroutput for PWM out
Modified script rc.APM to launch modules vrinput and vroutput
Modified startup scripts to run APM without SD
2014-04-08 16:19:20 +10:00
Emile Castelnuovo 201332caef AP_HAL: New VRBRAIN board definition and libraries 2014-04-08 16:19:19 +10:00