summaryrefslogtreecommitdiff
path: root/gps.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2011-11-19 20:02:14 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2011-11-19 20:02:14 +0100
commit307cfe164910eccc70c086c083595d637c7fb987 (patch)
treef9845dc9647518840faf469580f581cf65d9fced /gps.cpp
parentc265553652444293f90189c7481fb7eb16f28115 (diff)
Moved driver related files to a subdirectory.
Diffstat (limited to 'gps.cpp')
-rw-r--r--gps.cpp40
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;
- }
-}