summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2011-06-12 19:14:13 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2011-06-12 19:14:13 +0200
commit3db942d06cf22478041921bc570e6c9650b217d0 (patch)
treedb37b21ed03fbf3fb26c0717aa432b966007b9b4 /main.cpp
parent2802594200a76a6a6765dd44bc908ec47b5872f3 (diff)
Use RCC::enable().
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp7
1 files 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;