Skip to content

Commit

Permalink
Move MCLK from 24 -> 19.2 mhz + Add accuracy in sidebar (commaai#20960)
Browse files Browse the repository at this point in the history
* wip

* one day i'll flip that right

Co-authored-by: Comma Device <[email protected]>
  • Loading branch information
geohot and Comma Device authored May 19, 2021
1 parent efca6ea commit f43671c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion selfdrive/camerad/cameras/camera_qcom2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void sensors_init(int video0_fd, int sensor_fd, int camera_num) {
power->count = 1;
power->cmd_type = CAMERA_SENSOR_CMD_TYPE_PWR_UP;
power->power_settings[0].power_seq_type = 0;
power->power_settings[0].config_val_low = 24000000; //Hz
power->power_settings[0].config_val_low = 19200000; //Hz
power = power_set_wait(power, 10);

// 8,1 is this reset?
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/camerad/cameras/sensor2_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct i2c_random_wr_payload init_array_ar0231[] = {
{0x302A, 0x0006}, // VT_PIX_CLK_DIV
{0x302C, 0x0001}, // VT_SYS_CLK_DIV
{0x302E, 0x0002}, // PRE_PLL_CLK_DIV
{0x3030, 0x0028}, // PLL_MULTIPLIER
{0x3030, 0x0032}, // PLL_MULTIPLIER
{0x3036, 0x000A}, // OP_WORD_CLK_DIV
{0x3038, 0x0001}, // OP_SYS_CLK_DIV

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/ui/qt/sidebar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void Sidebar::update(const UIState &s) {
panda_status = danger_color;
panda_str = "NO\nPANDA";
} else if (Hardware::TICI() && s.scene.started) {
panda_str = QString("SAT CNT\n%1").arg(s.scene.satelliteCount);
panda_str = QString("SATS %1\nACC %2").arg(s.scene.satelliteCount).arg(fmin(10, s.scene.gpsAccuracy), 0, 'f', 2);
panda_status = (*s.sm)["liveLocationKalman"].getLiveLocationKalman().getGpsOK() ? good_color : warning_color;
}

Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ static void update_state(UIState *s) {
scene.satelliteCount = data.getMeasurementReport().getNumMeas();
}
}
if (sm.updated("gpsLocationExternal")) {
scene.gpsAccuracy = sm["gpsLocationExternal"].getGpsLocationExternal().getAccuracy();
}
if (sm.updated("carParams")) {
scene.longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl();
}
Expand Down Expand Up @@ -270,6 +273,7 @@ QUIState::QUIState(QObject *parent) : QObject(parent) {
ui_state.sm = std::make_unique<SubMaster, const std::initializer_list<const char *>>({
"modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "liveLocationKalman",
"pandaState", "carParams", "driverState", "driverMonitoringState", "sensorEvents", "carState", "ubloxGnss",
"gpsLocationExternal",
#ifdef QCOM2
"roadCameraState",
#endif
Expand Down
1 change: 1 addition & 0 deletions selfdrive/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ typedef struct UIScene {

// gps
int satelliteCount;
float gpsAccuracy;

// modelV2
float lane_line_probs[4];
Expand Down

0 comments on commit f43671c

Please sign in to comment.