We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9465915 commit b786d33Copy full SHA for b786d33
core/src/core.cpp
@@ -150,8 +150,8 @@ int gpsdrpp_main(int argc, char* argv[]) {
150
return 0;
151
}
152
153
- // Tell GPS to output 24MHz timepulse, align to UTC if possible
154
- core::gps.sendData((unsigned char *)Gps::UBX_CFG_TP5, Gps::UBX_CFG_TP5_SIZE);
+ // Tell GPS to output 24MHz timepulse
+ core::gps.outputReferenceClock(false);
155
156
bool serverMode = (bool)core::args["server"];
157
@@ -205,6 +205,9 @@ int gpsdrpp_main(int argc, char* argv[]) {
205
// Side Bar
206
defConfig["selectedPage"] = 0;
207
208
+ // GPS Page
209
+ defConfig["lockToGpsFreq"] = false;
210
+
211
// CLK OUT Page
212
defConfig["clkOut"] = true;
213
defConfig["reg58"] = 0;
core/src/dev_refresh_worker.cpp
@@ -51,14 +51,14 @@ void DeviceRefreshWorker::workerLoop() {
51
executeCommand("vgp set 4B2 0");
52
delay(500);
53
54
- // Tell GPS to output 24MHz
55
- try {
56
57
- } catch (const std::exception& e) {
58
- std::cerr << "GPS sendData failed: " << e.what() << std::endl;
59
- }
60
-
61
- delay(500);
+ // Tell GPS to output 24MHz
+ core::configManager.acquire();
+ bool lockToGpsFreq = core::configManager.conf["lockToGpsFreq"];
+ core::configManager.release(true);
+ if (lockToGpsFreq) {
+ core::gps.outputReferenceClock(lockToGpsFreq);
+ }
+ delay(500);
62
63
// Initialize Si5351
64
try {
core/src/gps.cpp
@@ -581,4 +581,8 @@ void Gps::readerLoop() {
581
582
int32_t Gps::getProcessedNMEA() {
583
return processedNMEA;
584
+}
585
586
+void Gps::outputReferenceClock(bool lockToGpsFreq) {
587
+ sendData((unsigned char *)(lockToGpsFreq ? UBX_CFG_TP5 : UBX_CFG_TP5_NO_SYNC), UBX_CFG_TP5_SIZE);
588
core/src/gps.h
@@ -68,7 +68,14 @@ class Gps {
68
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
69
0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x43, 0x50
70
};
71
+ static constexpr unsigned char UBX_CFG_TP5_NO_SYNC[40] = {
72
+ 0xB5, 0x62, 0x06, 0x31, 0x20, 0x00, 0x00, 0x01,
73
+ 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x36,
74
+ 0x6E, 0x01, 0x00, 0x36, 0x6E, 0x01, 0x00, 0x00,
75
+ 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76
+ 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00, 0xC1, 0xC8
77
+ };
78
79
uint8_t getUtcHour();
80
uint8_t getUtcMinute();
81
uint8_t getUtcSecond();
@@ -80,6 +87,8 @@ class Gps {
87
uint8_t getFixQuality();
88
uint8_t getUsedSatellites();
82
89
90
+ void outputReferenceClock(bool lockToGpsFreq);
91
83
92
int32_t processedNMEA = 0;
84
93
std::vector<Satellite> getSatellites();
85
94
core/src/gui/widgets/gps_page.cpp
@@ -31,16 +31,26 @@ const char* GPSPage::getLabel() {
31
32
33
void GPSPage::init() {
34
35
+ lockToGpsFreq = core::configManager.conf["lockToGpsFreq"];
36
37
38
39
40
41
42
void GPSPage::deinit() {
43
44
+ core::configManager.conf["lockToGpsFreq"] = lockToGpsFreq;
45
46
47
48
void GPSPage::draw() {
49
const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing() + 10;
50
if (ImGui::BeginChild("GPS_Content", ImVec2(0, -footer_height_to_reserve), true)) {
+ if (ImGui::Checkbox("Sync to 24MHz", &lockToGpsFreq)) {
ImGui::Text("Status: ");
ImGui::SameLine();
if (core::gps.getFixQuality() != 0) {
core/src/gui/widgets/gps_page.h
@@ -21,6 +21,7 @@ class GPSPage : public SideBar::SidePage {
21
22
private:
23
void drawSatelliteTable();
24
25
+ bool lockToGpsFreq = false;
26
LoadingAnimation loader;
27
core/src/version.h
@@ -1,3 +1,3 @@
1
#pragma once
2
3
-#define VERSION_STR "1.0.5"
+#define VERSION_STR "1.0.6"
0 commit comments