From: Ian Sutton Date: Thu, 13 Dec 2018 11:59:04 +0000 (-0600) Subject: random panel output X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f65bf397621f22396ea97c264fee393fc07c9d4;p=bort-panel.git random panel output --- 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));