disturbance observer

Dependencies:   mbed MATSUbed USBDevice

Revision:
4:a6882e08058c
Parent:
3:618130d2d43e
Child:
5:6190762f5f9a
diff -r 618130d2d43e -r a6882e08058c main.cpp
--- 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;