AP_BattMonitor: add and use an AP_BattMonitor_Config.h

This commit is contained in:
Peter Barker 2023-01-25 15:37:02 +11:00 committed by Peter Barker
parent 3e0ca818a3
commit 6b088c6a83
2 changed files with 23 additions and 20 deletions

View File

@ -6,6 +6,7 @@
#include <AP_TemperatureSensor/AP_TemperatureSensor_config.h>
#include <GCS_MAVLink/GCS_MAVLink.h>
#include "AP_BattMonitor_Params.h"
#include "AP_BattMonitor_config.h"
// maximum number of battery monitors
#ifndef AP_BATT_MONITOR_MAX_INSTANCES
@ -28,26 +29,6 @@
#define AP_BATT_MONITOR_CELLS_MAX 12
#endif
#ifndef AP_BATTMON_SMBUS_ENABLE
#define AP_BATTMON_SMBUS_ENABLE 1
#endif
#ifndef AP_BATTMON_FUELFLOW_ENABLE
#define AP_BATTMON_FUELFLOW_ENABLE (BOARD_FLASH_SIZE > 1024)
#endif
#ifndef AP_BATTMON_FUELLEVEL_PWM_ENABLE
#define AP_BATTMON_FUELLEVEL_PWM_ENABLE (BOARD_FLASH_SIZE > 1024)
#endif
#ifndef AP_BATTMON_FUELLEVEL_ANALOG_ENABLE
#define AP_BATTMON_FUELLEVEL_ANALOG_ENABLE (BOARD_FLASH_SIZE > 1024)
#endif
#ifndef AP_BATTMON_SYNTHETIC_CURRENT_ENABLED
#define AP_BATTMON_SYNTHETIC_CURRENT_ENABLED 1
#endif
// declare backend class
class AP_BattMonitor_Backend;
class AP_BattMonitor_Analog;

View File

@ -0,0 +1,22 @@
#pragma once
#ifndef AP_BATTMON_SMBUS_ENABLE
#define AP_BATTMON_SMBUS_ENABLE 1
#endif
#ifndef AP_BATTMON_FUELFLOW_ENABLE
#define AP_BATTMON_FUELFLOW_ENABLE (BOARD_FLASH_SIZE > 1024)
#endif
#ifndef AP_BATTMON_FUELLEVEL_PWM_ENABLE
#define AP_BATTMON_FUELLEVEL_PWM_ENABLE (BOARD_FLASH_SIZE > 1024)
#endif
#ifndef AP_BATTMON_FUELLEVEL_ANALOG_ENABLE
#define AP_BATTMON_FUELLEVEL_ANALOG_ENABLE (BOARD_FLASH_SIZE > 1024)
#endif
#ifndef AP_BATTMON_SYNTHETIC_CURRENT_ENABLED
#define AP_BATTMON_SYNTHETIC_CURRENT_ENABLED 1
#endif