8000 remove instance parameter · adafruit/circuitpython@237c636 · GitHub
[go: up one dir, main page]

Skip to content

Commit 237c636

Browse files
committed
remove instance parameter
1 parent 96c6271 commit 237c636

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

shared-bindings/board/__init__.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ STATIC mp_int_t board_get_instance(size_t n_args, const mp_obj_t *args, const mp
6464
}
6565
#endif
6666

67-
//| def I2C(instance: Optional[int] = 0) -> busio.I2C:
67+
//| def I2C() -> busio.I2C:
6868
//| """Returns the `busio.I2C` object for the board's designated I2C bus(es).
69-
//| If there is more than one default I2C bus, the buses are numbered starting at 0.
7069
//| The object created is a singleton, and uses the default parameter values for `busio.I2C`."""
7170
//| ...
7271
//|
@@ -85,11 +84,13 @@ mp_obj_t board_i2c(size_t n_args, const mp_obj_t *args) {
8584
return MP_ROM_NONE;
8685
}
8786
#endif
88-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(board_i2c_obj, 0, 1, board_i2c);
87+
mp_obj_t board_i2c_0(void) {
88+
board_i2c(0, NULL);
89+
}
90+
MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c_0);
8991

90-
//| def SPI(instance: Optional[int] = 0) -> busio.SPI:
92+
//| def SPI() -> busio.SPI:
9193
//| """Returns the `busio.SPI` object for the board's designated SPI bus(es).
92-
//| If there is more than one default SPI bus, the buses are numbered starting at 0.
9394
//| The object created is a singleton, and uses the default parameter values for `busio.SPI`."""
9495
//| ...
9596
//|
@@ -108,11 +109,13 @@ mp_obj_t board_spi(size_t n_args, const mp_obj_t *args) {
108109
return MP_ROM_NONE;
109110
}
110111
#endif
111-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(board_spi_obj, 0, 1, board_spi);
112+
mp_obj_t board_spi_0(void) {
113+
board_spi(0, NULL);
114+
}
115+
MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi_0);
112116

113-
//| def UART(instance: Optional[int] = 0) -> busio.UART:
117+
//| def UART() -> busio.UART:
114118
//| """Returns the `busio.UART` object for the board's designated UART bus(es).
115-
//| If there is more than one default UART bus, the buses are numbered starting at 0.
116119
//| The object created is a singleton, and uses the default parameter values for `busio.UART`."""
117120
//| ...
118121
//|
@@ -131,7 +134,10 @@ mp_obj_t board_uart(size_t n_args, const mp_obj_t *args) {
131134
return MP_ROM_N 6E1B ONE;
132135
}
133136
#endif
134-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(board_uart_obj, 0, 1, board_uart);
137+
mp_obj_t board_uart_0(void) {
138+
board_uart(0, NULL);
139+
}
140+
MP_DEFINE_CONST_FUN_OBJ_0(board_uart_obj, board_uart_0);
135141

136142
const mp_obj_module_t board_module = {
137143
.base = { &mp_type_module },

0 commit comments

Comments
 (0)
0