diff --git a/target/src/spinLockLib.c b/target/src/spinLockLib.c index f8d77fa..19e6686 100644 --- a/target/src/spinLockLib.c +++ b/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; } }