Subversion Repositories FlightCtrl

Rev

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

Rev 918 Rev 921
Line 58... Line 58...
58
// number [0..5]   
58
// number [0..5]   
59
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
59
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
60
{
60
{
61
   if (number > 5) number = 5;
61
   if (number > 5) number = 5;
62
   eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length);
62
   eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length);
-
 
63
   LED_Init();
63
}
64
}
Line 64... Line 65...
64
 
65
 
65
 
66
 
66
// -- Parametersatz ins EEPROM schreiben ---
67
// -- Parametersatz ins EEPROM schreiben ---
67
// number [0..5]   
68
// number [0..5]   
68
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
69
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
69
{
70
{
70
   if(number > 5) number = 5;  
71
   if(number > 5) number = 5;  
-
 
72
   eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length);
71
   eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length);
73
   eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number);                              // diesen Parametersatz als aktuell merken
Line 72... Line 74...
72
   eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number);                              // diesen Parametersatz als aktuell merken
74
   LED_Init();
73
}
75
}
74
 
76
 
Line 151... Line 153...
151
        sei();
153
        sei();
Line 152... Line 154...
152
 
154
 
153
    VersionInfo.Hauptversion = VERSION_HAUPTVERSION;
155
    VersionInfo.Hauptversion = VERSION_HAUPTVERSION;
154
    VersionInfo.Nebenversion = VERSION_NEBENVERSION;
156
    VersionInfo.Nebenversion = VERSION_NEBENVERSION;
-
 
157
    VersionInfo.PCKompatibel = VERSION_KOMPATIBEL;
Line 155... Line 158...
155
    VersionInfo.PCKompatibel = VERSION_KOMPATIBEL;
158
    VersionInfo.Hardware = 1; // FlightCtrl
156
   
159
   
Line 157... Line 160...
157
        printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a');
160
        printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a');
Line 158... Line 161...
158
        printf("\n\r==============================");
161
        printf("\n\r==============================");
159
 
162
 
160
        GRN_ON;
163
        GRN_ON;
161
 
164
 
162
#define EE_DATENREVISION 70 // wird angepasst, wenn sich die EEPROM-Daten geändert haben
165
#define EE_DATENREVISION 71 // wird angepasst, wenn sich die EEPROM-Daten geändert haben
163
    if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION)
166
    if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION)
Line 275... Line 278...
275
 
278
 
276
             SendSPI = 4;
279
             SendSPI = 4;
277
                         timer = SetDelay(20);  
280
                         timer = SetDelay(20);  
278
            }
281
            }
-
 
282
           //if(UpdateMotor) DebugOut.Analog[26]++;
279
           //if(UpdateMotor) DebugOut.Analog[26]++;
283
           LED_Update();
280
          }
284
          }
281
     if(!SendSPI) { SPI_TransmitByte(); }
285
     if(!SendSPI) { SPI_TransmitByte(); }
282
    }
286
    }
283
 return (1);
287
 return (1);