🎨 Fix comments, formatting

This commit is contained in:
Scott Lahteine 2022-06-21 23:28:19 -05:00
parent 2b8d115ebc
commit 15ca479708
4 changed files with 12 additions and 17 deletions

View file

@ -633,7 +633,7 @@
#define PROBE() ~, 1 // Second item will be 1 if this is passed #define PROBE() ~, 1 // Second item will be 1 if this is passed
#define _NOT_0 PROBE() #define _NOT_0 PROBE()
#define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. #define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'.
#define _BOOL(x) NOT(NOT(x)) // NOT('0') gets '0'. Anything else gets '1'. #define _BOOL(x) NOT(NOT(x)) // _BOOL('0') gets '0'. Anything else gets '1'.
#define IF_ELSE(TF) _IF_ELSE(_BOOL(TF)) #define IF_ELSE(TF) _IF_ELSE(_BOOL(TF))
#define _IF_ELSE(TF) _CAT(_IF_, TF) #define _IF_ELSE(TF) _CAT(_IF_, TF)
@ -647,7 +647,6 @@
#define HAS_ARGS(V...) _BOOL(FIRST(_END_OF_ARGUMENTS_ V)()) #define HAS_ARGS(V...) _BOOL(FIRST(_END_OF_ARGUMENTS_ V)())
#define _END_OF_ARGUMENTS_() 0 #define _END_OF_ARGUMENTS_() 0
// Simple Inline IF Macros, friendly to use in other macro definitions // Simple Inline IF Macros, friendly to use in other macro definitions
#define IF(O, A, B) ((O) ? (A) : (B)) #define IF(O, A, B) ((O) ? (A) : (B))
#define IF_0(O, A) IF(O, A, 0) #define IF_0(O, A) IF(O, A, 0)

View file

@ -241,7 +241,7 @@
#define PROBE() ~, 1 // Second item will be 1 if this is passed #define PROBE() ~, 1 // Second item will be 1 if this is passed
#define _NOT_0 PROBE() #define _NOT_0 PROBE()
#define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. #define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'.
#define _BOOL(x) NOT(NOT(x)) // NOT('0') gets '0'. Anything else gets '1'. #define _BOOL(x) NOT(NOT(x)) // _BOOL('0') gets '0'. Anything else gets '1'.
#define _DO_1(W,C,A) (_##W##_1(A)) #define _DO_1(W,C,A) (_##W##_1(A))
#define _DO_2(W,C,A,B) (_##W##_1(A) C _##W##_1(B)) #define _DO_2(W,C,A,B) (_##W##_1(A) C _##W##_1(B))

View file

@ -2100,9 +2100,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
/** /**
* At this point at least one of the axes has more steps than * At this point at least one of the axes has more steps than
* MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped as * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped
* zero-length. It's important to not apply corrections * as zero-length. It's important to not apply corrections to blocks
* to blocks that would get dropped! * that would get dropped!
* *
* A correction function is permitted to add steps to an axis, it * A correction function is permitted to add steps to an axis, it
* should *never* remove steps! * should *never* remove steps!
@ -2136,12 +2136,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#if ENABLED(AUTO_POWER_CONTROL) #if ENABLED(AUTO_POWER_CONTROL)
if (LINEAR_AXIS_GANG( if (LINEAR_AXIS_GANG(
block->steps.x, block->steps.x, || block->steps.y, || block->steps.z,
|| block->steps.y, || block->steps.i, || block->steps.j, || block->steps.k
|| block->steps.z,
|| block->steps.i,
|| block->steps.j,
|| block->steps.k
)) powerManager.power_on(); )) powerManager.power_on();
#endif #endif

View file

@ -968,7 +968,7 @@ void reset_trinamic_drivers() {
#if ANY_AXIS_HAS(SW_SERIAL) #if ANY_AXIS_HAS(SW_SERIAL)
struct SanitySwSerialDetails { int32_t txpin; int32_t rxpin; uint32_t address; }; struct SanitySwSerialDetails { int32_t txpin; int32_t rxpin; uint32_t address; };
#define TMC_SW_DETAIL_ARGS(A) TERN(A##_HAS_SW_SERIAL, A##_SERIAL_TX_PIN, -1), TERN(A##_HAS_SW_SERIAL, A##_SERIAL_RX_PIN, -1), TERN0(A##_HAS_SW_SERIAL, A##_SLAVE_ADDRESS) #define TMC_SW_DETAIL_ARGS(A) TERN(A##_HAS_SW_SERIAL, A##_SERIAL_TX_PIN, -1), TERN(A##_HAS_SW_SERIAL, A##_SERIAL_RX_PIN, -1), TERN0(A##_HAS_SW_SERIAL, A##_SLAVE_ADDRESS)
#define TMC_SW_DETAIL(A) TMC_SW_DETAIL_ARGS(A) #define TMC_SW_DETAIL(A) { TMC_SW_DETAIL_ARGS(A) }
constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = {
MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES) MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES)
}; };