Os util update (#4574)
* chVTSetAny: "this could be simplified" * os_utils: use Chibi's CriticalSectionLocker
This commit is contained in:
parent
273314bdf2
commit
68ee1c6a1f
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue