copy some stuff from upstream

This commit is contained in:
2026-02-17 09:43:26 +01:00
parent 01aa31a1fa
commit af0e177c7d
6 changed files with 55 additions and 13 deletions

View File

@@ -24,6 +24,7 @@ typedef enum {
Cmd_Set_NoiseBlanker_Audio = 24,
Cmd_Set_Deemphasis = 31,
Cmd_Set_StereoImprovement = 32,
Cmd_Set_LevelStep = 38,
Cmd_Set_LevelOffset = 39,
Cmd_Set_Softmute_Max = 45,
Cmd_Set_Highcut_Level = 52,
@@ -31,6 +32,7 @@ typedef enum {
Cmd_Set_Highcut_Mph = 54,
Cmd_Set_Highcut_Max = 55,
Cmd_Set_LowCut_Max = 57,
Cmd_Set_LowCut_Min = 58,
Cmd_Set_Stereo_Time = 60,
Cmd_Set_Stereo_Level = 62,
Cmd_Set_Stereo_Noise = 63,

View File

@@ -2,7 +2,7 @@
#include <Arduino.h>
#define VERSION "v2.20.5e"
#define VERSION "v2.20.6b"
#define ROTARY_PIN_A 34
#define ROTARY_PIN_B 36

View File

@@ -136,9 +136,10 @@ void TEF6686::init(byte TEF) {
while(devTEF_APPL_Get_Operation_Status() != 2) delay(1); // Wait for it to start
Wire.setClock(old_clock);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_LevelStep, 7, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffc, 0xfff8, 0x0);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_Highcut_Mph, 3, 0, 360, 300);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_Highcut_Max, 2, 0, 4000);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_LowCut_Max, 2, 0, 100);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_LowCut_Max, 2, 1, 60);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_Stereo_Time, 4, 60, 120, 100, 200);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_StHiBlend_Time, 4, 500, 2000, 200, 200);
devTEF_Set_Cmd(TEF_FM, Cmd_Set_StHiBlend_Level, 3, 0, 600, 240);

View File

@@ -5,7 +5,7 @@
bool Tuner_WriteBuffer(unsigned char *buf, uint16_t len) {
Wire.beginTransmission(TEF668X_ADDRESS);
for (uint16_t i = 0; i < len; i++) Wire.write(buf[i]);
Wire.write(buf, len);
uint8_t r = Wire.endTransmission();
if (!Data_Accelerator) delay(1);
return (r == 0) ? true : false;
@@ -33,7 +33,7 @@ static void Tuner_Patch_Load(const unsigned char *pLutBytes, uint16_t size) {
for (i = 0; i < len; i++) buf[1 + i] = pgm_read_byte(&pLutBytes[i]);
pLutBytes += len;
if (1 != (r = Tuner_WriteBuffer(buf, len + 1))) break;
if(!Tuner_WriteBuffer(buf, len + 1)) break;
}
}

View File

@@ -959,7 +959,7 @@ void total_pc_control() {
case 1: { // Send data
if(len < 3) break;
Wire.beginTransmission(data[1]);
for(int i = 0; i < (len-2); i++) Wire.write(data[2+i]);
Wire.write(data + 2, len - 2);
auto out = Wire.endTransmission();
Serial.write(2);
Serial.write(1);

View File

@@ -1036,6 +1036,44 @@ void NumpadProcess(int num) {
ShowFreq(5);
ShowFreq(0);
}
} else if (tunemode == TUNE_MEM) {
if (num == 127) {
freq_in = 0;
menuoption = ITEM1;
menupage = DXMODE;
menuitem = 0;
submenu = true;
menu = true;
if (language == LANGUAGE_CHS) PSSprite.setTextFont(1); else PSSprite.setTextFont(0);
BuildMenu();
} else if (num == 13) {
if (freq_in > 0 && freq_in <= EE_PRESETS_CNT) {
byte oldmemorypos = memorypos;
memorypos = freq_in - 1;
if (IsStationEmpty()) {
// Flash red and revert
FrequencySprite.setTextDatum(TR_DATUM);
FrequencySprite.fillSprite(BackgroundColor);
FrequencySprite.setTextColor(SignificantColor, SignificantColorSmooth, false);
FrequencySprite.drawString(String(freq_in) + " ", 218, -6);
FrequencySprite.pushSprite(46, 46);
delay(500);
memorypos = oldmemorypos;
ShowFreq(0);
ShowMemoryPos();
} else {
DoMemoryPosTune();
ShowMemoryPos();
}
} else ShowFreq(0);
freq_in = 0;
} else {
if (freq_in / 100 == 0) {
int temp = freq_in * 10 + num;
if (temp <= EE_PRESETS_CNT) freq_in = temp;
}
ShowNum(freq_in);
}
} else {
if (num == 127) {
freq_in = 0;
@@ -1353,10 +1391,10 @@ void setup() {
if (USBmode) Serial.updateBaudRate(19200); else Serial.updateBaudRate(115200);
if (iMSset && EQset) iMSEQ = 2;
if (!iMSset && EQset) iMSEQ = 3;
if (iMSset && !EQset) iMSEQ = 4;
if (!iMSset && !EQset) iMSEQ = 1;
if(iMSset && EQset) iMSEQ = 2;
else if(!iMSset && EQset) iMSEQ = 3;
else if(iMSset && !EQset) iMSEQ = 4;
else iMSEQ = 1;
switch (band) {
case BAND_LW:
@@ -1625,6 +1663,7 @@ void handleTimers() {
if (freq_in != 0 && millis() >= keypadtimer + DELAY_KEYPAD_TIMEOUT_MS) {
freq_in = 0;
ShowFreq(0);
if (tunemode == TUNE_MEM) ShowMemoryPos();
}
}
@@ -2648,10 +2687,10 @@ void ButtonPress() {
if (BWsettemp == 18 || BWsettemp == 19) {
if (BWsettemp == 18) iMSset = !iMSset;
if (BWsettemp == 19) EQset = !EQset;
if (!iMSset && !EQset) iMSEQ = 0;
if (iMSset && EQset) iMSEQ = 2;
if (!iMSset && EQset) iMSEQ = 3;
if (iMSset && !EQset) iMSEQ = 4;
if(!iMSset && !EQset) iMSEQ = 0;
else if(iMSset && EQset) iMSEQ = 2;
else if(!iMSset && EQset) iMSEQ = 3;
else iMSEQ = 4;
EEPROM.writeByte(EE_BYTE_IMSSET, iMSset);
EEPROM.writeByte(EE_BYTE_EQSET, EQset);
EEPROM.commit();