We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84410c0 commit 797f39cCopy full SHA for 797f39c
src/bridge.h
@@ -142,13 +142,16 @@ class BridgeClass {
142
}
143
144
// Initialize the bridge
145
- bool begin(unsigned long baud=DEFAULT_SERIAL_BAUD) {
+ bool begin(unsigned long baud=DEFAULT_SERIAL_BAUD, const uint32_t timeout=0) {
146
147
init();
148
149
if (is_started()) return true;
150
151
+ uint8_t start = k_uptime_get_32();
152
+
153
while (!ready()) {
154
+ if (timeout>0 && (k_uptime_get_32()-start)>timeout) break;
155
k_sleep(K_MSEC(10));
156
157
0 commit comments