From 3db942d06cf22478041921bc570e6c9650b217d0 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 12 Jun 2011 19:14:13 +0200 Subject: Use RCC::enable(). --- main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 179f2e8..9c4774b 100644 --- a/main.cpp +++ b/main.cpp @@ -114,7 +114,9 @@ void xbee_send(int len, const uint8_t* buf) { } int main() { - RCC.APB2ENR |= 0x400d; + RCC.enable(RCC.AFIO); + RCC.enable(RCC.IOPA); + RCC.enable(RCC.IOPB); GPIOA.CRL = 0x44344444; GPIOA.CRH = 0x444444b4; @@ -126,7 +128,7 @@ int main() { while(cnt++ < (1 << 20)); // 100 kHz. - RCC.APB1ENR = (1 << 22); + RCC.enable(RCC.I2C2); while(cnt++ < (1 << 20)); I2C2.CR1 = 0x8000; @@ -142,6 +144,7 @@ int main() { uint8_t buf[6]; + RCC.enable(RCC.USART1); USART1.BRR = 7500; // 9600 baud USART1.CR1 = 0x2008; -- cgit v1.2.3