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

[Feature request] Display strings and the Colon #4

Open
ganeshrvel opened this issue Mar 5, 2022 · 2 comments
Open

[Feature request] Display strings and the Colon #4

ganeshrvel opened this issue Mar 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ganeshrvel
Copy link

Feature request.

Please add strings and the colon support to the crate.

Thank you!

@igelbox
Copy link
Owner

igelbox commented Mar 5, 2022

Thank you for proposing ideas/features.

What do you mean by strings support? Could you please provide some useful example?
I cannot imaging how 4 characters displays could be useful to display strings.

As for the colon support - yeah it seems useful.

But, to be honest, I'm not sure when I will recreate the circuit to test the code afterwards. Probably, it would be better/faster if you just define some ALPHABET array (like DIGITS) and write something like print_hex in your code for now.
Also, for column workaround - you could try adding 0x80 to the code (but without a circuit I cannot tell it for sure).

@igelbox igelbox added the enhancement New feature or request label Mar 5, 2022
@ganeshrvel
Copy link
Author

ganeshrvel commented Mar 6, 2022

Got it working.

   SEG_8 = 0b10000000;

    pub fn print_hex(&mut self, address: u8, digits: &[u8], show_colon: bool) -> Res<E> {
        self.print_raw_iter(
            address,
            digits.iter().map(|digit| {
                let mut d = DIGITS[(digit & 0xf) as usize];

                if address == 1 && show_colon {
                    d |= SEG_8 as u8;
                }

                d
            }),
        )
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants