1. #include "exynos_4412.h"
    2. int main()
    3. {
    4. /*将GPX1_1设置成输入功能*/
    5. GPX1.CON = GPX1.CON & (~(0xF << 4));
    6. while(1)
    7. {
    8. /*判断GPX1_1引脚的状态,即判断按键是否按下*/
    9. if(!(GPX1.DAT & (1 << 1)))
    10. {
    11. printf("Key2 Pressed\n");
    12. /*等待松手*/
    13. while(!(GPX1.DAT & (1 << 1)));
    14. }
    15. else
    16. {
    17. }
    18. }
    19. return 0;
    20. }