From e657e26886993bc7489f19d5ac6b84cb1f6eb788 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Wed, 6 Feb 2019 15:15:37 +0200 Subject: [PATCH] check AMS product type --- targets/stm32l432/src/ams.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/stm32l432/src/ams.c b/targets/stm32l432/src/ams.c index a342513..4a7a2f7 100644 --- a/targets/stm32l432/src/ams.c +++ b/targets/stm32l432/src/ams.c @@ -275,12 +275,12 @@ bool ams_init() // check connection uint8_t productType = ams_read_reg(AMS_REG_PRODUCT_TYPE); - if (!productType) + if (productType != 0x14) { - printf1(TAG_NFC,"Have no product type. Connection error."); + printf1(TAG_NFC,"Have no product type [0x%02x]. Connection error.\n", productType); return false; } - printf1(TAG_NFC,"Product type 0x%02x.", productType); + printf1(TAG_NFC,"Product type 0x%02x.\n", productType); // enable tunneling mode and RF configuration ams_write_reg(AMS_REG_IC_CONF2, AMS_RFCFG_EN | AMS_TUN_MOD);