mirror of https://github.com/ARMmbed/mbed-os.git
[USBMIDI] Fix compile error
* Member variables in USBMIDIMessage and USBMIDI class wrongly initialized in class declaration * Add member initialization in constructorpull/1051/head
parent
e753aa2d9e
commit
5b74eed7da
|
|
@ -44,9 +44,9 @@
|
|||
/** A MIDI message container */
|
||||
class MIDIMessage {
|
||||
public:
|
||||
MIDIMessage() {}
|
||||
MIDIMessage() : length(4) {}
|
||||
|
||||
MIDIMessage(uint8_t *buf) {
|
||||
MIDIMessage(uint8_t *buf) : length(4) {
|
||||
for (int i = 0; i < 4; i++)
|
||||
data[i] = buf[i];
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ public:
|
|||
}
|
||||
|
||||
uint8_t data[MAX_MIDI_MESSAGE_SIZE+1];
|
||||
uint8_t length=4;
|
||||
uint8_t length;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
#include "USBMIDI.h"
|
||||
|
||||
|
||||
USBMIDI::USBMIDI(uint16_t vendor_id, uint16_t product_id, uint16_t product_release): USBDevice(vendor_id, product_id, product_release) {
|
||||
USBMIDI::USBMIDI(uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
|
||||
: USBDevice(vendor_id, product_id, product_release), cur_data(0), data_end(true)
|
||||
{
|
||||
midi_evt = NULL;
|
||||
USBDevice::connect();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ protected:
|
|||
|
||||
private:
|
||||
uint8_t data[MAX_MIDI_MESSAGE_SIZE+1];
|
||||
uint8_t cur_data=0;
|
||||
bool data_end = true;
|
||||
uint8_t cur_data;
|
||||
bool data_end;
|
||||
|
||||
void (*midi_evt)(MIDIMessage);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue