|
|
|
@ -474,11 +474,13 @@ void request_node_restart(void)
@@ -474,11 +474,13 @@ void request_node_restart(void)
|
|
|
|
|
void check_need_to_jump_boot(void) |
|
|
|
|
{ |
|
|
|
|
if ((last_invocation + 1000) < HAL_GetTick()) |
|
|
|
|
{ |
|
|
|
|
// process1HzTasks(getMonotonicTimestamp());
|
|
|
|
|
last_invocation = HAL_GetTick(); /* Intentionally exclude processing time */ |
|
|
|
|
if (node_restart_at && (HAL_GetTick() > node_restart_at)) |
|
|
|
|
{ |
|
|
|
|
NVIC_SystemReset(); |
|
|
|
|
if (node_restart_at && (HAL_GetTick() > node_restart_at)) |
|
|
|
|
{ |
|
|
|
|
NVIC_SystemReset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -616,10 +618,12 @@ void allocation_update(void)
@@ -616,10 +618,12 @@ void allocation_update(void)
|
|
|
|
|
bootloader_interface.node_id) |
|
|
|
|
{ |
|
|
|
|
canardSetLocalNodeID(&g_canard, bootloader_interface.node_id); |
|
|
|
|
init_uavcan_fifo(get_node_id()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
canardSetLocalNodeID(&g_canard, DEFAULT_NODE_ID); |
|
|
|
|
init_uavcan_fifo(get_node_id()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -743,19 +747,19 @@ static float uavcan_get_radom_float(void)
@@ -743,19 +747,19 @@ static float uavcan_get_radom_float(void)
|
|
|
|
|
|
|
|
|
|
void uavcan_init_by_allocation(void) |
|
|
|
|
{ |
|
|
|
|
can_filter_none(); |
|
|
|
|
can_init_irq(); |
|
|
|
|
canardInit(&g_canard, // Uninitialized library instance
|
|
|
|
|
g_canard_memory_pool, // Raw memory chunk used for dynamic allocation
|
|
|
|
|
sizeof(g_canard_memory_pool), // Size of the above, in bytes
|
|
|
|
|
onTransferReceived, // Callback, see CanardOnTransferReception
|
|
|
|
|
shouldAcceptTransfer, // Callback, see CanardShouldAcceptTransfer
|
|
|
|
|
NULL); |
|
|
|
|
can_init_irq(); |
|
|
|
|
read_unique_id(&node_unique_id[0]); |
|
|
|
|
allocation_init(); |
|
|
|
|
// canard_initialized = true;
|
|
|
|
|
allocation_init_tick = HAL_GetTick(); |
|
|
|
|
can_filter_none(); |
|
|
|
|
can_init_irq(); |
|
|
|
|
canardInit(&g_canard, // Uninitialized library instance
|
|
|
|
|
g_canard_memory_pool, // Raw memory chunk used for dynamic allocation
|
|
|
|
|
sizeof(g_canard_memory_pool), // Size of the above, in bytes
|
|
|
|
|
onTransferReceived, // Callback, see CanardOnTransferReception
|
|
|
|
|
shouldAcceptTransfer, // Callback, see CanardShouldAcceptTransfer
|
|
|
|
|
NULL); |
|
|
|
|
can_init_irq(); |
|
|
|
|
read_unique_id(&node_unique_id[0]); |
|
|
|
|
allocation_init(); |
|
|
|
|
// canard_initialized = true;
|
|
|
|
|
allocation_init_tick = HAL_GetTick(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uint64_t micros(void) |
|
|
|
|