Skip to content

Commit e8dc0c6

Browse files
kuligakartben
authored andcommitted
drivers: auxdisplay: hd44780: set rw_gpio line value only once
There's no need to set this line every single time a command is sent to the HD44780. Set it only once, so that one can save some cpu cycles. Signed-off-by: Jan Kuliga <[email protected]>
1 parent 7d22513 commit e8dc0c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/auxdisplay/auxdisplay_hd44780.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ static void auxdisplay_hd44780_command(const struct device *dev, bool rs, uint8_
9797

9898
gpio_pin_set_dt(&config->rs_gpio, rs);
9999

100-
if (config->rw_gpio.port) {
101-
gpio_pin_set_dt(&config->rw_gpio, 0);
102-
}
103-
104100
gpio_pin_set_dt(&config->e_gpio, 1);
105101
k_sleep(K_USEC(config->enable_line_rise_delay));
106102
gpio_pin_set_dt(&config->e_gpio, 0);
@@ -148,6 +144,8 @@ static int auxdisplay_hd44780_init(const struct device *dev)
148144
LOG_ERR("Configuration of RW GPIO failed: %d", rc);
149145
return rc;
150146
}
147+
148+
gpio_pin_set_dt(&config->rw_gpio, 0);
151149
}
152150

153151
rc = gpio_pin_configure_dt(&config->e_gpio, GPIO_OUTPUT);

0 commit comments

Comments
 (0)