mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-07 00:13:59 -04:00
HAL_SITL: fixed startup of SITL in synthetic clock mode
This commit is contained in:
parent
8a6fc0ad77
commit
74581a55bc
@ -215,7 +215,7 @@ void SITL_State::_sitl_setup(void)
|
||||
|
||||
if (_synthetic_clock_mode) {
|
||||
// start with non-zero clock
|
||||
hal.scheduler->stop_clock(100);
|
||||
hal.scheduler->stop_clock(1);
|
||||
}
|
||||
|
||||
// setup a pipe used to trigger loop to stop sleeping
|
||||
|
@ -317,6 +317,12 @@ void SITLScheduler::panic(const prog_char_t *errormsg) {
|
||||
*/
|
||||
void SITLScheduler::stop_clock(uint64_t time_usec)
|
||||
{
|
||||
if (time_usec == 1) {
|
||||
// special case for initialisation in synthetic clock mode
|
||||
stopped_clock_usec = time_usec;
|
||||
return;
|
||||
}
|
||||
|
||||
if (stopped_clock_usec != 0) {
|
||||
/*
|
||||
wait until the main thread is waiting for us. This ensures
|
||||
|
Loading…
Reference in New Issue
Block a user