AP_Volz_Protocol: move serial port init of Volz protocol into Volz library

This commit is contained in:
Peter Barker 2024-12-15 15:51:36 +11:00 committed by Peter Barker
parent 061097ac31
commit 4e0bc79002
1 changed files with 4 additions and 1 deletions

View File

@ -62,13 +62,16 @@ void AP_Volz_Protocol::init(void)
return; return;
} }
const AP_SerialManager &serial_manager = AP::serialmanager(); AP_SerialManager &serial_manager = AP::serialmanager();
port = serial_manager.find_serial(AP_SerialManager::SerialProtocol_Volz,0); port = serial_manager.find_serial(AP_SerialManager::SerialProtocol_Volz,0);
if (port == nullptr) { if (port == nullptr) {
// No port configured // No port configured
return; return;
} }
// update baud param in case user looks at it
serial_manager.set_and_default_baud(AP_SerialManager::SerialProtocol_Volz, 0, 115200);
// Create thread to handle output // Create thread to handle output
if (!hal.scheduler->thread_create(FUNCTOR_BIND_MEMBER(&AP_Volz_Protocol::loop, void), if (!hal.scheduler->thread_create(FUNCTOR_BIND_MEMBER(&AP_Volz_Protocol::loop, void),
"Volz", "Volz",