Skip to content

Commit d7b4917

Browse files
committed
add usb-a enable in examples
1 parent 0422f09 commit d7b4917

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

content/hardware/08.mega/boards/giga-r1/tutorials/giga-audio/content.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ void setup() {
484484
}
485485
486486
// Initializing keyboard interface
487-
pinMode(PA_15, OUTPUT);
487+
pinMode(PA_15, OUTPUT); //enable the USB-A port
488488
keyb.begin();
489489
490490
// DAC initialization
@@ -607,7 +607,7 @@ void setup() {
607607
}
608608
609609
// Initializing keyboard interface
610-
pinMode(PA_15, OUTPUT);
610+
pinMode(PA_15, OUTPUT); //enable the USB-A port
611611
keyb.begin();
612612
613613
// DAC initialization
@@ -692,6 +692,10 @@ mbed::FATFileSystem usb("USB_DRIVE_NAME");
692692
693693
void setup() {
694694
Serial.begin(115200);
695+
696+
pinMode(PA_15, OUTPUT); //enable the USB-A port
697+
digitalWrite(PA_15, HIGH);
698+
695699
while (!Serial);
696700
697701
delay(2500);

content/hardware/08.mega/boards/giga-r1/tutorials/giga-usb/giga-usb.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To enable the USB-A port, you will need to define it as an output. You can also
3333

3434
```arduino
3535
void setup(){
36-
pinMode(PA_15, OUTPUT);
36+
pinMode(PA_15, OUTPUT); //enable the USB-A port
3737
}
3838
3939
void loop(){
@@ -93,6 +93,10 @@ mbed::FATFileSystem usb("usb");
9393
void setup()
9494
{
9595
Serial.begin(115200);
96+
97+
pinMode(PA_15, OUTPUT); //enable the USB-A port
98+
digitalWrite(PA_15, HIGH);
99+
96100
while (!Serial)
97101
;
98102
@@ -189,6 +193,10 @@ mbed::DigitalOut otg(PB_14, 0);
189193
190194
void setup() {
191195
Serial.begin(115200);
196+
197+
pinMode(PA_15, OUTPUT); //enable the USB-A port
198+
digitalWrite(PA_15, HIGH);
199+
192200
while (!Serial);
193201
194202
delay(2500);
@@ -270,7 +278,12 @@ mbed::DigitalOut otg(PB_8, 1);
270278
271279
void setup() {
272280
Serial.begin(115200);
281+
282+
pinMode(PA_15, OUTPUT); //enable the USB-A port
283+
digitalWrite(PA_15, HIGH);
284+
273285
while (!Serial);
286+
274287
msd.connect();
275288
276289
while (!msd.connected()) {
@@ -336,7 +349,7 @@ void setup() {
336349
// put your setup code here, to run once:
337350
Serial.begin(115200);
338351
while (!Serial);
339-
pinMode(PA_15, OUTPUT); //enable the USB-A connector
352+
pinMode(PA_15, OUTPUT); //enable the USB-A port //enable the USB-A connector
340353
keyb.begin(); //init the library
341354
}
342355

0 commit comments

Comments
 (0)