From 861d7211aa5b4b1d07b9a7845b334e03cd1aa4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Rasmussen?= Date: Mon, 17 Jun 2024 17:47:25 +0200 Subject: [PATCH] Use GPIO 17/27 depending on architecture --- internal/hw/gpio.go | 10 ---------- internal/hw/pins_arm.go | 15 +++++++++++++++ internal/hw/pins_others.go | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 internal/hw/pins_arm.go create mode 100644 internal/hw/pins_others.go diff --git a/internal/hw/gpio.go b/internal/hw/gpio.go index 1dac18f..07dda03 100644 --- a/internal/hw/gpio.go +++ b/internal/hw/gpio.go @@ -7,16 +7,6 @@ import ( ) const ( - pinDoorOpen = 17 - pinFanPower = 22 - pinCoolerPower = 23 - pinHeaterPower = 24 - pinLightsPower = 25 - - // GPIO21 is located at pin 13 on RPi 1B rev 1. Rev 2 and never boards - // has GPIO27 here. - pinOneWirePower = 21 - off = 0 on = 1 ) diff --git a/internal/hw/pins_arm.go b/internal/hw/pins_arm.go new file mode 100644 index 0000000..5c07f23 --- /dev/null +++ b/internal/hw/pins_arm.go @@ -0,0 +1,15 @@ +//go:build arm + +package hw + +const ( + pinDoorOpen = 17 + pinFanPower = 22 + pinCoolerPower = 23 + pinHeaterPower = 24 + pinLightsPower = 25 + + // GPIO21 is located at pin 13 on RPi 1B rev 1. Rev 2 and never boards + // has GPIO27 here. + pinOneWirePower = 21 +) diff --git a/internal/hw/pins_others.go b/internal/hw/pins_others.go new file mode 100644 index 0000000..0893eb7 --- /dev/null +++ b/internal/hw/pins_others.go @@ -0,0 +1,15 @@ +//go:build !arm + +package hw + +const ( + pinDoorOpen = 17 + pinFanPower = 22 + pinCoolerPower = 23 + pinHeaterPower = 24 + pinLightsPower = 25 + + // GPIO21 is located at pin 13 on RPi 1B rev 1. Rev 2 and never boards + // has GPIO27 here. + pinOneWirePower = 27 +)