GPIO set certain bits without affecting others
BTW, what is the forum to ask general programming questions on STM32 architecture?
STM32F103C8Tx
I have two timer interrupt routines, sharing the
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim)call. Depending on which handle is passed, I process the code for TIM1 or TIM3.
When I enter TIM3 code A0,A1,A2,and A3 of port GPIOA are set to all 1. I achieved this by the statement
GPIOA->ODR=0xffff on initialization and whenever I exit the ISR. On entry I set GPIOA->ODR=0xffff&(~1)
(the 1 is a rotating pattern that sets A0-A3).
Now I want to toggle A4 in the code for TIM1 without affecting bits A0-A3 and A4 shouldn't be affected during the manipulation of A0-A3 in the code for TIM3.
How can I achieve this if at all?
