AP_Periph: prevent wrap of free memory in VSSC

This commit is contained in:
Andrew Tridgell 2024-01-17 07:52:00 +11:00
parent 212bde0b61
commit 38d7af450f
1 changed files with 1 additions and 1 deletions

View File

@ -1356,7 +1356,7 @@ void AP_Periph_FW::node_status_send(void)
uint8_t buffer[UAVCAN_PROTOCOL_NODESTATUS_MAX_SIZE];
node_status.uptime_sec = AP_HAL::millis() / 1000U;
node_status.vendor_specific_status_code = hal.util->available_memory();
node_status.vendor_specific_status_code = MIN(hal.util->available_memory(), UINT16_MAX);
uint32_t len = uavcan_protocol_NodeStatus_encode(&node_status, buffer, !canfdout());