QUESTIONS: (main.c) trying to get the user button and led to work:
While Debugging these two lines I notices an interesting phenomenon:
/*Configure user button PC13*/
GPIOC->CRH &= 0xFF0FFFFF; //reset CNF and MODE only for bit 13, leave all the rest as they are
GPIOC->CRH |= 0x00800000; //enable input with pull-up/ pull-down reset IDR bit 13 (see reference manual 9.2.2)
As implied GPIOC->IDR bit 13 is indeed reset to 0.
/*Configure led PA5*/
GPIOA->CRL &= 0xFF0FFFFF; //reset CNF and MODE only for bit 5, leave all the rest as they are
GPIOA->CRL |= 0x00200000; //PA5 configured to General purpose output push-pull | Output mode, max speed 2 MHz
But after these two lines, it is set back to 1. Why does that happen?
QUESTIONS: (main.c) trying to get the user button and led to work: While Debugging these two lines I notices an interesting phenomenon:
As implied GPIOC->IDR bit 13 is indeed reset to 0.
But after these two lines, it is set back to 1. Why does that happen?