feat(pin): use set_low/high() method instead write()

This commit is contained in:
doryan 2025-04-24 21:57:13 +04:00
parent 42d63292a8
commit 04b69b53f0

View File

@ -28,13 +28,13 @@ where
}
fn write_color_channel(&self, data: u8) {
let (mut data, port_data) = (data, P::read());
let mut data = data;
unsafe {
for _ in 0..8 {
P::write(port_data | P::PIN_POS);
P::set_high();
asm!("rjmp +0");
if data & MSB == 0 {
P::write(port_data & !P::PIN_POS);
P::set_low();
}
asm!(
"
@ -42,7 +42,7 @@ where
rjmp +0
"
);
P::write(port_data & !P::PIN_POS);
P::set_low();
asm!(
"
rjmp +0
@ -78,4 +78,3 @@ where
Ok(())
}
}