From 71f3ade770fa7f2637d94f5ba5840b64a16a95db Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 25 Sep 2020 14:47:34 +1000 Subject: ports: Support legacy soft I2C/SPI construction via id=-1 arg. With a warning that this way of constructing software I2C/SPI is deprecated. The check and warning will be removed in a future release. This should help existing code to migrate to the new SoftI2C/SoftSPI types. Signed-off-by: Damien George --- ports/esp8266/machine_hspi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ports/esp8266/machine_hspi.c') diff --git a/ports/esp8266/machine_hspi.c b/ports/esp8266/machine_hspi.c index 55bbcf9f58..ff3ba17255 100644 --- a/ports/esp8266/machine_hspi.c +++ b/ports/esp8266/machine_hspi.c @@ -151,6 +151,8 @@ STATIC void machine_hspi_init(mp_obj_base_t *self_in, size_t n_args, const mp_ob } mp_obj_t machine_hspi_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { + MP_MACHINE_SPI_CHECK_FOR_LEGACY_SOFTSPI_CONSTRUCTION(n_args, n_kw, args); + // args[0] holds the id of the peripheral if (args[0] != MP_OBJ_NEW_SMALL_INT(1)) { // FlashROM is on SPI0, so far we don't support its usage -- cgit v1.2.3