Commit Graph

62 Commits

Author SHA1 Message Date
Andrew Tridgell
347c774665 AP_HAL: fixed example build on ChibiOS 2018-01-15 11:46:02 +11:00
Chinese66
700aaf2e8f AP_HAL: add delay to UART_test example
For AC3.5 and higher version, serial uartA-USBconsole cannot work. Maybe the code before "setup" has been changed. Ensure that the uartA can be initialized
2017-11-22 09:05:17 +09:00
Lucas De Marchi
e98fe2d7d5 AP_HAL: RingBuffer: add missing include 2017-08-02 21:10:55 -07:00
Lucas De Marchi
61aed0f0d7 RingBuffer: example: integrate with build system
It's only compatible with Linux so for now disable the other boards.
2017-08-02 16:08:55 -07:00
Murilo Belluzzo
641671a366 AP_HAL: Add simple stress test for RingBuffer class
It runs a Producer/Consumer thread pair endless reading and writing a
ByteBuffer. Producer writes a number sequence that is twice the
ByteBuffer size so a given position have a different data on each write
pass. Consumer makes sure that this pattern is not broken and aborts the
program if it is.

It is possible to spawn more pairs by informing a number as argument of
the program.
2017-08-02 15:30:35 -07:00
Peter Barker
c163915f6e AP_HAL: correct storage example 2017-07-07 16:18:37 +01:00
Pierre Kancir
34199b4af0 AP_HAL: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
murata
03bf57219b AP_HAL: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
murata
c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Lucas De Marchi
ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
hiro2233
4a6447575c AP_HAL: fixed and updated RCInput example. 2016-07-27 00:52:13 -03:00
Lucas De Marchi
cf11776150 AP_HAL: fix signed and unsigned comparison warning
../../libraries/AP_HAL/examples/Printf/Printf.cpp:63:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (ret != strlen(float_tests[i].result)) {
                 ^
...

ardupilot/modules/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (expected == actual) {
                ^
And similar ones.
2016-05-04 08:58:37 -03:00
Lucas De Marchi
9ac63d7128 AP_HAL: examples: fix coding style 2016-05-04 08:58:37 -03:00
hiro2233
7814841cd6 AP_HAL: Add RCOutput interactive example with Menu 2016-04-09 07:01:35 -07:00
Lucas De Marchi
1f072c4353 AP_HAL: fix unused variable
../../libraries/AP_HAL/examples/UART_test/UART_test.cpp:13:28: warning: ‘uarts’ defined but not used [-Wunused-variable]
 static AP_HAL::UARTDriver* uarts[] = {
                            ^
2016-02-19 11:51:49 -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
Jonathan Challinger
d7639ce03a AP_HAL: fix example build 2015-12-29 10:46:35 -08: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
Lucas De Marchi
a1c3912bd8 AP_HAL: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Caio Marcelo de Oliveira Filho
6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Lucas De Marchi
6bc07da0ee AP_HAL: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:42:37 -02:00
Caio Marcelo de Oliveira Filho
5292bc0054 AP_HAL: example uses millis/micros/panic functions 2015-11-20 12:31:48 +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
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
6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +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
b98bf2a65e AP_HAL: remove unnecessary includes from examples 2015-10-21 09:16:10 +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
Andrew Tridgell
c72372722e AP_HAL: fixed example builds 2015-08-11 17:00:03 +10:00
Gustavo Jose de Sousa
0456eccca8 AP_HAL: 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
b83708f77f AP_HAL: use ARRAY_SIZE macro 2015-07-21 14:24:56 +09:00
Andrew Tridgell
979a571d68 AP_HAL: fixed example build 2015-06-10 09:27:41 +10:00
Eugene Shamaev
ca482cf44a StorageManager: added example sketch 2015-06-08 10:05:05 +09:00
Andrew Tridgell
5c86005160 AP_HAL: removed spurious delay example 2015-06-01 17:28:45 +10:00
Andrew Tridgell
36b19b26ce AP_HAL: convert example from .pde to .cpp 2015-06-01 17:03:40 +10:00
Randy Mackay
0d72f3ac29 AP_HAL: fix example sketches 2015-05-12 14:42:15 +09: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
mirkix
4f1dd85e47 AP_HAL: Add test sketch for RC input to RC output pass through 2015-03-11 21:14:15 +09:00
Randy Mackay
f84d31b838 HAL: fix example sketch 2015-01-28 17:15:40 +09:00
mirkix
7ceb93befa AP_HAL: make the examples usable with Linux 2015-01-22 14:30:47 +11:00
Andrew Tridgell
5aabfd4dc4 AP_HAL: added RCInput example sketch 2014-12-02 15:49:50 +11:00
Andrew Tridgell
8e36c1cd60 AP_HAL: fixed RCOutput example 2014-12-02 15:03:59 +11:00
Andrew Tridgell
4ec6a74829 AP_HAL: addex UART_test example sketch 2014-12-02 13:14:03 +11:00
Andrew Tridgell
9e0a7e6631 AP_HAL: fixed printf example build 2014-12-02 13:14:03 +11:00
Andrew Tridgell
b61ecb47af AP_HAL: fixed example build 2014-08-13 22:11:46 +10:00
Andrew Tridgell
5cca163b1f AP_HAL: fixed example build 2014-08-13 21:48:35 +10:00
Andrew Tridgell
02dec5634f AP_HAL: fixed example builds 2014-07-25 17:52:01 +10:00