Remove usb_midi.PortIn and PortOut constructors.
This commit is contained in:
parent
041a84e8f9
commit
de43911a68
@ -43,16 +43,12 @@
|
||||
//|
|
||||
//| .. class:: PortIn()
|
||||
//|
|
||||
//| Not currently dynamically supported.
|
||||
//| You cannot create an instance of `usb_midi.PortIn`.
|
||||
//|
|
||||
//| PortIn objects are constructed for every corresponding entry in the USB descriptor and added
|
||||
//| to the ``usb_midi.ports`` tuple.
|
||||
//| PortIn objects are constructed for every corresponding entry in the USB
|
||||
//| descriptor and added to the ``usb_midi.ports`` tuple.
|
||||
//|
|
||||
|
||||
STATIC mp_obj_t usb_midi_portin_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
// These are standard stream methods. Code is in py/stream.c.
|
||||
//
|
||||
//| .. method:: read(nbytes=None)
|
||||
@ -120,7 +116,6 @@ STATIC const mp_stream_p_t usb_midi_portin_stream_p = {
|
||||
const mp_obj_type_t usb_midi_portin_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_PortIn,
|
||||
.make_new = usb_midi_portin_make_new,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = mp_stream_unbuffered_iter,
|
||||
.protocol = &usb_midi_portin_stream_p,
|
||||
|
@ -31,9 +31,6 @@
|
||||
|
||||
extern const mp_obj_type_t usb_midi_portin_type;
|
||||
|
||||
// Construct an underlying UART object.
|
||||
extern void common_hal_usb_midi_portin_construct(usb_midi_portin_obj_t *self,
|
||||
uint8_t receiver_buffer_size);
|
||||
// Read characters.
|
||||
extern size_t common_hal_usb_midi_portin_read(usb_midi_portin_obj_t *self,
|
||||
uint8_t *data, size_t len, int *errcode);
|
||||
|
@ -43,16 +43,12 @@
|
||||
//|
|
||||
//| .. class:: PortOut()
|
||||
//|
|
||||
//| Not currently dynamically supported.
|
||||
//| You cannot create an instance of `usb_midi.PortOut`.
|
||||
//|
|
||||
//| PortOut objects are constructed for every corresponding entry in the USB descriptor and added
|
||||
//| to the ``usb_midi.ports`` tuple.
|
||||
//| PortOut objects are constructed for every corresponding entry in the USB
|
||||
//| descriptor and added to the ``usb_midi.ports`` tuple.
|
||||
//|
|
||||
|
||||
STATIC mp_obj_t usb_midi_portout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
// These are standard stream methods. Code is in py/stream.c.
|
||||
//
|
||||
//| .. method:: write(buf)
|
||||
@ -102,7 +98,6 @@ STATIC const mp_stream_p_t usb_midi_portout_stream_p = {
|
||||
const mp_obj_type_t usb_midi_portout_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_PortOut,
|
||||
.make_new = usb_midi_portout_make_new,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = mp_stream_unbuffered_iter,
|
||||
.protocol = &usb_midi_portout_stream_p,
|
||||
|
@ -31,10 +31,6 @@
|
||||
|
||||
extern const mp_obj_type_t usb_midi_portout_type;
|
||||
|
||||
// Construct an underlying UART object.
|
||||
extern void common_hal_usb_midi_portout_construct(usb_midi_portout_obj_t *self,
|
||||
uint8_t receiver_buffer_size);
|
||||
|
||||
// Write characters. len is in characters NOT bytes!
|
||||
extern size_t common_hal_usb_midi_portout_write(usb_midi_portout_obj_t *self,
|
||||
const uint8_t *data, size_t len, int *errcode);
|
||||
|
@ -28,9 +28,6 @@
|
||||
#include "supervisor/shared/translate.h"
|
||||
#include "tusb.h"
|
||||
|
||||
void common_hal_usb_midi_portin_construct(usb_midi_portin_obj_t *self, uint8_t receiver_buffer_size) {
|
||||
}
|
||||
|
||||
size_t common_hal_usb_midi_portin_read(usb_midi_portin_obj_t *self, uint8_t *data, size_t len, int *errcode) {
|
||||
return tud_midi_read(data, len);
|
||||
}
|
||||
|
@ -28,9 +28,6 @@
|
||||
#include "supervisor/shared/translate.h"
|
||||
#include "tusb.h"
|
||||
|
||||
void common_hal_usb_midi_portout_construct(usb_midi_portout_obj_t *self) {
|
||||
}
|
||||
|
||||
size_t common_hal_usb_midi_portout_write(usb_midi_portout_obj_t *self, const uint8_t *data, size_t len, int *errcode) {
|
||||
return tud_midi_write(0, data, len);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user