Skip to content
Snippets Groups Projects
Unverified Commit 6b94eca6 authored by prosper00's avatar prosper00 Committed by GitHub
Browse files

Update wiring.c

parent 53c5daa3
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment