This repository was archived by the owner on Mar 7, 2026. It is now read-only.
Fix: SWDP and JTAG TAP routine types and understandability#1118
Merged
Conversation
esden
previously approved these changes
Jul 19, 2022
Member
esden
left a comment
There was a problem hiding this comment.
Did some testing too. Seems to be working. 🤞 😸 Merging!
Member
|
Oops, missed the fact that it has conflicts due to the other PRs that I merged. When you have a moment can you take a look at it @dragonmux ? :) |
…ntation functions
…ntation functions
This doesn't actually change the resulting binary size, so worth doing
d2b9626 to
f3950e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In this PR we address a few aspects of the SWDP and JTAG TAP routines which were less than ideal. This resulted in over 400 bytes of Flash saved and what should be much more understandable routines to maintain moving forward.
The first major thing we addressed was the type confusion (
uint8_tinstead ofbool) and inappropriate use ofintfor values that must not be negative. The second was refactoring out the delayed and non-delayed paths that can be taken. The third was creating a much higher degree of re-use and re-usability where possible with clarified names for parameters to better indicate what they do.This also applies clang-format to many of the files involved, bringing the code base closer to formatting unity.
This has been tested on a couple of flavors of STM32 target (many thanks to @mubes), and Tiva-C (JTAG and SWD) without any sign of regressions caused by it.