Skip to content

Commit ddc326e

Browse files
committed
validation Studio projects update
Signed-off-by: Thibaut VIARD <thibaut.viard@atmel.com>
1 parent df1262a commit ddc326e

File tree

8 files changed

+129
-129
lines changed

8 files changed

+129
-129
lines changed

cores/validation/validation_I2C_I01/test.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ uint8_t a, b;
2525

2626
void setup()
2727
{
28-
Serial5.begin( 115200 );
29-
Serial5.println("Wire init");
28+
SERIAL_PORT_MONITOR.begin( 115200 );
29+
SERIAL_PORT_MONITOR.println("Wire init");
3030
Wire.begin();
3131
}
3232

@@ -39,8 +39,8 @@ void loop()
3939
delay(100);
4040

4141
Wire.requestFrom(addressTemp, 2);
42-
Serial5.print((char)13);
43-
Serial5.print("Temperature : ");
42+
SERIAL_PORT_MONITOR.print((char)13);
43+
SERIAL_PORT_MONITOR.print("Temperature : ");
4444

4545
a = Wire.read();
4646
b = Wire.read();
@@ -49,5 +49,5 @@ void loop()
4949
temp |= a;
5050
temp >>= 7;
5151

52-
Serial5.print(temp);
52+
SERIAL_PORT_MONITOR.print(temp);
5353
}

cores/validation/validation_I2C_LCD/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LiquidCrystal_I2C lcd(0x27, 16, 2);
2323

2424
void setup()
2525
{
26-
Serial5.begin( 9600 ) ;
26+
SERIAL_PORT_MONITOR.begin( 9600 ) ;
2727

2828
lcd.init();
2929

cores/validation/validation_I2C_RTC/test.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ uint8_t bcdToDec(byte val)
3434

3535
void setup()
3636
{
37-
Serial5.begin(9600);
38-
Serial5.println("Wire init");
37+
SERIAL_PORT_MONITOR.begin(9600);
38+
SERIAL_PORT_MONITOR.println("Wire init");
3939
Wire.begin();
4040

4141
// Setting the date
@@ -68,10 +68,10 @@ void loop()
6868
Wire.requestFrom(address, 7);
6969
/* while(Wire.available())
7070
{
71-
Serial5.print(bcdToDec(Wire.read()));
72-
Serial5.print(" ");
71+
SERIAL_PORT_MONITOR.print(bcdToDec(Wire.read()));
72+
SERIAL_PORT_MONITOR.print(" ");
7373
}
74-
Serial5.println();*/
74+
SERIAL_PORT_MONITOR.println();*/
7575

7676

7777
int second = bcdToDec(Wire.read() & 0x7f);
@@ -82,19 +82,19 @@ void loop()
8282
int month = bcdToDec(Wire.read());
8383
int year = bcdToDec(Wire.read());
8484

85-
Serial5.print(hour, DEC);
86-
Serial5.print(":");
87-
Serial5.print(minute, DEC);
88-
Serial5.print(":");
89-
Serial5.print(second, DEC);
90-
Serial5.print(" ");
91-
Serial5.print(month, DEC);
92-
Serial5.print("/");
93-
Serial5.print(dayOfMonth, DEC);
94-
Serial5.print("/");
95-
Serial5.print(year,DEC);
96-
Serial5.print(" ");
97-
Serial5.println();
85+
SERIAL_PORT_MONITOR.print(hour, DEC);
86+
SERIAL_PORT_MONITOR.print(":");
87+
SERIAL_PORT_MONITOR.print(minute, DEC);
88+
SERIAL_PORT_MONITOR.print(":");
89+
SERIAL_PORT_MONITOR.print(second, DEC);
90+
SERIAL_PORT_MONITOR.print(" ");
91+
SERIAL_PORT_MONITOR.print(month, DEC);
92+
SERIAL_PORT_MONITOR.print("/");
93+
SERIAL_PORT_MONITOR.print(dayOfMonth, DEC);
94+
SERIAL_PORT_MONITOR.print("/");
95+
SERIAL_PORT_MONITOR.print(year,DEC);
96+
SERIAL_PORT_MONITOR.print(" ");
97+
SERIAL_PORT_MONITOR.println();
9898

9999
delay(990);
100100
}

cores/validation/validation_I2C_multi/test.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void updateTime()
7676

7777
void setup()
7878
{
79-
Serial5.begin( 115200 );
80-
Serial5.println("Wire init");
79+
SERIAL_PORT_MONITOR.begin( 115200 );
80+
SERIAL_PORT_MONITOR.println("Wire init");
8181
Wire.begin();
8282

8383
lcd.init();
@@ -106,8 +106,8 @@ void loop()
106106
delay(10);
107107

108108
Wire.requestFrom(addressTemp, 2);
109-
Serial5.print((char)13); // Erase current line
110-
Serial5.print("Temperature : ");
109+
SERIAL_PORT_MONITOR.print((char)13); // Erase current line
110+
SERIAL_PORT_MONITOR.print("Temperature : ");
111111

112112
a = Wire.read();
113113
b = Wire.read();
@@ -116,9 +116,9 @@ void loop()
116116
valueTemp |= b;
117117
valueTemp >>= 7;
118118

119-
Serial5.print(a);
120-
Serial5.print(" | ");
121-
Serial5.print(b);
119+
SERIAL_PORT_MONITOR.print(a);
120+
SERIAL_PORT_MONITOR.print(" | ");
121+
SERIAL_PORT_MONITOR.print(b);
122122

123123
updateTime();
124124
lcd.setCursor(0, 0);

cores/validation/validation_PWM/test.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ void setup( void )
2828
pinMode( i, OUTPUT ) ;
2929
}
3030

31-
Serial5.begin( 115200 ) ; // Output to EDBG Virtual COM Port
32-
Serial5.println( "test") ;
33-
Serial5.println( brightness ) ;
31+
SERIAL_PORT_MONITOR.begin( 115200 ) ; // Output to EDBG Virtual COM Port
32+
SERIAL_PORT_MONITOR.println( "test") ;
33+
SERIAL_PORT_MONITOR.println( brightness ) ;
3434
}
3535

3636
void loop( void )
3737
{
38-
Serial5.println( brightness ) ;
38+
SERIAL_PORT_MONITOR.println( brightness ) ;
3939

4040
for ( int i=2 ; i < 14 ; i++ )
4141
{

cores/validation/validation_chuck/test.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ uint8_t accx,accy,zbut,cbut ;
2323

2424
void setup()
2525
{
26-
Serial5.begin( 115200 ) ;
27-
Serial5.println("nunchuk init");
26+
SERIAL_PORT_MONITOR.begin( 115200 ) ;
27+
SERIAL_PORT_MONITOR.println("nunchuk init");
2828

2929
Wire.begin(); // join i2c bus as master
3030
Wire.beginTransmission(0x52);// transmit to device 0x52
@@ -34,7 +34,7 @@ void setup()
3434
Wire.write((uint8_t)0x00);// sends sent a zero.
3535
Wire.endTransmission();// stop transmitting
3636

37-
Serial5.println( "WiiChukDemo ready" ) ;
37+
SERIAL_PORT_MONITOR.println( "WiiChukDemo ready" ) ;
3838
delay(100);
3939
}
4040

@@ -49,39 +49,39 @@ void loop()
4949
uint8_t accZ = Wire.read();
5050
uint8_t misc = Wire.read();
5151

52-
Serial5.print("Joy : ");
53-
Serial5.print(jX);
54-
Serial5.print(", ");
55-
Serial5.print(jY);
52+
SERIAL_PORT_MONITOR.print("Joy : ");
53+
SERIAL_PORT_MONITOR.print(jX);
54+
SERIAL_PORT_MONITOR.print(", ");
55+
SERIAL_PORT_MONITOR.print(jY);
5656

57-
Serial5.print("\tAcc : ");
58-
Serial5.print(accX);
59-
Serial5.print(", ");
60-
Serial5.print(accY);
61-
Serial5.print(", ");
62-
Serial5.print(accZ);
57+
SERIAL_PORT_MONITOR.print("\tAcc : ");
58+
SERIAL_PORT_MONITOR.print(accX);
59+
SERIAL_PORT_MONITOR.print(", ");
60+
SERIAL_PORT_MONITOR.print(accY);
61+
SERIAL_PORT_MONITOR.print(", ");
62+
SERIAL_PORT_MONITOR.print(accZ);
6363

64-
Serial5.print("\tBtn : ");
65-
Serial5.print(" [");
66-
Serial5.print(misc);
67-
Serial5.print("] ");
64+
SERIAL_PORT_MONITOR.print("\tBtn : ");
65+
SERIAL_PORT_MONITOR.print(" [");
66+
SERIAL_PORT_MONITOR.print(misc);
67+
SERIAL_PORT_MONITOR.print("] ");
6868

6969
switch(misc & 0x3ul)
7070
{
7171
case 0x0ul:
72-
Serial5.println("Z");
72+
SERIAL_PORT_MONITOR.println("Z");
7373
break;
7474

7575
case 0x1ul:
76-
Serial5.println("C");
76+
SERIAL_PORT_MONITOR.println("C");
7777
break;
7878

7979
case 0x2ul:
80-
Serial5.println("C + Z");
80+
SERIAL_PORT_MONITOR.println("C + Z");
8181
break;
8282

8383
case 0x3ul:
84-
Serial5.println("No key");
84+
SERIAL_PORT_MONITOR.println("No key");
8585
break;
8686

8787
default:

cores/validation/validation_core/test.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void setup( void )
6363
pinPeripheral( 13, PIO_AC_CLK ) ; // Clock Gen 3*/
6464

6565
//**********************************************
66-
Serial.begin( 115200 ) ; // Output to EDBG Virtual COM Port
66+
SERIAL_PORT_MONITOR.begin( 115200 ) ; // Output to EDBG Virtual COM Port
6767

6868
// Test External Interrupt
6969
attachInterrupt( 3, Interrupt_Pin3, LOW ) ;
@@ -73,11 +73,11 @@ void setup( void )
7373
attachInterrupt( 7, Interrupt_Pin7, CHANGE) ;
7474

7575
pcBuff = (char *)malloc(50);
76-
76+
7777
strcpy(pcBuff, "CIAO");
78-
Serial.println("----");
79-
Serial.println(pcBuff); // Outputs garbage instead of "CIAO"
80-
Serial.println("----");
78+
SERIAL_PORT_MONITOR.println("----");
79+
SERIAL_PORT_MONITOR.println(pcBuff); // Outputs garbage instead of "CIAO"
80+
SERIAL_PORT_MONITOR.println("----");
8181
}
8282

8383
static void led_step1( void )
@@ -106,15 +106,15 @@ void loop( void )
106106
led_step2() ;
107107
delay( 500 ) ; // wait for a second
108108

109-
// Test Serial output
110-
Serial.write( '-' ) ; // send a char
111-
Serial.write( "test1\n" ) ; // send a string
112-
Serial.write( "test2" ) ; // send another string
109+
// Test SERIAL_PORT_MONITOR output
110+
SERIAL_PORT_MONITOR.write( '-' ) ; // send a char
111+
SERIAL_PORT_MONITOR.write( "test1\n" ) ; // send a string
112+
SERIAL_PORT_MONITOR.write( "test2" ) ; // send another string
113113

114114
// Test digitalRead: connect pin 2 to either GND or 3.3V. !!!! NOT on 5V pin !!!!
115115
pin_value=digitalRead( 2 ) ;
116-
Serial.write( "pin 2 value is " ) ;
117-
Serial.write( (pin_value == LOW)?"LOW\n":"HIGH\n" ) ;
116+
SERIAL_PORT_MONITOR.write( "pin 2 value is " ) ;
117+
SERIAL_PORT_MONITOR.write( (pin_value == LOW)?"LOW\n":"HIGH\n" ) ;
118118

119119
duty_cycle+=8 ;//=(uint8_t)(millis() & 0xff) ;
120120
analogWrite( 13, duty_cycle ) ;
@@ -127,46 +127,46 @@ void loop( void )
127127
dac_value += 64;
128128
analogWrite(A0, dac_value);
129129

130-
Serial.print("\r\nAnalog pins: ");
130+
SERIAL_PORT_MONITOR.print("\r\nAnalog pins: ");
131131

132132
for ( uint32_t i = A0 ; i <= A0+NUM_ANALOG_INPUTS ; i++ )
133133
{
134134

135135
int a = analogRead(i);
136-
Serial.print(a, DEC);
137-
Serial.print(" ");
136+
SERIAL_PORT_MONITOR.print(a, DEC);
137+
SERIAL_PORT_MONITOR.print(" ");
138138

139139
}
140-
Serial.println();
140+
SERIAL_PORT_MONITOR.println();
141141

142-
Serial.println("External interrupt pins:");
142+
SERIAL_PORT_MONITOR.println("External interrupt pins:");
143143
if ( ul_Interrupt_Pin3 == 1 )
144144
{
145-
Serial.println( "Pin 3 triggered (LOW)" ) ;
145+
SERIAL_PORT_MONITOR.println( "Pin 3 triggered (LOW)" ) ;
146146
ul_Interrupt_Pin3 = 0 ;
147147
}
148148

149149
if ( ul_Interrupt_Pin4 == 1 )
150150
{
151-
Serial.println( "Pin 4 triggered (HIGH)" ) ;
151+
SERIAL_PORT_MONITOR.println( "Pin 4 triggered (HIGH)" ) ;
152152
ul_Interrupt_Pin4 = 0 ;
153153
}
154154

155155
if ( ul_Interrupt_Pin5 == 1 )
156156
{
157-
Serial.println( "Pin 5 triggered (FALLING)" ) ;
157+
SERIAL_PORT_MONITOR.println( "Pin 5 triggered (FALLING)" ) ;
158158
ul_Interrupt_Pin5 = 0 ;
159159
}
160160

161161
if ( ul_Interrupt_Pin6 == 1 )
162162
{
163-
Serial.println( "Pin 6 triggered (RISING)" ) ;
163+
SERIAL_PORT_MONITOR.println( "Pin 6 triggered (RISING)" ) ;
164164
ul_Interrupt_Pin6 = 0 ;
165165
}
166166

167167
if ( ul_Interrupt_Pin7 == 1 )
168168
{
169-
Serial.println( "Pin 7 triggered (CHANGE)" ) ;
169+
SERIAL_PORT_MONITOR.println( "Pin 7 triggered (CHANGE)" ) ;
170170
ul_Interrupt_Pin7 = 0 ;
171171
}
172172
}

0 commit comments

Comments
 (0)