Skip to content

Commander: parse once, improve parsing - #598

Open
Moddingear wants to merge 1 commit into
simplefoc:devfrom
Moddingear:commander_parse_once
Open

Moddingear wants to merge 1 commit into
simplefoc:devfrom
Moddingear:commander_parse_once

Conversation

@Moddingear

@Moddingear Moddingear commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Current parser parses anywhere between 1 to 3 times a command. Also it uses atof (double) instead of atoff (float).

It can also be thrown off by commands coming in too fast, so it ends up getting malformed commands, and unpacking a wrong value.

This makes sure that the unpacked command is correctly formed (letter then (optional) value then newline), and only parsed once. Anything before is discarded.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested on Phoque2 as part of a bigger set of changes.

@askuric

askuric commented Nov 25, 2026

Copy link
Copy Markdown
Member

Ok looks nice.
Did you test it with the webcontroller/some other ui?
Are all features functional?

Like for example monitoring variable setting?

@Moddingear

Copy link
Copy Markdown
Collaborator Author

@askuric Yep, tested with my UI, it works like before. I didn't test with the webui since Firefox doesn't have support for webserial.

@Moddingear
Moddingear force-pushed the commander_parse_once branch 3 times, most recently from 0084864 to f216356 Compare November 26, 2026 10:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants