[2.0.x] M43 & LPC176x - the real fix (PR #13568 was wrong) #13587
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.
I got it wrong on PR #13568. M43's Toggle and Watch utilizes were not working because the PARSED_PIN_INDEX function was not handling the default conditions properly.
The PR #13568 changes have already been backed out.
PARSED_PIN_INDEX scans the command line for code and returns an index into the pin map. If the code is found and the pin is valid then the index for the pin is returned. It returns the default if the code is not found or the pin is not valid.
PARSED_PIN_INDEX changes:
const uint16_t val = (uint16_t)parser.intval(code, -1), port = val / 100, pin = val % 100;
return ind > -1 ? ind : dval;
Additional changes were needed to make the M43 toggle utility work reliably with a LPC176x: