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

Bugs EV3UARTEmulation soft EV3UARTEmulation hard cpp #18

Open
tom-eilers-nl opened this issue Jan 30, 2020 · 0 comments
Open

Bugs EV3UARTEmulation soft EV3UARTEmulation hard cpp #18

tom-eilers-nl opened this issue Jan 30, 2020 · 0 comments

Comments

@tom-eilers-nl
Copy link

Sorry for my bad documentation of the DATA32 and DATAF bugs in the EV3UARTEmulation soft and hard.cpp

The code was:

void EV3UARTEmulation::send_data32(long l) {
byte bb[4];
for(int i=0;i<4;i++) {
bb[i] = (l >> (i * 8)) && 0xff;
}
send_cmd(CMD_DATA | (2 << CMD_LLL_SHIFT) | current_mode, bb, 4);
}

The code must be:

void EV3UARTEmulation::send_data32(long l) {
byte bb[4];
bb[0] = l & 0xFF;
bb[1] = (l >> 8) & 0xFF;
bb[2] = (l >> 16) & 0xFF;
bb[3] = (l >> 24) & 0xFF;
send_cmd(CMD_DATA | (2 << CMD_LLL_SHIFT) | current_mode, bb, 4);
}

New_EV3Uartemulation_cpp_files.zip

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