From 16ec5d6e6d717cc802093bbf6540432beac94b8a Mon Sep 17 00:00:00 2001 From: Marcel Peterkau Date: Tue, 15 Feb 2022 23:27:14 +0100 Subject: [PATCH] removed SoftwareSerial --- Software/ChainLube/src/gps.cpp | 16 +++------------- Software/ChainLube/src/gps.h | 1 - 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Software/ChainLube/src/gps.cpp b/Software/ChainLube/src/gps.cpp index 15e29d4..46ce049 100644 --- a/Software/ChainLube/src/gps.cpp +++ b/Software/ChainLube/src/gps.cpp @@ -1,6 +1,5 @@ #include "gps.h" -SoftwareSerial swSerGps; TinyGPSPlus gps; void Init_GPS() @@ -20,16 +19,7 @@ void Init_GPS() } Serial.printf(PSTR("Init GPS with Baud %d\n"), baudrate); - - swSerGps.begin(baudrate, SWSERIAL_8N1, GPIO_TRIGGER, -1, false, 256); - swSerGps.enableRx(true); - // high speed half duplex, turn off interrupts during tx - swSerGps.enableIntTx(false); - swSerGps.enableTx(false); - - // swSerGps.enableTx(true); - // swSerGps.write("Test"); - // swSerGps.enableTx(false); + Serial.begin(baudrate); } uint32_t Process_GPS_WheelSpeed() @@ -38,9 +28,9 @@ uint32_t Process_GPS_WheelSpeed() static uint32_t lastValidSpeedTimestamp; uint16_t RearWheelSpeed_kmh; - while (swSerGps.available() > 0) + while (Serial.available() > 0) { - uint8_t incoming = swSerGps.read(); + uint8_t incoming = Serial.read(); if (gps.encode(incoming)) { RearWheelSpeed_kmh = gps.speed.isValid() ? gps.speed.kmph() : 0; diff --git a/Software/ChainLube/src/gps.h b/Software/ChainLube/src/gps.h index 12a0cda..6e83803 100644 --- a/Software/ChainLube/src/gps.h +++ b/Software/ChainLube/src/gps.h @@ -1,7 +1,6 @@ #ifndef _GPS_H_ #define _GPS_H_ -#include #include #include "config.h" #include "common.h"