console fix + stepper step läuft
This commit is contained in:
1 parent
d076d981ac
commit
13eac4fd0c
3 files changed
+13
-25
No files matched your search
@@ -33,7 +33,7 @@ int StepperConsoleFunction( int argc, char** argv, void* ctx )
|
|||||||
}
|
}
|
||||||
else if ( strcmp(argv[0], "reset") == 0 )
|
else if ( strcmp(argv[0], "reset") == 0 )
|
||||||
{
|
{
|
||||||
init_stepper(NULL, NULL, NULL);
|
reset_stepper(h);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ void StepDriverReset(void* pGPO, const int ena){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StepLibraryDelay(unsigned int ms){
|
void StepLibraryDelay(unsigned int ms){
|
||||||
HAL_Delay(ms);
|
vTaskDelay(pdMS_TO_TICKS(ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1) Funktion schreiben (oben in stepper.c, vor init_stepper)
|
// 1) Funktion schreiben (oben in stepper.c, vor init_stepper)
|
||||||
@@ -91,9 +91,9 @@ static int StepLibraryStep( void* pPWM, int dir, unsigned int numPulses ){
|
|||||||
|
|
||||||
for(unsigned int i = 0; i < numPulses; i++){
|
for(unsigned int i = 0; i < numPulses; i++){
|
||||||
HAL_GPIO_WritePin(STEP_PULSE_GPIO_Port, STEP_PULSE_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(STEP_PULSE_GPIO_Port, STEP_PULSE_Pin, GPIO_PIN_SET);
|
||||||
HAL_Delay(1);
|
vTaskDelay(pdMS_TO_TICKS(1));
|
||||||
HAL_GPIO_WritePin(STEP_PULSE_GPIO_Port, STEP_PULSE_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(STEP_PULSE_GPIO_Port, STEP_PULSE_Pin, GPIO_PIN_RESET);
|
||||||
HAL_Delay(1);
|
vTaskDelay(pdMS_TO_TICKS(1));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -123,6 +123,11 @@ L6474_Handle_t init_stepper(void* pIO, void* pGPO, void* pPWM){
|
|||||||
//p.cancelStep = StepTimerCancelAsync;
|
//p.cancelStep = StepTimerCancelAsync;
|
||||||
L6474_Handle_t s = L6474_CreateInstance(&p, pIO, pGPO, pPWM);
|
L6474_Handle_t s = L6474_CreateInstance(&p, pIO, pGPO, pPWM);
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_stepper(L6474_Handle_t s){
|
||||||
|
|
||||||
L6474_BaseParameter_t b;
|
L6474_BaseParameter_t b;
|
||||||
L6474_SetBaseParameter(&b); // sinnvolle Standardwerte
|
L6474_SetBaseParameter(&b); // sinnvolle Standardwerte
|
||||||
b.stepMode = smMICRO4;
|
b.stepMode = smMICRO4;
|
||||||
@@ -136,22 +141,4 @@ L6474_Handle_t init_stepper(void* pIO, void* pGPO, void* pPWM){
|
|||||||
result |= L6474_Initialize(s, &b);
|
result |= L6474_Initialize(s, &b);
|
||||||
result |= L6474_SetPowerOutputs(s, 1);
|
result |= L6474_SetPowerOutputs(s, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// in case we have no error, we can enable the drivers
|
|
||||||
// and then we step a bit
|
|
||||||
if ( result == 0 )
|
|
||||||
{
|
|
||||||
result |= L6474_StepIncremental(s, 10000 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// error handling
|
|
||||||
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset_stepper(){
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -307,6 +307,7 @@ int main(void)
|
|||||||
|
|
||||||
//Konsole
|
//Konsole
|
||||||
ConsoleHandle_t c = CONSOLE_CreateInstance( 4*configMINIMAL_STACK_SIZE, configMAX_PRIORITIES - 5 );
|
ConsoleHandle_t c = CONSOLE_CreateInstance( 4*configMINIMAL_STACK_SIZE, configMAX_PRIORITIES - 5 );
|
||||||
|
L6474_Handle_t stepper1 = init_stepper(NULL, NULL, NULL);
|
||||||
|
|
||||||
CONSOLE_RegisterCommand(c, "capability", "prints a specified string of capability bits",
|
CONSOLE_RegisterCommand(c, "capability", "prints a specified string of capability bits",
|
||||||
CapabilityFunc, NULL);
|
CapabilityFunc, NULL);
|
||||||
@@ -315,7 +316,7 @@ int main(void)
|
|||||||
fabi, NULL);
|
fabi, NULL);
|
||||||
|
|
||||||
CONSOLE_RegisterCommand(c, "stepper", "stepper command",
|
CONSOLE_RegisterCommand(c, "stepper", "stepper command",
|
||||||
StepperConsoleFunction, NULL);
|
StepperConsoleFunction, stepper1);
|
||||||
|
|
||||||
//Spindle
|
//Spindle
|
||||||
init_spindle(c, 9000, -9000, 1600);
|
init_spindle(c, 9000, -9000, 1600);
|
||||||
|
|||||||
@@ -46,9 +46,9 @@
|
|||||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="disable"/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="disable"/>
|
||||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="true"/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="true"/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="freertos"/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="freertos"/>
|
||||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
|
||||||
|
|||||||
Reference in new issue
Block a user