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