Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 731 → Rev 732

/branches/V0.68d Code Redesign killagreg/main.c
89,15 → 89,16
// get board release
DDRB = 0x00;
PORTB = 0x00;
for(timer = 0; timer < 1000; timer++); // make delay
for(timer = 0; timer < 1000; timer++); // make some delay
if(PINB & 0x01) BoardRelease = 11;
else BoardRelease = 10;
 
// Set LED Ports as output
// set LED ports as output
DDRB |= (1<<DDB1)|(1<<DDB0);
ROT_ON;
GRN_OFF;
 
// diable watchdog
MCUSR &=~(1<<WDRF);
WDTCSR |= (1<<WDCE)|(1<<WDE);
WDTCSR = 0;
115,7 → 116,7
TIMER0_Init();
TIMER2_Init();
USART0_Init();
if (BoardRelease == 11) USART1_Init();
if (BoardRelease != 10) USART1_Init();
RC_Init();
ADC_Init();
I2C_Init();
/branches/V0.68d Code Redesign killagreg/rc.c
13,6 → 13,7
#include <avr/interrupt.h>
 
#include "rc.h"
#include "main.h"
 
volatile int16_t PPM_in[11];
volatile int16_t PPM_diff[11];
39,6 → 40,14
// low level
PORTD &= ~((1<<PORTD5)|(1<<PORTD4)|(1<<PORTD3));
 
// PD3 can't be used in FC 1.1 if 2nd UART is activated
// becouse TXD1 is at that port
if(BoardRelease == 10)
{
DDRD |= (1<<PORTD3);
PORTD &= ~(1<<PORTD3);
}
 
// Timer/Counter1 Control Register A, B, C
 
// Normal Mode (bits: WGM13=0, WGM12=0, WGM11=0, WGM10=0)
133,7 → 142,10
// demux sum signal for channels 5 to 7 to J3, J4, J5
if(index == 5) PORTD |= (1<<PORTD5); else PORTD &= ~(1<<PORTD5);
if(index == 6) PORTD |= (1<<PORTD4); else PORTD &= ~(1<<PORTD4);
if(index == 7) PORTD |= (1<<PORTD3); else PORTD &= ~(1<<PORTD3);
if(BoardRelease == 10)
{
if(index == 7) PORTD |= (1<<PORTD3); else PORTD &= ~(1<<PORTD3);
}
}
}
}