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>
This commit is contained in:
parent
0cb5e2155e
commit
83cccdf757
1 changed files with 3 additions and 3 deletions
|
@ -104,17 +104,17 @@ static void st7789v_exit_sleep(const struct device *dev)
|
||||||
|
|
||||||
static void st7789v_reset_display(const struct device *dev)
|
static void st7789v_reset_display(const struct device *dev)
|
||||||
{
|
{
|
||||||
struct st7789v_data *data = dev->data;
|
|
||||||
|
|
||||||
LOG_DBG("Resetting display");
|
LOG_DBG("Resetting display");
|
||||||
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
|
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
|
||||||
|
struct st7789v_data *data = dev->data;
|
||||||
|
|
||||||
k_sleep(K_MSEC(1));
|
k_sleep(K_MSEC(1));
|
||||||
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 1);
|
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 1);
|
||||||
k_sleep(K_MSEC(6));
|
k_sleep(K_MSEC(6));
|
||||||
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 0);
|
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 0);
|
||||||
k_sleep(K_MSEC(20));
|
k_sleep(K_MSEC(20));
|
||||||
#else
|
#else
|
||||||
st7789v_transmit(data, ST7789V_CMD_SW_RESET, NULL, 0);
|
st7789v_transmit(dev, ST7789V_CMD_SW_RESET, NULL, 0);
|
||||||
k_sleep(K_MSEC(5));
|
k_sleep(K_MSEC(5));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue