1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Merged in LP-457_fallthrough_fix (pull request #549)

LP-457 Fix build errors

Approved-by: Eric Price
This commit is contained in:
Vladimir Zidar 2022-06-16 14:40:35 +00:00 committed by Eric Price
commit e96f3d0936
2 changed files with 22 additions and 1 deletions

View File

@ -450,6 +450,7 @@ static void configure(uint16_t *bytes_to_send)
config_rate(bytes_to_send, min_rate);
break;
}
// fall through
case LAST_CONFIG_SENT_START + 1:
config_nav(bytes_to_send);
@ -717,7 +718,7 @@ void gps_ubx_autoconfig_run(char * *buffer, uint16_t *bytes_to_send)
// we can do that if we choose because we haven't sent any data in this state
// set_current_step_if_untouched(INIT_STEP_SET_LOWRATE);
// allow it enter the next state immmediately by not setting status->lastStepTimestampRaw = PIOS_DELAY_GetRaw();
// break;
// fall through
case INIT_STEP_SET_LOWRATE:
// Here we set minimal baudrate *before* changing gps baudrate

View File

@ -280,6 +280,26 @@ int32_t PIOS_COM_ChangeBaud(uint32_t com_id, uint32_t baud)
return 0;
}
/**
* Clear Rx buffer
* \param[in] port COM port
* \return -1 if port not available
* \return 0 on success
*/
int32_t PIOS_COM_ClearRxBuffer(uint32_t com_id)
{
struct pios_com_dev *com_dev = PIOS_COM_find_dev(com_id);
if (!PIOS_COM_validate(com_dev)) {
/* Undefined COM port for this board (see pios_board.c) */
return -1;
}
fifoBuf_clearData(&com_dev->rx);
return 0;
}
/**
* Sends a package over given port
* \param[in] port COM port