Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Repo: Fix hud display will be clear sometimes. #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mazda/callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,19 @@ void MazdaEventCallbacks::HandleNaviTurnDistance(IHUConnectionThreadInterface& s
navi_data->distance_unit = now_unit;
navi_data->distance = now_distance;
navi_data->changed = 1;
navi_data->previous_msg = navi_data->previous_msg+1;
if (navi_data->previous_msg == 8) {
navi_data->previous_msg = 1;
}
}

if (navi_data->time_until != request.time_until()) {
navi_data->time_until = request.time_until();
navi_data->changed = 1;
navi_data->previous_msg = navi_data->previous_msg+1;
if (navi_data->previous_msg == 8) {
navi_data->previous_msg = 1;
}
}

hudmutex.unlock();
Expand Down Expand Up @@ -818,4 +826,4 @@ void logUnknownFields(const ::google::protobuf::UnknownFieldSet& fields) {
break;
}
}
}
}
4 changes: 2 additions & 2 deletions mazda/hud/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ uint8_t turns[][3] = {
{NaviTurns::SHARP_LEFT,NaviTurns::SHARP_RIGHT,0}, //TURN_SHARP_TURN
{NaviTurns::U_TURN_LEFT, NaviTurns::U_TURN_RIGHT,0}, //TURN_U_TURN
{NaviTurns::LEFT,NaviTurns::RIGHT,NaviTurns::STRAIGHT}, //TURN_ON_RAMP
{NaviTurns::LEFT,NaviTurns::RIGHT,NaviTurns::STRAIGHT}, //TURN_OFF_RAMP
{NaviTurns::OFF_RAMP_LEFT,NaviTurns::OFF_RAMP_RIGHT,NaviTurns::STRAIGHT}, //TURN_OFF_RAMP
{NaviTurns::FORK_LEFT, NaviTurns::FORK_RIGHT, 0}, //TURN_FORK
{NaviTurns::MERGE_LEFT, NaviTurns::MERGE_RIGHT, 0}, //TURN_MERGE
{0,0,0}, //TURN_ROUNDABOUT_ENTER
Expand Down Expand Up @@ -161,4 +161,4 @@ bool hud_installed()
loge("DBUS: GetHUDIsInstalled failed %s: %s\n", error.name(), error.message());
return(false);
}
}
}
4 changes: 3 additions & 1 deletion mazda/hud/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ enum NaviTurns: uint32_t {
FORK_LEFT = 15,
FORK_RIGHT = 14,
MERGE_LEFT = 16,
MERGE_RIGHT = 17
MERGE_RIGHT = 17,
OFF_RAMP_LEFT = 7,
OFF_RAMP_RIGHT = 30
};

void hud_start();
Expand Down