Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
chg: OR in registry changes when setting LOW or HIGH instead of assig…
Browse files Browse the repository at this point in the history
…ning. A nicer behavior not messing with previous set bits.
  • Loading branch information
Chris committed Jun 23, 2018
1 parent e5e990f commit f4ef31c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/proxmark3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit f4ef31c

Please sign in to comment.