not really

This commit is contained in:
Jason Wen
2024-09-29 11:45:47 -04:00
parent 1b64a7debd
commit 9c57f6bad0
5 changed files with 7 additions and 8 deletions
+1 -1
Submodule panda updated: dcd226d85f...4f40ae6767
+2 -2
View File
@@ -137,8 +137,8 @@ void Panda::enable_deepsleep() {
handle->control_write(0xfb, 0, 0);
}
void Panda::send_heartbeat(bool engaged, bool mads_engaged) {
handle->control_write(0xf3, engaged, mads_engaged);
void Panda::send_heartbeat(bool engaged) {
handle->control_write(0xf3, engaged, 0);
}
void Panda::set_can_speed_kbps(uint16_t bus, uint16_t speed) {
+1 -1
View File
@@ -75,7 +75,7 @@ public:
std::optional<std::string> get_serial();
void set_power_saving(bool power_saving);
void enable_deepsleep();
void send_heartbeat(bool engaged, bool mads_engaged);
void send_heartbeat(bool engaged);
void set_can_speed_kbps(uint16_t bus, uint16_t speed);
void set_data_speed_kbps(uint16_t bus, uint16_t speed);
void set_canfd_non_iso(uint16_t bus, bool non_iso);
+2 -3
View File
@@ -313,7 +313,7 @@ void send_peripheral_state(Panda *panda, PubMaster *pm) {
}
void process_panda_state(std::vector<Panda *> &pandas, PubMaster *pm, bool spoofing_started) {
static SubMaster sm({"selfdriveState", "selfdriveStateSP"});
static SubMaster sm({"selfdriveState"});
std::vector<std::string> connected_serials;
for (Panda *p : pandas) {
@@ -352,9 +352,8 @@ void process_panda_state(std::vector<Panda *> &pandas, PubMaster *pm, bool spoof
sm.update(0);
const bool engaged = sm.allAliveAndValid({"selfdriveState"}) && sm["selfdriveState"].getSelfdriveState().getEnabled();
const bool mads_engaged = sm.allAliveAndValid({"selfdriveStateSP"}) && sm["selfdriveStateSP"].getSelfdriveStateSP().getMads().getEnabled();
for (const auto &panda : pandas) {
panda->send_heartbeat(engaged, mads_engaged);
panda->send_heartbeat(engaged);
}
}
}
+1 -1
View File
@@ -72,7 +72,7 @@ void PandaStream::streamThread() {
handleEvent(capnp::messageToFlatArray(msg));
panda->send_heartbeat(false, false);
panda->send_heartbeat(false);
}
}