update config

This commit is contained in:
fewikay committed 2026-11-12 10:32:18 +01:00
1 parent f746a3fc2d
commit 65502c60f0
1 file changed
+9 -1
@@ -132,8 +132,10 @@ static int config_stepper(L6474_Handle_t s, int param, float value){
switch(param){ switch(param){
case 1: case 1:
L6474_SetProperty(s, L6474_PROP_TORQUE, L6474_EncodePhaseCurrent(value));
case 2: case 2:
L6474_SetProperty(s, L6474_PROP_OCDTH, value);
//TODO value muss noch in Enum L6474x_OCD_TH_t gewandelt werden
case 3: case 3:
if(value == 1){ if(value == 1){
HAL_GPIO_WritePin(STEP_RSTN_GPIO_Port, STEP_RSTN_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(STEP_RSTN_GPIO_Port, STEP_RSTN_Pin, GPIO_PIN_SET);
@@ -519,7 +521,13 @@ int StepperConsoleFunction( int argc, char** argv, void* ctx )
else if (strcmp(argv[0], "config") == 0) else if (strcmp(argv[0], "config") == 0)
{ {
float value = atof(argv[2]); float value = atof(argv[2]);
if ( argc < 2 ){
printf("Too few arguments\r\n");
printf("FAIL\r\n");
return 1;
}
switch(atoi(argv[1])){ switch(atoi(argv[1])){
case 1: case 1:
config_stepper(h, 1, value); config_stepper(h, 1, value);