auto-sync
This commit is contained in:
parent
14d6bbd0cf
commit
9d2eddd419
|
@ -56,27 +56,18 @@ char hexChar(int v) {
|
|||
*/
|
||||
|
||||
void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par) {
|
||||
if (isIsrContext()) {
|
||||
bool wasLocked = lockAnyContext();
|
||||
|
||||
/**
|
||||
* 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))
|
||||
if (chVTIsArmedI(vtp)) {
|
||||
chVTResetI(vtp);
|
||||
}
|
||||
|
||||
chVTSetI(vtp, time, vtfunc, par);
|
||||
if (!wasLocked)
|
||||
chSysUnlockFromIsr()
|
||||
;
|
||||
} else {
|
||||
chSysLock()
|
||||
;
|
||||
if (chVTIsArmedI(vtp))
|
||||
chVTResetI(vtp);
|
||||
chVTSetI(vtp, time, vtfunc, par);
|
||||
chSysUnlock()
|
||||
;
|
||||
if (!wasLocked) {
|
||||
unlockAnyContext();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue