Skip to content

Commit ffc3c4a

Browse files
pdgendtcfriedt
authored andcommitted
samples: boards: nxp: mimxrt1060_evk: system_off: Fix GPIO config
A pull-up should be described in hardware (device tree) instead of software. Also interrupt on edges instead of the level. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent bf6b76a commit ffc3c4a

File tree

1 file changed

+2
-3
lines changed
  • samples/boards/nxp/mimxrt1060_evk/system_off/src

1 file changed

+2
-3
lines changed

samples/boards/nxp/mimxrt1060_evk/system_off/src/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@ int main(void)
4141
}
4242

4343
/* Configure to generate PORT event (wakeup) on button press. */
44-
/* No external pull-up on the user button, so configure one here */
45-
int ret = gpio_pin_configure_dt(&button, GPIO_INPUT | GPIO_PULL_UP);
44+
int ret = gpio_pin_configure_dt(&button, GPIO_INPUT);
4645

4746
if (ret != 0) {
4847
printk("Error %d: failed to configure %s pin %d\n", ret, button.port->name,
4948
button.pin);
5049
return 0;
5150
}
5251

53-
ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_LEVEL_LOW);
52+
ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE);
5453
if (ret != 0) {
5554
printk("Error %d: failed to configure interrupt on %s pin %d\n", ret,
5655
button.port->name, button.pin);

0 commit comments

Comments
 (0)