Remove power button bind
This commit is contained in:
parent
8375e3c617
commit
c6ce7d766c
@ -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.<br><br>
|
If moving to an alternate directory, ensure the c/libs/libgo_p2fa.so is copied.<br><br>
|
||||||
To enable the i2c device, add the following to the bottom of /boot/firmware/config.txt<br>
|
To enable the i2c device, add the following to the bottom of /boot/firmware/config.txt<br>
|
||||||
```text
|
```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<br>
|
||||||
|
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
|
Set GPIO pins
|
||||||
```bash
|
```bash
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#define BUTTON_SELECT 27
|
#define BUTTON_SELECT 27
|
||||||
#define BUTTON_ALT 22
|
#define BUTTON_ALT 22
|
||||||
#define BUTTON_BACK 6
|
#define BUTTON_BACK 6
|
||||||
#define BUTTON_POWER 20
|
//#define BUTTON_POWER 20
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int gpio_pin;
|
int gpio_pin;
|
||||||
@ -40,10 +40,10 @@ ButtonMap button_map[] = {
|
|||||||
{BUTTON_SELECT, 's'},
|
{BUTTON_SELECT, 's'},
|
||||||
{BUTTON_ALT, 'a'},
|
{BUTTON_ALT, 'a'},
|
||||||
{BUTTON_BACK, 'b'},
|
{BUTTON_BACK, 'b'},
|
||||||
{BUTTON_POWER, 'p'},
|
// {BUTTON_POWER, 'p'},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_BUTTONS 8
|
#define NUM_BUTTONS 7
|
||||||
|
|
||||||
struct gpiod_chip *chip;
|
struct gpiod_chip *chip;
|
||||||
struct gpiod_line *line_pointers[NUM_BUTTONS];
|
struct gpiod_line *line_pointers[NUM_BUTTONS];
|
||||||
|
Loading…
Reference in New Issue
Block a user