66,8 → 66,8 |
#define FALSE 0 |
#define TRUE 1 |
|
#define TXD_BUFFER_LEN 150 |
#define RXD_BUFFER_LEN 150 |
#define TXD_BUFFER_LEN 100 |
#define RXD_BUFFER_LEN 100 |
|
volatile uint8_t txd_buffer[TXD_BUFFER_LEN]; |
volatile uint8_t rxd_buffer_locked = FALSE; |
75,21 → 75,22 |
volatile uint8_t txd_complete = TRUE; |
volatile uint8_t ReceivedBytes = 0; |
|
#define VERSION_INFO 0x01 |
#define DEBUG_DATA 0x02 |
#define DEBUG_LABEL 0x04 |
#define COMPASS_HEADING 0x08 |
|
uint8_t RequestFlags = 0x00; |
uint8_t RequestDebugLabel = 0; |
|
uint8_t RequestVerInfo = FALSE; |
uint8_t RequestDebugData = FALSE; |
uint8_t RequestDebugLabel = FALSE; |
uint8_t RequestCompassHeading = FALSE; |
|
uint8_t MySlaveAddr = 0; |
|
//unsigned char,DebugGetAnforderung = 0, |
|
DebugOut_t DebugOut; |
ExternData_t ExternData; |
ExternControl_t ExternControl; |
VersionInfo_t VersionInfo; |
struct DebugOut_t DebugOut; |
struct ExternData_t ExternData; |
struct ExternControl_t ExternControl; |
struct VersionInfo_t VersionInfo; |
|
uint16_t Debug_Timer; |
|
417,7 → 418,7 |
{ |
case 'w':// Attitude |
Decode64((uint8_t *) &ExternData, sizeof(ExternData), 3, ReceivedBytes); |
RequestCompassHeading = TRUE; |
RequestFlags |= COMPASS_HEADING; |
break; |
|
case 'b': // extern control |
444,7 → 445,7 |
break; |
|
case 'v': // get version and board release |
RequestVerInfo = TRUE; |
RequestFlags |= VERSION_INFO; |
PC_Connected = 255; |
break; |
|
451,11 → 452,12 |
case 'a':// Labels of the Analog Debug outputs |
Decode64((uint8_t *) &tmp_char_arr2[0], sizeof(tmp_char_arr2), 3, ReceivedBytes); |
RequestDebugLabel = tmp_char_arr2[0]; |
RequestFlags |= DEBUG_LABEL; |
PC_Connected = 255; |
break; |
|
case 'g':// get debug data |
RequestDebugData = TRUE; |
RequestFlags |= DEBUG_DATA; |
PC_Connected = 255; |
break; |
} |
472,7 → 474,7 |
|
if(!txd_complete) return; |
|
if(CheckDelay(Debug_Timer) && txd_complete) |
if(CheckDelay(Debug_Timer)) |
{ |
SetDebugValues(); |
SendOutData('D',MySlaveAddr,(uint8_t *) &DebugOut,sizeof(DebugOut)); |
479,28 → 481,29 |
Debug_Timer = SetDelay(250); |
} |
|
if(RequestDebugLabel != 255) |
if(RequestFlags & DEBUG_LABEL) |
{ |
SendOutData('A',RequestDebugLabel + '0',(uint8_t *) ANALOG_LABEL[RequestDebugLabel],16); |
RequestDebugLabel = 255; |
RequestFlags &= ~DEBUG_LABEL; |
} |
|
if(RequestVerInfo && txd_complete) |
if(RequestFlags & VERSION_INFO) |
{ |
SendOutData('V',MySlaveAddr,(uint8_t *) &VersionInfo, sizeof(VersionInfo)); |
RequestVerInfo = FALSE; |
RequestFlags &= ~VERSION_INFO; |
} |
|
if(RequestDebugData && txd_complete) |
if(RequestFlags & DEBUG_DATA) |
{ |
SetDebugValues(); |
SendOutData('G',MySlaveAddr,(uint8_t *) &ExternControl,sizeof(ExternControl)); |
RequestDebugData = FALSE; |
RequestFlags &= ~DEBUG_DATA; |
} |
|
if(RequestCompassHeading && txd_complete) |
if(RequestFlags & COMPASS_HEADING) |
{ |
SendOutData('K',MySlaveAddr,(uint8_t *) &I2C_Heading, sizeof(I2C_Heading)); |
RequestCompassHeading = FALSE; |
RequestFlags &= ~COMPASS_HEADING; |
} |
} |