This software approach uses both external and timer interrupt. Buttons are initialized as GPIO_EXTI. Remember PA8 and PC8 will be interpreted by CPU as the same interrupt source. From datasheet read ...