BASEPRI
A Cortex-M register that masks interrupts below a chosen priority while letting the urgent ones through.
The blunt instrument is PRIMASK: cpsid i masks every configurable interrupt at once. It works, but it adds the full length of the critical section to every interrupt's latency, including the motor controller's, which never touches the shared data. BASEPRI, present from the Cortex-M3 upward but missing on the M0 and M0+, takes a priority value instead. Interrupts of equal or lesser urgency — a numerically higher value, since ARM counts backwards — wait; the important ones run as usual. Writing 0 disables the masking altogether.
FreeRTOS builds its critical sections on it. Anything above configMAX_SYSCALL_INTERRUPT_PRIORITY is never delayed by the kernel, on the condition that those interrupts never call the kernel API either. Breaking that rule doesn't produce an error message; it produces a crash three weeks later, which is why it appears in nearly every FreeRTOS FAQ.