Add param-validation to spin_lock_instance

This commit is contained in:
Andrew Scheller 2021-03-08 22:47:16 +00:00 committed by Luke Wren
parent 26fd36f853
commit a2576202ff

View File

@ -194,6 +194,7 @@ inline static void restore_interrupts(uint32_t status) {
* \return The spinlock instance
*/
inline static spin_lock_t *spin_lock_instance(uint lock_num) {
invalid_params_if(SYNC, lock_num >= NUM_SPIN_LOCKS);
return (spin_lock_t *) (SIO_BASE + SIO_SPINLOCK0_OFFSET + lock_num * 4);
}