mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 02:51:17 +00:00
Merge pull request #1906 from meshtastic/thebentern-patch-1
Fix for alpine linux builds
This commit is contained in:
commit
2fb85dc129
@ -15,10 +15,10 @@
|
|||||||
* -------------------------------------------
|
* -------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint printWPL(char *buf, const Position &pos, const char *name)
|
uint32_t printWPL(char *buf, const Position &pos, const char *name)
|
||||||
{
|
{
|
||||||
uint len = sprintf(buf, "$GNWPL,%07.2f,%c,%08.2f,%c,%s", pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N', pos.longitude_i * 1e-5, pos.longitude_i < 0 ? 'W' : 'E', name);
|
uint32_t len = sprintf(buf, "$GNWPL,%07.2f,%c,%08.2f,%c,%s", pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N', pos.longitude_i * 1e-5, pos.longitude_i < 0 ? 'W' : 'E', name);
|
||||||
uint chk = 0;
|
uint32_t chk = 0;
|
||||||
for (uint i = 1; i < len; i++) {
|
for (uint i = 1; i < len; i++) {
|
||||||
chk ^= buf[i];
|
chk ^= buf[i];
|
||||||
}
|
}
|
||||||
@ -50,9 +50,9 @@ uint printWPL(char *buf, const Position &pos, const char *name)
|
|||||||
* -------------------------------------------
|
* -------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint printGGA(char *buf, const Position &pos)
|
uint32_t printGGA(char *buf, const Position &pos)
|
||||||
{
|
{
|
||||||
uint len = sprintf(buf, "$GNGGA,%06u.%03u,%07.2f,%c,%08.2f,%c,%u,%02u,%04u,%04d,%c,%04d,%c,%d,%04d",
|
uint32_t len = sprintf(buf, "$GNGGA,%06u.%03u,%07.2f,%c,%08.2f,%c,%u,%02u,%04u,%04d,%c,%04d,%c,%d,%04d",
|
||||||
pos.time / 1000,
|
pos.time / 1000,
|
||||||
pos.time % 1000,
|
pos.time % 1000,
|
||||||
pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N',
|
pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N',
|
||||||
@ -67,8 +67,8 @@ uint printGGA(char *buf, const Position &pos)
|
|||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
uint chk = 0;
|
uint32_t chk = 0;
|
||||||
for (uint i = 1; i < len; i++) {
|
for (uint32_t i = 1; i < len; i++) {
|
||||||
chk ^= buf[i];
|
chk ^= buf[i];
|
||||||
}
|
}
|
||||||
len += sprintf(buf + len, "*%02X\r\n", chk);
|
len += sprintf(buf + len, "*%02X\r\n", chk);
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
uint printWPL(char *buf, const Position &pos, const char *name);
|
uint32_t printWPL(char *buf, const Position &pos, const char *name);
|
||||||
uint printGGA(char *buf, const Position &pos);
|
uint32_t printGGA(char *buf, const Position &pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user