Skip to content

Commit 12069d4

Browse files
committed
Wait for USB serial at startup
1 parent 548216c commit 12069d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/GG_for_Arduino.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int gg_start(const char *title) // Arduino用GGの処理開始
3232
// コンソール用シリアルのボーレート設定(負数であればセットしない)
3333
if (gg_con_baud>0) {
3434
Serial.begin(gg_con_baud); // ArduinoのSerialをセットアップ
35+
while(!Serial) ; // Serialの準備ができるまで待つ(USBシリアル対応) 2023.11.26 M.Kogan
3536
gg_std_putc = std_putc; // ArduinoのSerialへの出力ルーチン
3637
gg_std_getc = std_getc; // ArduinoのSerialからの入力ルーチン
3738
}

0 commit comments

Comments
 (0)