summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--multiplexer.c8
-rw-r--r--multiplexer.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/multiplexer.c b/multiplexer.c
index db1c572..50da183 100644
--- a/multiplexer.c
+++ b/multiplexer.c
@@ -92,14 +92,18 @@ void *put_on_display(void *param)
break;
}
for (column=0; column<8; column++) {
- GPIO_CLR = 1<<SER_CLK_PIN;
GPIO_ALTER(column + line == 7) = 1<<SER_DAT_PIN;
+ GPIO_CLR = 1<<SER_CLK_PIN;
+ wait_tpic_settle_time
GPIO_SET = 1<<SER_CLK_PIN;
+ wait_tpic_settle_time
}
for (column=39; column>=0; column--) {
- GPIO_CLR = 1<<SER_CLK_PIN;
GPIO_ALTER(display_data -> buf[display_data -> is_buf][column] & (0x01 << line)) = 1<<SER_DAT_PIN;
+ GPIO_CLR = 1<<SER_CLK_PIN;
+ wait_tpic_settle_time
GPIO_SET = 1<<SER_CLK_PIN;
+ wait_tpic_settle_time
#endif // SKIP_GPIO
}
#ifdef SKIP_GPIO
diff --git a/multiplexer.h b/multiplexer.h
index 738d6ad..4f94f17 100644
--- a/multiplexer.h
+++ b/multiplexer.h
@@ -49,6 +49,8 @@ static uint8_t gpioToPUDCLK [] =
#define SCROLL_BUF_LEN 4096
+#define wait_tpic_settle_time for (int i=0; i<100; i++) { asm volatile("" : : "r" (i)); }
+
int mem_fd;
void *gpio_map;