Skip to content

Commit 5743a41

Browse files
committed
refactor(arduino): Defer error handling to user sketch layer.
When `CRSFforArduino::begin()` fails, it is up to the programmer to decide how these errors are best handled.
1 parent 105c0e6 commit 5743a41

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/channels/channels.ino

+8-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ void setup()
118118
}
119119

120120
// Initialize the CRSFforArduino library.
121-
crsf.begin();
121+
if (!crsf.begin())
122+
{
123+
Serial.println("CRSF for Arduino initialization failed!");
124+
while (1)
125+
{
126+
;
127+
}
128+
}
122129

123130
// Show the user that the sketch is ready.
124131
Serial.println("RC Channels Example");

0 commit comments

Comments
 (0)