PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Sensor
libgps
gps_open.c
1
10
#include "
gps.h
"
11
12
volatile
int
gps_cog;
13
volatile
int
gps_stopping;
14
int
gps_stack[100];
15
int
_gps_rx_pin, _gps_tx_pin, _gps_baud;
16
17
nmea_data
gps_data;
18
19
void
gps_run(
void
*par);
20
21
int
gps_open
(
int
gpsSin,
int
gpsSout,
int
gps_baud)
// Open reader, start reading
22
{
23
24
gps_stopping = 0;
25
gps_cog =
cogstart
(gps_run, NULL, gps_stack,
sizeof
(gps_stack));
26
27
if
(gps_cog < 0)
28
{
29
//a valid cog was NOT grabbed, clear the GPS data structure and pin info
30
memset(&gps_data, 0,
sizeof
(
nmea_data
));
31
memset(&_gps_rx_pin, 0, (
sizeof
(
int
)*3));
32
}
33
else
34
{
35
//the GPS parser cog was started
36
_gps_rx_pin = gpsSin;
37
_gps_tx_pin = gpsSout;
38
_gps_baud = gps_baud;
39
}
40
41
return
(gps_cog < 0 ? GPS_FALSE:GPS_TRUE);
42
}
43
gps_open
int gps_open(int gpsSin, int gpsSout, int gps_baud)
Starts the GPS NMEA parser process. This process ultimately consumes two cogs - one cog to continuous...
Definition:
gps_open.c:21
nmea_data_s
Definition:
gps.h:46
cogstart
int cogstart(void(*func)(void *), void *par, void *stack, size_t stacksize)
Start a new propeller LMM function/thread in another COG.
gps.h
This library provides basic NMEA parsing capabilities. It is designed to take raw NMEA strings,...
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17