From 0ff2e20317ce5a6b7ae6b2b9f13f5aece1cd0e96 Mon Sep 17 00:00:00 2001 From: b4yuan Date: Fri, 11 Aug 2023 16:51:55 -0400 Subject: [PATCH] fix: incorrect not operator --- source/board/nrf5x_dk_ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/board/nrf5x_dk_ext.c b/source/board/nrf5x_dk_ext.c index 136796a938..555588ca49 100644 --- a/source/board/nrf5x_dk_ext.c +++ b/source/board/nrf5x_dk_ext.c @@ -155,12 +155,12 @@ static void nrf_prerun_board_config(void) // nonzero if external target is detected bit1 = (PIOB->PIO_PDSR >> 6) & 1; // Read PB6 bit2 = (PIOB->PIO_PDSR >> 18) & 1; // Read PB18 - target_ext = bit1 | !bit2; + target_ext = bit1 | ~bit2; // nonzero if shield-mounted target is detected bit1 = (PIOB->PIO_PDSR >> 5) & 1; // Read PB5 bit2 = (PIOB->PIO_PDSR >> 23) & 1; // Read PB23 - target_shield = bit1 | !bit2; + target_shield = bit1 | ~bit2; // Disable pull-ups for detection PIOB->PIO_PUDR = (1 << 18); // pull-up disable