summaryrefslogtreecommitdiff
path: root/multiplexer.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-10-29 09:29:55 +0100
committerErich Eckner <git@eckner.net>2018-10-29 09:29:55 +0100
commitd5d1f76a0b8fb1603f509e1296e9a29bf5dfa879 (patch)
tree1d69db3aa2f120293c9e078d9081ada8ebdbe2a0 /multiplexer.c
parent71e97ec2bc954e57b6955b3ec3fc49379116efc7 (diff)
downloadanzeige-d5d1f76a0b8fb1603f509e1296e9a29bf5dfa879.tar.xz
multiplexer.c: cleanup
Diffstat (limited to 'multiplexer.c')
-rw-r--r--multiplexer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/multiplexer.c b/multiplexer.c
index 52c7af1..641e2ce 100644
--- a/multiplexer.c
+++ b/multiplexer.c
@@ -73,10 +73,10 @@ void *put_on_display(void *param)
for (line=0; line<7; line++) {
#ifdef SKIP_GPIO
for (column=0; column<40; column++) {
- if ((*(display_data -> buf[display_data -> is_buf] + column)>>line) & 0x01)
+ if (display_data -> buf[display_data -> is_buf][column] & (0x01 << line))
printf("X");
else
- printf(".");
+ printf(" ");
#else
GPIO_CLR = 1<<GATE_PIN; // Licht an
for (column=0; column<8; column++) {
@@ -88,8 +88,8 @@ void *put_on_display(void *param)
}
for (column=39; column>=0; column--) {
GPIO_CLR = 1<<SER_CLK_PIN;
- GPIO_ALTER((*(display_data -> buf[display_data -> is_buf] + column)>>line) & 0x01) = 1<<SER_DAT_PIN;
- usleep(250);
+ GPIO_ALTER(display_data -> buf[display_data -> is_buf][column] & (0x01 << line)) = 1<<SER_DAT_PIN;
+ usleep(5);
GPIO_SET = 1<<SER_CLK_PIN;
usleep(250);
#endif