Added to LPC4088-USBHost the USBHostMidi class. Plugin an usb midi interface to the usb host of lpc4088 allows to send midi event to the midi interface. For the moment I can not be able to get event from the interface by using the attacheNoteOn or other triggers...

Dependencies:   FATFileSystem mbed-rtos

Fork of LPC4088-USBHost by Norimasa Okamoto

USBHost/myvector.h

Committer:
Grag38
Date:
2015-04-06
Revision:
1:d652de69bd1a
Parent:
0:148fca6fd246

File content as of revision 1:d652de69bd1a:

#pragma once

template<class T>
class myvector {
public:
    myvector() {
        m_size = 0;
        m_buf = NULL;
    }
    ~myvector() {
        if (m_buf) {
            delete[] m_buf;
        }
    }
    void push_back(T v) {
        T* new_buf = new T[m_size+1];
        if (m_size > 0) {
            for(int i = 0; i < m_size; i++) {
                new_buf[i] = m_buf[i];
            }
            delete[] m_buf;
        }
        m_buf = new_buf;
        m_buf[m_size++] = v;
    }
    T& operator[](const int index) {
        return m_buf[index];
    }
    int size() { return m_size; }

private:
    int m_size;
    T *m_buf;
};