From 030e5cdd712f6d7ed527743c8c54c5ced86d75b1 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 4 Dec 2011 12:06:35 +0100 Subject: Fixed some typos in pin.h. --- hal/pin.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'hal') diff --git a/hal/pin.h b/hal/pin.h index e45c178..29ec158 100644 --- a/hal/pin.h +++ b/hal/pin.h @@ -36,10 +36,10 @@ class Pin { } void set_af(int af) { - if(n > 8) { + if(n < 8) { g.AFRL = (g.AFRL & ~(0xf << (n * 4))) | af << (n * 4); } else { - g.AFRH = (g.AFRL & ~(0xf << (n * 4 - 32))) | af << (n * 4 - 32); + g.AFRH = (g.AFRH & ~(0xf << (n * 4 - 32))) | af << (n * 4 - 32); } } @@ -59,16 +59,16 @@ class Pin { } } }; -static Pin PB0(GPIOD, 0); -static Pin PB1(GPIOD, 1); -static Pin PB2(GPIOD, 2); -static Pin PB3(GPIOD, 3); -static Pin PB4(GPIOD, 4); -static Pin PB5(GPIOD, 5); -static Pin PB6(GPIOD, 6); -static Pin PB7(GPIOD, 7); -static Pin PB8(GPIOD, 8); -static Pin PB9(GPIOD, 9); +static Pin PB0(GPIOB, 0); +static Pin PB1(GPIOB, 1); +static Pin PB2(GPIOB, 2); +static Pin PB3(GPIOB, 3); +static Pin PB4(GPIOB, 4); +static Pin PB5(GPIOB, 5); +static Pin PB6(GPIOB, 6); +static Pin PB7(GPIOB, 7); +static Pin PB8(GPIOB, 8); +static Pin PB9(GPIOB, 9); static Pin PD12(GPIOD, 12); static Pin PD13(GPIOD, 13); -- cgit v1.2.3