Fix a few minor bugs to get KeyboardWalk to work reliably. #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch is mainly to collect a few small fixes for a few small bugs on the NUSense firmware. After this, KeyboardWalk should be mostly reliable.
Such bugs were:
Such fixes are:
memcpy
's in the CDC callback to be for-loops since the former throws away the volatile qualifier.* This is rough fix since the fault itself was an imprecise or asynchronous bus-fault. Disabling an internal buffer apparently makes it easier to troubleshoot. However, disabling the IRQ seems to work well. No hard-fault comes up when the robot is standing for about half an hour. Furthermore, too much time should not be spent since StreamReactor may have a better approach. Interestingly, this bug only happened with the firmware was fully optimised.
† I am not sure about this since it does allow a more accurate timing of missing bytes, but it may never time out if there is a consistent enough stream of garbage. However, Dex's independent watchdog idea may help this.
‡ We may want to make a more thorough DMA approach; see this task.