Browse Source

drivers: display: st7789v: fix function argument

The st7789v_transmit function accepts a device, not device data. As a
result, driver could not be compiled when reset GPIOs were not defined
in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
pull/42564/head
Gerard Marull-Paretas 3 years ago committed by Anas Nashif
parent
commit
83cccdf757
  1. 6
      drivers/display/display_st7789v.c

6
drivers/display/display_st7789v.c

@ -104,17 +104,17 @@ static void st7789v_exit_sleep(const struct device *dev) @@ -104,17 +104,17 @@ static void st7789v_exit_sleep(const struct device *dev)
static void st7789v_reset_display(const struct device *dev)
{
struct st7789v_data *data = dev->data;
LOG_DBG("Resetting display");
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
struct st7789v_data *data = dev->data;
k_sleep(K_MSEC(1));
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 1);
k_sleep(K_MSEC(6));
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 0);
k_sleep(K_MSEC(20));
#else
st7789v_transmit(data, ST7789V_CMD_SW_RESET, NULL, 0);
st7789v_transmit(dev, ST7789V_CMD_SW_RESET, NULL, 0);
k_sleep(K_MSEC(5));
#endif
}

Loading…
Cancel
Save