Skip to content

Commit e91efc6

Browse files
committed
Remove fast steps
1 parent 61ed9e3 commit e91efc6

File tree

5 files changed

+13
-51
lines changed

5 files changed

+13
-51
lines changed

ats-mini/Menu.cpp

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,6 @@ static const Step fmSteps[] =
275275
{ 100, "1M", 10 },
276276
};
277277

278-
static const uint8_t fmFastSteps[] =
279-
{
280-
1, // 10kHz -> 50kHz
281-
2, // 50kHz -> 100kHz
282-
3, // 100kHz -> 200kHz
283-
4, // 200kHz -> 1MHz
284-
4, // 1MHz -> 1MHz
285-
};
286-
287278
// SSB (Hz)
288279
static const Step ssbSteps[] =
289280
{
@@ -298,19 +289,6 @@ static const Step ssbSteps[] =
298289
{ 10000, "10k", 10 },
299290
};
300291

301-
static const uint8_t ssbFastSteps[] =
302-
{
303-
3, // 10Hz -> 100Hz
304-
3, // 25Hz -> 100Hz
305-
4, // 50Hz -> 500Hz
306-
5, // 100Hz -> 1kHz
307-
6, // 500Hz -> 5kHz
308-
6, // 1kHz -> 5kHz
309-
8, // 5kHz -> 10kHz
310-
7, // 9kHz -> 9kHz
311-
8, // 10kHz -> 10kHz
312-
};
313-
314292
// AM (kHz)
315293
static const Step amSteps[] =
316294
{
@@ -323,19 +301,7 @@ static const Step amSteps[] =
323301
{ 1000, "1M", 10 },
324302
};
325303

326-
static const uint8_t amFastSteps[] =
327-
{
328-
1, // 1kHz -> 5kHz
329-
3, // 5kHz -> 10kHz
330-
2, // 9kHz -> 9kHz
331-
4, // 10kHz -> 50kHz
332-
5, // 50kHz -> 100kHz
333-
6, // 100kHz -> 1MHz
334-
6, // 1MHz -> 1MHz
335-
};
336-
337304
static const Step *steps[4] = { fmSteps, ssbSteps, ssbSteps, amSteps };
338-
static const uint8_t *fastSteps[4] = { fmFastSteps, ssbFastSteps, ssbFastSteps, amFastSteps };
339305
static const uint8_t defaultStepIdx[4] = { 2, 5, 5, 1 };
340306

341307
static int getLastStep(int mode)
@@ -351,10 +317,10 @@ static int getLastStep(int mode)
351317
return(0);
352318
}
353319

354-
const Step *getCurrentStep(bool fast)
320+
const Step *getCurrentStep()
355321
{
356322
uint8_t idx = bands[bandIdx].currentStepIdx > getLastStep(currentMode) ? defaultStepIdx[currentMode] : bands[bandIdx].currentStepIdx;
357-
return(&steps[currentMode][fast ? fastSteps[currentMode][idx]:idx]);
323+
return(&steps[currentMode][idx]);
358324
}
359325

360326
static uint8_t freqInputPos = 0;
@@ -366,7 +332,7 @@ static uint8_t getDefaultFreqInputPos(int mode, int step)
366332

367333
void resetFreqInputPos()
368334
{
369-
freqInputPos = getDefaultFreqInputPos(currentMode, getCurrentStep(false)->step);
335+
freqInputPos = getDefaultFreqInputPos(currentMode, getCurrentStep()->step);
370336
}
371337

372338
uint8_t getFreqInputPos()

ats-mini/Menu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int getTotalMemories();
111111
Band *getCurrentBand();
112112
uint8_t getFreqInputPos();
113113
int getFreqInputStep();
114-
const Step *getCurrentStep(bool fast = false);
114+
const Step *getCurrentStep();
115115
const Bandwidth *getCurrentBandwidth();
116116
uint8_t getRDSMode();
117117

ats-mini/ats-mini.ino

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,15 @@ void showFrequencySeek(uint16_t freq)
517517
//
518518
// Handle encoder rotation in seek mode
519519
//
520-
bool doSeek(int16_t enc)
520+
bool doSeek(int16_t enc, int16_t enca)
521521
{
522522
// disable amp to avoid sound artifacts
523523
muteOn(MUTE_TEMP, true);
524524
if(seekMode() == SEEK_DEFAULT)
525525
{
526526
if(isSSB())
527527
{
528-
updateBFO(currentBFO + enc * getCurrentStep(true)->step, true);
528+
updateBFO(currentBFO + enca * getCurrentStep()->step, true);
529529
}
530530
else
531531
{
@@ -566,14 +566,14 @@ bool doSeek(int16_t enc)
566566
//
567567
// Handle tuning
568568
//
569-
bool doTune(int16_t enc, bool fast = false)
569+
bool doTune(int16_t enc)
570570
{
571571
//
572572
// SSB tuning
573573
//
574574
if(isSSB())
575575
{
576-
uint32_t step = getCurrentStep(fast)->step;
576+
uint32_t step = getCurrentStep()->step;
577577
uint32_t stepAdjust = (currentFrequency * 1000 + currentBFO) % step;
578578
step = !stepAdjust? step : enc>0? step - stepAdjust : stepAdjust;
579579

@@ -585,7 +585,7 @@ bool doTune(int16_t enc, bool fast = false)
585585
//
586586
else
587587
{
588-
uint16_t step = getCurrentStep(fast)->step;
588+
uint16_t step = getCurrentStep()->step;
589589
uint16_t stepAdjust = currentFrequency % step;
590590
stepAdjust = (currentMode==FM) && (step==20)? (stepAdjust+10) % step : stepAdjust;
591591
step = !stepAdjust? step : enc>0? step - stepAdjust : stepAdjust;
@@ -768,11 +768,6 @@ void loop()
768768
// Current frequency may have changed
769769
prefsRequestSave(SAVE_CUR_BAND);
770770
break;
771-
case CMD_SCAN:
772-
// Fast tuning in scan mode
773-
needRedraw |= doTune(encCountAccel, true);
774-
prefsRequestSave(SAVE_CUR_BAND);
775-
break;
776771
}
777772
}
778773
// Reset timeouts while push and rotate is active
@@ -800,7 +795,7 @@ void loop()
800795
break;
801796
case CMD_SEEK:
802797
// Seek mode
803-
needRedraw |= doSeek(encCount);
798+
needRedraw |= doSeek(encCount, encCountAccel);
804799
// Seek can take long time, renew the timestamp
805800
currentTime = millis();
806801
// Current frequency may have changed

changelog/+fast-steps.removed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove faster tuning in Seek mode on SSB and in Scan mode via press & rotate in favor af the new accelerated encoder control.

docs/source/manual.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ The menu can be invoked by clicking the encoder button and is closed automatical
5454
* **Band** - List of [Bands](#bands-table).
5555
* **Volume** - 0 (silent) ... 63 (max). The headphone volume level can be low (compared to the built-in speaker) due to limitation of the initial hardware design. Use short press to mute/unmute.
5656
* **Step** - Tuning step (not every step is available on every band and mode).
57-
* **Seek** - Scan up or down on AM/FM, faster tuning on LSB/USB (hardware seek function is not supported by SI4732 on SSB). Rotate or click the encoder to stop the scan. Use short press to switch between the scan and [schedule](#schedule) modes. Use press and rotate for manual fine tuning.
58-
* **Scan** - Scan a frequency range and plot the RSSI (S) and SNR (N) graphs (unfortunately, these metrics are almost meaningless in SSB modes due to SI4732 patch limitations). Both graphs are normalized to 0.0 - 1.0 range. While the Scan mode is active, short press the encoder for 0.5 seconds to rescan, press & rotate to tune using a larger step. To abort a running scan process click or rotate the encoder.
57+
* **Seek** - Seek up or down on AM/FM, normal tuning on LSB/USB (hardware seek function is not supported by SI4732 on SSB). Rotate or click the encoder to stop the seek. Use short press to switch between the seek and [schedule](#schedule) modes. Use press and rotate for manual fine tuning.
58+
* **Scan** - Scan a frequency range and plot the RSSI (S) and SNR (N) graphs (unfortunately, these metrics are almost meaningless in SSB modes due to SI4732 patch limitations). Both graphs are normalized to 0.0 - 1.0 range. While the Scan mode is active, short press the encoder for 0.5 seconds to rescan. To abort a running scan process click or rotate the encoder.
5959
* **Memory** - 99 slots to store favorite frequencies. Short press on an empty slot to store the current frequency, short press to erase a slot, switch between stored slots by rotating the encoder, click to exit the menu. It is also possible to edit the memory slots via [serial port](#serial-interface) or via the [web based tool](memory.md) in Google Chrome.
6060
* **Squelch** - mute the speaker when the RSSI level is lower than the defined threshold. Unlikely to work in SSB mode. To turn it off quickly, short press the encoder button while in the Squelch menu mode.
6161
* **Bandwidth** - Selects the bandwidth of the channel filter.

0 commit comments

Comments
 (0)