Read NFC data is now displayed
This commit is contained in:
+8
-6
@@ -70,12 +70,12 @@ async fn main(spawner: Spawner) {
|
||||
|
||||
let mut display = init_primary_lcd(
|
||||
peripherals.SPI2,
|
||||
peripherals.GPIO36,
|
||||
peripherals.GPIO35,
|
||||
peripherals.GPIO37,
|
||||
peripherals.GPIO11,
|
||||
peripherals.GPIO10,
|
||||
peripherals.GPIO12,
|
||||
peripherals.GPIO36, // sck
|
||||
peripherals.GPIO35, // mosi
|
||||
peripherals.GPIO37, // miso
|
||||
peripherals.GPIO11, // primary cs
|
||||
peripherals.GPIO10, // shared reset
|
||||
peripherals.GPIO12, // shared dc
|
||||
&mut delay,
|
||||
);
|
||||
|
||||
@@ -96,6 +96,8 @@ async fn main(spawner: Spawner) {
|
||||
loop {
|
||||
if let Ok(card_data) = nfc_driver.read_card_data() {
|
||||
log::info!("NFC Card Read: {:?}", card_data);
|
||||
|
||||
render_nfc_payload(&mut display, &card_data);
|
||||
}
|
||||
|
||||
if button1.is_low() {
|
||||
|
||||
@@ -12,7 +12,7 @@ use crate::card::model::NfcPayload;
|
||||
use crate::display::palette::{PALETTES, TYPE_STYLES};
|
||||
use crate::display::sprite::render_sprite_onto_ili9341;
|
||||
|
||||
pub fn render_nfc_payload<D>(display: &mut D, payload: &[u8; 858])
|
||||
pub fn render_nfc_payload<D>(display: &mut D, payload: &[u8])
|
||||
where
|
||||
D: DrawTarget<Color = Rgb565>,
|
||||
D::Error: core::fmt::Debug,
|
||||
|
||||
Reference in New Issue
Block a user