diff options
| -rw-r--r-- | embassy-nrf/src/nfct.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/embassy-nrf/src/nfct.rs b/embassy-nrf/src/nfct.rs index 2756c7952..85866063a 100644 --- a/embassy-nrf/src/nfct.rs +++ b/embassy-nrf/src/nfct.rs | |||
| @@ -215,6 +215,12 @@ impl<'d> NfcT<'d> { | |||
| 215 | r.framedelaymode().write(|w| { | 215 | r.framedelaymode().write(|w| { |
| 216 | w.set_framedelaymode(vals::Framedelaymode::WINDOW_GRID); | 216 | w.set_framedelaymode(vals::Framedelaymode::WINDOW_GRID); |
| 217 | }); | 217 | }); |
| 218 | r.framedelaymin().write(|w| { | ||
| 219 | w.set_framedelaymin(1152); | ||
| 220 | }); | ||
| 221 | r.framedelaymax().write(|w| { | ||
| 222 | w.set_framedelaymax(0xFFFF); // max | ||
| 223 | }); | ||
| 218 | 224 | ||
| 219 | info!("waiting for field"); | 225 | info!("waiting for field"); |
| 220 | poll_fn(|cx| { | 226 | poll_fn(|cx| { |
| @@ -259,12 +265,6 @@ impl<'d> NfcT<'d> { | |||
| 259 | continue; | 265 | continue; |
| 260 | } | 266 | } |
| 261 | 267 | ||
| 262 | // TODO: add support for "window" frame delay, which is technically | ||
| 263 | // needed to be compliant with iso14443-4 | ||
| 264 | r.framedelaymode().write(|w| { | ||
| 265 | w.set_framedelaymode(vals::Framedelaymode::FREE_RUN); | ||
| 266 | }); | ||
| 267 | |||
| 268 | // disable autocoll | 268 | // disable autocoll |
| 269 | #[cfg(not(feature = "nrf52832"))] | 269 | #[cfg(not(feature = "nrf52832"))] |
| 270 | r.autocolresconfig().write(|w| w.0 = 0b11u32); | 270 | r.autocolresconfig().write(|w| w.0 = 0b11u32); |
| @@ -328,7 +328,9 @@ impl<'d> NfcT<'d> { | |||
| 328 | 328 | ||
| 329 | if r.events_error().read() != 0 { | 329 | if r.events_error().read() != 0 { |
| 330 | trace!("Got error?"); | 330 | trace!("Got error?"); |
| 331 | warn!("errors: {:08x}", r.errorstatus().read().0); | 331 | let errs = r.errorstatus().read(); |
| 332 | r.errorstatus().write(|w| w.0 = 0xFFFF_FFFF); | ||
| 333 | trace!("errors: {:08x}", errs.0); | ||
| 332 | r.events_error().write_value(0); | 334 | r.events_error().write_value(0); |
| 333 | return Poll::Ready(Err(Error::RxError)); | 335 | return Poll::Ready(Err(Error::RxError)); |
| 334 | } | 336 | } |
| @@ -382,7 +384,9 @@ impl<'d> NfcT<'d> { | |||
| 382 | if r.events_rxerror().read() != 0 { | 384 | if r.events_rxerror().read() != 0 { |
| 383 | trace!("RXerror got in recv frame, should be back in idle state"); | 385 | trace!("RXerror got in recv frame, should be back in idle state"); |
| 384 | r.events_rxerror().write_value(0); | 386 | r.events_rxerror().write_value(0); |
| 385 | warn!("errors: {:08x}", r.errorstatus().read().0); | 387 | let errs = r.framestatus().rx().read(); |
| 388 | r.framestatus().rx().write(|w| w.0 = 0xFFFF_FFFF); | ||
| 389 | trace!("errors: {:08x}", errs.0); | ||
| 386 | return Poll::Ready(Err(Error::RxError)); | 390 | return Poll::Ready(Err(Error::RxError)); |
| 387 | } | 391 | } |
| 388 | 392 | ||
