If I single step through the code, no error is generated, but nothing happens.
If I step over all the functions, an error is generated, so nothing happens.
If I run the code all at once (by right clicking and selecting run to cursor), it runs successfully.
Does anyone understand why this happens? (I do have interrupts disabled now.)