This commit is contained in:
andrea
2026-05-26 04:31:23 +02:00
parent 8a84ea847e
commit e6eed1fd73
81 changed files with 116056 additions and 55425 deletions

View File

@@ -32,7 +32,8 @@ extern uint16_t t2ch;
extern uint16_t t3ch;
extern uint16_t t4ch;
extern uint16_t twch;
extern uint16_t tramp1;
extern uint16_t tanem;
extern uint16_t thanem;
extern uint16_t trampman;
extern uint16_t m1pwmMan;
extern uint16_t m2pwmMan;
@@ -58,6 +59,8 @@ extern uint16_t chM3stop;
extern uint16_t chM4start;
extern uint16_t chM4stop;
extern uint16_t flagPar;
const uint16_t deftab[EE_NUM_VIRTUAL_ADDR]={
40, //m1pwmap
60, //m1pwmch
@@ -83,8 +86,8 @@ const uint16_t deftab[EE_NUM_VIRTUAL_ADDR]={
1, //twch
0,
0,
0,
100, //tramp1
0x200,//thanem
20, //tanem
60, //m1pwmMan
70, //m2pwmMan
40, //m3pwmMan
@@ -122,7 +125,7 @@ const uint16_t deftab[EE_NUM_VIRTUAL_ADDR]={
40,
40,
50,
10,
0x01,//flagpar caricamento parametri
};
typedef struct
@@ -424,6 +427,19 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data)
return (uint16_t)st;
}
void loadDefault(void){
uint8_t i;
char s[100];
uint16_t st;
for(i=0;i<EE_NUM_VIRTUAL_ADDR;i++){
st=EEW_Write(i,deftab[i]);
if (st == EE_OK)sprintf((char*)s,"\ndone %d=%d",i,deftab[i]);
else sprintf((char*)s,"\nee write error %d", st);
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
}
}
void loadEE(void){
char s [200];
EEW_Read(M1PWMAP, &m1pwmap);
@@ -446,7 +462,8 @@ void loadEE(void){
EEW_Read(M3TIMEOUTMAN, &m3TimeoutMan);
EEW_Read(M4TIMEOUTMAN, &m4TimeoutMan);
EEW_Read(TRAMP1, &tramp1);
EEW_Read(THANEM, &thanem);
EEW_Read(TANEM, &thanem);
EEW_Read(M1PWMMAN, &m1pwmMan);
EEW_Read(M2PWMMAN, &m2pwmMan);
EEW_Read(M3PWMMAN, &m3pwmMan);
@@ -471,6 +488,8 @@ void loadEE(void){
EEW_Read(CHM4START,&chM4start);
EEW_Read(CHM4STOP ,&chM4stop);
EEW_Read(FLAGPAR ,&flagPar);
sprintf((char*)s,"LoadEE\n");
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
sprintf((char*)s,"\nm1pwmap=%d m1pwmch=%d m2pwmap=%d m2pwmch=%d m3pwmap=%d m3pwmch=%d m4pwmap=%d m4pwmch=%d",m1pwmap,m1pwmch,m2pwmap,m2pwmch,m3pwmap,m3pwmch,m4pwmap, m4pwmch);