Index: firmware/common/integer.h
===================================================================
--- firmware/common/integer.h	(revision 269)
+++ firmware/common/integer.h	(revision 270)
@@ -17,12 +17,17 @@
 typedef unsigned char	u08;
 typedef unsigned char	uint8_t;
 
+typedef signed char	int8_t;
+
 /* These types MUST be 16 bit */
 typedef short			SHORT;
 typedef unsigned short	WORD;
 typedef unsigned short	WCHAR;
 typedef unsigned short	u16;
+typedef unsigned short	uint16_t;
 
+typedef signed short	int16_t;
+
 /* These types MUST be 16 bit or 32 bit */
 typedef int				INT;
 typedef unsigned int	UINT;
@@ -31,7 +36,13 @@
 typedef long			LONG;
 typedef unsigned int	DWORD;
 typedef unsigned int u32;
+typedef unsigned int uint32_t;
 
+typedef uint8_t bool;
+#define false (0)
+#define NULL (0)
+#define true (1)
+
 #endif
 
 #endif
Index: firmware/usb/LICENSE
===================================================================
--- firmware/usb/LICENSE	(revision 269)
+++ firmware/usb/LICENSE	(revision 270)
@@ -1 +1 @@
-This part is GPL - in fact this whole firmware should be - just need to check a few things...
+This part is GPL - in fact this whole firmware should be - just need to check a few things from other contributors...
Index: firmware/usb/events.h
===================================================================
--- firmware/usb/events.h	(revision 269)
+++ firmware/usb/events.h	(revision 270)
@@ -1,3 +1,5 @@
+#include "printf.h"
+
 void event_keyboard(uint8_t i, uint8_t buf[])
 {
 	int j;
Index: firmware/usb/hid.c
===================================================================
--- firmware/usb/hid.c	(revision 269)
+++ firmware/usb/hid.c	(revision 270)
@@ -1,4 +1,4 @@
-#include <stdio.h>
+//#include <stdio.h>
 
 #include "usb.h"
 #include "timer.h"
@@ -316,7 +316,7 @@
       hid_set_protocol(dev, info->iface[i].iface_idx, HID_BOOT_PROTOCOL);
   }
   
-  puts("HID configured");
+  iprintf("HID configured\n");
 
   // update leds
   for(i=0;i<MAX_IFACES;i++)
@@ -330,7 +330,7 @@
 static uint8_t usb_hid_release(usb_device_t *dev) {
   usb_hid_info_t *info = &(dev->hid_info);
 
-  puts(__FUNCTION__);
+  iprintf("%s\n",__FUNCTION__);
 
   uint8_t i;
   // check if a joystick is released
Index: firmware/usb/hid.h
===================================================================
--- firmware/usb/hid.h	(revision 269)
+++ firmware/usb/hid.h	(revision 270)
@@ -1,8 +1,9 @@
 #ifndef HID_H
 #define HID_H
 
-#include <stdbool.h>
-#include <inttypes.h>
+//#include <stdbool.h>
+//#include <inttypes.h>
+#include <common/integer.h>
 #include "hidparser.h"
 
 #define HID_LED_NUM_LOCK    0x01
Index: firmware/usb/hidparser.c
===================================================================
--- firmware/usb/hidparser.c	(revision 269)
+++ firmware/usb/hidparser.c	(revision 270)
@@ -1,8 +1,8 @@
 // http://www.frank-zhao.com/cache/hid_tutorial_1.php
 
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stdio.h>
+//#include <inttypes.h>
+//#include <stdbool.h>
+//#include <stdio.h>
 
 #include "hidparser.h"
 #include "debug.h"
@@ -71,7 +71,9 @@
   uint8_t setup_complete = 0;
 
   // joystick/mouse components
-  int8_t axis[2] = { -1, -1};
+  int8_t axis[2]; // MWW = { -1, -1}; (this instantiates memcpy!)
+  axis[0] = -1;
+  axis[1] = -1;
   uint8_t btns = 0;
 
   conf->type = CONFIG_TYPE_NONE;
Index: firmware/usb/hidparser.h
===================================================================
--- firmware/usb/hidparser.h	(revision 269)
+++ firmware/usb/hidparser.h	(revision 270)
@@ -1,6 +1,8 @@
 #ifndef HIDPARSER_H
 #define HIDPARSER_H
 
+#include <common/integer.h>
+
 #define CONFIG_TYPE_NONE     0
 #define CONFIG_TYPE_MOUSE    1
 #define CONFIG_TYPE_KEYBOARD 2
Index: firmware/usb/hub.c
===================================================================
--- firmware/usb/hub.c	(revision 269)
+++ firmware/usb/hub.c	(revision 270)
@@ -1,4 +1,4 @@
-#include <stdio.h>
+//#include <stdio.h>
 
 #include "usb.h"
 #include "timer.h"
@@ -59,7 +59,7 @@
 
   rcode = usb_get_dev_descr( dev, 8, &buf.dev_desc );
   if( rcode ) {
-    puts("failed to get device descriptor 1");
+    iprintf("failed to get device descriptor 1\n");
     return rcode;
   }
   
@@ -66,13 +66,13 @@
   // Extract device class from device descriptor
   // If device class is not a hub return
   if (buf.dev_desc.bDeviceClass != USB_CLASS_HUB) {
-    puts("not a hub!");    
+    iprintf("not a hub!\n");    
     return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
   }
 
   // try to re-read full device descriptor from newly assigned address
   if(rcode = usb_get_dev_descr( dev, sizeof(usb_device_descriptor_t), &buf.dev_desc )) {
-    puts("failed to get device descriptor 2");
+    iprintf("failed to get device descriptor 2\n");
     return rcode;
   }
  
@@ -80,7 +80,7 @@
   rcode = usb_hub_get_hub_descriptor(dev, 0, 8, &buf.hub_desc);
     
   if (rcode) {
-    puts("failed to get hub descriptor");
+    iprintf("failed to get hub descriptor\n");
     return rcode;
   }
   
@@ -90,7 +90,7 @@
   // Read configuration Descriptor in Order To Obtain Proper Configuration Value
   rcode = usb_get_conf_descr(dev, sizeof(usb_configuration_descriptor_t), 0, &buf.conf_desc);
   if (rcode) {
-    puts("failed to read configuration descriptor");
+    iprintf("failed to read configuration descriptor\n");
     return rcode;
   }
 
@@ -114,7 +114,7 @@
 }
 
 static uint8_t usb_hub_release(usb_device_t *dev) {
-  puts(__FUNCTION__);
+  iprintf("%s\n",__FUNCTION__);
 
   // root hub unplugged
   if(!dev->parent)
@@ -126,23 +126,23 @@
 static void usb_hub_show_port_status(uint8_t port, uint16_t status, uint16_t changed) {
   iprintf("Status of port %d:\n", port);
 
-  if(status & USB_HUB_PORT_STATUS_PORT_CONNECTION)    puts(" connected");
-  if(status & USB_HUB_PORT_STATUS_PORT_ENABLE)        puts(" enabled");
-  if(status & USB_HUB_PORT_STATUS_PORT_SUSPEND)       puts(" suspended");
-  if(status & USB_HUB_PORT_STATUS_PORT_OVER_CURRENT)  puts(" over current");
-  if(status & USB_HUB_PORT_STATUS_PORT_RESET)         puts(" reset");
-  if(status & USB_HUB_PORT_STATUS_PORT_POWER)         puts(" powered");
-  if(status & USB_HUB_PORT_STATUS_PORT_LOW_SPEED)     puts(" low speed");
-  if(status & USB_HUB_PORT_STATUS_PORT_HIGH_SPEED)    puts(" high speed");
-  if(status & USB_HUB_PORT_STATUS_PORT_TEST)          puts(" test");
-  if(status & USB_HUB_PORT_STATUS_PORT_INDICATOR)     puts(" indicator");
+  if(status & USB_HUB_PORT_STATUS_PORT_CONNECTION)    iprintf(" connected\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_ENABLE)        iprintf(" enabled\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_SUSPEND)       iprintf(" suspended\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_OVER_CURRENT)  iprintf(" over current\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_RESET)         iprintf(" reset\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_POWER)         iprintf(" powered\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_LOW_SPEED)     iprintf(" low speed\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_HIGH_SPEED)    iprintf(" high speed\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_TEST)          iprintf(" test\n");
+  if(status & USB_HUB_PORT_STATUS_PORT_INDICATOR)     iprintf(" indicator\n");
 
   iprintf("Changes on port %d:\n", port);
-  if(changed & USB_HUB_PORT_STATUS_PORT_CONNECTION)   puts(" connected");
-  if(changed & USB_HUB_PORT_STATUS_PORT_ENABLE)       puts(" enabled");
-  if(changed & USB_HUB_PORT_STATUS_PORT_SUSPEND)      puts(" suspended");
-  if(changed & USB_HUB_PORT_STATUS_PORT_OVER_CURRENT) puts(" over current");
-  if(changed & USB_HUB_PORT_STATUS_PORT_RESET)        puts(" reset");
+  if(changed & USB_HUB_PORT_STATUS_PORT_CONNECTION)   iprintf(" connected\n");
+  if(changed & USB_HUB_PORT_STATUS_PORT_ENABLE)       iprintf(" enabled\n");
+  if(changed & USB_HUB_PORT_STATUS_PORT_SUSPEND)      iprintf(" suspended\n");
+  if(changed & USB_HUB_PORT_STATUS_PORT_OVER_CURRENT) iprintf(" over current\n");
+  if(changed & USB_HUB_PORT_STATUS_PORT_RESET)        iprintf(" reset\n");
 }
 
 static uint8_t usb_hub_port_status_change(usb_device_t *dev, uint8_t port, hub_event_t evt) {
Index: firmware/usb/hub.h
===================================================================
--- firmware/usb/hub.h	(revision 269)
+++ firmware/usb/hub.h	(revision 270)
@@ -1,8 +1,9 @@
 #ifndef HUB_H
 #define HUB_H
 
-#include <stdbool.h>
-#include <inttypes.h>
+//#include <stdbool.h>
+//#include <inttypes.h>
+#include <common/integer.h>
 
 typedef struct {
   uint8_t  bNbrPorts;	    // number of ports
Index: firmware/usb/timer.h
===================================================================
--- firmware/usb/timer.h	(revision 269)
+++ firmware/usb/timer.h	(revision 270)
@@ -3,7 +3,8 @@
 #ifndef TIMER_H
 #define TIMER_H
 
-#include <inttypes.h>
+//#include <inttypes.h>
+#include <common/integer.h>
 typedef uint32_t msec_t;
 
 void timer_init();
Index: firmware/usb/usb.c
===================================================================
--- firmware/usb/usb.c	(revision 269)
+++ firmware/usb/usb.c	(revision 270)
@@ -1,4 +1,4 @@
-#include <stdio.h>
+//#include <stdio.h>
 
 #include "timer.h"
 #include "usb.h"
@@ -22,7 +22,7 @@
 static usb_device_t dev[USB_NUMDEVICES];
 
 void usb_reset_state() {
-  puts(__FUNCTION__);
+  iprintf("%s\n",__FUNCTION__);
   bmHubPre	 = 0;
 }
 
@@ -31,7 +31,7 @@
 }
 
 void usb_init() {
-  puts(__FUNCTION__);
+  iprintf("%s\n",__FUNCTION__);
 
   // MWW max3421e_init();   // init underlaying hardware layer
   usbhostslave[OHS900_HOSTSLAVECTLREG] = OHS900_HSCTLREG_RESET_CORE;
@@ -489,7 +489,7 @@
     iprintf("Setting addr %x\n", i+1);
     rcode = usb_set_addr(d, i+1);
     if(rcode) {
-      puts("failed to assign address");
+      iprintf("failed to assign address\n");
       return rcode;
     }
 
@@ -502,13 +502,13 @@
       if (!rcode) {
 	d->class = class_list[c];
 
-	puts(" -> accepted :-)");
+	iprintf(" -> accepted :-)\n");
 	// ok, device accepted by class
 
 	return 0;
       }
   
-      puts(" -> not accepted :-(");
+      iprintf(" -> not accepted :-(\n");
     }
   } else
     iprintf("no more free entries\n");
Index: firmware/usb/usb.h
===================================================================
--- firmware/usb/usb.h	(revision 269)
+++ firmware/usb/usb.h	(revision 270)
@@ -1,9 +1,11 @@
 #ifndef USB_H
 #define USB_H
 
-#include <inttypes.h>
-#include <stdbool.h>
+//#include <inttypes.h>
+//#include <stdbool.h>
 
+#include "common/integer.h"
+
 /* NAK powers. To save space in endpoint data structure, amount of retries */
 /* before giving up and returning 0x4 is stored in bmNakPower as a power of 2.*/
 /* The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */
