Skip to content

Commit 7e3deb8

Browse files
pojirofhunleth
authored andcommitted
modify hal_apply_direction/1 for pins not activated "in" by simply exporting
There are pins that have "in" direction after export, but not be activated. These pins will not become active unless they are overwritten again. Therefore, modified it to write always. WHY: not apply this modifying for "out" Because overwriting "out" has a side effect of changing the GPIO value.
1 parent a52e973 commit 7e3deb8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/hal_sysfs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,7 @@ int hal_apply_direction(struct gpio_pin *pin)
276276

277277
if (pin->config.is_output == 0) {
278278
// Input
279-
if (!current_is_output)
280-
return 0;
281-
else
282-
return sysfs_write_file(direction_path, "in", 0);
279+
return sysfs_write_file(direction_path, "in", 0);
283280
} else {
284281
// Output
285282
if (pin->config.initial_value < 0) {

0 commit comments

Comments
 (0)