|
|
@ -8,7 +8,8 @@
|
|
|
|
// EEProm Speicher
|
|
|
|
// EEProm Speicher
|
|
|
|
uint8_t Dummy;
|
|
|
|
uint8_t Dummy;
|
|
|
|
uint8_t ee_Dummy EEMEM = 0x55; // Dummy for Address 0
|
|
|
|
uint8_t ee_Dummy EEMEM = 0x55; // Dummy for Address 0
|
|
|
|
uint8_t ee_TRX EEMEM = 0; // TRX 1 oder 2 oder beide
|
|
|
|
uint8_t ee_Trx1 EEMEM = 0; // TRX 1
|
|
|
|
|
|
|
|
uint8_t ee_Trx2 EEMEM = 0; // TRX 2
|
|
|
|
uint8_t ee_KeyerMode EEMEM = 1; // Iambic A, Iambic B oder Ultimatic
|
|
|
|
uint8_t ee_KeyerMode EEMEM = 1; // Iambic A, Iambic B oder Ultimatic
|
|
|
|
uint8_t ee_SidetoneEnabled EEMEM = 1; // Mithörton eingeschaltet
|
|
|
|
uint8_t ee_SidetoneEnabled EEMEM = 1; // Mithörton eingeschaltet
|
|
|
|
uint8_t ee_WpMBpM EEMEM = 0; // WpM oder BpM Anzeige
|
|
|
|
uint8_t ee_WpMBpM EEMEM = 0; // WpM oder BpM Anzeige
|
|
|
@ -22,6 +23,12 @@ uint8_t ee_WpM EEMEM = 12; // Geschwindigkeit WpM
|
|
|
|
uint8_t ee_RiseTime EEMEM = 5; // Anstiegszeit Sinuston
|
|
|
|
uint8_t ee_RiseTime EEMEM = 5; // Anstiegszeit Sinuston
|
|
|
|
uint8_t ee_RiseTimeCounter EEMEM = 5; // Anzahl Sinusschwingungen für den Anstieg
|
|
|
|
uint8_t ee_RiseTimeCounter EEMEM = 5; // Anzahl Sinusschwingungen für den Anstieg
|
|
|
|
uint8_t ee_DebounceTime EEMEM = 6; // Entprellzeit für Straight Key Eingang
|
|
|
|
uint8_t ee_DebounceTime EEMEM = 6; // Entprellzeit für Straight Key Eingang
|
|
|
|
|
|
|
|
// Textspeicher
|
|
|
|
|
|
|
|
uint8_t ee_Msg1[100] EEMEM;
|
|
|
|
|
|
|
|
uint8_t ee_Msg2[100] EEMEM;
|
|
|
|
|
|
|
|
uint8_t ee_Msg3[100] EEMEM;
|
|
|
|
|
|
|
|
uint8_t ee_Msg4[100] EEMEM;
|
|
|
|
|
|
|
|
uint8_t ee_Msg5[100] EEMEM;
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
/** @fn void DelayMilliSeconds(uint16_t ms)
|
|
|
|
/** @fn void DelayMilliSeconds(uint16_t ms)
|
|
|
@ -100,7 +107,8 @@ void WriteEEprom(void)
|
|
|
|
eeprom_write_byte(&ee_WpM, bConfig.WpM);
|
|
|
|
eeprom_write_byte(&ee_WpM, bConfig.WpM);
|
|
|
|
eeprom_write_byte(&ee_KeyerMode, bConfig.KeyerMode);
|
|
|
|
eeprom_write_byte(&ee_KeyerMode, bConfig.KeyerMode);
|
|
|
|
eeprom_write_word(&ee_SidetoneFreq, bConfig.SidetoneFreq);
|
|
|
|
eeprom_write_word(&ee_SidetoneFreq, bConfig.SidetoneFreq);
|
|
|
|
eeprom_write_byte(&ee_TRX, bConfig.TRX);
|
|
|
|
eeprom_write_byte(&ee_Trx1, bConfig.Trx1);
|
|
|
|
|
|
|
|
eeprom_write_byte(&ee_Trx2, bConfig.Trx2);
|
|
|
|
eeprom_write_byte(&ee_SidetoneEnabled, bConfig.SidetoneEnabled);
|
|
|
|
eeprom_write_byte(&ee_SidetoneEnabled, bConfig.SidetoneEnabled);
|
|
|
|
eeprom_write_byte(&ee_WpMBpM, bConfig.WpMBpM);
|
|
|
|
eeprom_write_byte(&ee_WpMBpM, bConfig.WpMBpM);
|
|
|
|
eeprom_write_byte(&ee_Reverse, bConfig.Reverse);
|
|
|
|
eeprom_write_byte(&ee_Reverse, bConfig.Reverse);
|
|
|
@ -152,7 +160,8 @@ void SetEEprom(void)
|
|
|
|
bConfig.WpM = 15;
|
|
|
|
bConfig.WpM = 15;
|
|
|
|
bConfig.KeyerMode = 2;
|
|
|
|
bConfig.KeyerMode = 2;
|
|
|
|
bConfig.SidetoneFreq = 600;
|
|
|
|
bConfig.SidetoneFreq = 600;
|
|
|
|
bConfig.TRX = 1;
|
|
|
|
bConfig.Trx1 = 1;
|
|
|
|
|
|
|
|
bConfig.Trx2 = 0;
|
|
|
|
bConfig.SidetoneEnabled = 1;
|
|
|
|
bConfig.SidetoneEnabled = 1;
|
|
|
|
bConfig.WpMBpM = 1;
|
|
|
|
bConfig.WpMBpM = 1;
|
|
|
|
bConfig.Reverse = 0;
|
|
|
|
bConfig.Reverse = 0;
|
|
|
@ -164,6 +173,8 @@ void SetEEprom(void)
|
|
|
|
bConfig.RiseTimeCounter = 5;
|
|
|
|
bConfig.RiseTimeCounter = 5;
|
|
|
|
bConfig.DebounceTime = 5;
|
|
|
|
bConfig.DebounceTime = 5;
|
|
|
|
WriteEEprom();
|
|
|
|
WriteEEprom();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sprintf(bMessage.Msg1,"CQ CQ CQ DE DL7BJ DL7BJ DL7BJ PSE K\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** @fn void ReadEEprom(void)
|
|
|
|
/** @fn void ReadEEprom(void)
|
|
|
|
* @brief Einstellungen aus dem EEprom lesen
|
|
|
|
* @brief Einstellungen aus dem EEprom lesen
|
|
|
@ -183,7 +194,8 @@ void ReadEEprom(void)
|
|
|
|
bConfig.WpM = eeprom_read_byte(&ee_WpM);
|
|
|
|
bConfig.WpM = eeprom_read_byte(&ee_WpM);
|
|
|
|
bConfig.KeyerMode = eeprom_read_byte(&ee_KeyerMode);
|
|
|
|
bConfig.KeyerMode = eeprom_read_byte(&ee_KeyerMode);
|
|
|
|
bConfig.SidetoneFreq = eeprom_read_word(&ee_SidetoneFreq);
|
|
|
|
bConfig.SidetoneFreq = eeprom_read_word(&ee_SidetoneFreq);
|
|
|
|
bConfig.TRX = eeprom_read_byte(&ee_TRX);
|
|
|
|
bConfig.Trx1 = eeprom_read_byte(&ee_Trx1);
|
|
|
|
|
|
|
|
bConfig.Trx2 = eeprom_read_byte(&ee_Trx2);
|
|
|
|
bConfig.SidetoneEnabled = eeprom_read_byte(&ee_SidetoneEnabled);
|
|
|
|
bConfig.SidetoneEnabled = eeprom_read_byte(&ee_SidetoneEnabled);
|
|
|
|
bConfig.WpMBpM = eeprom_read_byte(&ee_WpMBpM);
|
|
|
|
bConfig.WpMBpM = eeprom_read_byte(&ee_WpMBpM);
|
|
|
|
bConfig.Reverse = eeprom_read_byte(&ee_Reverse);
|
|
|
|
bConfig.Reverse = eeprom_read_byte(&ee_Reverse);
|
|
|
@ -277,6 +289,10 @@ void TXKey(uint8_t State)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SidetoneOn();
|
|
|
|
SidetoneOn();
|
|
|
|
sbi(PORTC,MORSE_LED);
|
|
|
|
sbi(PORTC,MORSE_LED);
|
|
|
|
|
|
|
|
if(bConfig.Trx1)
|
|
|
|
|
|
|
|
sbi(PORTC,TRX1);
|
|
|
|
|
|
|
|
if(bConfig.Trx2)
|
|
|
|
|
|
|
|
sbi(PORTC,TRX2);
|
|
|
|
bState.KeyState = 1;
|
|
|
|
bState.KeyState = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -288,11 +304,25 @@ void TXKey(uint8_t State)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SidetoneOff();
|
|
|
|
SidetoneOff();
|
|
|
|
cbi(PORTC,MORSE_LED);
|
|
|
|
cbi(PORTC,MORSE_LED);
|
|
|
|
|
|
|
|
if(bConfig.Trx1)
|
|
|
|
|
|
|
|
cbi(PORTC,TRX1);
|
|
|
|
|
|
|
|
if(bConfig.Trx2)
|
|
|
|
|
|
|
|
cbi(PORTC,TRX2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bState.KeyState = 0;
|
|
|
|
bState.KeyState = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @fn void CheckButtons(void)
|
|
|
|
|
|
|
|
* @brief Fragt die Taster ab und löst entsprechende Funktion aus
|
|
|
|
|
|
|
|
* @param none
|
|
|
|
|
|
|
|
* @return none
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void CheckButtons(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!(PINB & (1<<MEM5)))
|
|
|
|
|
|
|
|
SendString(bMessage.Msg1);
|
|
|
|
|
|
|
|
}
|
|
|
|
/** @fn void CheckStraightKey(void)
|
|
|
|
/** @fn void CheckStraightKey(void)
|
|
|
|
* @brief Fragt die Handtasteneingänge ab und gibt das
|
|
|
|
* @brief Fragt die Handtasteneingänge ab und gibt das
|
|
|
|
* entsprechende Symbol aus. Bei der Handtaste
|
|
|
|
* entsprechende Symbol aus. Bei der Handtaste
|
|
|
@ -620,57 +650,70 @@ void BeepBoop(void)
|
|
|
|
Boop();
|
|
|
|
Boop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SendString(char *s)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int c;
|
|
|
|
|
|
|
|
while(*s != 0x00)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(*s != 0x20)
|
|
|
|
|
|
|
|
SendChar(*s);
|
|
|
|
|
|
|
|
else if (*s == 0x20)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DelayMilliSeconds(7*DahMillis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*s++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SendChar(unsigned char c)
|
|
|
|
void SendChar(unsigned char c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch(c)
|
|
|
|
switch(c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Buchstaben
|
|
|
|
// Buchstaben
|
|
|
|
/*
|
|
|
|
case 'A': SendDit(); SendDah(); break;
|
|
|
|
case 'A': SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'B': SendDah(); SendDit(); SendDit(); SendDit(); break;
|
|
|
|
case 'B': SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'C': SendDit(); SendDah(); SendDit(); SendDah(); break;
|
|
|
|
case 'C': SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'D': SendDah(); SendDit(); SendDit(); break;
|
|
|
|
case 'D': SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'E': SendDit(); break;
|
|
|
|
case 'E': SendDit(AUTO); break;
|
|
|
|
case 'F': SendDit(); SendDah(); SendDit(); SendDit(); break;
|
|
|
|
case 'F': SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'G': SendDah(); SendDah(); SendDit(); break;
|
|
|
|
case 'G': SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'H': SendDit(); SendDit(); SendDit(); SendDit(); break;
|
|
|
|
case 'H': SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'I': SendDit(); SendDit(); break;
|
|
|
|
case 'I': SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'J': SendDit(); SendDah(); SendDah(); SendDah(); break;
|
|
|
|
case 'J': SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'K': SendDah(); SendDit(); SendDah(); break;
|
|
|
|
case 'K': SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'L': SendDit(); SendDah(); SendDit(); SendDit(); break;
|
|
|
|
case 'L': SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'M': SendDah(); SendDah(); break;
|
|
|
|
case 'M': SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'N': SendDah(); SendDit(); break;
|
|
|
|
case 'N': SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'O': SendDah(); SendDah(); SendDah(); break;
|
|
|
|
case 'O': SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'P': SendDit(); SendDah(); SendDah(); SendDit(); break;
|
|
|
|
case 'P': SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'Q': SendDah(); SendDah(); SendDit(); SendDah(); break;
|
|
|
|
case 'Q': SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'R': SendDit(); SendDah(); SendDit(); break;
|
|
|
|
case 'R': SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'S': SendDit(); SendDit(); SendDit(); break;
|
|
|
|
case 'S': SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case 'T': SendDah(); break;
|
|
|
|
case 'T': SendDah(AUTO); break;
|
|
|
|
case 'U': SendDit(); SendDit(); SendDah(); break;
|
|
|
|
case 'U': SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'V': SendDit(); SendDit(); SendDit(); SendDah(); break;
|
|
|
|
case 'V': SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'W': SendDit(); SendDah(); SendDah(); break;
|
|
|
|
case 'W': SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'X': SendDah(); SendDit(); SendDit(); SendDah(); break;
|
|
|
|
case 'X': SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'Y': SendDah(); SendDit(); SendDah(); SendDah(); break;
|
|
|
|
case 'Y': SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case 'Z': SendDit(); SendDit(); SendDah(); SendDah(); break;
|
|
|
|
case 'Z': SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
|
|
|
|
// Zahlen
|
|
|
|
// Zahlen
|
|
|
|
case '0': SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case '0': SendDah(); SendDah(); SendDah(); SendDah(); SendDah(); break;
|
|
|
|
case '1': SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case '1': SendDit(); SendDah(); SendDah(); SendDah(); SendDah(); break;
|
|
|
|
case '2': SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case '2': SendDit(); SendDit(); SendDah(); SendDah(); break;
|
|
|
|
case '3': SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case '3': SendDit(); SendDit(); SendDit(); SendDah(); SendDah(); break;
|
|
|
|
case '4': SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case '4': SendDit(); SendDit(); SendDit(); SendDit(); SendDah(); break;
|
|
|
|
case '5': SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case '5': SendDit(); SendDit(); SendDit(); SendDit(); SendDit(); break;
|
|
|
|
case '6': SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case '6': SendDah(); SendDit(); SendDit(); SendDit(); SendDit(); break;
|
|
|
|
case '7': SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case '7': SendDah(); SendDah(); SendDit(); SendDit(); SendDit(); break;
|
|
|
|
case '8': SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case '8': SendDah(); SendDah(); SendDah(); SendDit(); SendDit(); break;
|
|
|
|
case '9': SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case '9': SendDah(); SendDah(); SendDah(); SendDah(); SendDit(); break;
|
|
|
|
// Sonderzeichen
|
|
|
|
// Sonderzeichen
|
|
|
|
case '=': SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case '=': SendDah(); SendDit(); SendDit(); SendDit(); SendDah(); break;
|
|
|
|
case '/': SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case '/': SendDah(); SendDit(); SendDit(); SendDah(); SendDit(); break;
|
|
|
|
case '.': SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); break;
|
|
|
|
case '.': SendDit(); SendDah(); SendDit(); SendDah(); SendDit(); SendDah(); break;
|
|
|
|
case ',': SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); break;
|
|
|
|
case ',': SendDah(); SendDah(); SendDit(); SendDit(); SendDah(); SendDah(); break;
|
|
|
|
case '?': SendDit(AUTO); SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); SendDit(AUTO); break;
|
|
|
|
case '?': SendDit(); SendDit(); SendDah(); SendDah(); SendDit(); SendDit(); break;
|
|
|
|
case '@': SendDit(AUTO); SendDah(AUTO); SendDah(AUTO); SendDit(AUTO); SendDah(AUTO); SendDit(AUTO); break;
|
|
|
|
case '@': SendDit(); SendDah(); SendDah(); SendDit(); SendDah(); SendDit(); break;
|
|
|
|
*/
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|