MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / bitFlip

Function bitFlip

libraries/bitHelpers/bitHelpers.cpp:386–390  ·  view source on GitHub ↗

/////////////////////////////////////////////// BIT FLIP

Source from the content-addressed store, hash-verified

384// BIT FLIP
385//
386uint8_t bitFlip(uint8_t value, uint8_t pos)
387{
388 if (pos > 7) return value;
389 return value ^ (1 << pos);
390}
391
392
393uint16_t bitFlip(uint16_t value, uint8_t pos)

Callers 1

unittestFunction · 0.85

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.68