Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Branch:
- dev-USB
- Revision:
- 4:9bc07cce9fe6
- Parent:
- 2:c95d2291d1db
- Child:
- 13:da74d044f6a8
--- a/main.cpp Sat Aug 01 13:22:13 2015 +0000
+++ b/main.cpp Sat Aug 01 15:58:36 2015 +0000
@@ -1,5 +1,27 @@
#include "mbed.h"
+#include "USBSerial.h"
+
+DigitalOut myled(LED1);
+InterruptIn usbPower(PA_9);
+USBSerial pcSerial(0x1f00,0x2012,0x001,false);
+
+void usbConnectISR(){
+ myled=1;
+}
+void usbDisconnectISR(){
+ myled=0;
+}
int main(){
//USB Development branch
-}
\ No newline at end of file
+ usbPower.rise(usbConnectISR);
+ usbPower.fall(usbDisconnectISR);
+ usbPower.enable_irq();
+
+ pcSerial.printf("USB PORT SERIAL");
+ while(1){
+ if(pcSerial.readable()){
+ pcSerial.putc(pcSerial.getc());
+ }
+ }
+}

