Browse Source

Fixed spinLockIsrTake interrupt register save bug.

master
Hanhui 3 years ago
parent
commit
d9828d0485
  1. 8
      target/src/spinLockLib.c

8
target/src/spinLockLib.c

@ -56,15 +56,15 @@ void spinLockIsrGive (spinlockIsr_t * lock)
void spinLockIsrTake (spinlockIsr_t * lock)
{
INTREG *key;
INTREG intreg;
if (lock) {
key = (INTREG *)&(lock->lock.SL_pvReserved);
#if SPIN_LOCK_USE_QUICK_LOCK > 0
API_SpinLockQuick(&lock->lock, key);
API_SpinLockQuick(&lock->lock, &intreg);
#else
API_SpinLockIrq(&lock->lock, key);
API_SpinLockIrq(&lock->lock, &intreg);
#endif
*(INTREG *)&(lock->lock.SL_pvReserved) = intreg;
}
}

Loading…
Cancel
Save