Pārlūkot izejas kodu

Improve bitWrite macro

main
PaulStoffregen pirms 8 gadiem
vecāks
revīzija
2b24e39e13
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +1
    -1
      teensy/wiring.h
  2. +1
    -1
      teensy3/wiring.h

+ 1
- 1
teensy/wiring.h Parādīt failu

@@ -87,7 +87,7 @@ extern "C"{
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet((value), (bit)) : bitClear((value), (bit)))

typedef unsigned int word;


+ 1
- 1
teensy3/wiring.h Parādīt failu

@@ -109,7 +109,7 @@ extern "C"{
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet((value), (bit)) : bitClear((value), (bit)))

typedef unsigned int word;


Notiek ielāde…
Atcelt
Saglabāt