summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
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;