Skip to content

Commit

Permalink
rename macro to MP_DEFINE_BYTES_OBJ_WITH_NULL to avoid conflict (and …
Browse files Browse the repository at this point in the history
…off-by-one difference)
  • Loading branch information
dhalbert committed Sep 13, 2024
1 parent 5caa701 commit 4a5624a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ports/espressif/boards/adafruit_qualia_s3_rgb666/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#include "py/objtuple.h"
#include "shared-bindings/board/__init__.h"

#define MP_DEFINE_BYTES_OBJ(obj_name, bin) mp_obj_str_t obj_name = {{&mp_type_bytes}, 0, sizeof(bin) - 1, (const byte *)bin}
#define MP_DEFINE_BYTES_OBJ_WITH_NULL(obj_name, bin) mp_obj_str_t obj_name = {{&mp_type_bytes}, 0, sizeof(bin) - 1, (const byte *)bin}

static const char i2c_bus_init_sequence[] = {
2, 3, 0x78, // set GPIO direction
2, 2, 0, // disable all output inversion
0, // trailing NUL for python bytes() representation
};
static MP_DEFINE_BYTES_OBJ(i2c_init_byte_obj, i2c_bus_init_sequence);
static MP_DEFINE_BYTES_OBJ_WITH_NULL(i2c_init_byte_obj, i2c_bus_init_sequence);

static const mp_rom_map_elem_t tft_io_expander_table[] = {
{ MP_ROM_QSTR(MP_QSTR_i2c_address), MP_ROM_INT(0x3f)},
Expand Down
6 changes: 3 additions & 3 deletions ports/espressif/boards/espressif_esp32s3_lcd_ev/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "shared-module/displayio/__init__.h"
#include "boards/espressif_esp32s3_lcd_ev/board.h"

#define MP_DEFINE_BYTES_OBJ(obj_name, bin) mp_obj_str_t obj_name = {{&mp_type_bytes}, 0, sizeof(bin) - 1, (const byte *)bin}
#define MP_DEFINE_BYTES_OBJ_WITH_NULL(obj_name, bin) mp_obj_str_t obj_name = {{&mp_type_bytes}, 0, sizeof(bin) - 1, (const byte *)bin}

static const uint8_t display_init_sequence[] = {
0xf0, 5, 0x55, 0xaa, 0x52, 0x08, 0x00,
Expand Down Expand Up @@ -66,14 +66,14 @@ static const uint8_t display_init_sequence[] = {
0x29, 0x0,
0, // trailing NUL for Python bytes() representation
};
MP_DEFINE_BYTES_OBJ(display_init_byte_obj, display_init_sequence);
MP_DEFINE_BYTES_OBJ_WITH_NULL(display_init_byte_obj, display_init_sequence);

static const char i2c_bus_init_sequence[] = {
2, 3, 0xf1, // set GPIO direction
2, 2, 0, // disable all output inversion
0, // trailing NUL for Python bytes() representation
};
MP_DEFINE_BYTES_OBJ(i2c_init_byte_obj, i2c_bus_init_sequence);
MP_DEFINE_BYTES_OBJ_WITH_NULL(i2c_init_byte_obj, i2c_bus_init_sequence);

static const mcu_pin_obj_t *red_pins[] = {
&pin_GPIO1, &pin_GPIO2, &pin_GPIO42, &pin_GPIO41, &pin_GPIO40
Expand Down

0 comments on commit 4a5624a

Please sign in to comment.