From 6b94eca62320937fe27b441b27a9b017f077fb02 Mon Sep 17 00:00:00 2001 From: prosper00 <57373245+prosper00@users.noreply.github.com> Date: Wed, 24 May 2023 11:31:12 -0600 Subject: [PATCH] Update wiring.c --- examples/GPIO/wiring.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/examples/GPIO/wiring.c b/examples/GPIO/wiring.c index f852cd0..e0acde1 100644 --- a/examples/GPIO/wiring.c +++ b/examples/GPIO/wiring.c @@ -6,12 +6,9 @@ enum GPIOports getPort (enum GPIOpins pin) { - if (pin <= pin_A7) { + if (pin <= pin_A2) { return port_A; } - else if (pin <= pin_B7) { - return port_B; - } else if (pin <= pin_C7) { return port_C; } @@ -29,8 +26,6 @@ void portEnable(enum GPIOports port) { case port_A: RCC->APB2PCENR |= RCC_APB2Periph_GPIOA; break; - case port_B: - break; case port_C: RCC->APB2PCENR |= RCC_APB2Periph_GPIOC; break; @@ -106,10 +101,6 @@ void digitalWrite(enum GPIOpins pin, uint8_t value) { GPIOx = GPIOA; PinOffset = pin; } - else if (pin <= pin_B7) { /* GPIOB doesn't exist (yet?) - GPIOx = GPIOB; - PinOffset = (pin - 8); */ - } else if (pin <= pin_C7) { GPIOx = GPIOC; PinOffset = (pin - 16); @@ -140,10 +131,6 @@ uint8_t digitalRead(uint8_t pin) { GPIOx = GPIOA; PinOffset = pin; } - else if (pin <= pin_B7) { /* GPIOB doesn't exist (yet?) - GPIOx = GPIOB; - PinOffset = (pin - 8); */ - } else if (pin <= pin_C7) { GPIOx = GPIOC; PinOffset = (pin - 16); -- GitLab