Skip to content

Commit

Permalink
Fix for non-zero CN issue (fixed #76)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuuichiAkagawa committed Jan 8, 2022
1 parent 3c035c2 commit 15f0021
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# USBH_MIDI v0.6.0
# USBH_MIDI v0.6.1

USB-MIDI 1.0 class driver for Arduino [USB Host Shield 2.0 Library][UHS2]

Expand Down Expand Up @@ -78,6 +78,9 @@ If your device does not work, please report this information.
Get the USB device address.

## ChangeLog
2022.1.6 (0.6.1)
* Fix for RecvData(uint8_t) does not work when CableNumber(CN) is non-zero.

2021.5.9 (0.6.0)
* Change configuration descriptor parser. Supports large descriptors.
* Fixed an issue when the endpoint size exceeded 64 bytes
Expand Down
4 changes: 2 additions & 2 deletions usbh_midi.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
*******************************************************************************
* USB-MIDI class driver for USB Host Shield 2.0 Library
* Copyright (c) 2012-2021 Yuuichi Akagawa
* Copyright (c) 2012-2022 Yuuichi Akagawa
*
* Idea from LPK25 USB-MIDI to Serial MIDI converter
* by Collin Cunningham - makezine.com, narbotic.com
Expand Down Expand Up @@ -359,7 +359,7 @@ uint8_t USBH_MIDI::RecvData(uint8_t *outBuf, bool isRaw)
*(outBuf++) = recvBuf[readPtr++];
*(outBuf++) = recvBuf[readPtr++];

return getMsgSizeFromCin(cin);
return getMsgSizeFromCin(cin & 0x0f);
}

/* Send data to MIDI device */
Expand Down
4 changes: 2 additions & 2 deletions usbh_midi.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
*******************************************************************************
* USB-MIDI class driver for USB Host Shield 2.0 Library
* Copyright (c) 2012-2021 Yuuichi Akagawa
* Copyright (c) 2012-2022 Yuuichi Akagawa
*
* Idea from LPK25 USB-MIDI to Serial MIDI converter
* by Collin Cunningham - makezine.com, narbotic.com
Expand All @@ -28,7 +28,7 @@
#define _USBH_MIDI_H_
#include "Usb.h"

#define USBH_MIDI_VERSION 600
#define USBH_MIDI_VERSION 601
#define MIDI_MAX_ENDPOINTS 3 //endpoint 0, bulk_IN(MIDI), bulk_OUT(MIDI)
#define USB_SUBCLASS_MIDISTREAMING 3
#define MIDI_EVENT_PACKET_SIZE 64
Expand Down

0 comments on commit 15f0021

Please sign in to comment.