From 307cfe164910eccc70c086c083595d637c7fb987 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 19 Nov 2011 20:02:14 +0100 Subject: Moved driver related files to a subdirectory. --- gps.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 gps.cpp (limited to 'gps.cpp') 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() { - 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&>(complete_msg) = incomplete_msg; - incomplete_msg.reset(); - complete = true; - } -} -- cgit v1.2.3