|
|
|
@ -35,6 +35,7 @@
@@ -35,6 +35,7 @@
|
|
|
|
|
|
|
|
|
|
#include "boot_app_shared.h" |
|
|
|
|
|
|
|
|
|
#include <drivers/drv_watchdog.h> |
|
|
|
|
#include <lib/ecl/geo/geo.h> |
|
|
|
|
#include <lib/version/version.h> |
|
|
|
|
|
|
|
|
@ -145,6 +146,7 @@ int UavcanNode::getHardwareVersion(uavcan::protocol::HardwareVersion &hwver)
@@ -145,6 +146,7 @@ int UavcanNode::getHardwareVersion(uavcan::protocol::HardwareVersion &hwver)
|
|
|
|
|
|
|
|
|
|
int UavcanNode::start(uavcan::NodeID node_id, uint32_t bitrate) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (_instance != nullptr) { |
|
|
|
|
PX4_WARN("Already started"); |
|
|
|
|
return -1; |
|
|
|
@ -232,6 +234,7 @@ void UavcanNode::busevent_signal_trampoline()
@@ -232,6 +234,7 @@ void UavcanNode::busevent_signal_trampoline()
|
|
|
|
|
|
|
|
|
|
static void cb_reboot(const uavcan::TimerEvent &) |
|
|
|
|
{ |
|
|
|
|
watchdog_pet(); |
|
|
|
|
board_reset(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -310,6 +313,10 @@ void UavcanNode::Run()
@@ -310,6 +313,10 @@ void UavcanNode::Run()
|
|
|
|
|
{ |
|
|
|
|
pthread_mutex_lock(&_node_mutex); |
|
|
|
|
|
|
|
|
|
// Bootloader started it.
|
|
|
|
|
|
|
|
|
|
watchdog_pet(); |
|
|
|
|
|
|
|
|
|
if (!_initialized) { |
|
|
|
|
|
|
|
|
|
get_node().setRestartRequestHandler(&restart_request_handler); |
|
|
|
@ -434,6 +441,9 @@ extern "C" int uavcannode_start(int argc, char *argv[])
@@ -434,6 +441,9 @@ extern "C" int uavcannode_start(int argc, char *argv[])
|
|
|
|
|
{ |
|
|
|
|
//board_app_initialize(nullptr);
|
|
|
|
|
|
|
|
|
|
// Sarted byt the bootloader, we must pet it
|
|
|
|
|
watchdog_pet(); |
|
|
|
|
|
|
|
|
|
// CAN bitrate
|
|
|
|
|
int32_t bitrate = 0; |
|
|
|
|
|
|
|
|
|