From 96c6271134d5ddf6d53e74550e0182b1b8f15299 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 15 Dec 2021 02:00:20 +0530 Subject: [PATCH] apply suggestions from reviews - minor typo fix - update documentation for board module --- shared-bindings/board/__init__.c | 15 +++++++++------ shared-bindings/board/__init__.h | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 4edd455b44..b9a0bb489a 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -65,8 +65,9 @@ STATIC mp_int_t board_get_instance(size_t n_args, const mp_obj_t *args, const mp #endif //| def I2C(instance: Optional[int] = 0) -> busio.I2C: -//| """Returns the `busio.I2C` object for the board's designated I2C bus(es). It is a singleton. -//| The object created uses the default parameter values for `busio.I2C`.""" +//| """Returns the `busio.I2C` object for the board's designated I2C bus(es). +//| If there is more than one default I2C bus, the buses are numbered starting at 0. +//| The object created is a singleton, and uses the default parameter values for `busio.I2C`.""" //| ... //| #if CIRCUITPY_BOARD_I2C @@ -87,8 +88,9 @@ mp_obj_t board_i2c(size_t n_args, const mp_obj_t *args) { MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(board_i2c_obj, 0, 1, board_i2c); //| def SPI(instance: Optional[int] = 0) -> busio.SPI: -//| """Returns the `busio.SPI` object for the board's designated SPI bus(es). It is a singleton. -//| The object created uses the default parameter values for `busio.SPI`.""" +//| """Returns the `busio.SPI` object for the board's designated SPI bus(es). +//| If there is more than one default SPI bus, the buses are numbered starting at 0. +//| The object created is a singleton, and uses the default parameter values for `busio.SPI`.""" //| ... //| #if CIRCUITPY_BOARD_SPI @@ -109,8 +111,9 @@ mp_obj_t board_spi(size_t n_args, const mp_obj_t *args) { MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(board_spi_obj, 0, 1, board_spi); //| def UART(instance: Optional[int] = 0) -> busio.UART: -//| """Returns the `busio.UART` object for the board's designated UART bus(es). It is a singleton. -//| The object created uses the default parameter values for `busio.UART`.""" +//| """Returns the `busio.UART` object for the board's designated UART bus(es). +//| If there is more than one default UART bus, the buses are numbered starting at 0. +//| The object created is a singleton, and uses the default parameter values for `busio.UART`.""" //| ... //| #if CIRCUITPY_BOARD_UART diff --git a/shared-bindings/board/__init__.h b/shared-bindings/board/__init__.h index 78428c46e4..8755e78663 100644 --- a/shared-bindings/board/__init__.h +++ b/shared-bindings/board/__init__.h @@ -36,19 +36,19 @@ extern const mp_obj_dict_t board_module_globals; STATIC const MP_DEFINE_STR_OBJ(board_module_id_obj, CIRCUITPY_BOARD_ID); bool common_hal_board_is_i2c(mp_obj_t obj); -mp_obj_t common_hal_board_get_i2c(const mp_int_t insatnce); +mp_obj_t common_hal_board_get_i2c(const mp_int_t instance); mp_obj_t common_hal_board_create_i2c(const mp_int_t instance); mp_obj_t board_i2c(size_t n_args, const mp_obj_t *args); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(board_i2c_obj); bool common_hal_board_is_spi(mp_obj_t obj); -mp_obj_t common_hal_board_get_spi(const mp_int_t insatnce); +mp_obj_t common_hal_board_get_spi(const mp_int_t instance); mp_obj_t common_hal_board_create_spi(const mp_int_t instance); mp_obj_t board_spi(size_t n_args, const mp_obj_t *args); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(board_spi_obj); bool common_hal_board_is_uart(mp_obj_t obj); -mp_obj_t common_hal_board_get_uart(const mp_int_t insatnce); +mp_obj_t common_hal_board_get_uart(const mp_int_t instance); mp_obj_t common_hal_board_create_uart(const mp_int_t instance); mp_obj_t board_uart(size_t n_args, const mp_obj_t *args); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(board_uart_obj);