Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 595 → Rev 596

/trunk/spi.c
28,14 → 28,11
SPI_BufferIndex = 1;
DebugOut.Analog[16]++;
// -- Debug-Output ---
cli();
DebugOut.Analog[20] = FromNaviCtrl.Comp;
/* DebugOut.Analog[20] = FromNaviCtrl.Comp;
DebugOut.Analog[21] = FromNaviCtrl.GPS_Nick;
DebugOut.Analog[22] = FromNaviCtrl.GPS_Roll;
DebugOut.Analog[23] = FromNaviCtrl.CompassValue;
sei();
*/
//----
SPDR = ToNaviCtrl.Comp; // Start transmission
}
48,7 → 45,8
if (SPI_BufferIndex < sizeof(FromNaviCtrl))
{ SPI_Buffer[SPI_BufferIndex]= SPDR; // get data
// if (SPI_BufferIndex < 32 ) DebugOut.Analog[26+SPI_BufferIndex] = SPI_Buffer[SPI_BufferIndex];
//if(SPDR!= 0x00) DebugOut.Analog[19]++; ;
}
59,10 → 57,8
else
{
unsigned char *ptr = (unsigned char *)&FromNaviCtrl;
unsigned char i;
SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT); // DeselectSlave
memcpy(ptr, (unsigned char *) SPI_Buffer, sizeof(SPI_Buffer));
}
/trunk/spi.h
11,6 → 11,32
#define DD_MOSI PB5
#define DD_MISO PB6
 
// for compatibility reasons gcc3.x <-> gcc4.x
#ifndef SPCR
#define SPCR SPCR0
#endif
#ifndef SPE
#define SPE SPE0
#endif
#ifndef MSTR
#define MSTR MSTR0
#endif
#ifndef SPR1
#define SPR1 SPR01
#endif
#ifndef SPIE
#define SPIE SPIE0
#endif
#ifndef SPDR
#define SPDR SPDR0
#endif
#ifndef SPIF
#define SPIF SPIF0
#endif
#ifndef SPSR
#define SPSR SPSR0
#endif
// -------------------------
 
#define SLAVE_SELECT_DDR_PORT DDRC
#define SLAVE_SELECT_PORT PORTC
26,6 → 52,7
 
struct str_FromNaviCtrl
{
unsigned int Dummy;
unsigned char Comp;
int GPS_Nick;
int GPS_Roll;
43,4 → 70,4
 
 
 
#endif
#endif