Commit Graph
12 Commits
Author SHA1 Message Date
Samuel Sadok dee8efef22 initialize USB interrupt pump before initializing USB device 2018-04-20 21:15:59 -07:00
Samuel Sadok 27574234d5 improve resilience and safety of entering DFU mode
- 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
2018-04-16 23:20:20 -07:00
Samuel Sadok 44fd8090e1 add overvoltage protection
The motor phases will go into floating state as soon as an overvoltage condition is detected.
2018-04-10 15:49:16 -07:00
Samuel Sadok 8972e4a8b1 reenable ASCII protocol (formerly "legacy" protocol) 2018-04-07 21:20:26 -07:00
Samuel Sadok e264e1c326 rename legacy protocol to ASCII protocol 2018-04-07 13:25:19 -07:00
Samuel Sadok 814454da00 set usb task pump priority to osPriorityAboveNormal
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.
2018-04-06 22:19:03 -07:00
Samuel Sadok b8b483c9d6 Firmware hardening
- 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
2018-03-30 22:32:07 -07:00
Samuel Sadok e89569a6b4 add back enter_dfu_mode 2018-03-13 14:35:52 -07:00
Samuel Sadok 4be3f829d5 Merge branch 'sam_dfu' into sam_refactoring 2018-03-13 14:14:43 -07:00
Samuel Sadok 1f732bb0fb fix stack overflow 2018-03-09 20:23:03 -08:00
Samuel Sadok 9d85854de3 add toplevel functions back to protocol 2018-03-09 15:03:55 -08:00
Samuel Sadok 9486f9ed15 make stuff working again, improve state machine design, add underscore to member names 2018-03-09 13:37:07 -08:00