[riot-notifications] [RIOT-OS/RIOT] Wiegand driver for RIOT-OS (#12217)

Mario Gómez notifications at github.com
Thu Sep 26 03:07:41 CEST 2019


mxgxw commented on this pull request.



> +  {
+    // shift value to high bits
+    dev->wg_card_temp_high |= ((0x80000000 & dev->wg_card_temp)>>31);
+    dev->wg_card_temp_high <<= 1;
+    dev->wg_card_temp |= 1;
+    dev->wg_card_temp <<=1;
+  }
+  else
+  {
+    // D1 represent binary 1, so OR card data with 1 then
+    dev->wg_card_temp |= 1;
+    // left shift card data
+    dev->wg_card_temp <<= 1;
+  }
+  // Keep track of last wiegand bit received
+  dev->wg_last_wiegand = xtimer_now_usec64();

Yes. We can use only one 64 bit integer. I suppose that the original author of the algorithm wanted to make the code a little bit more readable when decoding the Mifare 34 format.

Let me do this little change.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12217#discussion_r328399090
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190925/619d6ba4/attachment.htm>


More information about the notifications mailing list