-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gpsid_detect
- Loading branch information
Showing
23 changed files
with
699 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "AP_Mount_Backend_Serial.h" | ||
|
||
#if HAL_MOUNT_ENABLED | ||
#include <AP_SerialManager/AP_SerialManager.h> | ||
|
||
// Default init function for every mount | ||
void AP_Mount_Backend_Serial::init() | ||
{ | ||
const AP_SerialManager& serial_manager = AP::serialmanager(); | ||
|
||
// search for serial port. hild classes should check that uart is not nullptr | ||
_uart = serial_manager.find_serial(AP_SerialManager::SerialProtocol_Gimbal, _serial_instance); | ||
if (_uart == nullptr) { | ||
return; | ||
} | ||
|
||
// initialised successfully if uart is found | ||
_initialised = true; | ||
|
||
// call the parent class init | ||
AP_Mount_Backend::init(); | ||
} | ||
|
||
#endif // HAL_MOUNT_ENABLED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* | ||
Mount driver backend class for serial drivers | ||
Mounts using custom serial protocols should be derived from this class | ||
*/ | ||
#pragma once | ||
|
||
#include "AP_Mount_config.h" | ||
|
||
#if HAL_MOUNT_ENABLED | ||
|
||
#include "AP_Mount_Backend.h" | ||
|
||
class AP_Mount_Backend_Serial : public AP_Mount_Backend | ||
{ | ||
public: | ||
// Constructor | ||
AP_Mount_Backend_Serial(class AP_Mount &frontend, class AP_Mount_Params ¶ms, uint8_t instance, uint8_t serial_instance) : | ||
AP_Mount_Backend(frontend, params, instance), | ||
_serial_instance(serial_instance) | ||
{} | ||
|
||
// perform any required initialisation for this instance | ||
void init() override; | ||
|
||
protected: | ||
|
||
// internal variables | ||
AP_HAL::UARTDriver *_uart; // uart connected to gimbal | ||
uint8_t _serial_instance; // this instance's serial instance number | ||
bool _initialised; // true if uart has been initialised | ||
}; | ||
|
||
#endif // HAL_MOUNT_ENABLED |
Oops, something went wrong.