HAL_SITL: don't sync clocks during system initialisation

This commit is contained in:
Andrew Tridgell 2015-03-24 08:02:47 -07:00
parent 127791127c
commit 0c2232a4be
1 changed files with 13 additions and 10 deletions

View File

@ -282,7 +282,7 @@ void SITLScheduler::_run_timer_procs(bool called_from_isr)
// and the failsafe, if one is setup
if (_failsafe != NULL) {
//_failsafe(NULL);
_failsafe();
}
_in_timer_proc = false;
@ -320,8 +320,10 @@ void SITLScheduler::panic(const prog_char_t *errormsg) {
void SITLScheduler::stop_clock(uint64_t time_usec)
{
stopped_clock_usec = time_usec;
if (!system_initializing()) {
/*
we want to ensure the main thread
we want to ensure the main thread gets a chance to run on
each tick from the FDM
*/
while (wait_time_usec == 0) {
pthread_yield();
@ -331,6 +333,7 @@ void SITLScheduler::stop_clock(uint64_t time_usec)
kill(0, SIGCONT);
pthread_yield();
}
}
_run_io_procs(false);
}