Commit Graph

53 Commits

Author SHA1 Message Date
Peter Barker 2319638dd2 AP_HAL_SITL: simulated i2c support 2020-08-04 21:40:21 +10:00
bugobliterator 07907ac81d HAL_SITL: fix gcc build on macosx 2020-05-17 16:12:43 +10:00
Peter Barker 9ef23872e0 AP_HAL_SITL: check result code of pthread_attr_init 2020-01-21 11:22:20 +11:00
Peter Barker f504009287 AP_HAL_SITL: disable SITL stack checking due to memory corruption
There appears to be issues with pthread_attr_setstack.
2020-01-15 19:41:58 +11:00
Mark Whitehorn 3873baf676 AP_HAL_SITL: change in_sensor_config_error to in_config_error 2019-11-08 10:14:34 +11:00
Peter Barker 045960fe57 AP_HAL_SITL: catch SIGTERM and exit with zero exit status 2019-09-23 19:36:38 +10:00
Peter Barker 15308af230 AP_HAL_SITL: avoid lockstep scheduling issue with semaphores
If there is another thread holding a lock that the main thread wants to
take while pretending to be the IO thread, we will wait forever as we do
not move SITL time forward while pretending to be the IO thread.

This patch simply allows time to move forward if we've failed to take a
semaphore immediately and need to wait.
2019-09-10 21:01:37 +10:00
Andrew Tridgell 5e5c30efe8 HAL_SITL: allow SITL to use SERIALn_PROTOCOL=23
this allows for testing of RC input protocol parsing in SITL
2019-09-06 08:51:45 +10:00
Peter Hall 4492c09b3b AP_HAL_SITL: Scheduler skip set stack on Cygwin 2019-08-20 15:59:32 -07:00
Andrew Tridgell ac7a67fda0 HAL_SITL: added uartH 2019-07-12 17:01:21 +10:00
Peter Barker 848a70acd4 AP_HAL_SITL: fix rebooting while in sensor config error loop 2019-07-09 10:01:23 +10:00
Andrew Tridgell 916b3003e1 AP_HAL_SITL: removed unusued AP_Common/Semaphore.h 2019-05-15 15:33:48 +10:00
Peter Barker 556e836a66 AP_HAL_SITL: cast PTHREAD_STACK_MIN to unsigned
Sometimes this comes in as signed...
2019-02-20 15:06:24 +11:00
Andrew Tridgell 751dade9a8 HAL_SITL: enable optional storage in flash
this brings storage in SITL very close to storage in ChibiOS
2019-01-21 20:59:00 +11:00
Peter Barker d6fe9d47e0 AP_HAL_SITL: check return value from posix_memalign
Avoids return-value-must-be-checked compiler warning
2018-09-04 09:22:18 +10:00
Patrick José Pereira ab31fcb8f4 AP_HAL_SITL: Makes scheduler compile under Mac OS
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-08-25 11:25:17 +10:00
Andrew Tridgell 836176297d HAL_SITL: added stack checking to SITL 2018-08-20 13:49:14 +10:00
Peter Barker fdd111a24d AP_HAL_SITL: move include for pthread.h
We need pthread_t for a member
2018-07-19 10:27:47 +10:00
Andrew Tridgell 10e9182c21 HAL_SITL: fixed delay() for SITL threads
with the new thread_create() interface we need to handle delays a bit
differently
2018-07-12 15:04:43 +10:00
Andrew Tridgell 3fc6968700 HAL_SITL: allow delay from other than main thread 2018-07-09 19:41:18 +10:00
Andrew Tridgell 88842adbd5 HAL_SITL: implement thread_create() API 2018-07-09 19:41:18 +10:00
Andrew Tridgell 5862138a4b HAL_SITL: support uartG 2018-06-29 08:17:38 +10:00
Michael du Breuil 0f2482f05b AP_HAL_SITL: Remove timer process suspension interface 2018-06-06 07:16:58 +10:00
Pierre Kancir b615677223 HAL_SITL: implement reboot support 2018-05-30 18:48:53 +10:00
Peter Barker 190bd18769 AP_HAL_SITL: move delay callback handling to base HAL Scheduler class 2018-05-09 16:15:38 +10:00
Andrew Tridgell e276edbb03 HAL_SITL: implement _timer_tick in UARTDriver 2018-02-07 20:33:45 +11:00
Andrew Tridgell 7def86ae96 HAL_SITL: don't run IO at more than 100Hz
save some CPU for faster frame rates
2017-10-21 11:57:05 +11:00
Lucas De Marchi 5ea1784838 global: remove AP_HAL::in_timerprocess()
This is not used and in the only places it would make sense would be
internally to the scheduler so remove it.
2017-08-03 20:25:14 -07:00
Miguel Arroyo 4394c5145b AP_HAL_SITL: Fixes bug with uartF.
uartF _timer_tick() was not being called in the scheduler.
2017-06-26 13:05:16 +01:00
murata 67fdbf5c2d AP_HAL_SITL: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Pierre Kancir ab9e88299f AP_HAL_SITL: Scheduler remove unreachable code & minor fix
usleep wasn't reached since synthetic clock is always used
correct style
make constructor explicit
use c++ cast
2017-01-12 01:27:16 +00:00
Pierre Kancir f9c8827809 SITL: Scheduler correct misplaced parenthese && switch to do while loop 2016-12-04 18:28:14 +00: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
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Siddharth Bharat Purohit d65f453da1 AP_HAL_SITL:use common fenv function 2016-07-07 11:35:18 -03:00
Lucas De Marchi 9aa49cda93 Global: remove system_initializing() from scheduler
This is not used anymore.
2016-02-12 23:42:34 -02:00
Andrew Tridgell 655f57ad01 HAL_SITL: cleanup class names
remove SITL prefix
2016-01-10 17:43:01 +11:00
Andrew Tridgell 492c733750 HAL_SITL: added RingBuffers to UART driver
makes for faster log download
2016-01-10 17:43:01 +11:00
Lucas De Marchi 4c82c535cc AP_HAL_SITL: 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:49:11 -02:00
Caio Marcelo de Oliveira Filho 783db23a0f AP_HAL_SITL: remove unused functions 2015-11-20 12:36:42 +09:00
Caio Marcelo de Oliveira Filho 3ef77617fd AP_HAL_SITL: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.

The '_sketch_start_time' was renamed and moved as a detail of
implementation of the functions code. It allows the code to return time
starting from zero.

The 'stopped_clock_usec' was renamed to follow convention in the file
and add a getter so that AP_HAL functions can reach it. It's not a
problem this getter is public because in practice, regular code
shouldn't even access the SITLScheduler directly -- only code that
should is from SITL itself.
2015-11-20 12:25:38 +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 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 6027a02fe9 AP_HAL_SITL: 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
Gustavo Jose de Sousa 27b9d71e2c AP_HAL_SITL: 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
tcr3dr 9d26bc6958 HAL_SITL: Adds polyfill for feenableexcept on OS X. 2015-07-01 11:32:01 +10:00