Skip to content

Commit 1f0a5be

Browse files
biagiomsys_maker
authored and
sys_maker
committed
Fix for USB virtual serial port in sketches of CurieI2S library
Since Arduino/Genuino 101 uses USB native port, wait for the Serial port to open before executing the next lines of code to not lose serial data already sent to the Serial monitor Signed-off-by: Biagio Montaruli <[email protected]>
1 parent e76e953 commit 1f0a5be

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

libraries/CurieI2S/examples/I2SDMA_RXCallBack/I2SDMA_RXCallBack.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ uint32_t loop_count = 0; // record the higher 16 bits of received data
3737
uint32_t shift_count = 0; // the position of first non-zero
3838
void setup()
3939
{
40-
Serial.begin(115200);
41-
while(!Serial);
40+
Serial.begin(115200); // initialize Serial communication
41+
while(!Serial) ; // wait for serial port to connect.
4242
Serial.println("CurieI2SDMA Rx Callback");
4343

4444
CurieI2SDMA.iniRX();
@@ -119,4 +119,4 @@ void loop()
119119
License along with this library; if not, write to the Free Software
120120
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-
121121
1301 USA
122-
*/
122+
*/

libraries/CurieI2S/examples/I2SDMA_TXCallBack/I2SDMA_TXCallBack.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ uint32_t dataBuff[BUFF_SIZE];
1515
uint32_t loop_count = 0;
1616
void setup()
1717
{
18-
Serial.begin(115200);
19-
while(!Serial);
18+
Serial.begin(115200); // initialize Serial communication
19+
while(!Serial) ; // wait for serial port to connect.
2020
Serial.println("CurieI2SDMA Tx Callback");
2121

2222
CurieI2SDMA.iniTX();

libraries/CurieI2S/examples/I2S_RxCallback/I2S_RxCallback.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ volatile int count = 0;
2323
void setup()
2424
{
2525
// put your setup code here, to run once:
26-
Serial.begin(115200);
27-
while(!Serial);
26+
Serial.begin(115200); // initialize Serial communication
27+
while(!Serial) ; // wait for serial port to connect.
2828
Serial.println("CurieI2S Rx Callback Example");
2929
CurieI2S.begin(I2S_44K, I2S_32bit);
3030
CurieI2S.setI2SMode(PHILIPS_MODE);

libraries/CurieI2S/examples/I2S_TxCallback/I2S_TxCallback.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
void setup()
88
{
9-
Serial.begin(115200);
10-
while(!Serial);
9+
Serial.begin(115200); // initialize Serial communication
10+
while(!Serial) ; // wait for serial port to connect.
1111
Serial.println("CurieI2S Tx Callback");
1212
CurieI2S.begin(I2S_44K, I2S_32bit);
1313
CurieI2S.setI2SMode(PHILIPS_MODE);

0 commit comments

Comments
 (0)