diff options
Diffstat (limited to 'gps.cpp')
-rw-r--r-- | gps.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/gps.cpp b/gps.cpp deleted file mode 100644 index 1ae3684..0000000 --- a/gps.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "gps.h" - -GPS* GPS::self; - -template<> -void interrupt<Interrupt::USART3>() { - GPS::self->irq(); -} - -void GPS::irq() { - - uint8_t c = USART3.DR; - - if(!incomplete_msg) { - incomplete_msg = msg_pool.create(); - - if(!incomplete_msg) { - return; - } - } - - if(incomplete_msg->n == 0 && c != '$') { - return; - } - - if(incomplete_msg->n >= 128) { - incomplete_msg->n = 0; - return; - } - - incomplete_msg->buf[incomplete_msg->n++] = c; - - if(c == '\n') { - GPIOB.ODR ^= 1 << 1; - - const_cast<P<GPSMsg>&>(complete_msg) = incomplete_msg; - incomplete_msg.reset(); - complete = true; - } -} |