/trunk/Spektrum.c |
---|
7,7 → 7,6 |
unsigned char SpektrumTimer = 0; |
//--------------------------------------------------------------// |
//--------------------------------------------------------------// |
void SpektrumBinding(void) |
{ |
70,7 → 69,12 |
{ |
// -- Start of USART1 initialisation for Spekturm seriell-mode |
// USART1 Control and Status Register A, B, C and baud rate register |
uint8_t sreg = SREG; |
uint16_t ubrr = (uint16_t) ((uint32_t) SYSCLK/(8 * 115200) - 1); |
// disable all interrupts before reconfiguration |
cli(); |
// disable RX-Interrupt |
UCSR1B &= ~(1 << RXCIE1); |
// disable TX-Interrupt |
81,9 → 85,13 |
// set RXD1 (PD2) as an input pin |
PORTD |= (1 << PORTD2); |
DDRD &= ~(1 << DDD2); |
// set TXD1 (PD3) as an output pin |
PORTD |= (1 << PORTD3); |
DDRD |= (1 << DDD3); |
// USART0 Baud Rate Register |
// set clock divider |
UBRR1H = (uint8_t)(ubrr>>8); |
UBRR1L = (uint8_t)ubrr; |
// enable double speed operation |
109,6 → 117,9 |
// enable RX-interrupts at the end |
UCSR1B |= (1 << RXCIE1); |
// -- End of USART1 initialisation |
// restore global interrupt flags |
SREG = sreg; |
return; |
} |
190,7 → 201,6 |
//############################################################################ |
//Diese Routine startet und inizialisiert den USART1 für seriellen Spektrum satellite reciever |
//SIGNAL(USART1_RX_vect) |
//############################################################################ |
void SpektrumParser(unsigned char c) |
{ |
/trunk/fc.c |
---|
658,6 → 658,7 |
{ |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
LipoDetection(0); |
InitReceiver(); |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
{ |
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
/trunk/libfcinit.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/libfcinit.h |
---|
1,7 → 1,8 |
#ifndef _INITLIB_H |
#define _INITLIB_H |
extern void InitFC(void); |
extern void Polling(void); |
extern void InitFC(void); // general init function (must be called at startup) |
extern void InitReceiver(void); // init of reveicer type |
extern void Polling(void); // must be called in main-loop |
#endif //_INITLIB_H |
/trunk/main.c |
---|
194,17 → 194,15 |
i2c_init(); |
SPI_MasterInit(); |
InitFC(); |
InitFC(); |
sei(); |
printf("\n\r==================================="); |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a'); |
printf("\n\rthe use of this software is only permitted \n\ron original MikroKopter-Hardware"); |
printf("\n\rwww.MikroKopter.de (c) HiSystems GmbH"); |
printf("\n\r==================================="); |
GRN_ON; |
sei(); |
GRN_ON; |
ReadParameterSet(3, (unsigned char *) &EE_Parameter.Kanalbelegung[0], 13); // read only the first bytes |
if((eeprom_read_byte(&EEPromArray[EEPROM_ADR_MIXER_TABLE]) == MIXER_REVISION) && // Check Revision in the first Byte |
(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != 0xff)) // Settings reset via Koptertool |
{ |
228,6 → 226,9 |
eeprom_write_block(&Mixer, &EEPromArray[EEPROM_ADR_MIXER_TABLE], sizeof(Mixer)); |
} |
printf("\n\rMixer-Config: '%s' (%u Motors)",Mixer.Name,RequiredMotors); |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Check connected BL-Ctrls |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
313,7 → 314,9 |
SetActiveParamSetNumber(3); // default-Setting |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION); |
} |
FlugMinuten = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_MINUTES2]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_MINUTES2+1]); |
FlugMinutenGesamt = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_MINUTES]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_MINUTES+1]); |
if(FlugMinutenGesamt == 0xffff || FlugMinuten == 0xffff) |
357,6 → 360,8 |
I2CTimeout = 5000; |
WinkelOut.Orientation = 1; |
LipoDetection(1); |
InitReceiver(); |
printf("\n\r===================================\n\r"); |
//SpektrumBinding(); |
timer = SetDelay(2000); |
/trunk/makefile |
---|
413,7 → 413,7 |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) Flight-Ctrl_*.hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
424,7 → 424,7 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
# $(REMOVE) $(OBJ) |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
/trunk/uart.c |
---|
373,6 → 373,7 |
SendOutData('S', FC_ADDRESS, 1, &tempchar1, sizeof(tempchar1)); |
if(!MotorenEin) Piep(tempchar1,110); |
LipoDetection(0); |
InitReceiver(); |
break; |
case 'f': // auf anderen Parametersatz umschalten |
if((1 <= pRxData[0]) && (pRxData[0] <= 5)) SetActiveParamSetNumber(pRxData[0]); |
381,6 → 382,7 |
SendOutData('F', FC_ADDRESS, 1, &tempchar1, sizeof(tempchar1)); |
if(!MotorenEin) Piep(tempchar1,110); |
LipoDetection(0); |
InitReceiver(); |
break; |
case 'y':// serial Potis |
PPM_in[13] = (signed char) pRxData[0]; PPM_in[14] = (signed char) pRxData[1]; PPM_in[15] = (signed char) pRxData[2]; PPM_in[16] = (signed char) pRxData[3]; |