Commit Graph

120 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 0c837326b5 AP_HAL_Empty: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 346ab77c27 AP_HAL_Empty: 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 302252d096 AP_HAL_Empty: remove unused write method 2015-09-29 11:53:42 +09:00
mirkix 07d50b5fbb AP_HAL_Empty: Add support for using SPI devices of the same type. 2015-09-18 09:15:09 +10:00
Gustavo Jose de Sousa 4e27d19107 AP_HAL_Empty: 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 ca5afbfdc9 AP_HAL_Empty: 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 379b130d0a AP_HAL_Empty: convert example from .pde to .cpp 2015-06-01 17:03:37 +10:00
Andrew Tridgell 40e3b422b5 HAL_SITL: rename HAL_AVR_SITL to HAL_SITL
it is nothing to do with the original AVR emulation now
2015-05-05 09:45:54 +10:00
Andrew Tridgell 6450c84987 HAL_Empty: added dummy millis64() and micros64() 2014-08-20 07:59:21 +10:00
Andrew Tridgell 8e15b4db0d HAL_Empty: fixed example build 2014-08-13 22:12:00 +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 e137bf26ef HAL_Empty: avoid some float conversion warnings 2014-07-08 20:27:13 +10:00
Andrew Tridgell 7ceb14bec0 HAL_Empty: make I2C ops fail 2014-07-08 15:08:18 +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 58d5454d65 HAL_Empty: no uartE 2014-02-26 08:19:18 +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 5e980a5b49 HAL_EMPTY: added uartD 2013-11-23 19:29:22 +11:00
Andrew Tridgell 8b254f2947 HAL_EMPTY: prevent valgrind errors
zero I2C transfers
2013-11-23 18:50:55 +11:00
Andrew Tridgell 8e7d9bb464 HAL_Empty: removed Console driver 2013-10-05 18:32:35 +10:00
Andrew Tridgell a8c97f99d1 HAL_Empty: implement a dummy buffered write 2013-10-03 12:21:08 +10:00
Andrew Tridgell a2b879493d HAL_Empty: updates for AP_HAL::MemberProc 2013-09-30 20:56:15 +10:00
Andrew Tridgell 6bc4a830ac HAL_Empty: updates for new scheduler API 2013-09-28 21:24:02 +10:00
Andrew Tridgell 21010104e6 AP_HAL_Empty: added register_io_process() 2013-09-22 16:02:05 +10:00
Andrew Tridgell d0bb998352 AP_HAL_Empty: updates for new API 2013-09-22 12:21:54 +10:00
Andrew Tridgell 4c1925b578 AP_HAL_Empty: convert to new AP_HAL printf 2013-09-21 13:29:22 +10:00
Andrew Tridgell cf633e4d79 AP_HAL: convert to unix file format 2013-09-19 16:26:14 +10:00
Andrew Tridgell a5b29f44d5 AP_HAL: added hal.gpio->usb_connected() function
this replaces the USB_MUX_PIN on APM2, and works on PX4 and FMUv2
2013-09-19 16:23:40 +10:00
Andrew Tridgell a587b1140a AP_HAL: added voltage_latest() interface
this will be used for reading the 5V rail
2013-09-12 13:23:04 +10:00
Andrew Tridgell 7082e0f8aa AP_HAL: added hold_in_bootloader parameter to scheduler->reboot() 2013-09-04 11:58:13 +10:00
Randy Mackay ac36a09747 AP_HAL: add toggle to GPIO 2013-08-30 13:01:34 +10:00
phokur b00e5d95c9 Update AnalogIn.cpp
Fixed AnalogIn.cpp:42: undefined references

Full error msgs:
/cygdrive/c/MAVPRO~1/ardupilot/libraries/AP_HAL_Empty/AnalogIn.cpp:42: undefined reference to `Empty::EmptyAnalogSource::set_stop_pin(unsigned char)'
/cygdrive/c/MAVPRO~1/ardupilot/libraries/AP_HAL_Empty/AnalogIn.cpp:42: undefined reference to `Empty::EmptyAnalogSource::set_settle_time(unsigned short)'
2013-06-26 23:22:08 -10:00
Andrew Tridgell 2316c3bd11 AP_HAL: make storage->write_block() take a const pointer 2013-06-04 14:02:13 +10:00
Andrew Tridgell a5b20b4dfc AP_HAL: removed scaling factor on analog sources
these are not use anymore, as voltage_average() is used instead
2013-05-13 15:29:42 +10:00
Andrew Tridgell 589b8cdb58 AP_HAL: added voltage_average_ratiometric() call to AnalogIn
this is for ratiometric sensors such as the 3DR airspeed sensor and
the Maxbotix analog sonar
2013-05-13 15:12:43 +10:00
Andrew Tridgell 5d80a5619d HAL_Empty: add new API functions 2013-05-03 09:45:19 +10:00
Randy Mackay bbbd90c430 AP_HAL: rename RCInput's valid() fn to valid_channels 2013-04-29 15:05:53 +09:00
Andrew Tridgell eb6c66af7e AP_HAL: added gpio->analogPinToDigitalPin() API 2013-03-22 12:31:14 +11:00
Andrew Tridgell b1c27407a2 AP_HAL: added voltage_average() interface to AnalogIn
returns voltage in Volts, using averaged reading over samples.

Where possible this should be auto-scaled against a known reference
voltage
2013-03-03 16:16:01 +11:00
Andrew Tridgell 70f7cde9b8 AP_HAL: added run_debug_shell() hal.util method 2013-02-07 15:04:33 +11:00
Andrew Tridgell 76092eb590 AP_HAL: remove unused peek() interface from UART drivers
this is a bit tricky to implement on some platforms, and is unused
anyway
2013-01-16 14:43:18 +11:00
Andrew Tridgell 4609114a81 HAL_Empty: fixed example build 2013-01-14 07:03:34 +11:00
Andrew Tridgell 3dc0a990a1 HAL_Empty: added bulk SPI transfer() method 2013-01-13 17:31:42 +11:00
Pat Hickey 4d5d08ad10 AP_HAL_Empty: main calls system_initialized 2013-01-10 14:37:07 -08:00
Pat Hickey 83adb72f16 AP_HAL_Empty: Stub out new Scheduler methods 2013-01-10 14:07:44 -08:00
Pat Hickey 0db60464f7 AP_HAL_Empty: add semaphore to I2CDriver 2013-01-04 16:19:51 -08:00
Pat Hickey f178d1bd02 AP_HAL_Empty: implement new Semaphore interface 2013-01-03 13:48:07 -08:00
Andrew Tridgell e729a8b277 AP_HAL: rename Semaphores cpp file to match header 2013-01-03 21:36:48 +11:00
Andrew Tridgell 85007cb766 HAL_Empty: fixed throttle in Empty RCInput 2013-01-03 21:14:00 +11:00
Andrew Tridgell a3c26d44e4 AP_HAL: rename Sempahore.h to Semaphores.h
this is needed to allow build on MacOS, as its case-insensitive
filesystem picks up the NuttX semaphore.h
2013-01-02 18:22:13 +11:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell 93040e5725 AP_HAL: removed the defer_timer_process() function
this is now unused
2012-12-21 20:01:42 +11:00
Andrew Tridgell 60d3df50ae AP_HAL: changed delay() to take a uint16_t
this allows for up to 32 second delays, and saves a bit of flash space
2012-12-20 14:53:23 +11:00
Pat Hickey b2d69e6a8c AP_HAL_Empty: betterstreams get vprintfs 2012-12-20 14:53:23 +11:00
Andrew Tridgell 8a70e173a7 AP_HAL: restrict build to right board type 2012-12-20 14:53:22 +11:00
Pat Hickey 771f2a3acf AP_HAL_Empty: add Util driver 2012-12-20 14:52:37 +11:00
Andrew Tridgell bd2a733a6b HAL_Empty: allow example build for other backends 2012-12-20 14:52:36 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell 6627e7ea0e HAL_Empty: fixed I2CDriver declaration 2012-12-20 14:52:33 +11:00
Pat Hickey 5c1e7abf0e AP_HAL_Empty: add spi driver transaction 2012-12-20 14:52:32 +11:00
Pat Hickey 885fc79af5 AP_HAL_Empty: add panic method to scheduler 2012-12-20 14:52:31 +11:00
Pat Hickey 76dabef7d6 AP_HAL_Empty: fix public declaration for i2cdriver 2012-12-20 14:52:31 +11:00
Pat Hickey de6f9e52b2 AP_HAL_Empty: finished up scaffolding 2012-12-20 14:52:31 +11:00
Pat Hickey b7cd4312f3 AP_HAL_Empty: more scaffolding complete 2012-12-20 14:52:31 +11:00
Pat Hickey 3e3c0f57ae AP_HAL_Empty: started building out the scaffolding 2012-12-20 14:52:30 +11:00