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

i8080.set_byte_order seems to be incorrect starting 0.21.0 #2362

Open
yanshay opened this issue Oct 16, 2024 · 2 comments · May be fixed by #2487
Open

i8080.set_byte_order seems to be incorrect starting 0.21.0 #2362

yanshay opened this issue Oct 16, 2024 · 2 comments · May be fixed by #2487
Assignees
Labels
bug Something isn't working
Milestone

Comments

@yanshay
Copy link
Contributor

yanshay commented Oct 16, 2024

application using i8080 stopped working starting esp-hal 0.21.0.
Detailed discussion regarding the issue: #2352 .

Findings are this is due to change made in set_byte_order which the application relies on.
In 0.21.0 the function change the byte ordering for both the 8bits and the 16bits case.
Prior to that the change was made depending on what the word size of the data is.
Seems like doing both changes in either case doesn't work well, at least for 8 bits i8080 and can't send the data properly to the device with if changing the byte order using set_byte_order.

0.20.0 code:

   pub fn set_byte_order(&mut self, byte_order: ByteOrder) -> &mut Self {
        let is_inverted = byte_order != ByteOrder::default();
        self.lcd_cam.lcd_user().modify(|_, w| {
            if size_of::<P::Word>() == 2 {
                w.lcd_byte_order().bit(is_inverted)
            } else {
                w.lcd_8bits_order().bit(is_inverted)
            }
        });
        self
    }

0.20.1 code:

    pub fn set_byte_order(&mut self, byte_order: ByteOrder) -> &mut Self {
        let is_inverted = byte_order != ByteOrder::default();
        self.lcd_cam.lcd_user().modify(|_, w| {
            w.lcd_byte_order().bit(is_inverted);               /// <- the line causing the issue in 8 bits case
            w.lcd_8bits_order().bit(is_inverted)
        });
        self
    }
@yanshay yanshay added bug Something isn't working status:needs-attention This should be prioritized labels Oct 16, 2024
@MabezDev MabezDev added this to the 0.22.0 milestone Oct 18, 2024
@MabezDev MabezDev removed the status:needs-attention This should be prioritized label Oct 18, 2024
@Dominaezzz Dominaezzz self-assigned this Oct 20, 2024
@MabezDev
Copy link
Member

MabezDev commented Nov 7, 2024

@Dominaezzz sorry for the ping, the milestone is near its end, do you still plan on fixing this, or shall I re-assign?

@Dominaezzz
Copy link
Collaborator

Yes I'll take care of it

@Dominaezzz Dominaezzz linked a pull request Nov 7, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants