Skip to content

Commit

Permalink
Merge pull request #5152 from TD-er/feature/GPS_course
Browse files Browse the repository at this point in the history
[GPS] Add course (bearing) as output option
  • Loading branch information
TD-er authored Nov 4, 2024
2 parents b4b381c + df42dfe commit 9796b64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/_P082_GPS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,14 @@ boolean Plugin_082(uint8_t function, struct EventStruct *event, String& string)
# endif // ifndef BUILD_NO_DEBUG
success = true;
}

if (P082_data->gps->course.isUpdated()) {
P082_setOutputValue(event, static_cast<uint8_t>(P082_query::P082_QUERY_COURSE), P082_data->gps->course.deg());
# ifndef BUILD_NO_DEBUG
addLog(LOG_LEVEL_DEBUG, F("GPS: Course update."));
# endif // ifndef BUILD_NO_DEBUG
success = true;
}
}
P082_setOutputValue(event, static_cast<uint8_t>(P082_query::P082_QUERY_SATVIS), P082_data->gps->satellitesStats.nrSatsVisible());
P082_setOutputValue(event, static_cast<uint8_t>(P082_query::P082_QUERY_SATUSE), P082_data->gps->satellitesStats.nrSatsTracked());
Expand Down
1 change: 1 addition & 0 deletions src/src/PluginStructs/P082_data_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const __FlashStringHelper* Plugin_082_valuename(P082_query value_nr, bool displa
case P082_query::P082_QUERY_CHKSUM_FAIL: return displayString ? F("Checksum Fail") : F("chksum_fail");
case P082_query::P082_QUERY_DISTANCE: return displayString ? F("Distance (ODO)") : F("dist");
case P082_query::P082_QUERY_DIST_REF: return displayString ? F("Distance from Reference Point") : F("dist_ref");
case P082_query::P082_QUERY_COURSE: return displayString ? F("Course (BeaRinG)") : F("course");
case P082_query::P082_NR_OUTPUT_OPTIONS: break;
}
return F("");
Expand Down
1 change: 1 addition & 0 deletions src/src/PluginStructs/P082_data_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ enum class P082_query : uint8_t {
P082_QUERY_CHKSUM_FAIL = 9,
P082_QUERY_DISTANCE = 10,
P082_QUERY_DIST_REF = 11,
P082_QUERY_COURSE = 12,
P082_NR_OUTPUT_OPTIONS
};

Expand Down

0 comments on commit 9796b64

Please sign in to comment.