8000 Merge pull request #1526 from cpforbes/cpf-1490 · ihassin/circuitpython@3fccdab · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fccdab

Browse files
authored
Merge pull request adafruit#1526 from cpforbes/cpf-1490
Remove usb_midi.PortIn and PortOut constructors.
2 parents 041a84e + de43911 commit 3fccdab

File tree

6 files changed

+6
-29
lines changed

6 files changed

+6
-29
lines changed

shared-bindings/usb_midi/PortIn.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@
4343
//|
4444
//| .. class:: PortIn()
4545
//|
46-
//| Not currently dynamically supported.
46+
//| You cannot create an instance of `usb_midi.PortIn`.
4747
//|
48-
//| PortIn objects are constructed for every corresponding entry in the USB descriptor and added
49-
//| to the ``usb_midi.ports`` tuple.
48+
//| PortIn objects are constructed for every corresponding entry in the USB
49+
//| descriptor and added to the ``usb_midi.ports`` tuple.
5050
//|
5151

52-
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) {
53-
return mp_const_none;
54-
}
55-
5652
// These are standard stream methods. Code is in py/stream.c.
5753
//
5854
//| .. method:: read(nbytes=None)
@@ -120,7 +116,6 @@ STATIC const mp_stream_p_t usb_midi_portin_stream_p = {
120116
const mp_obj_type_t usb_midi_portin_type = {
121117
{ &mp_type_type },
122118
.name = MP_QSTR_PortIn,
123-
.make_new = usb_midi_portin_make_new,
124119
.getiter = mp_identity_getiter,
125120
.iternext = mp_stream_unbuffered_iter,
126121
.protocol = &usb_midi_portin_stream_p,

shared-bindings/usb_midi/PortIn.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131

3232
extern const mp_obj_type_t usb_midi_portin_type;
3333

34-
// Construct an underlying UART object.
35-
extern void common_hal_usb_midi_portin_construct(usb_midi_portin_obj_t *self,
36-
uint8_t receiver_buffer_size);
3734
// Read characters.
3835
extern size_t common_hal_usb_midi_portin_read(usb_midi_portin_obj_t *self,
3936
uint8_t *data, size_t len, int *errcode);

shared-bindings/usb_midi/PortOut.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@
4343
//|
4444
//| .. class:: PortOut()
4545
//|
46-
//| Not currently dynamically supported.
46+
//| You cannot create an instance of `usb_midi.PortOut`.
4747
//|
48-
//| PortOut objects are constructed for every corresponding entry in the USB descriptor and added
49-
//| to the ``usb_midi.ports`` tuple.
48+
//| PortOut objects are constructed for every corresponding entry in the USB
49+
//| descriptor and added to the ``usb_midi.ports`` tuple.
5050
//|
5151

52-
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) {
53-
return mp_const_none;
54-
}
55-
5652
// These are standard stream methods. Code is in py/stream.c.
5753
//
5854
//| .. method:: write(buf)
@@ -102,7 +98,6 @@ STATIC const mp_stream_p_t usb_midi_portout_stream_p = {
10298
const mp_obj_type_t usb_midi_portout_type = {
10399
{ &mp_type_type },
104100
.name = MP_QSTR_PortOut,
105-
.make_new = usb_midi_portout_make_new,
106101
.getiter = mp_identity_getiter,
107102
.iternext = mp_stream_unbuffered_iter,
108103
.protocol = &usb_midi_portout_stream_p,

shared-bindings/usb_midi/PortOut.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232
extern const mp_obj_type_t usb_midi_portout_type;
3333

34-
// Construct an underlying UART object.
35-
extern void common_hal_usb_midi_portout_construct(usb_midi_portout_obj_t *self,
36-
uint8_t receiver_buffer_size);
37-
3834
// Write characters. len is in characters NOT bytes!
3935
extern size_t common_hal_usb_midi_portout_write(usb_midi_portout_obj_t *self,
4036
const uint8_t *data, size_t len, int *errcode);

shared-module/usb_midi/PortIn.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
#include "supervisor/shared/translate.h"
2929
#include "tusb.h"
3030

31-
void common_hal_usb_midi_portin_construct(usb_midi_portin_obj_t *self, uint8_t receiver_buffer_size) {
32-
}
33-
3431
size_t common_hal_usb_midi_portin_read(usb_midi_portin_obj_t *self, uint8_t *data, size_t len, int *errcode) {
3532
return tud_midi_read(data, len);
3633
}

shared-module/usb_midi/PortOut.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
#include "supervisor/shared/translate.h"
2929
#include "tusb.h"
3030

31-
void common_hal_usb_midi_portout_construct(usb_midi_portout_obj_t *self) {
32-
}
33-
3431
size_t common_hal_usb_midi_portout_write(usb_midi_portout_obj_t *self, const uint8_t *data, size_t len, int *errcode) {
3532
return tud_midi_write(0, data, len);
3633
}

0 commit comments

Comments
 (0)
0