Compare commits
4 Commits
42d63292a8
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f734b1036 | |||
| 3b6cc73b92 | |||
| 733fc8e22f | |||
| 04b69b53f0 |
10
Cargo.toml
10
Cargo.toml
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "soft-serial"
|
||||
name = "neopixel-avr"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
@@ -9,10 +9,12 @@ smart-leds = "0.4.0"
|
||||
[dependencies.arduino-hal]
|
||||
git = "https://github.com/rahix/avr-hal"
|
||||
rev = "3e362624547462928a219c40f9ea8e3a64f21e5f"
|
||||
features = ["sparkfun-promicro"]
|
||||
|
||||
[dependencies.static_pins]
|
||||
git = "https://gitea.doryan04.ru/TheEmbeddedRust/static_pins"
|
||||
[dependencies.static-pins]
|
||||
git = "https://gitea.doryan04.ru/TheEmbeddedRust/static-pins"
|
||||
|
||||
[features]
|
||||
sparkfun-promicro = ["arduino-hal/sparkfun-promicro", "static-pins/sparkfun-promicro"]
|
||||
|
||||
[dependencies.avr-device]
|
||||
version = "0.5.4"
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user