Skip to content

Commit

Permalink
AP_Periph: support FSOPowerStack
Browse files Browse the repository at this point in the history
  • Loading branch information
lthall committed Aug 8, 2024
1 parent 3c30de8 commit 35f8711
Show file tree
Hide file tree
Showing 6 changed files with 1,863 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tools/AP_Periph/AP_Periph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ void AP_Periph_FW::init()
relay.init();
#endif

#ifdef HAL_PERIPH_ENABLE_FSO_POWER_STACK
FSO_power_stack.init();
#endif

#if AP_SCRIPTING_ENABLED
scripting.init();
#endif
Expand Down Expand Up @@ -471,6 +475,10 @@ void AP_Periph_FW::update()
#ifdef HAL_PERIPH_ENABLE_BATTERY_BALANCE
batt_balance_update();
#endif

#ifdef HAL_PERIPH_ENABLE_FSO_POWER_STACK
FSO_power_stack.update(battery.last_read_ms == now);
#endif

static uint32_t fiftyhz_last_update_ms;
if (now - fiftyhz_last_update_ms >= 20) {
Expand Down
8 changes: 8 additions & 0 deletions Tools/AP_Periph/AP_Periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#endif
#include <AP_AHRS/AP_AHRS.h>

#ifdef HAL_PERIPH_ENABLE_FSO_POWER_STACK
#include "FSOPowerStack.h"
#endif

#ifdef HAL_PERIPH_ENABLE_RELAY
#ifdef HAL_PERIPH_ENABLE_PWM_HARDPOINT
#error "Relay and PWM_HARDPOINT both use hardpoint message"
Expand Down Expand Up @@ -356,6 +360,10 @@ class AP_Periph_FW {
BattBalance battery_balance;
#endif

#ifdef HAL_PERIPH_ENABLE_FSO_POWER_STACK
FSOPowerStack FSO_power_stack;
#endif

#ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
SerialOptions serial_options;
#endif
Expand Down
Loading

0 comments on commit 35f8711

Please sign in to comment.