AP_SerialManager: move serial_manager parameters up to base class

This commit is contained in:
Peter Barker 2024-02-27 22:54:14 +11:00 committed by Peter Barker
parent 684b621b8c
commit b623b8ec94
5 changed files with 22 additions and 0 deletions

View File

@ -20,6 +20,10 @@
find which serial port they should use
*/
#include "AP_SerialManager_config.h"
#if AP_SERIALMANAGER_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_Math/AP_Math.h>
#include <AP_RCProtocol/AP_RCProtocol.h>
@ -867,3 +871,5 @@ AP_SerialManager &serialmanager()
}
}
#endif // AP_SERIALMANAGER_ENABLED

View File

@ -22,6 +22,9 @@
#pragma once
#include "AP_SerialManager_config.h"
#if AP_SERIALMANAGER_ENABLED
#include <AP_Param/AP_Param.h>
class AP_SerialManager {
@ -207,3 +210,5 @@ private:
namespace AP {
AP_SerialManager &serialmanager();
};
#endif // AP_SERIALMANAGER_ENABLED

View File

@ -39,6 +39,10 @@
#define HAL_NUM_SERIAL_PORTS SERIALMANAGER_NUM_PORTS
#endif
#ifndef AP_SERIALMANAGER_ENABLED
#define AP_SERIALMANAGER_ENABLED 1
#endif
/*
array size for state[]. This needs to be at least
SERIALMANAGER_NUM_PORTS, but we want it to be the same length on

View File

@ -294,8 +294,10 @@ void AP_Vehicle::setup()
// load the default values of variables listed in var_info[]
AP_Param::setup_sketch_defaults();
#if AP_SERIALMANAGER_ENABLED
// initialise serial port
serial_manager.init_console();
#endif
DEV_PRINTF("\n\nInit %s"
"\n\nFree RAM: %u\n",
@ -345,8 +347,10 @@ void AP_Vehicle::setup()
gcs().init();
#endif
#if AP_SERIALMANAGER_ENABLED
// initialise serial ports
serial_manager.init();
#endif
#if HAL_GCS_ENABLED
gcs().setup_console();
#endif

View File

@ -354,7 +354,10 @@ protected:
#if AP_VIDEOTX_ENABLED
AP_VideoTX vtx;
#endif
#if AP_SERIALMANAGER_ENABLED
AP_SerialManager serial_manager;
#endif
#if AP_RELAY_ENABLED
AP_Relay relay;