Skip to content

Commit 46f388d

Browse files
committed
Make external target detection less restrictive
Switch to external or shield if VCC or GNDdetect are detected. Requiring both to be detected would reduce the number of targets that can be debugged
1 parent 95de294 commit 46f388d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/board/nrf5x_dk_ext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ static void nrf_prerun_board_config(void)
155155
// nonzero if external target is detected
156156
bit1 = (PIOB->PIO_PDSR >> 6) & 1; // Read PB6
157157
bit2 = (PIOB->PIO_PDSR >> 18) & 1; // Read PB18
158-
target_ext = bit1 & !bit2;
158+
target_ext = bit1 | !bit2;
159159

160160
// nonzero if shield-mounted target is detected
161161
bit1 = (PIOB->PIO_PDSR >> 5) & 1; // Read PB5
162162
bit2 = (PIOB->PIO_PDSR >> 23) & 1; // Read PB23
163-
target_shield = bit1 & !bit2;
163+
target_shield = bit1 | !bit2;
164164

165165
// Disable pull-ups for detection
166166
PIOB->PIO_PUDR = (1 << 18); // pull-up disable

0 commit comments

Comments
 (0)