diff --git a/CHANGELOG.md b/CHANGELOG.md index d077db09f..b1f54c767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed PM5 `hf mf sim` and other 14a sims - the RSSI ADC was reset and recalibrated before every listen, missing fast reader frames such as the auth nR/aR (@iceman1001) - Added `hf mf sam` and `hf mfdes sam` - read PACS from MIFARE Classic SE and DESFire EV1/EV2 through a HID SAM, as Seader does (@iceman1001) - Added `--dg` / `--save` to the HID SAM commands and `wiegand downgrade` - Seader style downgrades to iCLASS legacy / SR dumps, MIFARE Classic dumps and HID Prox clone commands (@iceman1001) - Changed `hf iclass sam`, `hf seos sam` - show the CSN / UID and the plaintext SIO seen during the read (@iceman1001) diff --git a/common_arm/rssi/rssi_hw_at32.c b/common_arm/rssi/rssi_hw_at32.c index 65c5c39ed..a7e6e0ce5 100644 --- a/common_arm/rssi/rssi_hw_at32.c +++ b/common_arm/rssi/rssi_hw_at32.c @@ -17,7 +17,18 @@ static void gpio_config(void) { gpio_init(AT32_GPIO_ADC_RSSI, &gpio_initstructure); } +// Channel of the last full setup, -1 = none +static int s_rssi_ch = -1; + void AdcSetupRssiChannel(adc_rssi_ch_t ch) { + // Full setup blocks for tens of us (reset, calibration, vref read), too slow + // for the 14a tag sim turnaround. Same channel and ADC still up: just restart. + if ((s_rssi_ch == (int)ch) && adc_flag_get(AT32_RSSI_ADC, ADC_RDY_FLAG)) { + adc_flag_clear(AT32_RSSI_ADC, ADC_OCCE_FLAG); // drop a stale result + AdcRssiConversionStart(); + return; + } + adc_common_config_type adc_common_struct; adc_base_config_type adc_base_struct; @@ -74,5 +85,6 @@ void AdcSetupRssiChannel(adc_rssi_ch_t ch) { } else { adc_ordinary_channel_set(AT32_RSSI_ADC, AT32_RSSI_ADC_LF_CHANNEL, 1, ADC_SAMPLETIME_640_5); } + s_rssi_ch = (int)ch; AdcRssiConversionStart(); }