You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright (c) 2024 The nanoFramework project contributors
2
+
// See LICENSE file in the project root for full license information.
3
+
4
+
usingSystem.Device.Gpio;
5
+
usingSystem.Threading;
6
+
7
+
namespaceIot.Device.EPaper.Utilities
8
+
{
9
+
internalstaticclassGpioPinExtensions
10
+
{
11
+
/// <summary>
12
+
/// Blocks the current thread until the pin value equals the desired value.
13
+
/// </summary>
14
+
/// <param name="pin">The GPIO pin to wait on.</param>
15
+
/// <param name="desiredValue">The desired value of the pin to continue thread execution.</param>
16
+
/// <param name="cancellationToken">The <see cref="CancellationTokenSource"/> to use to cancel blocking the thread if needed.</param>
17
+
/// <returns><see langword="true"/> if the waiting ended with the pin changing to the desired value. <see langword="false"/> if the wait ended due to timeout.</returns>
18
+
/// <remarks>Use the <paramref name="cancellationToken"/> as a way to cancel the wait after some time if needed.</remarks>
0 commit comments