wip
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
* Created on: May 2, 2026
|
||||
* Author: user
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "main.h"
|
||||
#include "mot.h"
|
||||
#include "pwm.h"
|
||||
@@ -36,8 +38,17 @@ extern uint16_t m4pwmch;
|
||||
extern uint16_t mrampstart[4];
|
||||
extern uint16_t tramp;
|
||||
|
||||
extern UART_HandleTypeDef huart1;
|
||||
|
||||
motMov_st m1ap(void){
|
||||
static motMov_st m1st;
|
||||
static motMov_st m1st=motWaiting;
|
||||
static motMov_st memm1st=motStop;
|
||||
char s[100];
|
||||
if(memm1st!=m1st){
|
||||
memm1st=m1st;
|
||||
sprintf(s,"\nm1ap=%d",m1st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(rtCiclo<apM1start)m1st=motWaiting;
|
||||
switch(m1st){
|
||||
case motWaiting:
|
||||
@@ -75,6 +86,13 @@ motMov_st m1ap(void){
|
||||
|
||||
motMov_st m2ap(void){
|
||||
static motMov_st m2st;
|
||||
static motMov_st memm2st=motStop;
|
||||
char s[100];
|
||||
if(memm2st!=m2st){
|
||||
memm2st=m2st;
|
||||
sprintf(s,"\nm2ap=%d",m2st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(rtCiclo<apM2start)m2st=motWaiting;
|
||||
switch(m2st){
|
||||
case motWaiting:
|
||||
@@ -112,6 +130,13 @@ motMov_st m2ap(void){
|
||||
|
||||
motMov_st m3ap(void){
|
||||
static motMov_st m3st;
|
||||
static motMov_st memm3st=motStop;
|
||||
char s[100];
|
||||
if(memm3st!=m3st){
|
||||
memm3st=m3st;
|
||||
sprintf(s,"\nm3ap=%d",m3st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(rtCiclo<apM3start)m3st=motWaiting;
|
||||
switch(m3st){
|
||||
case motWaiting:
|
||||
@@ -149,6 +174,13 @@ motMov_st m3ap(void){
|
||||
|
||||
motMov_st m4ap(void){
|
||||
static motMov_st m4st;
|
||||
static motMov_st memm4st=motStop;
|
||||
char s[100];
|
||||
if(memm4st!=m4st){
|
||||
memm4st=m4st;
|
||||
sprintf(s,"\nm4ap=%d",m4st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(rtCiclo<apM4start)m4st=motWaiting;
|
||||
switch(m4st){
|
||||
case motWaiting:
|
||||
@@ -171,7 +203,7 @@ motMov_st m4ap(void){
|
||||
}
|
||||
break;
|
||||
case motStopRamp:
|
||||
if(ramp(43,BW,m4pwmap,0,tramp,RAMPRUN)==DONE){
|
||||
if(ramp(M4,BW,m4pwmap,0,tramp,RAMPRUN)==DONE){
|
||||
m4st=motStop;
|
||||
}
|
||||
break;
|
||||
@@ -186,6 +218,13 @@ motMov_st m4ap(void){
|
||||
|
||||
motMov_st m1ch(void){
|
||||
static motMov_st m1st;
|
||||
static motMov_st memm1st=motStop;
|
||||
char s[100];
|
||||
if(memm1st!=m1st){
|
||||
memm1st=m1st;
|
||||
sprintf(s,"\nm1ch=%d",m1st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(rtCiclo<chM1start)m1st=motWaiting;
|
||||
switch(m1st){
|
||||
case motWaiting:
|
||||
@@ -223,6 +262,14 @@ motMov_st m1ch(void){
|
||||
|
||||
motMov_st m2ch(void){
|
||||
static motMov_st m2st;
|
||||
static motMov_st memm2st=motStop;
|
||||
char s[100];
|
||||
if(memm2st!=m2st){
|
||||
memm2st=m2st;
|
||||
sprintf(s,"\nm2ch=%d",m2st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
|
||||
if(rtCiclo<chM2start)m2st=motWaiting;
|
||||
switch(m2st){
|
||||
case motWaiting:
|
||||
@@ -260,6 +307,14 @@ motMov_st m2ch(void){
|
||||
|
||||
motMov_st m3ch(void){
|
||||
static motMov_st m3st;
|
||||
static motMov_st memm3st=motStop;
|
||||
char s[100];
|
||||
if(memm3st!=m3st){
|
||||
memm3st=m3st;
|
||||
sprintf(s,"\nm3ch=%d",m3st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
|
||||
if(rtCiclo<chM3start)m3st=motWaiting;
|
||||
switch(m3st){
|
||||
case motWaiting:
|
||||
@@ -297,6 +352,14 @@ motMov_st m3ch(void){
|
||||
|
||||
motMov_st m4ch(void){
|
||||
static motMov_st m4st;
|
||||
static motMov_st memm4st=motStop;
|
||||
char s[100];
|
||||
if(memm4st!=m4st){
|
||||
memm4st=m4st;
|
||||
sprintf(s,"\nm4ch=%d",m4st);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
|
||||
if(rtCiclo<chM4start)m4st=motWaiting;
|
||||
switch(m4st){
|
||||
case motWaiting:
|
||||
|
||||
Reference in New Issue
Block a user