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 f1215b4 commit 2fa25e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/src/ps_move/controller.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::collections::HashMap;
use std::time::{SystemTime, UNIX_EPOCH};

use hidapi::{HidDevice, HidError};
use palette::{FromColor, Hsv, Srgb};
use tracing::info;
use tracing::field::debug;
use tracing::{debug, info};

use crate::ps_move::effects::{LedEffect, RumbleEffect, RumbleEffectKind};
use crate::ps_move::models::{BatteryLevel, ButtonState, ConnectionType, ControllerInfo, DataInput, fill_state_from_byte_slice, MoveRequestType, MoveSetting};
Expand Down Expand Up @@ -232,6 +234,11 @@ impl PsMoveController {
}

fn update_hsv_and_rumble(&self) -> Result<(), ()> {
// temp
if (SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() % 1000 == 0) {
debug!("Current effect on controller update is {}", self.led_effect.kind);
}

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

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

0 comments on commit 2fa25e9

Please sign in to comment.