This will initialize those structs with zero in all fields not set
and all fields set will only be change once to the final value not
wasting CPU time zeroing it.
This will guarantee that no non-unitialized structs will have
a trash value on from_external causing it to be sent to the
MAVLink channel without need it.
Define the default I2C buss frequncies that are backward compatible
with the existing code. While allowing it the defaults to be overridden
by a board config.
Based on the legacy STM32 code, the I2C buss numbering starts at 1.
The bus frequency is stored in a 0 based array. If px4_i2cbus_initialize
returns a valid device, then the _bus-1 will act as the index to the
busses frequency.
A board may define BOARD_NUMBER_I2C_BUSES - the number of I2C busses
it supports* and BOARD_I2C_BUS_CLOCK_INIT to initalize the bus
clocks for a given busses.
BOARD_NUMBER_I2C_BUSES - the number of busses including the *highest
number bus. If the board has 2 I2C
busses I2C1 and I2C3 BOARD_NUMBER_I2C_BUSES
would be set to 3
BOARD_I2C_BUS_CLOCK_INIT - Initalization for the bus frequencies
by bus. A call init, with a frequency
less then the value used for the
Initalization will result in the device
not starting becuase the buss runs too
fast for it.
PX4_NUMBER_I2C_BUSES number of busses that the HW can support
not all of them my be usesd. I.E. The STM32F427 has 3 I2C
busses but only I2C1 and I2C3 are used.
The GPS simulation now mimicks the real driver more closely and should provide even GPS delays. The delays themselves are set by the simulator, and default to 120 ms for Gazebo
The simulation engine had the ability to pause already and properly handled load spikes, however, it was not hardened against constant drift. This addition enables it to run at a constant slower-than-realtime rate successfully.
px4_shutdown_request() was called from the power button IRQ callback, which
invoked a work queue callback. But on NuttX, the work queue uses a
semaphore, and thus it cannot be called from IRQ context.
This patch switches to publishing an uORB msg instead, which is handled in
the commander main thread.
To increase failure resistance, we could subscribe to the same topic in
another module for redundancy, in case commander runs wild.
system_source - This battery status is for the brick that is
supplying VDD_5V_IN
priority - Zero based, This battery status is for the brick
that is connected to the Power controller's
N-1 priority input. V1..VN. 0 would normally be
Brick1, 1 for Brick2 etc
Battery now assigns connected from the api in the
updateBatteryStatus, as well as system_source and priority
This PR is preliminary ground work for FMUv5.
PX4 does not use the NuttX adc driver. But used the same format
for the data returned by the nuttx ADC driver.
There was a fixme:in src/platforms/px4_adc.h "this needs to be
a px4_adc_msg_s type" With this PR the need for
src/platforms/px4_adc.h goes away as the driver drv_adc.h now
describes the px4_adc_msg_t.
Current driver was copy pasted from a MS5611 driver.
The existing driver takes data from Simulator, not from
an actual device.
Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
Provides:
- thread-safety for module start/stop
- some shared code for module start/stop. Should also be less prone to
errors.
- constructor & destructors are called from within the new module thread
- can be used for work queue & thread modules
- strutured & formal way for module printf usage & module documentation
Limitation:
- supports only modules with one instance (eg. not mavlink)
- Fixed V712
- The compiler can optimize this code by creating an infinite loop, or simply deleting it.
- There is need to add a volatile qualifier to the '_ExitFlag' and 'sim_delay' variables.