https://developer.mbed.org/teams/WizziLab/code/DebouncedInterrupt/#2df374d23986