Edited by supra, 12 October 2012 - 02:33 PM.
How to reset button on NGo
#1
Posted 12 October 2012 - 02:27 PM
#2
Posted 12 October 2012 - 02:38 PM
private static InterruptPort _ResetButton = new InterruptPort(Pins.Button, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh); public static void Main() { _ResetButton.OnInterrupt += delegate(uint PinId, uint Value, DateTime Time) { Debug.Print("RESET pressed"); PowerState.RebootDevice(true); }; _ResetButton.EnableInterrupt(); // Your code here :-) }
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#3
Posted 12 October 2012 - 02:47 PM
it is ok with this?
InterruptPort button = new InterruptPort(Pins.Button,false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
#4
Posted 12 October 2012 - 02:49 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#5
Posted 13 October 2012 - 10:16 AM
--
Asbjørn
#6
Posted 13 October 2012 - 11:31 AM
glitch filter?, is that some debouncing?, is that built into .netmf or the chip?
It have no clue if it's in the MCU or in the .netmf, but if it is the latter it's deep inside...
If you pass the value true in the glitchFilter parameter when creating an InputPort, it can "debounce" the attached switch. The exact time that determines whether or not a pair of signals is considered a bounce is controllable with Cpu.GlitchFilterTime value. A pair of signals that appears within the specified interval will be ignored by the InterruptPort.
Funny this info is now in a thread where it actually don't matter much, we are resetting the MCU, but for every other button that generates interrupts, or should I say, one interrupt.
- Ulrik
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users