AP_Periph: added reboot for scripting

This commit is contained in:
Andrew Tridgell 2024-01-15 09:09:43 +11:00
parent 46f65aec4e
commit 59fe2c9d4e
2 changed files with 12 additions and 1 deletions

View File

@ -594,6 +594,14 @@ void AP_Periph_FW::prepare_reboot()
hal.scheduler->delay(40); hal.scheduler->delay(40);
} }
/*
reboot, optionally holding in bootloader. For scripting
*/
void AP_Periph_FW::reboot(bool hold_in_bootloader)
{
hal.scheduler->reboot(hold_in_bootloader);
}
AP_Periph_FW *AP_Periph_FW::_singleton; AP_Periph_FW *AP_Periph_FW::_singleton;
AP_Periph_FW& AP::periph() AP_Periph_FW& AP::periph()

View File

@ -468,7 +468,10 @@ public:
uint16_t data_type_id, uint16_t data_type_id,
CanardTransferType transfer_type, CanardTransferType transfer_type,
uint8_t source_node_id); uint8_t source_node_id);
// reboot the peripheral, optionally holding in bootloader
void reboot(bool hold_in_bootloader);
#if AP_UART_MONITOR_ENABLED #if AP_UART_MONITOR_ENABLED
void handle_tunnel_Targetted(CanardInstance* canard_instance, CanardRxTransfer* transfer); void handle_tunnel_Targetted(CanardInstance* canard_instance, CanardRxTransfer* transfer);
void send_serial_monitor_data(); void send_serial_monitor_data();