Skip to content

Commit

Permalink
chore: temp dbg
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgomesdev committed Dec 24, 2023
1 parent c1ffc34 commit 349509e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions server/src/ps_move/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,27 @@ impl PsMoveController {
self.setting.rumble = rumble_effect.kind.get_updated_rumble(current_rumble);
}

fn update_hsv_and_rumble(&self) -> Result<(), ()> {
fn update_hsv_and_rumble(&mut self) -> Result<(), ()> {
// temp logs
if !self.has_changed_since_last_update {
if SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() % 1000 == 0 {
debug!("Has not changed. ({})", self.led_effect.kind);
}
return Ok(());
}
debug!("Has changed! Sending {} (with {:?})", self.led_effect.kind, self.setting.led);
if SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() % 1000 == 0 {
debug!("Has changed! Sending {} (with {:?})", self.led_effect.kind, self.setting.led);
}

let request = build_set_led_and_rumble_request(self.setting.led, self.setting.rumble);

let res = self.device.write(&request);

match res {
Ok(_) => Ok(()),
Ok(_) => {
self.has_changed_since_last_update = false;
Ok(())
}
Err(err) => {
let err = &err;

Expand Down

0 comments on commit 349509e

Please sign in to comment.