diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gps.cpp | 4 | ||||
-rw-r--r-- | drivers/gps.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gps.cpp b/drivers/gps.cpp index 1ae3684..cdbb7ad 100644 --- a/drivers/gps.cpp +++ b/drivers/gps.cpp @@ -9,7 +9,7 @@ void interrupt<Interrupt::USART3>() { void GPS::irq() { - uint8_t c = USART3.DR; + uint8_t c = USART3.recv(); if(!incomplete_msg) { incomplete_msg = msg_pool.create(); @@ -31,7 +31,7 @@ void GPS::irq() { incomplete_msg->buf[incomplete_msg->n++] = c; if(c == '\n') { - GPIOB.ODR ^= 1 << 1; + //GPIOB.ODR ^= 1 << 1; const_cast<P<GPSMsg>&>(complete_msg) = incomplete_msg; incomplete_msg.reset(); diff --git a/drivers/gps.h b/drivers/gps.h index 786b719..16a971b 100644 --- a/drivers/gps.h +++ b/drivers/gps.h @@ -2,7 +2,7 @@ #define GPS_H #include "rcc.h" -#include "stm32.h" +#include "usart.h" #include "interrupt.h" #include "thread.h" @@ -37,8 +37,8 @@ class GPS { void enable() { RCC.enable(RCC.USART3); - USART3.BRR = 7500; // 4800 baud - USART3.CR1 = 0x202c; + USART3.set_baudrate(4800); + USART3.enable(); Interrupt::enable(Interrupt::USART3); } |