This repository was archived by the owner on Apr 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,13 @@ bool axp209_init(void) {
6060 }
6161 }
6262
63- /* Set N_OE Shutdown delay to 3S*/
63+ /* Set PEK Long press delay to 2.5s*/
64+ err = i2c_smbus_write_byte_data (fd_axp209 , AXP209_REG_PEK_PARAMS , 0x9F );
65+ if (err < 0 ){
66+ printf ("ERROR Setting AXP209 PEK Long press delay to 2.5s\n" );
67+ }
68+
69+ /* Set N_OE Shutdown delay to 3s*/
6470 err = i2c_smbus_write_byte_data (fd_axp209 , AXP209_REG_32H , 0x47 );
6571 if (err < 0 ){
6672 printf ("ERROR Setting AXP209 N_OE Shutdown delay to 3S\n" );
Original file line number Diff line number Diff line change 1515
1616// Chip registers adresses
1717#define AXP209_REG_32H 0x32
18+ #define AXP209_REG_PEK_PARAMS 0x36
1819#define AXP209_INTERRUPT_BANK_1_ENABLE 0x40
1920#define AXP209_INTERRUPT_BANK_1_STATUS 0x48
2021#define AXP209_INTERRUPT_BANK_2_ENABLE 0x41
Original file line number Diff line number Diff line change 5454
5555#define KEY_IDX_MAPPED_FOR_SHORT_PEK_PRESS 16 //KEY_Q
5656#define KEY_IDX_MAPPED_FOR_LONG_PEK_PRESS 28 //KEY_ENTER
57+ #define SHELL_CMD_LONG_PEK_PRESS "poweroff"
5758
5859
5960/****************************************************************
@@ -410,7 +411,9 @@ int listen_gpios_interrupts(void)
410411 }
411412 if (val_int_bank_3 & AXP209_INTERRUPT_PEK_LONG_PRESS ){
412413 GPIO_PRINTF (" AXP209 long PEK key press detected\n" );
413- sendKeyAndStopKey (KEY_IDX_MAPPED_FOR_LONG_PEK_PRESS );
414+ //sendKeyAndStopKey(KEY_IDX_MAPPED_FOR_LONG_PEK_PRESS); SHELL_CMD_LONG_PEK_PRESS
415+ GPIO_PRINTF ("Apply mapping activation fct: shell command \"%s\"\n" , SHELL_CMD_LONG_PEK_PRESS );
416+ system (SHELL_CMD_LONG_PEK_PRESS );
414417 }
415418 }
416419#endif //ENABLE_AXP209_INTERRUPTS
You can’t perform that action at this time.
0 commit comments