Horus internal GPS: cmake changes, more CLI options, ability to send commands to the module

This commit is contained in:
Damjan Adamic
2016-08-30 21:23:20 +02:00
parent 1ef91597ca
commit ff37274e64
7 changed files with 75 additions and 13 deletions
+24 -1
View File
@@ -275,7 +275,30 @@ void gpsWakeup()
{
uint8_t byte;
while (gpsGetByte(&byte)) {
TRACE_PING("%c", (char)byte);
gpsNewData(byte);
}
}
#if defined(DEBUG)
char hex(uint8_t b) {
return b > 9 ? b + 'A' - 10 : b + '0';
}
void gpsSendFrame(const char * frame)
{
// send given frame, add checksum and CRLF
uint8_t parity = 0;
while (*frame) {
if (*frame != '$') parity ^= *frame;
gpsSendByte(*frame);
++frame;
}
gpsSendByte('*');
gpsSendByte(hex(parity >> 4));
gpsSendByte(hex(parity & 0x0F));
gpsSendByte('\r');
gpsSendByte('\n');
TRACE("parity %02x", parity);
}
#endif // #if defined(DEBUG)