AP_RCTelemetry: fixed warning with gcc 12.2

This commit is contained in:
Andrew Tridgell 2023-02-19 09:36:00 +11:00
parent 312d37306e
commit 3bead4f88a
1 changed files with 5 additions and 0 deletions

View File

@ -831,6 +831,10 @@ void AP_CRSF_Telem::update_vtx_params()
}
_telem_pending = true;
// calculate command crc
#pragma GCC diagnostic push
#if defined(__GNUC__) && __GNUC__ >= 10
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
uint8_t* crcptr = &_telem.ext.command.destination;
uint8_t crc = crc8_dvb(0, AP_RCProtocol_CRSF::CRSF_FRAMETYPE_COMMAND, 0xBA);
for (uint8_t i = 0; i < len; i++) {
@ -838,6 +842,7 @@ void AP_CRSF_Telem::update_vtx_params()
}
crcptr[len] = crc;
_telem_size = len + 1;
#pragma GCC diagnostic pop
}
}
#endif // AP_VIDEOTX_ENABLED