From c0e52f380c0a06ccd87630ea4231c66b5976fe01 Mon Sep 17 00:00:00 2001 From: MFAshby Date: Mon, 21 May 2018 10:32:03 +0100 Subject: spelling --- unicorn/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unicorn/README.md b/unicorn/README.md index 9db2a3e..9e3d13a 100644 --- a/unicorn/README.md +++ b/unicorn/README.md @@ -1,4 +1,4 @@ -A go library for interacting with Raspberry Pi Unicorn HAT HD, with a cimilar API to the official library https://github.com/pimoroni/unicorn-hat-hd +A go library for interacting with Raspberry Pi Unicorn HAT HD, with a similar API to the official library https://github.com/pimoroni/unicorn-hat-hd Includes a simulator when running on amd64 and 386 linux PCs. @@ -21,4 +21,4 @@ func main() { uni.Show() uni.MainLoop() } -``` \ No newline at end of file +``` -- cgit v1.2.3-ZIG From 7213657a539c86dccef9446c373ba8a1ba386c20 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Mon, 21 May 2018 10:34:08 +0100 Subject: fixed real unicorns --- unicorn/RealUnicorn.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unicorn/RealUnicorn.go b/unicorn/RealUnicorn.go index fb10a79..a114c73 100644 --- a/unicorn/RealUnicorn.go +++ b/unicorn/RealUnicorn.go @@ -6,6 +6,7 @@ import ( "github.com/ecc1/spi" "log" "os" + "syscall" ) type RealUnicorn struct { @@ -65,9 +66,9 @@ func (u *RealUnicorn) Close() error { // MainLoop ... // Do nothing until SIGTERM, then close the SPI library -func MainLoop() { +func (u *RealUnicorn) MainLoop() { c := make(chan os.Signal, 2) signal.Notify(c, os.Interrupt, syscall.SIGTERM) - <- c - Close() + <-c + u.Close() } -- cgit v1.2.3-ZIG From 90aec54d0045d7a9b4ac837a03447684ecdc46e6 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Mon, 21 May 2018 10:34:56 +0100 Subject: More imports --- unicorn/RealUnicorn.go | 1 + 1 file changed, 1 insertion(+) diff --git a/unicorn/RealUnicorn.go b/unicorn/RealUnicorn.go index a114c73..b3c1df3 100644 --- a/unicorn/RealUnicorn.go +++ b/unicorn/RealUnicorn.go @@ -6,6 +6,7 @@ import ( "github.com/ecc1/spi" "log" "os" + "os/signal" "syscall" ) -- cgit v1.2.3-ZIG