The software-only solution sounds great, but if you'd rather not deal with the extra code, how about a 0.1 uf (or larger) capacitor across the input?

Regards,

Anand