Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MTDOT-EVB-LinkCheck-AL MTDOT-BOX-EVB-Factory-Firmware-LIB-108 TelitSensorToCloud mDot_sensor_to_cloud ... more
Revision 13:b41779d6cddb, committed 2018-01-31
- Comitter:
- Evan Hosseini
- Date:
- Wed Jan 31 09:14:03 2018 -0600
- Parent:
- 12:179474537b42
- Commit message:
- Pull LED i2c write out of the Ticker ISR
Changed in this revision
| GPSPARSER.cpp | Show annotated file Show diff for this revision Revisions of this file |
| GPSPARSER.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/GPSPARSER.cpp Thu Aug 10 16:23:41 2017 -0500
+++ b/GPSPARSER.cpp Wed Jan 31 09:14:03 2018 -0600
@@ -35,6 +35,7 @@
: _getSentenceThread(&GPSPARSER::startSentenceThread,this),
_led(led),
_led_state(0),
+ _led_state_out(0),
_tick_running(false)
{
_gps_uart = uart;
@@ -191,6 +192,12 @@
if (! _tick_running) {
_tick.attach(this, &GPSPARSER::blinker, 0.5);
_tick_running = true;
+ } else {
+ if (_led_state_out != _led_state)
+ {
+ _led_state_out = _led_state;
+ _led->setPWM(NCP5623B::LED_3, _led_state_out);
+ }
}
}
}
@@ -480,6 +487,5 @@
void GPSPARSER::blinker() {
_led_state = (_led_state == 0) ? 8 : 0;
- _led->setPWM(NCP5623B::LED_3, _led_state);
}
--- a/GPSPARSER.h Thu Aug 10 16:23:41 2017 -0500
+++ b/GPSPARSER.h Wed Jan 31 09:14:03 2018 -0600
@@ -153,6 +153,7 @@
Thread _getSentenceThread;
NCP5623B* _led;
int8_t _led_state;
+ int8_t _led_state_out;
Ticker _tick;
bool _tick_running;
Mutex _mutex;