Re: [PATCH v4 32/32] auxdisplay: add a driver for lcd2s character display
From: Miguel Ojeda
Date: Thu Oct 15 2020 - 23:30:11 EST
On Mon, Oct 5, 2020 at 3:01 PM <poeschel@xxxxxxxxxxx> wrote:
>
> + while (*esc && i < LCD2S_CHARACTER_SIZE + 2) {
> + shift ^= 4;
> + if (*esc >= '0' && *esc <= '9') {
> + value |= (*esc - '0') << shift;
> + } else if (*esc >= 'A' && *esc <= 'Z') {
> + value |= (*esc - 'A' + 10) << shift;
> + } else if (*esc >= 'a' && *esc <= 'z') {
> + value |= (*esc - 'a' + 10) << shift;
This should also probably use hex_to_bin() or similar (see my other
comment on patch 24) and/or share the implementation as much as
possible.
Cheers,
Miguel