1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-02 19:02:35 +02:00

See which switch caused the hard limit

- Used for debugging
- Set Message/Level=Debug to activate

looks like this...

[MSG:Pn:X]
ALARM:1
This commit is contained in:
bdring
2021-02-28 08:54:00 -06:00
parent 30a014d508
commit 9ff2f4bc38
3 changed files with 17 additions and 0 deletions

View File

@@ -52,6 +52,11 @@ void IRAM_ATTR isr_limit_switches() {
int evt;
xQueueSendFromISR(limit_sw_queue, &evt, NULL);
#else
// Debugging...Show what axis triggered the ISR
if (static_cast<MsgLevel>(message_level->get()) == MsgLevel::Debug) {
grbl_msg_sendf(CLIENT_ALL, MsgLevel::Debug, "Pn:%s", maskToString(limits_get_state()));
}
# ifdef HARD_LIMIT_FORCE_STATE_CHECK
// Check limit pin state.
if (limits_get_state()) {

View File

@@ -956,4 +956,14 @@ void reportTaskStackSize(UBaseType_t& saved) {
#endif
}
String maskToString(uint32_t mask) {
String str = "";
for (int i = 0; i < MAX_N_AXIS; i++) {
if (mask & bit(i)) {
str += "XYZABC"[i];
}
}
return str;
}
void __attribute__((weak)) forward_kinematics(float* position) {} // This version does nothing. Make your own to do something with it

View File

@@ -129,3 +129,5 @@ char* reportAxisNameMsg(uint8_t axis);
char* reportAxisNameMsg(uint8_t axis, uint8_t dual_axis);
void reportTaskStackSize(UBaseType_t& saved);
String maskToString(uint32_t mask);