         E_Notify(PSTR("\r\nGetting device descriptor"), 0x80);
         rcode = Usb.getDevDescr(1, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*) & buf);
 
-        if (rcode) 
-				{
+        if (rcode) {
           E_Notify(PSTR("\r\nError reading device descriptor. Error code "), 0x80);
+          // print_hex(rcode, 8);
         }
-        else 
-				{
+        else {
+
           E_Notify(PSTR("\r\nDescriptor Length:\t"), 0x80);
           print_hex(buf.bLength, 8);
           E_Notify(PSTR("\r\nDescriptor type:\t"), 0x80);

  Usb.Task();
  usbstate = Usb.getUsbTaskState();

  if (usbstate != laststate) 
	{
    laststate = usbstate;

    switch (usbstate) {

static uint8_t midiOut_buff[MAX_TX_BUFF];
static uint8_t midiOut_buff_len = 0;



/*******************************************************************************
* Send MIDI data to BLE Stack
*******************************************************************************/
void m_uart_rx_handle(void * p_context)
{
  if(rx_buf_num > 0 && isConnected)
  {
    int bufInc = 0;
    if (rx_buf_num < 17)
    {
      bufInc = rx_buf_num % 17; }
    else
    {
      bufInc = 17;
    }
    ble.updateCharacteristicValue(txCharacteristic.getHandle(), rx_buf, bufInc);
    memmove(rx_buf, rx_buf+bufInc, rx_buf_num-bufInc); // probably not best practice, needs to be fixed
    rx_buf_num -= bufInc;
    rx_state = 0;
  }
}

void uartCallBack(void)
{
  uint32_t err_code = NRF_SUCCESS;
