- Disable interrupts before setting the reboot cookie
- Delay after NVIC_SystemReset before jumping to bootloader
(see comment for an explanation)
- Make a variable for the reboot cookie
- Do reboot cookie checks before C++ static initializers
Previously the assumption was made that the compiler
uses 32 bits for each enum value. This assumption was
invalid and meant that when reading/writing from
control_mode you would also read/write to enable_step_dir.
Before this commit, if the NVM is deemed valid and but the subsequent config load fails (e.g. because of a checksum mismatch), the motor config could be left in an undefined state.
Also a variable user_config_loaded is added to indicate whether the device is using user-saved config or factory defaults.
osPriorityNormal is the same priority as the communication task. If the USB pump task runs on the same priority, it sometimes fails to respond to the host in time, causing spurious halt conditions.
osPriorityNormal is the same priority as the communication task. If the USB pump task runs on the same priority, it sometimes fails to respond to the host in time, causing spurious halt conditions.
- check return code of enqueue_modulation_timings
- wrap all hardware access to safety critical hardware timer registers in safety_critical_ sections. These functions like the armed-ness of each PWM output to a corresponding armed state that can only be set at start or by the user
- ensure NaN in any variables doesn't cause unpredictable behavior on the safety critical PWM outputs
If the motor phase resistance and phase inductance was loaded from NVM (pre_calibrated = true) (as opposed to calibration) the current control P and I gains would not be loaded correctly. This commit fixes this.
If the motor phase resistance and phase inductance was loaded from NVM (pre_calibrated = true) (as opposed to calibration) the current control P and I gains would not be loaded correctly. This commit fixes this.