drivers: display: st7735r: fix build break
display_st7735r broke after cd1fb2972e
:
/zephyr/drivers/display/display_st7735r.c: In function 'st7735r_write':
/zephyr/drivers/display/display_st7735r.c:191:34: error: initialization
discards 'const' qualifier from pointer target type
[-Werror=discarded-qualifiers]
191 | struct st7735r_config *config = dev->config;
| ^~~
/zephyr/drivers/display/display_st7735r.c: In function 'st7735r_lcd_init':
/zephyr/drivers/display/display_st7735r.c:318:26: error: passing
argument 1 of 'st7735r_set_lcd_margins' from incompatible pointer type
[-Werror=incompatible-po
inter-types]
318 | st7735r_set_lcd_margins(dev, data->x_offset, data->y_offset);
| ^~~
| |
| const struct device *
/zephyr/drivers/display/display_st7735r.c:60:58: note: expected 'struct
st7735r_data *' but argument is of type 'const struct device *'
60 | static void st7735r_set_lcd_margins(struct st7735r_data *data,
| ~~~~~~~~~~~~~~~~~~~~~^~~~
/zephyr/drivers/display/display_st7735r.c: In function 'st7735r_init':
/zephyr/drivers/display/display_st7735r.c:441:24: error: passing
argument 1 of 'device_is_ready' from incompatible pointer type
[-Werror=incompatible-pointer-types]
441 | if (!device_is_ready(&config->reset)) {
| ^~~~~~~~~~~~~~
| |
| const struct gpio_dt_spec *
and few others. Fix all of them.
Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
This commit is contained in:
parent
6539ac752e
commit
1c2d72cfad
1 changed files with 6 additions and 4 deletions
|
@ -57,9 +57,11 @@ struct st7735r_data {
|
||||||
uint16_t y_offset;
|
uint16_t y_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void st7735r_set_lcd_margins(struct st7735r_data *data,
|
static void st7735r_set_lcd_margins(const struct device *dev,
|
||||||
uint16_t x_offset, uint16_t y_offset)
|
uint16_t x_offset, uint16_t y_offset)
|
||||||
{
|
{
|
||||||
|
struct st7735r_data *data = dev->data;
|
||||||
|
|
||||||
data->x_offset = x_offset;
|
data->x_offset = x_offset;
|
||||||
data->y_offset = y_offset;
|
data->y_offset = y_offset;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +190,7 @@ static int st7735r_write(const struct device *dev,
|
||||||
const struct display_buffer_descriptor *desc,
|
const struct display_buffer_descriptor *desc,
|
||||||
const void *buf)
|
const void *buf)
|
||||||
{
|
{
|
||||||
struct st7735r_config *config = dev->config;
|
const struct st7735r_config *config = dev->config;
|
||||||
const uint8_t *write_data_start = (uint8_t *) buf;
|
const uint8_t *write_data_start = (uint8_t *) buf;
|
||||||
struct spi_buf tx_buf;
|
struct spi_buf tx_buf;
|
||||||
struct spi_buf_set tx_bufs;
|
struct spi_buf_set tx_bufs;
|
||||||
|
@ -438,7 +440,7 @@ static int st7735r_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->reset.port != NULL) {
|
if (config->reset.port != NULL) {
|
||||||
if (!device_is_ready(&config->reset)) {
|
if (!device_is_ready(config->reset.port)) {
|
||||||
LOG_ERR("Reset GPIO port for display not ready");
|
LOG_ERR("Reset GPIO port for display not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
@ -451,7 +453,7 @@ static int st7735r_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!device_is_ready(&config->cmd_data)) {
|
if (!device_is_ready(config->cmd_data.port)) {
|
||||||
LOG_ERR("cmd/DATA GPIO port not ready");
|
LOG_ERR("cmd/DATA GPIO port not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue