Skip to content

Commit 410d193

Browse files
committed
Allow greater than 1Hz settings for initBestnav, initBestnavXyz, and initRectime.
Fix for #19
1 parent be344bb commit 410d193

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/SparkFun_Unicore_GNSS_Arduino_Library.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ bool UM980::initVersion()
14141414
}
14151415

14161416
// Allocate RAM for packetBESTNAV and initialize it
1417-
bool UM980::initBestnav(uint8_t rate)
1417+
bool UM980::initBestnav(float rate)
14181418
{
14191419
if ((startBinaryBeforeFix == false) && (isNmeaFixed() == false))
14201420
{
@@ -1433,7 +1433,7 @@ bool UM980::initBestnav(uint8_t rate)
14331433

14341434
// Start outputting BESTNAV in Binary on this COM port
14351435
char command[50];
1436-
snprintf(command, sizeof(command), "BESTNAVB %d", rate);
1436+
snprintf(command, sizeof(command), "BESTNAVB %0.2f", rate);
14371437
if (sendCommand(command) == false)
14381438
{
14391439
delete packetBESTNAV;
@@ -1465,7 +1465,7 @@ bool UM980::initBestnav(uint8_t rate)
14651465
}
14661466

14671467
// Allocate RAM for packetBESTNAVXYZ and initialize it
1468-
bool UM980::initBestnavXyz(uint8_t rate)
1468+
bool UM980::initBestnavXyz(float rate)
14691469
{
14701470
if ((startBinaryBeforeFix == false) && (isNmeaFixed() == false))
14711471
{
@@ -1484,7 +1484,7 @@ bool UM980::initBestnavXyz(uint8_t rate)
14841484

14851485
// Start outputting BESTNAVXYZ in Binary on this COM port
14861486
char command[50];
1487-
snprintf(command, sizeof(command), "BESTNAVXYZB %d", rate);
1487+
snprintf(command, sizeof(command), "BESTNAVXYZB %0.2f", rate);
14881488
if (sendCommand(command) == false)
14891489
{
14901490
delete packetBESTNAVXYZ;
@@ -1516,7 +1516,7 @@ bool UM980::initBestnavXyz(uint8_t rate)
15161516
}
15171517

15181518
// Allocate RAM for packetRECTIME and initialize it
1519-
bool UM980::initRectime(uint8_t rate)
1519+
bool UM980::initRectime(float rate)
15201520
{
15211521
if ((startBinaryBeforeFix == false) && (isNmeaFixed() == false))
15221522
{
@@ -1537,7 +1537,7 @@ bool UM980::initRectime(uint8_t rate)
15371537

15381538
// Start outputting RECTIME in Binary on this COM port
15391539
char command[50];
1540-
snprintf(command, sizeof(command), "RECTIMEB %d", rate);
1540+
snprintf(command, sizeof(command), "RECTIMEB %0.2f", rate);
15411541
if (sendCommand(command) == false)
15421542
{
15431543
delete packetRECTIME;

src/SparkFun_Unicore_GNSS_Arduino_Library.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ class UM980
340340
void configHandler(uint8_t *response, uint16_t length);
341341
void modeHandler(uint8_t *response, uint16_t length);
342342

343-
bool initBestnav(uint8_t rate = 1);
343+
bool initBestnav(float rate = 1.0);
344344
UNICORE_BESTNAV_t *packetBESTNAV = nullptr;
345345

346-
bool initBestnavXyz(uint8_t rate = 1);
346+
bool initBestnavXyz(float rate = 1.0);
347347
UNICORE_BESTNAVXYZ_t *packetBESTNAVXYZ = nullptr;
348348

349-
bool initRectime(uint8_t rate = 1);
349+
bool initRectime(float rate = 1.0);
350350
UNICORE_RECTIME_t *packetRECTIME = nullptr;
351351

352352
bool initVersion();

0 commit comments

Comments
 (0)