Os util update (#4574)

* chVTSetAny: "this could be simplified"

* os_utils: use Chibi's CriticalSectionLocker
This commit is contained in:
Andrey G 2022-09-14 00:57:13 +03:00 committed by GitHub
parent 4fef1d2346
commit a269287b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 10 deletions

View File

@ -25,18 +25,9 @@
#include "os_util.h"
void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par) {
syssts_t sts = chSysGetStatusAndLockX();
/**
* todo: this could be simplified once we migrate to ChibiOS 3.0
* See http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:porting_from_2_to_3
*/
if (chVTIsArmedI(vtp)) {
chVTResetI(vtp);
}
chibios_rt::CriticalSectionLocker csl;
chVTSetI(vtp, time, vtfunc, par);
chSysRestoreStatusX(sts);
}
#endif /* EFI_UNIT_TEST */