removed SoftwareSerial

This commit is contained in:
Marcel Peterkau 2022-02-15 23:27:14 +01:00
parent d940d7aa78
commit 16ec5d6e6d
2 changed files with 3 additions and 14 deletions

View File

@ -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;

View File

@ -1,7 +1,6 @@
#ifndef _GPS_H_
#define _GPS_H_
#include <SoftwareSerial.h>
#include <TinyGPSPlus.h>
#include "config.h"
#include "common.h"