regenerate cargo.lock and make clippy happy
This commit is contained in:
parent
19202249b9
commit
22d5f33541
1077
display/Cargo.lock
generated
Normal file
1077
display/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -38,8 +38,9 @@ const SET_DDRAM_ADDR: u8 = 0x80;
|
||||
const EN: u8 = 0b000_00100;
|
||||
const RS: u8 = 0b000_00001;
|
||||
|
||||
const ROWS: usize = 2;
|
||||
const LINE_LENGTH: usize = 16;
|
||||
const LINE_OFFSETS: [u8; 2] = [0x00, 0x40];
|
||||
const LINE_OFFSETS: [u8; ROWS] = [0x00, 0x40];
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Lines {
|
||||
@ -49,7 +50,7 @@ pub enum Lines {
|
||||
|
||||
pub struct Lcd<'a> {
|
||||
i2c: Twim<'a, TWISPI0>,
|
||||
lines: [&'a str; 2],
|
||||
lines: [&'a str; ROWS],
|
||||
address: u8,
|
||||
}
|
||||
|
||||
@ -125,13 +126,11 @@ impl<'a> Lcd<'a> {
|
||||
}
|
||||
|
||||
async fn write_buffer(&mut self) -> Result<(), twim::Error> {
|
||||
for line in 0..2 {
|
||||
let mut position = 0;
|
||||
|
||||
for c in self.lines[line].chars() {
|
||||
self.write_character(c, position, LINE_OFFSETS[line])
|
||||
#[allow(clippy::needless_range_loop)]
|
||||
for line in 0..ROWS {
|
||||
for (position, c) in self.lines[line].chars().enumerate() {
|
||||
self.write_character(c, position as u8, LINE_OFFSETS[line])
|
||||
.await?;
|
||||
position += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +145,8 @@ impl<'a> Lcd<'a> {
|
||||
}
|
||||
|
||||
async fn set_cursor(&mut self, position: u8, line_offset: u8) -> Result<(), twim::Error> {
|
||||
self.cmd(SET_DDRAM_ADDR | line_offset + position, 0).await?;
|
||||
self.cmd(SET_DDRAM_ADDR | (line_offset + position), 0)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,16 +1,11 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use core::cell::Cell;
|
||||
|
||||
use ble::gatt::Server;
|
||||
use cortex_m::interrupt::Mutex;
|
||||
use defmt_rtt as _;
|
||||
use embassy_nrf as _;
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_time::Delay;
|
||||
use embedded_hal_async::delay::DelayNs;
|
||||
use flash::Config;
|
||||
use futures::pin_mut;
|
||||
use nrf_softdevice::{Flash, Softdevice};
|
||||
use panic_probe as _;
|
||||
|
@ -34,7 +34,7 @@ fn configure(device_name: &str) -> nrf_softdevice::Config {
|
||||
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
|
||||
}),
|
||||
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
|
||||
p_value: device_name.as_bytes().as_ptr() as *const u8 as _,
|
||||
p_value: device_name.as_bytes().as_ptr() as _,
|
||||
current_len: 9,
|
||||
max_len: 9,
|
||||
write_perm: unsafe { mem::zeroed() },
|
||||
|
Loading…
Reference in New Issue
Block a user