summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriabdalkader <i.abdalkader@gmail.com>2022-10-06 20:28:31 +0200
committerDamien George <damien@micropython.org>2022-10-22 12:58:21 +1100
commit5e90ec233139e90b5dc022932b15b3bc9fd7865c (patch)
tree4840566ded1dcb61b9bce42ad0f856ed6f0a6f8a
parentbfa6f34404374bb7c7d892ca6cb32175e8dd19f6 (diff)
zephyr: Rename machine I2C and SPI types consistently across ports.
This renames: - machine_hard_i2c_type -> machine_i2c_type - machine_hard_spi_type -> machine_spi_type
-rw-r--r--ports/zephyr/machine_i2c.c4
-rw-r--r--ports/zephyr/machine_spi.c4
-rw-r--r--ports/zephyr/modmachine.c4
-rw-r--r--ports/zephyr/modmachine.h4
4 files changed, 8 insertions, 8 deletions
diff --git a/ports/zephyr/machine_i2c.c b/ports/zephyr/machine_i2c.c
index 8f0f25257..c261ffad0 100644
--- a/ports/zephyr/machine_i2c.c
+++ b/ports/zephyr/machine_i2c.c
@@ -84,7 +84,7 @@ mp_obj_t machine_hard_i2c_make_new(const mp_obj_type_t *type, size_t n_args, siz
mp_raise_NotImplementedError(MP_ERROR_TEXT("explicit choice of timeout is not implemented"));
}
- machine_hard_i2c_obj_t *self = mp_obj_malloc(machine_hard_i2c_obj_t, &machine_hard_i2c_type);
+ machine_hard_i2c_obj_t *self = mp_obj_malloc(machine_hard_i2c_obj_t, &machine_i2c_type);
self->dev = dev;
self->restart = false;
@@ -127,7 +127,7 @@ STATIC const mp_machine_i2c_p_t machine_hard_i2c_p = {
};
MP_DEFINE_CONST_OBJ_TYPE(
- machine_hard_i2c_type,
+ machine_i2c_type,
MP_QSTR_I2C,
MP_TYPE_FLAG_NONE,
make_new, machine_hard_i2c_make_new,
diff --git a/ports/zephyr/machine_spi.c b/ports/zephyr/machine_spi.c
index 19d4ae6de..507d839c6 100644
--- a/ports/zephyr/machine_spi.c
+++ b/ports/zephyr/machine_spi.c
@@ -106,7 +106,7 @@ mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz
.cs = NULL
};
- machine_hard_spi_obj_t *self = mp_obj_malloc(machine_hard_spi_obj_t, &machine_hard_spi_type);
+ machine_hard_spi_obj_t *self = mp_obj_malloc(machine_hard_spi_obj_t, &machine_spi_type);
self->dev = dev;
self->config = cfg;
@@ -198,7 +198,7 @@ STATIC const mp_machine_spi_p_t machine_hard_spi_p = {
};
MP_DEFINE_CONST_OBJ_TYPE(
- machine_hard_spi_type,
+ machine_spi_type,
MP_QSTR_SPI,
MP_TYPE_FLAG_NONE,
make_new, machine_hard_spi_make_new,
diff --git a/ports/zephyr/modmachine.c b/ports/zephyr/modmachine.c
index 63bd33698..95a66c511 100644
--- a/ports/zephyr/modmachine.c
+++ b/ports/zephyr/modmachine.c
@@ -69,10 +69,10 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_idle), MP_ROM_PTR(&machine_idle_obj) },
#if MICROPY_PY_MACHINE_I2C
- { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_hard_i2c_type) },
+ { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_i2c_type) },
#endif
#if MICROPY_PY_MACHINE_SPI
- { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&machine_hard_spi_type) },
+ { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&machine_spi_type) },
#endif
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&machine_uart_type) },
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
diff --git a/ports/zephyr/modmachine.h b/ports/zephyr/modmachine.h
index a3cdd2b30..a605ada0d 100644
--- a/ports/zephyr/modmachine.h
+++ b/ports/zephyr/modmachine.h
@@ -4,8 +4,8 @@
#include "py/obj.h"
extern const mp_obj_type_t machine_pin_type;
-extern const mp_obj_type_t machine_hard_i2c_type;
-extern const mp_obj_type_t machine_hard_spi_type;
+extern const mp_obj_type_t machine_i2c_type;
+extern const mp_obj_type_t machine_spi_type;
extern const mp_obj_type_t machine_uart_type;
MP_DECLARE_CONST_FUN_OBJ_0(machine_info_obj);