mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 19:02:35 +02:00
uncomment all tool change source code
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
//TODO describe this
|
//TODO describe this
|
||||||
Tool change function called by G code "T[1..n] M06". Not triggered by G38.2 or ESP3D probe function :-)
|
Tool change function called by G code "T[1..n] M06". Not triggered by G38.2 or ESP3D probe function :-)
|
||||||
first Z probe before tool change. Only executed once, because then we<77>ll know the initial Z height.
|
first Z probe before tool change. Only executed once, because then we<77>ll know the initial Z height.
|
||||||
// second Z probe after tool change. Now we can compare
|
// second Z probe after tool change. Now we can compare
|
||||||
|
|
||||||
//TODO parameterise this
|
//TODO parameterise this
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
/*
|
/*
|
||||||
VARIABLES
|
VARIABLES
|
||||||
*/
|
*/
|
||||||
uint8_t AmountOfToolChanges; // Each new tool increases this by 1. Before first tool, it<69>s 0.
|
uint8_t AmountOfToolChanges; // Each new tool increases this by 1. Before first tool, it<69>s 0.
|
||||||
uint8_t currenttoolNo, newtoolNo;
|
uint8_t currenttoolNo, newtoolNo;
|
||||||
float firstZPos, newZPos, Zdiff;
|
float firstZPos, newZPos, Zdiff;
|
||||||
static TaskHandle_t zProbeSyncTaskHandle = NULL;
|
static TaskHandle_t zProbeSyncTaskHandle = NULL;
|
||||||
@@ -74,6 +74,7 @@ void machine_init()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// state machine
|
// state machine
|
||||||
|
/*
|
||||||
void zProbeSyncTask(void* pvParameters)
|
void zProbeSyncTask(void* pvParameters)
|
||||||
{
|
{
|
||||||
TickType_t xLastWakeTime;
|
TickType_t xLastWakeTime;
|
||||||
@@ -212,7 +213,7 @@ void zProbeSyncTask(void* pvParameters)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// That<61>s it
|
// That<61>s it
|
||||||
case TOOLCHANGE_FINISH:
|
case TOOLCHANGE_FINISH:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
grbl_sendf (CLIENT_ALL, "zProbeSyncTask. TOOLCHANGE_FINISH. State=%d\r", tc_state);
|
grbl_sendf (CLIENT_ALL, "zProbeSyncTask. TOOLCHANGE_FINISH. State=%d\r", tc_state);
|
||||||
@@ -240,21 +241,20 @@ void zProbeSyncTask(void* pvParameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_TOOL_CHANGE
|
#ifdef USE_TOOL_CHANGE
|
||||||
/*
|
//
|
||||||
user_tool_change() is called when tool change gcode is received,
|
// user_tool_change() is called when tool change gcode is received,
|
||||||
to perform appropriate actions for your machine.
|
// to perform appropriate actions for your machine.
|
||||||
|
|
||||||
Prerequisite: add "#define USE_TOOL_CHANGE" to your machine.h file
|
// Prerequisite: add "#define USE_TOOL_CHANGE" to your machine.h file
|
||||||
*/
|
|
||||||
void user_tool_change(uint8_t new_tool)
|
void user_tool_change(uint8_t new_tool)
|
||||||
{
|
{
|
||||||
// let<65>s start with the state machine
|
// let<65>s start with the state machine
|
||||||
|
|
||||||
newtoolNo = new_tool;
|
newtoolNo = new_tool;
|
||||||
tc_state = TOOLCHANGE_INIT;
|
tc_state = TOOLCHANGE_INIT;
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
// Nach Aufruf dieser Function wird gleich wieder zurc<72>gkegeben in die aufrufende Function.
|
// Nach Aufruf dieser Function wird gleich wieder zurc<72>gkegeben in die aufrufende Function.
|
||||||
// Ziel: Erst return, wenn wirklich beendet (RTOS!)
|
// Ziel: Erst return, wenn wirklich beendet (RTOS!)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -272,3 +272,6 @@ float getLastZProbePos()
|
|||||||
|
|
||||||
return m_pos[Z_AXIS];
|
return m_pos[Z_AXIS];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
@@ -74,5 +74,3 @@
|
|||||||
|
|
||||||
//#define USE_MACHINE_INIT
|
//#define USE_MACHINE_INIT
|
||||||
//#define USE_TOOL_CHANGE
|
//#define USE_TOOL_CHANGE
|
||||||
|
|
||||||
void zProbeSyncTask(void* pvParameters);
|
|
Reference in New Issue
Block a user