Subversion Repositories FlightCtrl

Rev

Rev 1444 | Rev 1497 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1444 Rev 1490
Line 4... Line 4...
4
// + www.MikroKopter.com
4
// + www.MikroKopter.com
5
// + see the File "License.txt" for further Informations
5
// + see the File "License.txt" for further Informations
6
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7
#include <stdarg.h>
7
#include <stdarg.h>
8
#include <string.h>
8
#include <string.h>
-
 
9
#include <avr/pgmspace.h>
9
#include "main.h"
10
#include "main.h"
10
#include "uart.h"
11
#include "uart.h"
11
#include "libfc.h"
12
#include "libfc.h"
Line 47... Line 48...
47
 
48
 
48
int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D;
49
int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D;
49
unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0;
50
unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0;
Line 50... Line 51...
50
unsigned int AboTimeOut = 0;
51
unsigned int AboTimeOut = 0;
51
 
52
 
52
const unsigned char ANALOG_TEXT[32][16] =
53
const unsigned char ANALOG_TEXT[32][16] PROGMEM =
53
{
54
{
54
   //1234567890123456
55
   //1234567890123456
55
    "AngleNick       ", //0
56
    "AngleNick       ", //0
Line 159... Line 160...
159
                  RxdBuffer[buf_ptr++] = SioTmp;
160
                  RxdBuffer[buf_ptr++] = SioTmp;
160
                  crc += SioTmp;
161
                  crc += SioTmp;
161
                  break;
162
                  break;
162
   case 2: //  Eingangsdaten sammeln
163
   case 2: //  Eingangsdaten sammeln
163
                  RxdBuffer[buf_ptr] = SioTmp;
164
                  RxdBuffer[buf_ptr] = SioTmp;
164
                  if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++;  
165
                  if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++;
165
                  else UartState = 0;
166
                  else UartState = 0;
166
                  crc += SioTmp;
167
                  crc += SioTmp;
167
                  break;
168
                  break;
168
   default:
169
   default:
169
          UartState = 0;
170
          UartState = 0;
Line 588... Line 589...
588
          SendOutData('C', FC_ADDRESS, 1, (unsigned char *) &Data3D,sizeof(Data3D));
589
          SendOutData('C', FC_ADDRESS, 1, (unsigned char *) &Data3D,sizeof(Data3D));
589
          Timer3D = SetDelay(Intervall3D);
590
          Timer3D = SetDelay(Intervall3D);
590
         }
591
         }
591
    if(DebugTextAnforderung != 255) // Texte für die Analogdaten
592
    if(DebugTextAnforderung != 255) // Texte für die Analogdaten
592
     {
593
     {
-
 
594
                unsigned char label[16]; // local sram buffer
-
 
595
                memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 16); // read lable from flash to sra
593
      SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),(unsigned char *) ANALOG_TEXT[DebugTextAnforderung], 16);
596
      SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16);
594
      DebugTextAnforderung = 255;
597
      DebugTextAnforderung = 255;
595
         }
598
         }
596
     if(ConfirmFrame && UebertragungAbgeschlossen)   // Datensatz bestätigen
599
     if(ConfirmFrame && UebertragungAbgeschlossen)   // Datensatz bestätigen
597
         {
600
         {
598
                SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame));
601
                SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame));