From 917d541a4ea76b6cf33c691604780c128821f3bb Mon Sep 17 00:00:00 2001 From: Adrian Stevens Date: Mon, 27 Nov 2023 17:25:45 -0800 Subject: [PATCH] Update DateTime.Now in intterupt support for v1500 --- source/Meadow.Core/Hardware/BiDirectionalInterruptPort.cs | 2 +- source/Meadow.Core/Hardware/DigitalInterruptPort.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Meadow.Core/Hardware/BiDirectionalInterruptPort.cs b/source/Meadow.Core/Hardware/BiDirectionalInterruptPort.cs index d0fc07ac..e8d2742d 100644 --- a/source/Meadow.Core/Hardware/BiDirectionalInterruptPort.cs +++ b/source/Meadow.Core/Hardware/BiDirectionalInterruptPort.cs @@ -275,7 +275,7 @@ private void OnInterrupt(IPin pin, bool state) if (pin == this.Pin) { var capturedLastTime = LastEventTime; // note: doing this for latency reasons. kind of. sort of. bad time good time. all time. - this.LastEventTime = DateTime.UtcNow; + this.LastEventTime = DateTime.Now; // BC 2021.05.21 b5.0: Changed this to the new result type. // assuming that old state is just an inversion of the new state, yeah? RaiseChangedAndNotify(new DigitalPortResult(new DigitalState(state, this.LastEventTime), new DigitalState(!state, capturedLastTime))); diff --git a/source/Meadow.Core/Hardware/DigitalInterruptPort.cs b/source/Meadow.Core/Hardware/DigitalInterruptPort.cs index 549b7bb2..adfd0ac7 100644 --- a/source/Meadow.Core/Hardware/DigitalInterruptPort.cs +++ b/source/Meadow.Core/Hardware/DigitalInterruptPort.cs @@ -135,7 +135,7 @@ private void OnInterrupt(IPin pin, bool state) { // this is all to prevent new-ing up (and thereby preventing GC stuff) _oldState.Time = LastEventTime; // note: doing this for latency reasons. kind of. sort of. bad time good time. all time. - _newState.Time = this.LastEventTime = DateTime.UtcNow; + _newState.Time = this.LastEventTime = DateTime.Now; _oldState.State = !state; _newState.State = state; _interruptResult.Old = (LastEventTime == DateTime.MinValue) ? null : _oldState;