For example, in this Texas Instruments video, the instructor shows how to use a capacitor and a Schmitt Trigger to debounce a switch. The capacitor smooths out the rising and falling edges of a button ...
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 ...