How to run a function after power key press?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to run a function after power key press?

680件の閲覧回数
sujay1
Contributor V

I'm using am imx6slevk with yocto bsp, on leaving the board idle for 10 minutes the console goes off(wait mode) and it turns back on when I press the power button,

The requirement is to run a function when the power button is pressed (the function merely turns on 2 gpios). 

I'm not sure how to detect a power key press and which header file to include for the same, does anyone have any idea how to integrate this?

Thanks in advance

0 件の賞賛
1 返信

607件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Sujay

one can look at gpio interrupt examples

https://community.nxp.com/thread/474144 

How to enable GPIO1 on X27 to act as an interrupt handler for max14830? - Toradex Community 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛