internal PinValueBase(GpioPinState state, bool digitalValue, GpioPinMode pinMode, PinEventState eventState) { State = state; DigitalValue = digitalValue; PinMode = pinMode; EventState = eventState; }
internal PinEventConfiguration(int gpioPin, PinEventState eventState, CurrentValue currentValue, PreviousValue previousValue, CancellationTokenSource?token = default) { GpioPin = gpioPin; EventState = eventState; EventToken = token == null ? new CancellationTokenSource() : token; Current = currentValue; Previous = previousValue; }
private async Task ParallelExecuteOnEach(PinEventState state, Action <IPinEvent> action) { var tasks = new List <Task>(); for (int i = 0; i < LoadablePinEvents.Count; i++) { tasks.Add(new Task(() => action(LoadablePinEvents[i]))); } await Helpers.InParallel(tasks).ConfigureAwait(false); }
internal PreviousValue(GpioPinState state, bool digitalValue, GpioPinMode pinMode, PinEventState eventState) : base(state, digitalValue, pinMode, eventState) { }