/trunk/flight.pnproj |
---|
1,0 → 0,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="eeprom.c"></File></Project> |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="eeprom.c"></File><File path="spi.h"></File><File path="spi.c"></File></Project> |
/trunk/main.c |
---|
121,7 → 121,7 |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
// SPI_MasterInit(); |
SPI_MasterInit(); |
sei(); |
187,7 → 187,7 |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
// SPI_TransmitByte(); |
SPI_TransmitByte(); //# |
UpdateMotor=0; |
//PORTD |= 0x08; |
MotorRegler(); |
237,7 → 237,8 |
BeepMuster = 0x0300; |
} |
} |
// SPI_StartTransmitPacket(); |
SPI_StartTransmitPacket();//# |
timer = SetDelay(100); |
} |
} |
/trunk/main.h |
---|
19,6 → 19,8 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 |
#define F_CPU SYSCLK |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
/trunk/makefile |
---|
75,8 → 75,7 |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c |
SRC += twimaster.c rc.c fc.c GPS.c |
#spi.c |
SRC += twimaster.c rc.c fc.c GPS.c spi.c |
########################################################################################################## |
/trunk/spi.c |
---|
7,7 → 7,7 |
unsigned char SPI_BufferIndex; |
volatile unsigned char SPI_Buffer[sizeof(FromNaviCtrl)]; |
unsigned char *Ptr_buffer = (unsigned char *) &ToNaviCtrl; |
#ifdef USE_SPI_COMMUNICATION |
//------------------------------------------------------ |
void SPI_MasterInit(void) |
{ |
78,5 → 78,6 |
sei(); |
} |
#endif |
/trunk/spi.h |
---|
2,6 → 2,8 |
#ifndef _SPI_H |
#define _SPI_H |
//#define USE_SPI_COMMUNICATION |
#define SPI_PROTOCOL_COMP 1 |
//----------------------------------------- |
59,6 → 61,7 |
int CompassValue; |
}; |
#ifdef USE_SPI_COMMUNICATION |
extern struct str_ToNaviCtrl ToNaviCtrl; |
extern struct str_FromNaviCtrl FromNaviCtrl; |
67,7 → 70,15 |
extern void SPI_StartTransmitPacket(void); |
extern void UpdateSPI_Buffer(void); |
extern void SPI_TransmitByte(void); |
#else |
// -------------------------------- Dummy ----------------------------------------- |
#define SPI_MasterInit() ; |
#define SPI_StartTransmitPacket() ; |
#define UpdateSPI_Buffer() ; |
#define SPI_TransmitByte() ; |
#endif |
#endif |
#endif |