From 9f65bf397621f22396ea97c264fee393fc07c9d4 Mon Sep 17 00:00:00 2001 From: Ian Sutton Date: Thu, 13 Dec 2018 05:59:04 -0600 Subject: [PATCH] random panel output --- seg.c | 22 +++++++++++----------- seg.h | 4 ++++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/seg.c b/seg.c index 462b03f..8af863e 100644 --- a/seg.c +++ b/seg.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -17,6 +18,8 @@ int main(int argc, char *argv[]) { + uint8_t ent[4]; + signal(SIGINT, inth); config_pins(); @@ -28,17 +31,14 @@ int main(int argc, char *argv[]) { start(); byte(0xc0 | 0x01); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - byte(0xdd); - +for(;;) { + arc4random_buf(ent, 32); + byte(ent[0]); + byte(ent[1]); + byte(ent[2]); + byte(ent[3]); + usleep(DEL); +} stop(); start(); diff --git a/seg.h b/seg.h index 0d6c8a6..a831f58 100644 --- a/seg.h +++ b/seg.h @@ -108,6 +108,10 @@ void set_pin(char *name, int state) { void config_pins() { struct gpio_pin_set *ser, *oe, *rclk, *srclk, *srclr, *dio, *clk; + /* ??? XXX wtf */ + system("gpioctl gpio2 6 set out clk"); + system("gpioctl gpio2 8 set out dio"); + ser = calloc(1, sizeof(struct gpio_pin_set)); oe = calloc(1, sizeof(struct gpio_pin_set)); rclk = calloc(1, sizeof(struct gpio_pin_set)); -- 2.41.0