Peter Barker
fdfe5ac75a
AP_HAL_SITL: add override keyword where required
6 years ago
Andrew Tridgell
7e790a04d2
HAL_SITL: increase max timer procs
...
needed for compass learning
6 years ago
Andrew Tridgell
836176297d
HAL_SITL: added stack checking to SITL
7 years ago
Peter Barker
fdd111a24d
AP_HAL_SITL: move include for pthread.h
...
We need pthread_t for a member
7 years ago
Andrew Tridgell
3fc6968700
HAL_SITL: allow delay from other than main thread
7 years ago
Andrew Tridgell
88842adbd5
HAL_SITL: implement thread_create() API
7 years ago
Michael du Breuil
0f2482f05b
AP_HAL_SITL: Remove timer process suspension interface
7 years ago
Pierre Kancir
b615677223
HAL_SITL: implement reboot support
7 years ago
Peter Barker
190bd18769
AP_HAL_SITL: move delay callback handling to base HAL Scheduler class
7 years ago
Andrew Tridgell
ebcffcb0ac
HAL_SITL: fixed console printf in SITL examples
7 years ago
Andrew Tridgell
7def86ae96
HAL_SITL: don't run IO at more than 100Hz
...
save some CPU for faster frame rates
7 years ago
Peter Barker
0f54cc9b22
AP_HAL_SITL: implement in_main_thread
7 years ago
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.
8 years ago
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
8 years ago
Lucas De Marchi
9aa49cda93
Global: remove system_initializing() from scheduler
...
This is not used anymore.
9 years ago
Andrew Tridgell
655f57ad01
HAL_SITL: cleanup class names
...
remove SITL prefix
9 years ago
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.
9 years ago
Caio Marcelo de Oliveira Filho
783db23a0f
AP_HAL_SITL: remove unused functions
9 years ago
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.
9 years ago
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.
9 years ago
Lucas De Marchi
9eaf7c5660
AP_HAL: add format attribute to panic()
9 years ago
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.
9 years ago
Lucas De Marchi
0ed7f94bfc
AP_HAL_SITL: use method for downcast
...
Instead of just doing a static cast to the desired class, use a method
named "from". Pros:
- When we have data shared on the parent class, the code is cleaner in
child class when it needs to access this data. Almost all the data
we use in AP_HAL benefits from this
- There's a minimal type checking because now we are using a method
that can only receive the type of the parent class
10 years ago
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.
10 years ago
Andrew Tridgell
c44ab01be8
AP_HAL: use noreturn attribute on panic
...
should reduce coverity warnings
10 years ago
Andrew Tridgell
c81ad1d622
HAL_SITL: reformat HAL_SITL with astyle
10 years ago
Andrew Tridgell
b9abf30785
HAL_SITL: removed unused cygwin code
10 years ago
Andrew Tridgell
40e3b422b5
HAL_SITL: rename HAL_AVR_SITL to HAL_SITL
...
it is nothing to do with the original AVR emulation now
10 years ago
Andrew Tridgell
a6f41b3ca6
HAL_SITL: removed the need for the FDM thread
...
this also removes the need for the barriers
10 years ago
Andrew Tridgell
063a33ebce
HAL_SITL: implement barriers using pthread condition variables
...
this avoid pthread_barrier_*, which is not available on cygwin
10 years ago
Andrew Tridgell
0695277773
HAL_SITL: use pthread barriers for synthetic clock synchronisation
...
this avoids siganls and provides a race free way of keeping time in
lock step
10 years ago
Andrew Tridgell
9748cb1e3e
HAL_SITL: use a synthetic clock when possible
...
this decouples wall clock time from simulation time if the FDM
supports it
10 years ago
Andrew Tridgell
22237f2530
HAL_SITL: fixed handling of SIM_FLOAT_EXCEPT in main thread
10 years ago
Andrew Tridgell
5a55101703
HAL_SITL: added millis64() and micros64()
11 years ago
Andrew Tridgell
82fe40224b
HAL_AVR_SITL: updates for AP_HAL::MemberProc
12 years ago
Andrew Tridgell
c08f29fca6
HAL_AVR_SITL: updates for new scheduler API
12 years ago
Michael Oborne
54fc004956
SITL: fix sitl timer issues under cygwin
12 years ago
Andrew Tridgell
7082e0f8aa
AP_HAL: added hold_in_bootloader parameter to scheduler->reboot()
12 years ago
Andrew Tridgell
af7381e9e0
AP_HAL: added register_io_process()
...
this is used to register a low priority IO task. Used for file IO in
DataFlash_File.cpp
12 years ago
Pat Hickey
a228519b18
AP_HAL_AVR_SITL: Implement new Scheduler methods
12 years ago
Pat Hickey
bc3b6fcb9f
AP_HAL_AVR_SITL: remove begin/end atomic, adjust timer procs
12 years ago
Andrew Tridgell
93040e5725
AP_HAL: removed the defer_timer_process() function
...
this is now unused
12 years ago
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
12 years ago
Andrew Tridgell
dcc17dad94
SITL: added panic() method in scheduler
12 years ago
Andrew Tridgell
8916b280fd
SITL: filled in more of the HAL SITL backend
12 years ago
Andrew Tridgell
d42cbb791f
HAL_SITL: start filling in more of SITL framework
12 years ago
Pat Hickey
f9e9b8a7ef
AP_HAL_AVR: move scheduler's timer-hw dependent methods to a separate cpp
12 years ago
Pat Hickey
6e45ce12b2
AP_HAL_AVR: implement reboot in scheduler
...
* still need to fix system io register inits to do it like bootloader would
12 years ago
Pat Hickey
d47f77f8dd
AP_HAL_AVR Scheduler: support nested atomic sections
12 years ago
Pat Hickey
17b951c45b
AP_HAL_AVR Scheduler: rename Arduino to be AVR
12 years ago