Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Apr 16 19:04:41 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13668


Change subject: ncn8025: Invert the software logic of RSTIN
......................................................................

ncn8025: Invert the software logic of RSTIN

In hardware, the Card RST pin is low-active.  There's a level
translator in the NCN8025, but there's no logic inversion, so RSTIN
is also low-active.  In software, we have the policy of all signals
being "true-active", i.e. true represents the active state, and false
the inactive state.

Hence, we must invert the logic of how we handle rstin.

Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
---
M sysmoOCTSIM/ncn8025.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/68/13668/1

diff --git a/sysmoOCTSIM/ncn8025.c b/sysmoOCTSIM/ncn8025.c
index 61509bc..711b082 100644
--- a/sysmoOCTSIM/ncn8025.c
+++ b/sysmoOCTSIM/ncn8025.c
@@ -21,7 +21,7 @@
 static uint8_t ncn8025_encode(const struct ncn8025_settings *set)
 {
 	uint8_t reg = 0;
-	if (set->rstin)
+	if (!set->rstin)
 		reg |= 0x01;
 	if (!set->cmdvcc)
 		reg |= 0x02;
@@ -43,7 +43,7 @@
 {
 	memset(set, 0, sizeof(*set));
 
-	if (reg & 0x01)
+	if (!(reg & 0x01))
 		set->rstin = true;
 	if (!(reg & 0x02))
 		set->cmdvcc = true;

-- 
To view, visit https://gerrit.osmocom.org/13668
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
Gerrit-Change-Number: 13668
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190416/08a6fe0c/attachment-0001.html>


More information about the gerrit-log mailing list