diff --git a/README.md b/README.md index 240cfb2..0dc3b37 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,10 @@ Executable will be in the "c" directory If moving to an alternate directory, ensure the c/libs/libgo_p2fa.so is copied.

To enable the i2c device, add the following to the bottom of /boot/firmware/config.txt
```text -dtoverlay=i2c-rtc,ds3231 +dtoverlay=i2c-rtc,ds3231,gpio-shutdown,gpio_pin=20,active_low=1,gpio_pull=up ``` -Reference [this walk through](https://pimylifeup.com/raspberry-pi-rtc/) for more info +Reference [this walk through](https://pimylifeup.com/raspberry-pi-rtc/) for more info
+Reference [this walk through](https://howchoo.com/pi/how-to-add-a-power-button-to-your-raspberry-pi/) to configure the power button. Make sure to use GPIO pin 20 instead of 3 Set GPIO pins ```bash diff --git a/c/src/p2fa.c b/c/src/p2fa.c index 12a4aad..ff09ed0 100644 --- a/c/src/p2fa.c +++ b/c/src/p2fa.c @@ -25,7 +25,7 @@ #define BUTTON_SELECT 27 #define BUTTON_ALT 22 #define BUTTON_BACK 6 -#define BUTTON_POWER 20 +//#define BUTTON_POWER 20 typedef struct { int gpio_pin; @@ -40,10 +40,10 @@ ButtonMap button_map[] = { {BUTTON_SELECT, 's'}, {BUTTON_ALT, 'a'}, {BUTTON_BACK, 'b'}, - {BUTTON_POWER, 'p'}, +// {BUTTON_POWER, 'p'}, }; -#define NUM_BUTTONS 8 +#define NUM_BUTTONS 7 struct gpiod_chip *chip; struct gpiod_line *line_pointers[NUM_BUTTONS];