Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.x] M43 & LPC176x - the real fix (PR #13568 was wrong) #13587

Merged

Conversation

Bob-the-Kuhn
Copy link
Contributor

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:

  • Adding -1 results in getting the default when the code is not present. const uint16_t val = (uint16_t)parser.intval(code, -1), port = val / 100, pin = val % 100;
  • Changing to -1 results in getting the default value if an invalid pin is specified. return ind > -1 ? ind : dval;

Additional changes were needed to make the M43 toggle utility work reliably with a LPC176x:

  • Toggling the three USB pins causes hangs & disconnects. The M43_NEVER_TOUCH macro was added to cover this.
  • Random hangs and disconnects were occurring when the WDT was enabled. WDT resets were added to minimize. this.

@Bob-the-Kuhn Bob-the-Kuhn changed the title [2.0.x] M43 & LP176x - the real fix (PR #13568 was wrong) [2.0.x] M43 & LPC176x - the real fix (PR #13568 was wrong) Apr 5, 2019
@Bob-the-Kuhn Bob-the-Kuhn added PR: Bug Fix T: HAL & APIs Topic related to the HAL and internal APIs. labels Apr 5, 2019
@thinkyhead thinkyhead merged commit 9a56d90 into MarlinFirmware:bugfix-2.0.x Apr 6, 2019
@hectori4502
Copy link

M43 Still halt the printer

@Bob-the-Kuhn
Copy link
Contributor Author

@hectori4502 - sounds like you need to disable the WDT.

@hectori4502
Copy link

Thanks Bob-the-kuhn.
//#define USE_WATCHDOG
I will test.
Thanks.

@hectori4502
Copy link

I get Compile ERROR
can you tell me how to disable WDT.
thanks.

thinkyhead added a commit that referenced this pull request Apr 10, 2019
@thinkyhead
Copy link
Member

Compile error is now patched.

@Bob-the-Kuhn Bob-the-Kuhn deleted the M43-the-real-fix branch April 13, 2019 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Bug Fix T: HAL & APIs Topic related to the HAL and internal APIs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants