Enable BATTx_options for AP_Periph builds if useful - Battery summing on a node #28630
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a condition for the options parameter to be included in the build for AP_Periph firmware if AP_BATTERY_SUM_ENABLED is true.
This is a niche use case where a user is using a battery monitor sum of other monitor(s) and may want to be able to set the voltage source as minimum rather than average. Current builds do not include this options parameter as it is kept out of AP_Periph builds.
This has been tested on a MATEK L431 Periph CAN Node with the hwdef.dat file modified. I have verified that the options are included when
define AP_BATTERY_SUM_ENABLED 1
is included and are not present when removed from the hwdef.dat.Current hardware definitions for the L431 don't have these in by default however it may be beneficial to include them if they don't hinder other functionality. The inclusion of 4 adcs allows for voltage and current to be measured from two battery sources and combining them may be helpful for more complex or non-standard vehicles.
I have included the
defined(HAL_BUILD_AP_PERIPH)
as I was unsure of any consequences if the parameter is defined twice.