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

Command ID sign mismatch #8

Open
kierdavis opened this issue Jan 29, 2018 · 0 comments
Open

Command ID sign mismatch #8

kierdavis opened this issue Jan 29, 2018 · 0 comments

Comments

@kierdavis
Copy link
Member

kierdavis commented Jan 29, 2018

Command IDs sent to the Arduino which are greater than 32767 will be returned as negative values instead (i.e. Arduino is implicitly casting an unsigned 16-bit int to a signed 16-bit int).

robotd log:

: Sending to servo assembly: b'@64015 gpio-read 10\n'
: Got back from servo: b'# @64015 gpio-read 10\n'
: Got back from servo: b'@-1521 > low\r\n'
: Got back from servo: b'@-1521 + OK\r\n'

robotd works around this because it bitwise ANDs returned command IDs with 0xFFFF before examining them, but it would be nice if servo-firmware didn't do this in the first place.

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

No branches or pull requests

1 participant