Subversion Repositories FlightCtrl

Rev

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

Rev 685 Rev 687
Line 3... Line 3...
3
// + only for non-profit use
3
// + only for non-profit use
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
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Line -... Line 7...
-
 
7
 
-
 
8
#include <avr/io.h>
-
 
9
#include <avr/interrupt.h>
-
 
10
#include <avr/wdt.h>
-
 
11
 
7
 
12
#include "eeprom.h"
8
#include "main.h"
13
#include "main.h"
9
#include "menu.h"
14
#include "menu.h"
10
#include "timer0.h"
15
#include "timer0.h"
11
#include "uart.h"
16
#include "uart.h"
Line 334... Line 339...
334
            // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
339
            // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
335
            Decode64((uint8_t *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
340
            Decode64((uint8_t *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
336
            if(tmp_char_arr2[0] != 0xff)
341
            if(tmp_char_arr2[0] != 0xff)
337
             {
342
             {
338
                          if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5;
343
                          if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5;
339
                  ReadParameterSet(tmp_char_arr2[0], (uint8_t *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
344
                  ParamSet_ReadFromEEProm(tmp_char_arr2[0]);
340
                  SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(uint8_t *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE);
345
                  SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(uint8_t *) &ParamSet.Kanalbelegung[0],PARAMSET_STRUCT_LEN);
341
             }
346
             }
342
             else
347
             else
343
                  SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(uint8_t *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE);
348
                  SendOutData('L' + GetParamByte(PID_ACTIVE_SET)-1,MeineSlaveAdresse,(uint8_t *) &ParamSet.Kanalbelegung[0],PARAMSET_STRUCT_LEN);
Line 344... Line 349...
344
 
349
 
Line 345... Line 350...
345
            break;
350
            break;
346
 
351
 
347
   case 'l':
352
   case 'l':
348
   case 'm':
353
   case 'm':
349
   case 'n':
354
   case 'n':
350
   case 'o':
355
   case 'o':
351
   case 'p': // Parametersatz speichern
356
   case 'p': // Parametersatz speichern
352
            Decode64((uint8_t *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes);
357
            Decode64((uint8_t *) &ParamSet.Kanalbelegung[0],PARAMSET_STRUCT_LEN,3,AnzahlEmpfangsBytes);
353
                        WriteParameterSet(rxd_buffer[2] - 'l' + 1, (uint8_t *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
358
                        ParamSet_WriteToEEProm(rxd_buffer[2] - 'l' + 1);
354
            eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], rxd_buffer[2] - 'l' + 1);  // aktiven Datensatz merken
359
            //SetActiveParamSet(rxd_buffer[2] - 'l' + 1);  // is alredy done in ParamSet_WriteToEEProm()
355
            Umschlag180Nick = (int32_t) EE_Parameter.WinkelUmschlagNick * 2500L;
360
            Umschlag180Nick = (int32_t) ParamSet.WinkelUmschlagNick * 2500L;
356
            Umschlag180Roll = (int32_t) EE_Parameter.WinkelUmschlagRoll * 2500L;
361
            Umschlag180Roll = (int32_t) ParamSet.WinkelUmschlagRoll * 2500L;
Line 357... Line 362...
357
            Piep(GetActiveParamSetNumber());
362
            Piep(GetActiveParamSet());
358
         break;
363
         break;