50,10 → 50,24 |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "timer0.h" |
#include "timer2.h" |
#include "uart.h" |
#include "uart1.h" |
#include "menu.h" |
#include "fc.h" |
#include "rc.h" |
#include "analog.h" |
#include "printf_P.h" |
#include "spi.h" |
#include "twimaster.h" |
#include "eeprom.h" |
#include "_Settings.h" |
|
unsigned char EEPromArray[E2END+1] EEMEM; |
unsigned char PlatinenVersion = 10; |
|
uint8_t EEPromArray[E2END+1] EEMEM; |
uint8_t BoardRelease = 10; |
|
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
72,16 → 86,19 |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
|
unsigned char GetActiveParamSetNumber(void) |
/***************************************************/ |
/* Get number of active parameter set */ |
/***************************************************/ |
uint8_t GetActiveParamSetNumber(void) |
{ |
unsigned char set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
uint8_t set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
} |
|
//############################################################################ |
97,7 → 114,11 |
DDRB = 0x00; |
PORTB = 0x00; |
for(timer = 0; timer < 1000; timer++); // make delay |
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
|
|
if(PINB & 0x01) BoardRelease = 11; |
else BoardRelease = 10; |
|
DDRC = 0x81; // SCL & Speaker |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
137,7 → 158,7 |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
|
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a'); |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",BoardRelease/10,BoardRelease%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a'); |
printf("\n\r=============================="); |
GRN_ON; |
|
189,7 → 210,7 |
|
printf("\n\n\r"); |
|
LcdClear(); |
LCD_Clear(); |
I2CTimeout = 5000; |
while (1) |
{ |