Rev 1591 | Rev 1600 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1591 | Rev 1598 | ||
---|---|---|---|
Line 221... | Line 221... | ||
221 | AdNeutralRoll= (roll_neutral+NEUTRAL_FILTER/2) / (NEUTRAL_FILTER / 8); |
221 | AdNeutralRoll= (roll_neutral+NEUTRAL_FILTER/2) / (NEUTRAL_FILTER / 8); |
222 | AdNeutralGier= (gier_neutral+NEUTRAL_FILTER/2) / (NEUTRAL_FILTER); |
222 | AdNeutralGier= (gier_neutral+NEUTRAL_FILTER/2) / (NEUTRAL_FILTER); |
223 | AdNeutralGierBias = AdNeutralGier; |
223 | AdNeutralGierBias = AdNeutralGier; |
224 | StartNeutralRoll = AdNeutralRoll; |
224 | StartNeutralRoll = AdNeutralRoll; |
225 | StartNeutralNick = AdNeutralNick; |
225 | StartNeutralNick = AdNeutralNick; |
226 | if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK]) > 4) |
226 | if(eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_NICK)) > 4) |
227 | { |
227 | { |
228 | NeutralAccY = abs(Mittelwert_AccRoll) / (2*ACC_AMPLIFY); |
228 | NeutralAccY = abs(Mittelwert_AccRoll) / (2*ACC_AMPLIFY); |
229 | NeutralAccX = abs(Mittelwert_AccNick) / (2*ACC_AMPLIFY); |
229 | NeutralAccX = abs(Mittelwert_AccNick) / (2*ACC_AMPLIFY); |
230 | NeutralAccZ = Aktuell_az; |
230 | NeutralAccZ = Aktuell_az; |
231 | } |
231 | } |
232 | else |
232 | else |
233 | { |
233 | { |
234 | NeutralAccX = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK+1]); |
234 | NeutralAccX = (int)eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_NICK)) * 256 + (int)eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_NICK+1)); |
235 | NeutralAccY = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL+1]); |
235 | NeutralAccY = (int)eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_ROLL)) * 256 + (int)eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_ROLL+1)); |
236 | NeutralAccZ = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_Z]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_Z+1]); |
236 | NeutralAccZ = (int)eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_Z)) * 256 + (int)eeprom_read_byte((unsigned char*)(EEPROM_ADR_ACC_Z+1)); |
237 | } |
237 | } |
Line 238... | Line 238... | ||
238 | 238 | ||
239 | MesswertNick = 0; |
239 | MesswertNick = 0; |
240 | MesswertRoll = 0; |
240 | MesswertRoll = 0; |
Line 673... | Line 673... | ||
673 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) // ACC Neutralwerte speichern |
673 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) // ACC Neutralwerte speichern |
674 | { |
674 | { |
675 | if(++delay_neutral > 200) // nicht sofort |
675 | if(++delay_neutral > 200) // nicht sofort |
676 | { |
676 | { |
677 | GRN_OFF; |
677 | GRN_OFF; |
678 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_NICK],0xff); // Werte löschen |
678 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_NICK),0xff); // Werte löschen |
679 | MotorenEin = 0; |
679 | MotorenEin = 0; |
680 | delay_neutral = 0; |
680 | delay_neutral = 0; |
681 | modell_fliegt = 0; |
681 | modell_fliegt = 0; |
682 | SetNeutral(); |
682 | SetNeutral(); |
683 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_NICK],NeutralAccX / 256); // ACC-NeutralWerte speichern |
683 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_NICK),NeutralAccX / 256); // ACC-NeutralWerte speichern |
684 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_NICK+1],NeutralAccX % 256); // ACC-NeutralWerte speichern |
684 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_NICK+1),NeutralAccX % 256); // ACC-NeutralWerte speichern |
685 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL],NeutralAccY / 256); |
685 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_ROLL),NeutralAccY / 256); |
686 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL+1],NeutralAccY % 256); |
686 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_ROLL+1),NeutralAccY % 256); |
687 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_Z],(int)NeutralAccZ / 256); |
687 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_Z),(int)NeutralAccZ / 256); |
688 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_Z+1],(int)NeutralAccZ % 256); |
688 | eeprom_write_byte((unsigned char*)(EEPROM_ADR_ACC_Z+1),(int)NeutralAccZ % 256); |
689 | Piep(GetActiveParamSetNumber(),120); |
689 | Piep(GetActiveParamSetNumber(),120); |
690 | } |
690 | } |
691 | } |
691 | } |
692 | else delay_neutral = 0; |
692 | else delay_neutral = 0; |
693 | } |
693 | } |