Skip to content

Commit 4f85ce6

Browse files
maxd-nordicmmahadevan108
authored andcommitted
dp: swdp_bitbang: fix missing reset pin error
This patch fixes an issue where the reset pin is used even when it's not given. Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
1 parent 4331b5f commit 4f85ce6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/dp/swdp_bitbang.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,11 @@ static int sw_port_on(const struct device *dev)
601601
return ret;
602602
}
603603

604-
ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_ACTIVE);
605-
if (ret) {
606-
return ret;
604+
if (config->reset.port) {
605+
ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_ACTIVE);
606+
if (ret) {
607+
return ret;
608+
}
607609
}
608610

609611
return 0;

0 commit comments

Comments
 (0)