MATSU-bed / Mbed 2 deprecated MATSU-bed_blinky

Dependencies:   mbed MATSUbed USBDevice

Fork of MATSU-bed_blinky by takaaki mastuzawa

Files at this revision

API Documentation at this revision

Comitter:
hardtail
Date:
Mon Oct 30 09:48:29 2017 +0000
Parent:
3:618130d2d43e
Child:
5:6190762f5f9a
Commit message:
fix USBSerial blocking

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USBDevice.lib	Wed Oct 25 08:08:09 2017 +0000
+++ b/USBDevice.lib	Mon Oct 30 09:48:29 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/USBDevice/#01321bd6ff89
+https://os.mbed.com/users/hardtail/code/USBDevice/#01321bd6ff89
--- a/main.cpp	Wed Oct 25 08:08:09 2017 +0000
+++ b/main.cpp	Mon Oct 30 09:48:29 2017 +0000
@@ -9,15 +9,24 @@
 #define ISP0 P0_4
 #define ISP1 P0_16
 
-USBSerial pc;
+USBSerial pc(0x1f00,0x2012, 0x0001,false);
 
 BusOut myled(LED1, LED2, LED3, LED4);
 
 //DigitalIn sw1(ISP0);
 //DigitalIn sw2(ISP1);
 
+InterruptIn USB_ISP_bt(ISP0);
+
+// ISP0ボタンを押すとUSB ISPモードに入る設定
+void enter_USB_ISP(){
+    pc.printf("enter ISP\n");
+    NVIC_SystemReset();
+}
+
 int main() {
-    //sw1.mode(PullUp);
+    USB_ISP_bt.mode(PullUp);
+    USB_ISP_bt.fall(&enter_USB_ISP);
     
     myled = 0b0001;