Permalink
Browse files

Work around a crash in Particle firmware 0.7.0

  • Loading branch information...
monkbroc committed Apr 17, 2018
1 parent f31a605 commit 186acf9403c375e9e251769fb4669c9a4d226704
Showing with 6 additions and 5 deletions.
  1. +1 −1 library.properties
  2. +4 −3 src/carloop.cpp
  3. +1 −1 src/carloop.h
@@ -1,5 +1,5 @@
name=carloop
version=2.0.0
version=2.1.0
license=MIT
author=Julien Vanier <julien@carloop.io>
sentence=Carloop.io library for the Particle platform
@@ -11,7 +11,8 @@
template<typename Config>
Carloop<Config>::Carloop()
: canDriver(Config::CAN_PINS),
canSpeed(Config::CAN_DEFAULT_SPEED)
canSpeed(Config::CAN_DEFAULT_SPEED),
gpsSerialThread(NULL)
{
}
@@ -92,9 +93,9 @@ void Carloop<Config>::enableGPS()
Serial1.begin(Config::GPS_BAUD_RATE);
if (!gpsSerialThread.is_valid()) {
if (!gpsSerialThread) {
// Start a thread that will run this->receiveSerialChars()
gpsSerialThread = Thread("gps_serial", [this]() { receiveSerialChars(); });
gpsSerialThread = new Thread("gps_serial", [this]() { receiveSerialChars(); });
}
}
@@ -69,8 +69,8 @@ class Carloop
CANChannel canDriver;
uint32_t canSpeed;
Thread *gpsSerialThread;
TinyGPSPlus gpsDriver;
Thread gpsSerialThread;
float batteryVoltage;

0 comments on commit 186acf9

Please sign in to comment.