diff --git a/Source/BJ-Keyer.eep b/Source/BJ-Keyer.eep index 6b2adb3..325c41a 100644 --- a/Source/BJ-Keyer.eep +++ b/Source/BJ-Keyer.eep @@ -1,2 +1,34 @@ -:100000000605050C580200321E00000001010055D3 +:1000000000000000000000000000000000000000F0 +:1000100000000000000000000000000000000000E0 +:1000200000000000000000000000000000000000D0 +:1000300000000000000000000000000000000000C0 +:1000400000000000000000000000000000000000B0 +:1000500000000000000000000000000000000000A0 +:100060000000000000000000000000000000000090 +:100070000000000000000000000000000000000080 +:100080000000000000000000000000000000000070 +:100090000000000000000000000000000000000060 +:1000A0000000000000000000000000000000000050 +:1000B0000000000000000000000000000000000040 +:1000C0000000000000000000000000000000000030 +:1000D0000000000000000000000000000000000020 +:1000E0000000000000000000000000000000000010 +:1000F0000000000000000000000000000000000000 +:1001000000000000000000000000000000000000EF +:1001100000000000000000000000000000000000DF +:1001200000000000000000000000000000000000CF +:1001300000000000000000000000000000000000BF +:1001400000000000000000000000000000000000AF +:10015000000000000000000000000000000000009F +:10016000000000000000000000000000000000008F +:10017000000000000000000000000000000000007F +:10018000000000000000000000000000000000006F +:10019000000000000000000000000000000000005F +:1001A000000000000000000000000000000000004F +:1001B000000000000000000000000000000000003F +:1001C000000000000000000000000000000000002F +:1001D000000000000000000000000000000000001F +:1001E000000000000000000000000000000000000F +:1001F000000000000605050C580200321E00000039 +:050200000101000055A2 :00000001FF diff --git a/Source/controls.c b/Source/controls.c index 19fa0fc..854549d 100644 --- a/Source/controls.c +++ b/Source/controls.c @@ -8,8 +8,8 @@ // Stringkonstanten für das Display // Programm Info -const char Trx1[] = "TRX 1"; -const char Trx2[] = "TRX 2"; +const char sTrx1[] = "TRX 1"; +const char sTrx2[] = "TRX 2"; const char IambicA[] = "Iambic A"; const char IambicB[] = "Iambic B"; const char Ultimatic[] = "Ultimat."; @@ -114,17 +114,17 @@ void Drehencoder(void) switch(bMenuCtrl.CurMenue) { case M_TRX1: - if(bConfig.TRX == 2) - bConfig.TRX = 0; + if(bConfig.Trx1) + bConfig.Trx1 = 0; else - bConfig.TRX = 1; + bConfig.Trx1 = 1; bMenuCtrl.m_buttonPressed = 0; break; case M_TRX2: - if(bConfig.TRX == 1) - bConfig.TRX = 0; + if(bConfig.Trx2) + bConfig.Trx2 = 0; else - bConfig.TRX = 2; + bConfig.Trx2 = 1; bMenuCtrl.m_buttonPressed = 0; break; case M_IAMBICA: @@ -282,7 +282,7 @@ void ConfigMenue(void) { case M_TRX1: lcd_gotoxy(0,3); - if((bConfig.TRX == 1) || (bConfig.TRX == 0)) + if(bConfig.Trx1) sprintf(line,"[%s]", "TRX 1"); else sprintf(line," %s ", "TRX 1"); @@ -290,7 +290,7 @@ void ConfigMenue(void) break; case M_TRX2: lcd_gotoxy(0,3); - if((bConfig.TRX == 2) || (bConfig.TRX == 0)) + if(bConfig.Trx2) sprintf(line,"[%s]", "TRX 2"); else sprintf(line," %s ", "TRX 2"); @@ -441,12 +441,12 @@ void UpdateDisplay(void) sprintf(line,"%s", Ultimatic); lcd_puts(line); lcd_gotoxy(0,0); - if(bConfig.TRX == 1) - sprintf(line, "%s", Trx1); - if(bConfig.TRX == 2) - sprintf(line, "%s", Trx2); - if(bConfig.TRX == 0) - sprintf(line, "%s %s", Trx1, Trx2); + if(bConfig.Trx1 == 1) + sprintf(line, "%s", sTrx1); + if(bConfig.Trx2 == 1) + sprintf(line, "%s", sTrx2); + if((bConfig.Trx1 == 1) && (bConfig.Trx2 == 1)) + sprintf(line, "%s %s", sTrx1, sTrx2); lcd_puts(line); lcd_gotoxy(0,6); if(bConfig.SpeedRatioEnabled) diff --git a/Source/controls.h b/Source/controls.h index a26a08d..8d898e6 100644 --- a/Source/controls.h +++ b/Source/controls.h @@ -22,6 +22,7 @@ extern void SideToneOff(void); extern void DelayMilliSeconds(uint16_t t); extern void Tone(uint16_t f, uint8_t t); extern void SetRatio(void); +extern void SetWeight(void); extern void SidetoneDisable(void); extern void SidetoneEnable(void); extern void SidetoneOff(void); diff --git a/Source/functions.c b/Source/functions.c index 978ec4c..89fa0f2 100644 --- a/Source/functions.c +++ b/Source/functions.c @@ -8,7 +8,8 @@ // EEProm Speicher uint8_t Dummy; 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_SidetoneEnabled EEMEM = 1; // Mithörton eingeschaltet 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_RiseTimeCounter EEMEM = 5; // Anzahl Sinusschwingungen für den Anstieg 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) @@ -100,7 +107,8 @@ void WriteEEprom(void) eeprom_write_byte(&ee_WpM, bConfig.WpM); eeprom_write_byte(&ee_KeyerMode, bConfig.KeyerMode); 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_WpMBpM, bConfig.WpMBpM); eeprom_write_byte(&ee_Reverse, bConfig.Reverse); @@ -152,7 +160,8 @@ void SetEEprom(void) bConfig.WpM = 15; bConfig.KeyerMode = 2; bConfig.SidetoneFreq = 600; - bConfig.TRX = 1; + bConfig.Trx1 = 1; + bConfig.Trx2 = 0; bConfig.SidetoneEnabled = 1; bConfig.WpMBpM = 1; bConfig.Reverse = 0; @@ -164,6 +173,8 @@ void SetEEprom(void) bConfig.RiseTimeCounter = 5; bConfig.DebounceTime = 5; WriteEEprom(); + + sprintf(bMessage.Msg1,"CQ CQ CQ DE DL7BJ DL7BJ DL7BJ PSE K\n"); } /** @fn void ReadEEprom(void) * @brief Einstellungen aus dem EEprom lesen @@ -183,7 +194,8 @@ void ReadEEprom(void) bConfig.WpM = eeprom_read_byte(&ee_WpM); bConfig.KeyerMode = eeprom_read_byte(&ee_KeyerMode); 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.WpMBpM = eeprom_read_byte(&ee_WpMBpM); bConfig.Reverse = eeprom_read_byte(&ee_Reverse); @@ -277,6 +289,10 @@ void TXKey(uint8_t State) { SidetoneOn(); sbi(PORTC,MORSE_LED); + if(bConfig.Trx1) + sbi(PORTC,TRX1); + if(bConfig.Trx2) + sbi(PORTC,TRX2); bState.KeyState = 1; } } @@ -288,11 +304,25 @@ void TXKey(uint8_t State) { SidetoneOff(); cbi(PORTC,MORSE_LED); + if(bConfig.Trx1) + cbi(PORTC,TRX1); + if(bConfig.Trx2) + cbi(PORTC,TRX2); } 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<