MIDI Interface in progress

Dependencies:   SPI_TFT_ILI9341 TFT_fonts Touch_tft PowerControl mbed USBMIDI

Revision:
12:f78afb23f7e2
Parent:
11:258abdee25b1
Child:
13:f72d45d919b4
--- a/main.cpp	Thu Feb 13 06:27:37 2014 +0000
+++ b/main.cpp	Thu Feb 13 07:36:00 2014 +0000
@@ -1,9 +1,10 @@
 #include "mbed.h"
 #include "Arial12x12.h"
 #include "Arial28x28.h"
-
 #include "USBMIDI.h"
 #include "light_pressed.h"
+#include "PowerControl/PowerControl.h"
+#include "PowerControl/EthernetPowerControl.h"
 
 // the TFT is connected to SPI pin 5-7
 // the touch is connected to 19,20,16,17
@@ -18,6 +19,13 @@
 
 USBMIDI midi;
 
+// Function to power down magic USB interface chip with new firmware
+#define USR_POWERDOWN    (0x104)
+int semihost_powerdown() {
+    uint32_t arg;
+    return __semihost(USR_POWERDOWN, &arg);
+}
+
 void draw_buttons(unsigned short color)
 {
     unsigned int i = 0;
@@ -48,10 +56,18 @@
 }
 
 
+void powerdown(void)
+{
+    PHY_PowerDown();
+    semihost_powerdown();
+    //Peripheral_PowerDown(0xFFFF7FFF);
+}
+
+
 int main()
 {
     // PERUSPOHJA, ÄLÄ MUOKKAA!
-
+    powerdown();
     point p;
     unsigned short color = White;