Lucas De Marchi
a1b62b4984
AP_HAL_Linux: Scheduler: use PeriodicThread
...
Some tasks were not accounting for the time to execute the tasks. Now
that we are using the infra from PeriodicThread all of them are.
9 years ago
Lucas De Marchi
48e81c8589
AP_HAL_Linux: Thread: add PeriodicThread helper
...
This is a helper class to run a single periodic function like the ones
used in the scheduler.
9 years ago
Lucas De Marchi
860d5aaf84
AP_HAL_Linux: Scheduler: move rpcmem initialization to setup phase
...
This was the only piece remaining in the timer thread that was used only
to setup the thread.
9 years ago
Lucas De Marchi
0282ebb8ff
AP_HAL_Linux: add method to check caller same as thread
9 years ago
Lucas De Marchi
e3beef0f77
AP_HAL_Linux: Scheduler: remove unused parameter
9 years ago
Lucas De Marchi
2b61eaf9f2
Global: remove {begin,end}_atomic from scheduler
...
These are never used and largely not implemented.
9 years ago
Lucas De Marchi
9aa49cda93
Global: remove system_initializing() from scheduler
...
This is not used anymore.
9 years ago
Lucas De Marchi
9cf9fc152b
AP_HAL_Linux: use pthread's barrier instead of polling
...
Use pthread's barrier so we don't keep waking up threads with possibly
higher priority during initialization phase.
This also synchronizes all of them to a single point. With the previous
approach it was possible (but unlikely) that a thread hadn't reach the
synchronization point when main thread signalize "system initialized".
9 years ago
Lucas De Marchi
2b0e214168
AP_HAL_Linux: Scheduler: move synchronization to common method
9 years ago
Lucas De Marchi
66e6cd60d8
AP_HAL_Linux: Thread: allow to override run method
9 years ago
Lucas De Marchi
a183ff8d32
AP_HAL_Linux: Scheduler: use Thread abstraction
9 years ago
Lucas De Marchi
3e0a83ede9
AP_HAL_Linux: add Thread abstraction class
9 years ago
Lucas De Marchi
5e9b45ebc2
AP_HAL_Linux: Scheduler: make microsleep() public
...
This will be used outside of scheduler class.
9 years ago
Lucas De Marchi
27999b339d
AP_HAL_Linux: Scheduler: include cleanups
...
While at it also remove some wrong whitespaces.
9 years ago
mirkix
5b8de06beb
AP_HAL_Linux: Enable optical flow onboard for BBBMINI
9 years ago
Lucas De Marchi
2296139516
AP_HAL_Linux: remove unused constant
9 years ago
Lucas De Marchi
21b2d5d34c
AP_HAL_Linux: AnalogIn_Raspilot: rename classes to follow other names
9 years ago
Lucas De Marchi
87e7704b1c
AP_HAL_Linux: ADS1115: rename classes to follow other names
...
While at it, remove some dead/commented-out code.
9 years ago
Lucas De Marchi
5bb2716081
AP_HAL_Linux: add name to SPI device table
...
A string name allows to more easily expand the table: the board is
responsible for the name and doesn't have to declare it as a enum or
define. It's also easier to add 2 sensors of the same type.
9 years ago
Lucas De Marchi
9d5fb97819
Global: rename enum SPIDevice to SPIDeviceType
...
Free the SPIDevice name so to have a consistent name for I2C/SPI device
classes.
9 years ago
mirkix
c622ff1539
AP_HAL_Linux: Enable AnalogIN_IIO for BBBMINI
9 years ago
mirkix
fe404c8a5d
AP_HAL_Linux: AnalogIIO: Remove unused code, add scaling for BBBMINI, rework
9 years ago
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.
9 years ago
Gustavo Jose de Sousa
a2d2661765
waf: use methods from bld instead of ardupilotwaf for the remaining
9 years ago
Gustavo Jose de Sousa
3d22490397
waf: examples: use methods from bld instead of ardupilotwaf
9 years ago
mirkix
86e335b6b6
AP_HAL_Linux: Prevent buffer overflow
9 years ago
Lucas De Marchi
2d3a62eae3
AP_HAL_Linux: RCInput_RPI: revert PWM support
...
This reverts support for RCInput via PWM. This is causing trouble in
some RPI-based boards, receiving a SIGSEGV. Let's revert it for now and
retry this later.
This reverts commit 5629f38b2c
.
This reverts commit 51fd0b3d55
.
This reverts commit 79d56073f7
.
9 years ago
Lucas De Marchi
c8947c3e9c
AP_HAL_Linux: RCInput_RPI: provide signal information
...
Otherwise it's difficult to know what signal is causing the program to
exit.
9 years ago
Lucas De Marchi
5629f38b2c
AP_HAL_Linux: RCInput_RPI: fix use of uninitiliazed value
...
../../libraries/AP_HAL_Linux/RCInput_RPI.cpp: In member function ‘virtual void Linux::RCInput_RPI::_timer_tick()’:
../../libraries/AP_HAL_Linux/RCInput_RPI.cpp:489:127: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
counter = circle_buffer->bytes_available(curr_pointer, circle_buffer->get_offset(circle_buffer->_virt_pages, (uintptr_t)x));
^
9 years ago
Julien BERAUD
4acc121bd6
AP_HAL_Linux: support for timesliced timers
...
In order for lower frequency timers not to be called at the same iteration
of the main timer loop. This improves scheduling.
9 years ago
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().
9 years ago
Ricardo de Almeida Gonzaga
4c60dd5e44
AP_HAL_Linux: improve yuyv_to_grey() performance
...
Based on gbenchmark metrics.
Before:
Benchmark Time(ns) CPU(ns) Iterations
----------------------------------------------------
BM_YuyvToGrey/4k 3109 3114 233334
BM_YuyvToGrey/75k 55777 55857 12353
BM_YuyvToGrey/300k 231829 232227 3043
After:
Benchmark Time(ns) CPU(ns) Iterations
----------------------------------------------------
BM_YuyvToGrey/4k 1713 1716 411765
BM_YuyvToGrey/75k 32124 32152 21875
BM_YuyvToGrey/300k 128530 128753 5385
9 years ago
Ricardo de Almeida Gonzaga
3748760ead
AP_HAL_Linux: improve crop_8bpp() performance
...
Based on gbenchmark metrics.
Before:
Benchmark Time(ns) CPU(ns) Iterations
----------------------------------------------------
BM_Crop8bpp/64/64 3206 3197 198113
BM_Crop8bpp/240/240 38166 38181 18421
BM_Crop8bpp/640/480 193589 193317 3621
After:
Benchmark Time(ns) CPU(ns) Iterations
----------------------------------------------------
BM_Crop8bpp/64/64 2652 2657 232103
BM_Crop8bpp/240/240 33532 33506 20792
BM_Crop8bpp/640/480 187848 188201 3684
9 years ago
Ricardo de Almeida Gonzaga
210c90e784
AP_HAL_Linux: add benchmark for crop_8bpp() and yuyv_to_grey()
...
We had to check for board subtypes in the benchmark since VideoIn.cpp
does these checks.
9 years ago
Julien BERAUD
43307d95c8
OpticalFlow_Onboard: fix body rate calculation
...
The correct integral of the body rate is (rate + last_rate)/2*dt
and not rate * dt
9 years ago
Ricardo de Almeida Gonzaga
753f7d864a
AP_HAL_Linux: add a shrink by software option in OpticalFlow
...
This shrink must be used when the output camera sizes doesn't fit
the expected output.
We don't need to crop it even when the camera sizes aren't squared since
the shrink_8bpp() function shrinks a selected area.
9 years ago
Ricardo de Almeida Gonzaga
553d36c860
AP_HAL_Linux: add shrink_8bpp() to VideoIn
...
This function shrinks a selected area on a 8bpp image.
The focus in this function was the performance, so this may not be the
clearer or the most understandable way to write it. The performance
was measured using GoogleBenchmark[1].
[1] - https://github.com/google/benchmark.git
9 years ago
Lucas De Marchi
51fd0b3d55
AP_HAL_Linux: RCInput_RPI: fix coding style
...
- Remove trailing whitespaces
- Remove some uneeded comments
- Fix indentation
- Replace some breaks inside the loop by checking in the loop itself
9 years ago
Aaron Wang Shi
79d56073f7
AP_HAL_Linux: support PWM input for BH hat
9 years ago
Julien BERAUD
f449107563
AP_HAL_Linux: Add Perf Lttng
...
Support for perf api using lttng.
Some additional build tricks needed for bebop because lttng uses dl_open
which is not compatible with a static link on a different libc as used
on the bebop
9 years ago
Lucas De Marchi
a3cac102cd
AP_HAL_Linux: AnalogIn_Raspilot: rename misleading variables
...
We are not doing any dma here, it's just an SPI transaction. Name them
only rx/tx (although io_packet_tx/io_packet_rx could be another option).
This also zero-initialize the struct to keep valgrind happy about not
calling ioctl() with uninitialized variables.
9 years ago
Lucas De Marchi
0cff40ed7b
AP_HAL_Linux: AnalogIn_Raspilot: remove unused debug
9 years ago
Pritam Ghanghas
60636c1653
AP_HAL_Linux: rename RaspilotAnalogIn.cpp to AnalogIn_Raspilot.cpp
9 years ago
Lucas De Marchi
1fde473afc
AP_HAL_Linux: AnalogIn_IIO: normalize names
...
Use same name for file and classes, preferring AnalogIn_IIO over
IIOAnalogIn.
9 years ago
Lucas De Marchi
be2af0877c
AP_HAL_Linux: AnalogIn_IIO: formatting fixes
...
- remove trailing whitespaces
- use pragma 0 for header guard
9 years ago
Víctor Mayoral Vilches
8195631fac
HAL_Linux: AnalogIn_IIO update reopen_pin
9 years ago
Víctor Mayoral Vilches
b9c83da8c6
HAL_Linux: AnalogIn_IIO, replace reopen by select
...
A new select_pin method has been implemented and
set that changes solely the file descriptor (avoids
reopening the file every time we call set_pin).
9 years ago
Víctor Mayoral Vilches
da1b529415
HAL_Linux: AnalogIn_IIO add init_pins
...
initializes all the available analog
sources and stores the corresponding file descriptors
in fd_analog_sources.
9 years ago
Víctor Mayoral Vilches
546fbd1f25
HAL_Linux: mv AnalogIn_PXF to AnalogIn_IIO
...
Initial implementation used for the PXF moved for
a wider use. The implementation uses the Linux Industrial
I/O Subsystem (IIO) to get Analog Input.
9 years ago
Víctor Mayoral Vilches
4820e0b2c7
HAL_Linux: AnalogIn_PXF changes in AnalogIn
...
Recent changes in AP_HAL::AnalogIn have made the previous
code not valid anymore. This commit fixes the init()
method and adds common headers.
9 years ago