1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-29 17:19:50 +02:00

Finished bit macro rename

This commit is contained in:
Mitch Bradley
2021-07-25 07:17:50 -10:00
parent b7107661c5
commit dfc7060569
3 changed files with 4 additions and 4 deletions

View File

@@ -442,7 +442,7 @@ void limits_init() {
// Return a mask of the switches that are engaged. // Return a mask of the switches that are engaged.
AxisMask limits_check(AxisMask check_mask) { AxisMask limits_check(AxisMask check_mask) {
// Expand the bitmask to include both gangs // Expand the bitmask to include both gangs
bit_true(check_mask, check_mask << 16); set_bits(check_mask, check_mask << 16);
return (Machine::Axes::posLimitMask | Machine::Axes::negLimitMask) & check_mask; return (Machine::Axes::posLimitMask | Machine::Axes::negLimitMask) & check_mask;
} }

View File

@@ -64,10 +64,10 @@ namespace Machine {
_value = _pin.read(); _value = _pin.read();
if (_value) { if (_value) {
if (_posLimits != nullptr) { if (_posLimits != nullptr) {
bit_true(*_posLimits, _bitmask); set_bits(*_posLimits, _bitmask);
} }
if (_negLimits != nullptr) { if (_negLimits != nullptr) {
bit_true(*_negLimits, _bitmask); set_bits(*_negLimits, _bitmask);
} }
} else { } else {
if (_posLimits != nullptr) { if (_posLimits != nullptr) {

View File

@@ -81,7 +81,7 @@ const float INCH_PER_MM = (0.0393701f);
#endif #endif
#define bit(n) (1 << static_cast<unsigned int>(n)) #define bit(n) (1 << static_cast<unsigned int>(n))
#define bit_true(target, mask) (target) |= (mask) #define set_bits(target, mask) (target) |= (mask)
#define clear_bits(target, mask) (target) &= ~(mask) #define clear_bits(target, mask) (target) &= ~(mask)
#define bits_are_true(target, mask) ((target & mask) != 0) #define bits_are_true(target, mask) ((target & mask) != 0)
#define bits_are_false(target, mask) ((target & mask) == 0) #define bits_are_false(target, mask) ((target & mask) == 0)