From f4ef31c4bec1e5e59a60ef0f19c07822e9ce34a3 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 23 Jun 2018 06:41:51 +0200 Subject: [PATCH] chg: OR in registry changes when setting LOW or HIGH instead of assigning. A nicer behavior not messing with previous set bits. --- include/proxmark3.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/proxmark3.h b/include/proxmark3.h index 002c7db36..4532baf09 100644 --- a/include/proxmark3.h +++ b/include/proxmark3.h @@ -53,8 +53,11 @@ #define UDP_CSR_BYTES_RECEIVED(x) (((x) >> 16) & 0x7ff) //************************************************************** -#define LOW(x) AT91C_BASE_PIOA->PIO_CODR = (x) -#define HIGH(x) AT91C_BASE_PIOA->PIO_SODR = (x) + + +#define LOW(x) AT91C_BASE_PIOA->PIO_CODR |= (x) +#define HIGH(x) AT91C_BASE_PIOA->PIO_SODR |= (x) + #define GETBIT(x) (AT91C_BASE_PIOA->PIO_ODSR & (x)) ? 1:0 #define SETBIT(x, y) (y) ? (HIGH(x)):(LOW(x)) #define INVBIT(x) SETBIT((x), !(GETBIT(x)))