|
|
|
@ -18,6 +18,7 @@
|
|
|
|
|
2022-09-02 DL7BJ viele Softwareänderungen, neuer Filter für PWM
|
|
|
|
|
2022-09-11 DL7BJ Encoder, LC-Display, Frontplatine "entsorgt"
|
|
|
|
|
2023-06-28 DL7BJ Port Anpassungen an neue Leiterplatte V1.01
|
|
|
|
|
2023-07-29 DL7BJ Menü für Einstellungen implementiert
|
|
|
|
|
|
|
|
|
|
ATMEGA328(P)
|
|
|
|
|
----------
|
|
|
|
@ -159,7 +160,7 @@ void Init()
|
|
|
|
|
cbi(PORTD,RIGHT_PADDLE);
|
|
|
|
|
cbi(PORTD,STRAIGHT_KEY);
|
|
|
|
|
|
|
|
|
|
t_element_length = (uint16_t)1200/bConfig.wpm;
|
|
|
|
|
t_element_length = (uint16_t)1200/bConfig.WpM;
|
|
|
|
|
|
|
|
|
|
// Pin Change Interrupts Port D - Keys
|
|
|
|
|
// PD4 - StraightKey - PCINT20 - Pin Change Interrupt 20
|
|
|
|
@ -186,20 +187,22 @@ void Init()
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
bMenuCtrl.Config = 0;
|
|
|
|
|
bMenuCtrl.buttonPressed = 0;
|
|
|
|
|
bMenuCtrl.WriteEEProm = 0;
|
|
|
|
|
bMenuCtrl.WriteEEprom = 0;
|
|
|
|
|
bMenuCtrl.buttonPressedLong = 0;
|
|
|
|
|
// Initialisierung Konfiguration
|
|
|
|
|
bConfig.iambic = 1;
|
|
|
|
|
bConfig.sidetone_f = 600;
|
|
|
|
|
bConfig.sidetone = 1;
|
|
|
|
|
bConfig.trx = 0;
|
|
|
|
|
bConfig.weight = 50;
|
|
|
|
|
bConfig.wpmbpm = 1;
|
|
|
|
|
bConfig.wpm = 15;
|
|
|
|
|
bConfig.ratio = 30;
|
|
|
|
|
bConfig.reverse = 0;
|
|
|
|
|
bConfig.Risetime = 4;
|
|
|
|
|
bConfig.RisetimeCounter = 4;
|
|
|
|
|
bConfig.IambicMode = 1;
|
|
|
|
|
bConfig.FrequencySidetone = 600;
|
|
|
|
|
bConfig.SidetoneEnabled = 1;
|
|
|
|
|
bConfig.TRX = 0;
|
|
|
|
|
bConfig.Weight = 50;
|
|
|
|
|
bConfig.WpMBpM = 1;
|
|
|
|
|
bConfig.WpM = 12;
|
|
|
|
|
bConfig.Ratio = 30;
|
|
|
|
|
bConfig.Reverse = 0;
|
|
|
|
|
bConfig.RiseTime = 6;
|
|
|
|
|
bConfig.RiseTimeCounter = 6;
|
|
|
|
|
bConfig.DebounceTime = 5;
|
|
|
|
|
bConfig.WinkeyerEnabled = 0;
|
|
|
|
|
sei(); // enable all interrupts
|
|
|
|
|
}
|
|
|
|
|
/** \brief 16 Bit Timer 1A
|
|
|
|
@ -218,8 +221,8 @@ ISR(TIMER1_COMPA_vect)
|
|
|
|
|
{
|
|
|
|
|
ocr2a = pgm_read_byte_near(sinewave+icnt);
|
|
|
|
|
icnt++;
|
|
|
|
|
if(StateRisetime > 0)
|
|
|
|
|
OCR2A = (ocr2a >> StateRisetime);
|
|
|
|
|
if(StateRiseTime > 0)
|
|
|
|
|
OCR2A = (ocr2a >> StateRiseTime);
|
|
|
|
|
else
|
|
|
|
|
OCR2A = ocr2a;
|
|
|
|
|
|
|
|
|
@ -228,20 +231,20 @@ ISR(TIMER1_COMPA_vect)
|
|
|
|
|
icnt = 0;
|
|
|
|
|
if(state_sidetoneoff == 0)
|
|
|
|
|
{
|
|
|
|
|
if(StateRisetime > 0)
|
|
|
|
|
if(StateRiseTime > 0)
|
|
|
|
|
{
|
|
|
|
|
StateRisetimeCounter++;
|
|
|
|
|
if(StateRisetimeCounter > bConfig.RisetimeCounter)
|
|
|
|
|
StateRisetime--;
|
|
|
|
|
StateRiseTimeCounter++;
|
|
|
|
|
if(StateRiseTimeCounter > bConfig.RiseTimeCounter)
|
|
|
|
|
StateRiseTime--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(state_sidetoneoff == 1)
|
|
|
|
|
{
|
|
|
|
|
if(StateRisetime < bConfig.Risetime)
|
|
|
|
|
if(StateRiseTime < bConfig.RiseTime)
|
|
|
|
|
{
|
|
|
|
|
StateRisetimeCounter++;
|
|
|
|
|
if(StateRisetimeCounter > bConfig.RisetimeCounter)
|
|
|
|
|
StateRisetime++;
|
|
|
|
|
StateRiseTimeCounter++;
|
|
|
|
|
if(StateRiseTimeCounter > bConfig.RiseTimeCounter)
|
|
|
|
|
StateRiseTime++;
|
|
|
|
|
} else {
|
|
|
|
|
OCR2A = 0;
|
|
|
|
|
cbi(TIMSK1,OCIE1A);
|
|
|
|
@ -259,41 +262,51 @@ ISR(TIMER1_COMPA_vect)
|
|
|
|
|
*/
|
|
|
|
|
ISR(TIMER0_COMPA_vect)
|
|
|
|
|
{
|
|
|
|
|
ms++;
|
|
|
|
|
StoreEEprom++;
|
|
|
|
|
MenuCtrlTimer++;
|
|
|
|
|
|
|
|
|
|
mselement++; // element length of dit or dat
|
|
|
|
|
ms++; // allgemeiner Millisekundenzähler
|
|
|
|
|
StoreEEprom++; // Zähler für Zeitablauf speichern EEprom
|
|
|
|
|
MenuCtrlTimer++; // Zähler für Zeitablauf Einstellungen
|
|
|
|
|
EncoderTimer++; // Zähler für 5ms Drehencoder Timer
|
|
|
|
|
|
|
|
|
|
mselement++; // element length of dit or dat
|
|
|
|
|
t_wait++;
|
|
|
|
|
l_timer++;
|
|
|
|
|
encoder_timer++;
|
|
|
|
|
|
|
|
|
|
if(l_timer >= L_WAIT){
|
|
|
|
|
if(l_timer >= L_WAIT)
|
|
|
|
|
{
|
|
|
|
|
l_timer = 0;
|
|
|
|
|
}
|
|
|
|
|
// Alle 5ms den Drehencoder abfragen
|
|
|
|
|
if(encoder_timer > 5) {
|
|
|
|
|
if(EncoderTimer > 5)
|
|
|
|
|
{
|
|
|
|
|
EncoderTimer = 0;
|
|
|
|
|
EncoderPolling();
|
|
|
|
|
// Schalter vom Drehencoder abfragen
|
|
|
|
|
if(EncoderGetButtonState() == ButtonPressed_Short)
|
|
|
|
|
lastButton = EncoderGetButtonState();
|
|
|
|
|
if(lastButton == ButtonPressed_Short)
|
|
|
|
|
{
|
|
|
|
|
bMenuCtrl.buttonPressed = 1;
|
|
|
|
|
SendSerialString("Button pressed short\r\n");
|
|
|
|
|
SendSerialString("Encoder Button pressed short\r\n");
|
|
|
|
|
}
|
|
|
|
|
if(EncoderGetButtonState() == ButtonPressed_Long)
|
|
|
|
|
if(lastButton == ButtonPressed_Long)
|
|
|
|
|
{
|
|
|
|
|
bMenuCtrl.buttonPressedLong = 1;
|
|
|
|
|
SendSerialString("Button pressed long\r\n");
|
|
|
|
|
SendSerialString("Encoder Button pressed long\r\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Wpm verändert?
|
|
|
|
|
// WpM verändert? Nach einer Sekunde im EEPROM Speichern
|
|
|
|
|
if((StoreEEprom > 1000) && (bMerker.WpMChanged))
|
|
|
|
|
{
|
|
|
|
|
StoreEEprom = 0;
|
|
|
|
|
bMerker.WriteWpMEEProm = 1;
|
|
|
|
|
bMerker.WriteWpMEEprom = 1;
|
|
|
|
|
bMerker.WpMChanged = 0;
|
|
|
|
|
}
|
|
|
|
|
// Softwareentprellung für StraightKey
|
|
|
|
|
TimerStraightKeyPressed++;
|
|
|
|
|
if(StateStraightKeyPressed == 1)
|
|
|
|
|
{
|
|
|
|
|
if(TimerStraightKeyPressed > bConfig.DebounceTime)
|
|
|
|
|
StateStraightKeyPressed = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Konfiguration nach 3 Sekunden verlassen
|
|
|
|
|
// if((MenuCtrlTimer > 3000) && (bMenuCtrl.Config == 1))
|
|
|
|
|
// {
|
|
|
|
@ -428,7 +441,9 @@ void ConfigMenue(void)
|
|
|
|
|
|
|
|
|
|
lcd_charMode(NORMAL);
|
|
|
|
|
lcd_gotoxy(0,0);
|
|
|
|
|
sprintf(line,"%s - %i","Konfiguration", bMenuCtrl.CurMenue);
|
|
|
|
|
lcd_puts(CLEARLINE);
|
|
|
|
|
lcd_gotoxy(0,0);
|
|
|
|
|
sprintf(line,"%s - %i","Einstellungen", bMenuCtrl.CurMenue);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
lcd_charMode(DOUBLESIZE);
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
@ -437,63 +452,63 @@ void ConfigMenue(void)
|
|
|
|
|
{
|
|
|
|
|
case M_TRX1:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if((bConfig.trx == 1) || (bConfig.trx == 0))
|
|
|
|
|
if((bConfig.TRX == 1) || (bConfig.TRX == 0))
|
|
|
|
|
sprintf(line,"[%s]", "TRX 1");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "TRX 1");
|
|
|
|
|
sprintf(line," %s ", "TRX 1");
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_TRX2:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if((bConfig.trx == 2) || (bConfig.trx == 0))
|
|
|
|
|
if((bConfig.TRX == 2) || (bConfig.TRX == 0))
|
|
|
|
|
sprintf(line,"[%s]", "TRX 2");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "TRX 2");
|
|
|
|
|
sprintf(line," %s ", "TRX 2");
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_IAMBICA:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.iambic == 1)
|
|
|
|
|
sprintf(line,"[%s]", "Iambic A");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "Iambic A");
|
|
|
|
|
if(bConfig.IambicMode == 1)
|
|
|
|
|
sprintf(line,"[%s]", IambicA);
|
|
|
|
|
else
|
|
|
|
|
sprintf(line," %s ", IambicB);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_IAMBICB:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.iambic == 2)
|
|
|
|
|
sprintf(line,"[%s]", "Iambic B");
|
|
|
|
|
if(bConfig.IambicMode == 2)
|
|
|
|
|
sprintf(line,"[%s]", IambicB);
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "Iambic B");
|
|
|
|
|
sprintf(line," %s ", IambicB);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_REVERSE:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.reverse == 0)
|
|
|
|
|
sprintf(line,"%s", "L . R -");
|
|
|
|
|
if(bConfig.Reverse == 0)
|
|
|
|
|
sprintf(line,"%s", ReverseLR);
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "L - R .");
|
|
|
|
|
sprintf(line,"%s", ReverseRL);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_RATIO:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.ratio == 30)
|
|
|
|
|
if(bConfig.Ratio == 30)
|
|
|
|
|
sprintf(line,"%s", "Ratio 3:1");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s %f:1", "Ratio", bConfig.ratio/10);
|
|
|
|
|
sprintf(line,"%s %i:1", "Ratio", bConfig.Ratio/10);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_TON_FREQ:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.sidetone_f == 650)
|
|
|
|
|
if(bConfig.FrequencySidetone == 650)
|
|
|
|
|
sprintf(line,"%s", "Ton 650Hz");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s %uHz", "Ton", bConfig.sidetone_f);
|
|
|
|
|
sprintf(line,"%s %uHz", "Ton", bConfig.FrequencySidetone);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_TON:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.ratio == 1)
|
|
|
|
|
if(bConfig.SidetoneEnabled == 1)
|
|
|
|
|
sprintf(line,"%s", "Ton an");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "Ton aus");
|
|
|
|
@ -501,12 +516,22 @@ void ConfigMenue(void)
|
|
|
|
|
break;
|
|
|
|
|
case M_WPMBPM:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
if(bConfig.wpmbpm == 0)
|
|
|
|
|
if(bConfig.WpMBpM == 0)
|
|
|
|
|
sprintf(line,"%s", "WpM");
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%s", "BpM");
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_RISETIME:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
sprintf(line,"%s %ims",RiseTime, bConfig.RiseTime);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
case M_DEBOUNCE:
|
|
|
|
|
lcd_gotoxy(0,3);
|
|
|
|
|
sprintf(line,"%s %ims",DebounceTime, bConfig.DebounceTime);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
bMenuCtrl.Update = 0;
|
|
|
|
|
lcd_charMode(NORMAL);
|
|
|
|
@ -528,29 +553,30 @@ void UpdateDisplay(void)
|
|
|
|
|
{
|
|
|
|
|
lcd_clrscr();
|
|
|
|
|
bMenuCtrl.ClrScr = 0;
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
}
|
|
|
|
|
if(!(bMenuCtrl.Config))
|
|
|
|
|
{
|
|
|
|
|
lcd_charMode(DOUBLESIZE);
|
|
|
|
|
lcd_gotoxy(4,3);
|
|
|
|
|
if(bConfig.wpmbpm)
|
|
|
|
|
sprintf(line,"%i WpM ",bConfig.wpm);
|
|
|
|
|
if(bConfig.WpMBpM)
|
|
|
|
|
sprintf(line,"%i WpM ",bConfig.WpM);
|
|
|
|
|
else
|
|
|
|
|
sprintf(line,"%i BpM ", bConfig.wpm*5);
|
|
|
|
|
sprintf(line,"%i BpM ", bConfig.WpM*5);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
lcd_charMode(NORMAL);
|
|
|
|
|
lcd_gotoxy(13,0);
|
|
|
|
|
if(bConfig.iambic == 1)
|
|
|
|
|
if(bConfig.IambicMode == 1)
|
|
|
|
|
sprintf(line,"%s", IambicA);
|
|
|
|
|
if(bConfig.iambic == 2)
|
|
|
|
|
if(bConfig.IambicMode == 2)
|
|
|
|
|
sprintf(line,"%s", IambicB);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
lcd_gotoxy(0,0);
|
|
|
|
|
if(bConfig.trx == 1)
|
|
|
|
|
if(bConfig.TRX == 1)
|
|
|
|
|
sprintf(line, "%s", Trx1);
|
|
|
|
|
if(bConfig.trx == 2)
|
|
|
|
|
if(bConfig.TRX == 2)
|
|
|
|
|
sprintf(line, "%s", Trx2);
|
|
|
|
|
if(bConfig.trx == 0)
|
|
|
|
|
if(bConfig.TRX == 0)
|
|
|
|
|
sprintf(line, "%s %s", Trx1, Trx2);
|
|
|
|
|
lcd_puts(line);
|
|
|
|
|
}
|
|
|
|
@ -570,11 +596,16 @@ void Drehencoder(void)
|
|
|
|
|
{
|
|
|
|
|
EncoderMinMax(5,50);
|
|
|
|
|
st = EncoderRead(1);
|
|
|
|
|
if(bConfig.wpm != st)
|
|
|
|
|
if(bConfig.WpM != st)
|
|
|
|
|
{
|
|
|
|
|
bConfig.wpm = st;
|
|
|
|
|
bMerker.WpMChanged = 1;
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
bConfig.WpM = st; // neuen Wert in bConfig speichern
|
|
|
|
|
bMerker.WpMChanged = 1; // Merker für Timer 0 setzen
|
|
|
|
|
bMenuCtrl.Update = 1; // Merker für UpdateDisplay setzen
|
|
|
|
|
EncoderPos = st; // neuen Werte in EncoderPos speichern
|
|
|
|
|
WpM = bConfig.WpM; // neuen Wert in WpM übernehmen
|
|
|
|
|
cli();
|
|
|
|
|
StoreEEprom = 0; // Timer 0 Variable löschen für Update EEprom
|
|
|
|
|
sei();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -583,6 +614,10 @@ void Drehencoder(void)
|
|
|
|
|
bMenuCtrl.Config = 1;
|
|
|
|
|
MenuCtrlTimer = 0;
|
|
|
|
|
bMenuCtrl.buttonPressed = 0;
|
|
|
|
|
EncoderPos = EncoderRead(1);
|
|
|
|
|
bMenuCtrl.CurMenue = EncoderPosConfig;
|
|
|
|
|
EncoderWrite(EncoderPosConfig);
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if((bMenuCtrl.buttonPressedLong == 1) && (bMenuCtrl.Config == 1))
|
|
|
|
@ -592,8 +627,11 @@ void Drehencoder(void)
|
|
|
|
|
bMenuCtrl.buttonPressedLong = 0;
|
|
|
|
|
bMenuCtrl.buttonPressed = 0;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
MenuCtrlTimer = 0;
|
|
|
|
|
EncoderPosConfig = EncoderRead(1);
|
|
|
|
|
EncoderWrite(EncoderPos);
|
|
|
|
|
bMenuCtrl.ClrScr = 1;
|
|
|
|
|
Beep();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(bMenuCtrl.Config == 1)
|
|
|
|
@ -603,9 +641,9 @@ void Drehencoder(void)
|
|
|
|
|
EncoderMinMax(1,M_MAX);
|
|
|
|
|
st = EncoderRead(1);
|
|
|
|
|
sprintf(sdebug,"Encoder %i\r\n",st);
|
|
|
|
|
SendSerialString(sdebug);
|
|
|
|
|
if(last != st)
|
|
|
|
|
{
|
|
|
|
|
SendSerialString(sdebug);
|
|
|
|
|
bMenuCtrl.CurMenue = st;
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
}
|
|
|
|
@ -624,47 +662,52 @@ void Drehencoder(void)
|
|
|
|
|
switch(bMenuCtrl.CurMenue)
|
|
|
|
|
{
|
|
|
|
|
case M_TRX1:
|
|
|
|
|
if(bConfig.trx == 2)
|
|
|
|
|
bConfig.trx = 0;
|
|
|
|
|
if(bConfig.TRX == 2)
|
|
|
|
|
bConfig.TRX = 0;
|
|
|
|
|
else
|
|
|
|
|
bConfig.trx = 1;
|
|
|
|
|
bConfig.TRX = 1;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
break;
|
|
|
|
|
case M_TRX2:
|
|
|
|
|
if(bConfig.trx == 1)
|
|
|
|
|
bConfig.trx = 0;
|
|
|
|
|
if(bConfig.TRX == 1)
|
|
|
|
|
bConfig.TRX = 0;
|
|
|
|
|
else
|
|
|
|
|
bConfig.trx = 2;
|
|
|
|
|
bConfig.TRX = 2;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
break;
|
|
|
|
|
case M_IAMBICA:
|
|
|
|
|
bConfig.iambic = 1;
|
|
|
|
|
bConfig.IambicMode = 1;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
break;
|
|
|
|
|
case M_IAMBICB:
|
|
|
|
|
bConfig.iambic = 2;
|
|
|
|
|
bConfig.IambicMode = 2;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
break;
|
|
|
|
|
case M_REVERSE:
|
|
|
|
|
if(bConfig.reverse == 1)
|
|
|
|
|
bConfig.reverse = 0;
|
|
|
|
|
if(bConfig.Reverse == 1)
|
|
|
|
|
bConfig.Reverse = 0;
|
|
|
|
|
else
|
|
|
|
|
bConfig.reverse = 1;
|
|
|
|
|
bConfig.Reverse = 1;
|
|
|
|
|
bMenuCtrl.m_buttonPressed = 0;
|
|
|
|
|
if(bConfig.Reverse == 1)
|
|
|
|
|
PaddleMode = PADDLE_REVERSE;
|
|
|
|
|
else
|
|
|
|
|
PaddleMode = PADDLE_NORMAL;
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
break;
|
|
|
|
|
case M_RATIO:
|
|
|
|
|
EncoderMinMax(15,30);
|
|
|
|
|
st = EncoderRead(1);
|
|
|
|
|
bConfig.ratio = st;
|
|
|
|
|
if(bConfig.ratio > 30) bConfig.ratio = 30;
|
|
|
|
|
if(bConfig.ratio < 15) bConfig.ratio = 15;
|
|
|
|
|
bConfig.Ratio = st;
|
|
|
|
|
if(bConfig.Ratio > 30) bConfig.Ratio = 30;
|
|
|
|
|
if(bConfig.Ratio < 15) bConfig.Ratio = 15;
|
|
|
|
|
bMenuCtrl.Update = 1;
|
|
|
|
|
break;
|
|
|
|
|
case M_TON_FREQ:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -687,21 +730,29 @@ int main(void)
|
|
|
|
|
|
|
|
|
|
MachineMode = NORMAL;
|
|
|
|
|
KeyerMode = IAMBIC_A;
|
|
|
|
|
ReadEEProm_WpM();
|
|
|
|
|
|
|
|
|
|
SendSerialString(CLRSCR);
|
|
|
|
|
SendSerialString(CLRSCR);
|
|
|
|
|
SendSerialString("BJ-Keyer V1.00\r\n");
|
|
|
|
|
SendSerialString("Ready!\r\n");
|
|
|
|
|
EncoderWrite(bConfig.wpm);
|
|
|
|
|
|
|
|
|
|
SetFrequency(600);
|
|
|
|
|
ReadEEpromWpM();
|
|
|
|
|
WpM = bConfig.WpM;
|
|
|
|
|
EncoderPos = bConfig.WpM;
|
|
|
|
|
EncoderWrite(bConfig.WpM);
|
|
|
|
|
EncoderPosConfig = 1;
|
|
|
|
|
|
|
|
|
|
SetFrequency(600);
|
|
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
Drehencoder();
|
|
|
|
|
|
|
|
|
|
if(bMerker.WriteWpMEEProm)
|
|
|
|
|
WriteEEProm_WpM();
|
|
|
|
|
// Wenn Geschwindigkeit verändert und Zeit abgelaufen,
|
|
|
|
|
// dann im EEprom speichern und Merker löschen.
|
|
|
|
|
if(bMerker.WriteWpMEEprom)
|
|
|
|
|
{
|
|
|
|
|
sprintf(" %i WpM in EEprom speichern\r\n", bConfig.WpM);
|
|
|
|
|
WriteEEpromWpM();
|
|
|
|
|
bMerker.WriteWpMEEprom = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateDisplay();
|
|
|
|
|
|
|
|
|
|