feat(const): rename LAST_BIT -> MSB

This commit is contained in:
doryan 2025-04-22 22:51:38 +04:00
parent 4e0d9d82f2
commit 6e54b54895

View File

@ -7,7 +7,7 @@ use avr_device::interrupt::free;
use smart_leds::{SmartLedsWrite, RGB8}; use smart_leds::{SmartLedsWrite, RGB8};
use static_pins::StaticPinOps; use static_pins::StaticPinOps;
const LAST_BIT: u8 = 0x80; const MSB: u8 = 0x80;
#[repr(transparent)] #[repr(transparent)]
pub struct Neopixel<P> { pub struct Neopixel<P> {
@ -21,6 +21,7 @@ where
#[inline] #[inline]
pub const fn new(_pin: Pin<Output, P>) -> Self { pub const fn new(_pin: Pin<Output, P>) -> Self {
Self { _pin } Self { _pin }
if data & MSB == 0 {
} }
} }
@ -57,7 +58,6 @@ where
while count > 0 { while count > 0 {
P::write(port_data | pin_data); P::write(port_data | pin_data);
asm!("rjmp +0"); asm!("rjmp +0");
if data & LAST_BIT == 0 {
P::write(port_data & !pin_data); P::write(port_data & !pin_data);
} }
asm!( asm!(