rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
gps_uart.h File Reference

Functions

void initGps (void)
 
float getCurrentSpeed (void)
 

Function Documentation

◆ getCurrentSpeed()

float getCurrentSpeed ( void  )

Definition at line 38 of file gps_uart.cpp.

38 {
39 // TODO: ???
40 return GPSdata.speed;
41}
static loc_t GPSdata
Definition gps_uart.cpp:30
float speed
Definition nmea.h:30

Referenced by printGpsInfo().

Here is the caller graph for this function:

◆ initGps()

void initGps ( void  )

Definition at line 102 of file gps_uart.cpp.

102 {
103 if (!isGpsEnabled())
104 return;
105
106
107 sdStart(GPS_SERIAL_DEVICE, &GPSserialConfig);
108// GPS we have USART1: PB7 -> USART1_RX and PB6 -> USART1_TX
109 efiSetPadMode("GPS tx", engineConfiguration->gps_tx_pin, PAL_MODE_ALTERNATE(7));
110 efiSetPadMode("GPS rx", engineConfiguration->gps_rx_pin, PAL_MODE_ALTERNATE(7));
111
112// todo: add a thread which would save location. If the GPS 5Hz - we should save the location each 200 ms
113 chThdCreateStatic(gpsThreadStack, sizeof(gpsThreadStack), LOWPRIO, (tfunc_t)(void*) GpsThreadEntryPoint, NULL);
114
115 addConsoleAction("gpsinfo", &printGpsInfo);
116}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
static constexpr engine_configuration_s * engineConfiguration
static SerialConfig GPSserialConfig
Definition gps_uart.cpp:26
static bool isGpsEnabled()
Definition gps_uart.cpp:97
static void printGpsInfo()
Definition gps_uart.cpp:43

Referenced by initHardware().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.