  
      if (sm.updated("deviceState") && !no_fan_control) {
        // Fan speed
        uint16_t fan_speed = sm["deviceState"].getDeviceState().getFanSpeedPercentDesired();
        if (fan_speed != prev_fan_speed || cnt % 100 == 0) {
          panda->set_fan_speed(fan_speed);
          prev_fan_speed = fan_speed;
        }
      }
  
 
</s> remove     cnt++;
    sm.update(1000); // TODO: what happens if EINTR is sent while in sm.update?
 </s> add     sm.update(1000); </s> remove     if (ir_pwr != prev_ir_pwr || cnt % 100 == 0 || ir_pwr >= 50.0) {
 </s> add     if (ir_pwr != prev_ir_pwr || sm.frame % 100 == 0 || ir_pwr >= 50.0) { </s> remove     // Disable ir_pwr on front frame timeout
    uint64_t cur_t = nanos_since_boot();
    if (cur_t - last_front_frame_t > 1e9) {
 </s> add     // Disable IR on input timeout
    if (nanos_since_boot() - last_driver_camera_t > 1e9) { </s> remove   unsigned int cnt = 0;
 </s> add  </s> remove     // exit if no pandas are connected
 </s> add 
      if (fan_speed != prev_fan_speed || sm.frame % 100 == 0) {
  
      if (sm.updated("deviceState") && !no_fan_control) {
        // Fan speed
        uint16_t fan_speed = sm["deviceState"].getDeviceState().getFanSpeedPercentDesired();
      if (fan_speed != prev_fan_speed || sm.frame % 100 == 0) {
          panda->set_fan_speed(fan_speed);
          prev_fan_speed = fan_speed;
        }
      }
  
keep keep keep keep replace keep keep keep keep keep
 boardd: misc cleanup (#28969)

* boardd cleanup

* no more front frame

* faster connect loop

* fix that on mac 
selfdrive/boardd/boardd.cc