Some syntax changes to avoid some compilation errors

pull/13/head
Frederic.Pierson 2020-06-24 20:14:57 +02:00
rodzic e1fd1b5eaa
commit 5c9cdf01c5
1 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -38,12 +38,12 @@
#define CS_LOW() { if(self->cs) {mp_hal_pin_write(self->cs, 0);} }
#define CS_HIGH() { if(self->cs) {mp_hal_pin_write(self->cs, 1);} }
#define DC_LOW() (mp_hal_pin_write(self->dc, 0))
#define DC_HIGH() (mp_hal_pin_write(self->dc, 1))
#define RESET_LOW() (mp_hal_pin_write(self->reset, 0))
#define RESET_HIGH() (mp_hal_pin_write(self->reset, 1))
#define DISP_HIGH() (mp_hal_pin_write(self->backlight, 1))
#define DISP_LOW() (mp_hal_pin_write(self->backlight, 0))
#define DC_LOW() mp_hal_pin_write(self->dc, 0)
#define DC_HIGH() mp_hal_pin_write(self->dc, 1)
#define RESET_LOW() mp_hal_pin_write(self->reset, 0)
#define RESET_HIGH() mp_hal_pin_write(self->reset, 1)
#define DISP_HIGH() mp_hal_pin_write(self->backlight, 1)
#define DISP_LOW() mp_hal_pin_write(self->backlight, 0)
STATIC void write_spi(mp_obj_base_t *spi_obj, const uint8_t *buf, int len) {
@ -549,12 +549,12 @@ mp_obj_t st7789_ST7789_make_new(const mp_obj_type_t *type,
self->xstart = ST7789_135x240_XSTART;
self->ystart = ST7789_135x240_YSTART;
} else {
mp_raise_ValueError(MP_ERROR_TEXT("Unsupported display. Only 240x240 and 135x240 are supported without xstart and ystart provided"));
mp_raise_ValueError("Unsupported display. Only 240x240 and 135x240 are supported without xstart and ystart provided");
}
if (args[ARG_reset].u_obj == MP_OBJ_NULL
|| args[ARG_dc].u_obj == MP_OBJ_NULL) {
mp_raise_ValueError(MP_ERROR_TEXT("must specify all of reset/dc pins"));
mp_raise_ValueError("must specify all of reset/dc pins");
}
self->reset = mp_hal_get_pin_obj(args[ARG_reset].u_obj);