Use Drawing::Color instead of hardcoded values
parent
81966846ba
commit
b022ec1dbb
|
|
@ -61,6 +61,8 @@ use hal::{
|
||||||
mod lut;
|
mod lut;
|
||||||
use self::lut::*;
|
use self::lut::*;
|
||||||
|
|
||||||
|
use drawing::Color;
|
||||||
|
|
||||||
pub mod command;
|
pub mod command;
|
||||||
pub use command::Command as Command;
|
pub use command::Command as Command;
|
||||||
|
|
||||||
|
|
@ -338,8 +340,8 @@ where
|
||||||
///
|
///
|
||||||
/// TODO: should that option be removed? E.g. the struct contains an additional default background value
|
/// TODO: should that option be removed? E.g. the struct contains an additional default background value
|
||||||
/// which is settable?
|
/// which is settable?
|
||||||
pub fn clear_frame(&mut self, reset_color: Option<u8>) -> Result<(), E> {
|
pub fn clear_frame(&mut self, reset_color: Option<Color>) -> Result<(), E> {
|
||||||
let reset_color: u8 = reset_color.unwrap_or(0xff);
|
let reset_color: Color = reset_color.unwrap_or(Color::White);
|
||||||
|
|
||||||
self.send_resolution()?;
|
self.send_resolution()?;
|
||||||
|
|
||||||
|
|
@ -348,7 +350,7 @@ where
|
||||||
self.send_command(Command::DATA_START_TRANSMISSION_1)?;
|
self.send_command(Command::DATA_START_TRANSMISSION_1)?;
|
||||||
self.delay_ms(2);
|
self.delay_ms(2);
|
||||||
for _ in 0..size {
|
for _ in 0..size {
|
||||||
self.send_data(reset_color)?;
|
self.send_data(reset_color.get_full_byte())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.delay_ms(2);
|
self.delay_ms(2);
|
||||||
|
|
@ -356,7 +358,7 @@ where
|
||||||
self.send_command(Command::DATA_START_TRANSMISSION_2)?;
|
self.send_command(Command::DATA_START_TRANSMISSION_2)?;
|
||||||
self.delay_ms(2);
|
self.delay_ms(2);
|
||||||
for _ in 0..size {
|
for _ in 0..size {
|
||||||
self.send_data(reset_color)?;
|
self.send_data(reset_color.get_full_byte())?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue