MediaTek-Labs / mt3620_m4_software

mt3620_m4_driver
Other
32 stars 29 forks source link

[Question] GPIO Interrupt on M4 #26

Closed Visit-Learn closed 4 years ago

Visit-Learn commented 4 years ago

Hi,

I check your sample code for GPIO (MT3620_RTApp_FreeRTOS_GPIO), and I found that is using polling method to know the button is pressed or not; but I think that using GPIO interrupt is more suitable for MCU limited resource. Could I know there has material or sample code to describe it? Thank you so much.

kevinwh-chou commented 4 years ago

Hi,

You're right, but for the moment external interrupt function is not supported in Azure Sphere OS firewall configuration, so in the sample it uses the polling method instead of receiving an external interrupt, as the latter is not available yet.

Visit-Learn commented 4 years ago

Hi,

Got it, thank you so much.

kevinwh-chou commented 4 years ago

You're welcome! Besides that, the purpose of that GPIO sample code is to demonstrate the basic GPIO functions, like reading a state or setting an output state, so it reads a state from the button and outputs a state at LED just as the example.