STM32F103R6 (Cortex-M3) trouble with rising edge detection
In general, using noisy pushbuttons directly with interrupts may not be a good idea. What may happen in this case is that it thinks first edge already is pending when you enable interrupts. And due to noise, both falling and rising edge interrupts get latched as pending. Perhaps most important is to know that if no interrupts has happened, button state has not changed. When interrupt has happened, button state has glitched but if you wait for some time without new intetrupts you can believe that it has stabilized. You may want to disable further interrupts for the stabilization period. And a timer can be useful for determining time or actually executing the button callback in timer interrupt if further interrupts do not restart it. It all depends on if you want to just use pushbuttons, or use pushbutton to simulate interrupt signals.