GPS handling library
Dependents: LoRaWAN-NAMote72-Application-Demo-good LoRaWAN-gps-cayenne LoRaWAN-NAMote72-Application-Demo
Fork of lib_gps by
Diff: gps.cpp
- Revision:
- 3:03d7275dc4fd
- Parent:
- 2:b531881123bf
- Child:
- 4:b8c049fa7db2
--- a/gps.cpp Fri May 08 01:39:02 2015 +0000 +++ b/gps.cpp Thu Jul 02 00:12:50 2015 +0000 @@ -74,45 +74,18 @@ //pps_pin.rise(this, &GPS::pps); } -#define DELAY_MAX 20 void GPS::enable(bool en) { if (en) { -#ifdef SOFT_START - /* probably better instead to remove 22uF from GPS VCC */ - volatile int d; - volatile int i; - //volatile int d_on = 0; - for (d = DELAY_MAX; d > 0; d--) { - gps_en = 0; - /*for (i = 0; i < d_on; i++) - asm("nop"); - if (d & 1) - d_on++;*/ - gps_en = 1; - for (i = 0; i < d; i++) { - asm("nop"); - } - } - - for (d = 0; d < 10; d++) { - volatile int n; - for (n = 0; n < 3; n++) { - gps_en = 0; - for (i = 0; i < d; i++) { - asm("nop"); - } - gps_en = 1; - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - } - } -#endif /* SOFT_START */ - m_en_pin = 0; + if (en_invert) + m_en_pin = 0; + else + m_en_pin = 1; } else { - m_en_pin = 1; + if (en_invert) + m_en_pin = 1; + else + m_en_pin = 0; } // reset current string index @@ -121,7 +94,10 @@ bool GPS::enabled() { - return !m_en_pin.read(); + if (en_invert) + return !m_en_pin.read(); + else + return m_en_pin.read(); } /*char GPS::Nibble2HexChar( char a );