示例#1
0
 internal PinValueBase(GpioPinState state, bool digitalValue, GpioPinMode pinMode, PinEventState eventState)
 {
     State        = state;
     DigitalValue = digitalValue;
     PinMode      = pinMode;
     EventState   = eventState;
 }
示例#2
0
 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);
        }
示例#4
0
 internal PreviousValue(GpioPinState state, bool digitalValue, GpioPinMode pinMode, PinEventState eventState) : base(state, digitalValue, pinMode, eventState)
 {
 }