Skip to content

Commit 28a6930

Browse files
committed
Button: Handle Pinetime hardware button
The Pintime hardware button has to be enable before usage
1 parent 40cc204 commit 28a6930

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/drivers/PinMap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Pinetime {
88
// Pinetime
99
static constexpr uint8_t Charging = 12;
1010
static constexpr uint8_t Cst816sReset = 10;
11-
static constexpr uint8_t Button = 13;
11+
static constexpr uint8_t Button = 13;
1212
#elif defined(TARGET_DEVICE_P8)
1313
// COLMI P8 and variants
1414
static constexpr uint8_t Charging = 19;
@@ -18,6 +18,7 @@ namespace Pinetime {
1818
#error Invalid TARGET_DEVICE
1919
#endif
2020

21+
static constexpr uint8_t ButtonEnable = 15;
2122
static constexpr uint8_t Cst816sIrq = 28;
2223
static constexpr uint8_t PowerPresent = 19;
2324
static constexpr uint8_t Bma421Irq = 8;

src/systemtask/SystemTask.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ void SystemTask::Work() {
179179
pinConfig.is_watcher = false;
180180

181181
// Button
182+
nrf_gpio_cfg_output(PinMap::ButtonEnable);
183+
nrf_gpio_pin_set(PinMap::ButtonEnable);
182184
pinConfig.sense = NRF_GPIOTE_POLARITY_TOGGLE;
183185
pinConfig.pull = NRF_GPIO_PIN_PULLDOWN;
184186
nrfx_gpiote_in_init(PinMap::Button, &pinConfig, nrfx_gpiote_evt_handler);

0 commit comments

Comments
 (0)