Commit Graph

121 Commits

Author SHA1 Message Date
Lucas De Marchi b5d3094738 AP_ADC: fix warning on printf
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp: In function ‘void show_timing()’:
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
     hal.console->printf("timing: mint=%lu maxt=%lu avg=%lu\n", mint, maxt, totalt/count);
                                                                                        ^
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
2016-05-04 08:58:37 -03:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Lucas De Marchi 6623246cf5 AP_ADC: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Lucas De Marchi 4562c0cffc AP_ADC: ADS1115: coding style fixes
- Clean trailing whitespaces
  - Fix switch
  - Use pragma once
2016-02-01 14:18:51 -02:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Andrew Tridgell 1ee7963edb AP_ADC: fixed example build 2015-11-20 17:33:17 +11:00
Caio Marcelo de Oliveira Filho b293fb150c AP_ADC: use millis/micros/panic functions 2015-11-20 12:28:36 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Lucas De Marchi 4ae35c9a74 AP_ADC: 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 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
Caio Marcelo de Oliveira Filho 1fc801c2c9 AP_ADC: remove unnecessary board includes from example 2015-10-21 09:16:12 +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
Gustavo Jose de Sousa a552390125 AP_ADC: 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:41 +10:00
Andrew Tridgell 0cfdb9af8a AP_ADC: convert example from .pde to .cpp 2015-06-01 16:58:10 +10:00
Lucas De Marchi f7dc19554f AP_ADC: 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:51 +10:00
Lucas De Marchi 57386434d1 AP_ADC: remove AP_ADC_HIL
It's not being used and it's actually broken: it references
AP_ADC_HIL::read() that doesn't exist.
2015-05-26 13:46:48 +10:00
Tom Pittenger 52474faa2e AP_ADC: fix compile warning re member init order 2015-04-24 14:15:24 +09:00
Tom Pittenger f4bfc12316 AP_ADC: fix compile warnings re float constants 2015-04-24 12:24:49 +09:00
Staroselskii Georgii b5aef01f72 AP_ADC: added ADS1115 support 2015-02-12 12:57:45 +11:00
Andrew Tridgell 1c94b39d6e AP_ADC: fixed example build 2014-08-13 22:11:21 +10:00
Kevin Hester c34c4d79f6 AP_ADC: fixup line endings 2014-04-15 15:56:13 +09:00
Andrew Tridgell d83dbb38b4 AP_ADC: updates for AP_HAL::MemberProc 2013-09-30 21:06:42 +10:00
Andrew Tridgell 30b6b23b10 AP_ADC: enable APM1 ADC on Linux 2013-09-29 00:57:13 +10:00
Andrew Tridgell 6134d9d0d7 AP_ADC: use new scheduler API 2013-09-28 21:24:03 +10:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell dc97a8eff7 AP_ADC: fixed license text
we are on GPLv3 now
2013-08-30 13:01:32 +10:00
Andrew Tridgell 90cf1b0386 AP_ADC: removed unused setHIL method 2013-05-02 15:27:16 +10:00
Andrew Tridgell 5667f5d817 AP_ADC: fixed APM1 HIL_SENSORS Ch6() return 2013-04-02 13:20:08 +11:00
Michael Oborne 541fa13291 cleanup comments 2013-03-31 17:14:54 +08:00
Michael Oborne 2160bf135d fix sitl segfault in hil 2013-03-31 16:39:15 +08:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
James Bielman d84ba8ef59 Use HAL suspend/resume timer procs rather than atomic.
- Preparation for removing begin/end atomic.
2013-01-03 17:33:13 -08:00
Pat Hickey a556a95565 AP_ADC: uses new semaphore interface 2013-01-03 13:48:07 -08:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell d6b00bd848 AP_ADC: fixed bool problem on ARM 2013-01-02 14:45:09 +11:00
Andrew Tridgell a1187519a8 AP_HAL: use AP_HAL_BOARD_DRIVER in remaining test sketches 2012-12-20 14:52:37 +11:00
Andrew Tridgell b673320f72 ADC: fixed example warnings 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
Pat Hickey 992de8c2b9 AP_ADC_ADS7844: changed to use spidevicedriver transaction 2012-12-20 14:52:32 +11:00
Pat Hickey b43b003777 AP_ADC: fix typo in test 2012-12-20 14:52:32 +11:00
Pat Hickey d5a46ca1e3 AP_ADC: uses scheduler panic 2012-12-20 14:52:32 +11:00
Andrew Tridgell 7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Pat Hickey 475da4eca4 CONFIG_HAL_BOARD - test sketches fixed up, build all passes 2012-12-20 14:51:37 +11:00
Pat Hickey 09c14f3807 AP_ADC: more robust semaphores 2012-12-20 14:51:35 +11:00