Temp fix for eeprom problem

This commit is contained in:
philsson 2016-10-28 10:22:42 +02:00
parent 428a6140b4
commit c57ec51397
3 changed files with 30 additions and 6 deletions

View File

@ -75,4 +75,6 @@ void pidInit();
**************************************************************************/
void pidRun(uint8_t ID);
void pidEproom(void);
#endif /* FLIGHT_PID_H_ */

View File

@ -498,9 +498,6 @@ void pidUAVInit(pidProfile_t *pidProfile, uint8_t ID)
PidProfile[ID].PID_Out[PITCH] = 0;
PidProfile[ID].PID_Out[YAW] = 0;
PidProfile[ID].PIDweight[ROLL] = 100;
PidProfile[ID].PIDweight[PITCH] = 100;
PidProfile[ID].PIDweight[YAW] = 100;
PidProfile[ID].P[ROLL] = 10;
PidProfile[ID].P[PITCH] = 10;
@ -510,6 +507,10 @@ void pidUAVInit(pidProfile_t *pidProfile, uint8_t ID)
{
case PID_ID_GYRO:
PidProfile[ID].PIDweight[ROLL] = 100;
PidProfile[ID].PIDweight[PITCH] = 100;
PidProfile[ID].PIDweight[YAW] = 100;
PidProfile[ID].pidEnabled = true;
PidProfile[ID].dterm_lpf = 90;
PidProfile[ID].pid_out_limit = 3000;
@ -517,20 +518,30 @@ void pidUAVInit(pidProfile_t *pidProfile, uint8_t ID)
break;
case PID_ID_ACCELEROMETER:
PidProfile[ID].PIDweight[ROLL] = 2;
PidProfile[ID].PIDweight[PITCH] = 2;
PidProfile[ID].PIDweight[YAW] = 100;
PidProfile[ID].pidEnabled = true;
PidProfile[ID].dterm_lpf = 90;
PidProfile[ID].pid_out_limit = 1000;
pidProfile[ID].PIDweight[ROLL] = 50;
pidProfile[ID].PIDweight[PITCH] = 50;
break;
case PID_ID_COMPASS:
PidProfile[ID].PIDweight[ROLL] = 100;
PidProfile[ID].PIDweight[PITCH] = 100;
PidProfile[ID].PIDweight[YAW] = 100;
PidProfile[ID].pidEnabled = false;
break;
case PID_ID_BAROMETER:
PidProfile[ID].PIDweight[ROLL] = 100;
PidProfile[ID].PIDweight[PITCH] = 100;
PidProfile[ID].PIDweight[YAW] = 100;
PidProfile[ID].pidEnabled = false;
break;
@ -560,3 +571,12 @@ void pidInit()
pidUAVInit(&PidProfile[PID_ID_BAROMETER], PID_ID_BAROMETER);
pidUAVInit(&PidProfile[PID_ID_COMPASS], PID_ID_COMPASS);
}
void pidEproom(void)
{
PidProfile[PID_ID_ACCELEROMETER].PIDweight[ROLL] = 2;
PidProfile[PID_ID_ACCELEROMETER].PIDweight[PITCH] = 2;
PidProfile[PID_ID_ACCELEROMETER].PIDweight[YAW] = 100;
}

View File

@ -51,8 +51,10 @@ void init_system()
/* read saved variables from eeprom, in most cases eeprom should be read after a lot of the initializes */
readEEPROM();
pidEproom();
//initialize the CLI NOTE: Cant use the same usart as anything else or there will be some big trouble
cliInit(USART6);
cliInit(USART3);
//init sbus, using USART1
sbus_init();