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

epaperdisplay: fix delay when two_byte_sequence_length is true #9694

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shared-module/epaperdisplay/EPaperDisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void send_command_sequence(epaperdisplay_epaperdisplay_obj_t *self,
uint16_t delay_length_ms = 0;
if (delay) {
data_size++;
delay_length_ms = *(cmd + 1 + data_size);
delay_length_ms = *(cmd + 1 + data_size + self->two_byte_sequence_length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks -- I think I understand why the existing code is wrong, but maybe you want to have it as delay_length_ms = *(data + data_size) so that it always refers to the next byte after the end of data. I think that's clearer overall, and might even result in smaller generated code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do *(data+datasize), but then I think we have to move the increment of data_size to after reading delay_length_ms. I can try this out this evening and update the PR.

if (delay_length_ms == 255) {
delay_length_ms = 500;
}
Expand Down
Loading