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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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) {
|
||||||
|
@@ -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)
|
||||||
|
Reference in New Issue
Block a user