AP_Periph: ignore unused-function error for helper fix_float16()

This commit is contained in:
Siddharth Purohit 2020-12-12 01:11:55 -08:00 committed by Tom Pittenger
parent 07aeab5c44
commit 4d91071e7e
1 changed files with 3 additions and 0 deletions

View File

@ -451,10 +451,13 @@ static void handle_allocation_response(CanardInstance* ins, CanardRxTransfer* tr
/*
fix value of a float for canard float16 format
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static void fix_float16(float &f)
{
*(uint16_t *)&f = canardConvertNativeFloatToFloat16(f);
}
#pragma GCC diagnostic pop
#ifdef HAL_PERIPH_ENABLE_BUZZER