Skip to content

Commit

Permalink
Merge pull request #1777 from satoryboy/active-devel
Browse files Browse the repository at this point in the history
Finalize smootch dynamic tune
  • Loading branch information
df8oe authored May 1, 2019
2 parents d53a680 + 3d963fe commit 9af8ab6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
3 changes: 2 additions & 1 deletion mchf-eclipse/drivers/ui/menu/ui_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4320,7 +4320,8 @@ void UiMenu_UpdateItem(uint16_t select, MenuProcessingMode_t mode, int pos, int
break;
#endif
case MENU_DEBUG_SMOOTH_DYN_TUNE:
var_change = UiDriverMenuItemChangeEnableOnOffBool(var, mode, &ts.smooth_dyn_tune,0,options,&clr);
var_change = UiDriverMenuItemChangeEnableOnOffFlag(var, mode, &ts.expflags1,0,options,&clr, EXPFLAGS1_SMOOTH_DYNAMIC_TUNE);
clr = White;
break;

default: // Move to this location if we get to the bottom of the table!
Expand Down
1 change: 1 addition & 0 deletions mchf-eclipse/drivers/ui/ui_configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ const ConfigEntryDescriptor ConfigEntryInfo[] =
{ ConfigEntry_Int32_16, EEPROM_CW_DECODER_BLOCKSIZE,&cw_decoder_config.blocksize,CW_DECODER_BLOCKSIZE_DEFAULT,CW_DECODER_BLOCKSIZE_MIN,CW_DECODER_BLOCKSIZE_MAX}, // NO INT DEFAULT PROBLEM
{ ConfigEntry_UInt8x2, EEPROM_SMETER_ALPHAS,&sm.config.alphaCombined,CONFIG_UINT8x2_COMBINE(SMETER_ALPHA_ATTACK_DEFAULT, SMETER_ALPHA_DECAY_DEFAULT), CONFIG_UINT8x2_COMBINE(SMETER_ALPHA_MIN, SMETER_ALPHA_MIN), CONFIG_UINT8x2_COMBINE(SMETER_ALPHA_MAX,SMETER_ALPHA_MAX) },
{ ConfigEntry_UInt8, EEPROM_VSWR_PROTECTION_THRESHOLD,&ts.debug_vswr_protection_threshold,1,1,10},
{ ConfigEntry_UInt16, EEPROM_EXPFLAGS1,&ts.expflags1,EXPFLAGS1_CONFIG_DEFAULT,0,0xffff},

// the entry below MUST be the last entry, and only at the last position Stop is allowed
{
Expand Down
3 changes: 2 additions & 1 deletion mchf-eclipse/drivers/ui/ui_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,8 @@ void UiConfiguration_UpdateMacroCap(void);
#define EEPROM_TX_IQ_10M_UP_GAIN_BALANCE_TRANS_OFF 424
#define EEPROM_TX_IQ_10M_UP_PHASE_BALANCE_TRANS_OFF 425
#define EEPROM_VSWR_PROTECTION_THRESHOLD 426
#define EEPROM_FIRST_UNUSED 427 // change this if new value ids are introduced, must be correct at any time
#define EEPROM_EXPFLAGS1 427 // Flags for options in Debag/Expert menu - see variable "expflags1"
#define EEPROM_FIRST_UNUSED 428 // change this if new value ids are introduced, must be correct at any time

#define MAX_VAR_ADDR (EEPROM_FIRST_UNUSED - 1)

Expand Down
4 changes: 2 additions & 2 deletions mchf-eclipse/drivers/ui/ui_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@ static bool UiDriver_CheckFrequencyEncoder()

if (ts.flags1 & FLAGS1_DYN_TUNE_ENABLE) // check if dynamic tuning has been activated by touchscreen
{
if (!ts.smooth_dyn_tune) // Smooth dynamic tune is OFF
if (!(ts.expflags1 & EXPFLAGS1_SMOOTH_DYNAMIC_TUNE)) // Smooth dynamic tune is OFF
{
if ((enc_speed_avg > 80) || (enc_speed_avg < (-80)))
{
Expand Down Expand Up @@ -3536,7 +3536,7 @@ static void UiDriver_CheckEncoderTwo()

enc_multiplier = 1; //set standard speed

if (!ts.smooth_dyn_tune) // Smooth dynamic tune is OFF
if (!(ts.expflags1 & EXPFLAGS1_SMOOTH_DYNAMIC_TUNE)) // Smooth dynamic tune is OFF
{
if ((enc_speed_avg > 80) || (enc_speed_avg < (-80)))
{
Expand Down
20 changes: 19 additions & 1 deletion mchf-eclipse/hardware/uhsdr_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,25 @@ typedef struct TransceiverState
#define FLAGS1_REVERSE_X_TOUCHSCREEN 0x4000 // 1 = X direcction of touchscreen is mirrored
#define FLAGS1_REVERSE_Y_TOUCHSCREEN 0x8000 // 1 = Y direcction of touchscreen is mirrored

uint16_t expflags1; // Used to hold flags for options in Debag/Expert menu, stored in EEPROM location "EEPROM_EXPFLAGS1"
#define EXPFLAGS1_SMOOTH_DYNAMIC_TUNE 0x01 // 1 = Smooth dynamic tune is ON
// #define EXPFLAGS1_RESERVE_1 0x02 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_2 0x04 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_3 0x08 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_4 0x10 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_5 0x20 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_6 0x40 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_7 0x80 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_8 0x100 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_9 0x200 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_10 0x400 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_11 0x800 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_12 0x1000 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_13 0x2000 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_14 0x4000 // Reserve flag for options in Debag/Expert menu
// #define EXPFLAGS1_RESERVE_15 0x8000 // Reserve flag for options in Debag/Expert menu
#define EXPFLAGS1_CONFIG_DEFAULT 0x0000 // Default flags state

#ifdef UI_BRD_MCHF
// the default screen needs no reversed touch
#define FLAGS1_CONFIG_DEFAULT (FLAGS1_WFALL_ENABLED|FLAGS1_SCOPE_ENABLED)
Expand Down Expand Up @@ -674,7 +693,6 @@ typedef struct TransceiverState
// noise reduction gain display in spectrum
int16_t nr_gain_display; // 0 = do not display gains, 1 = display bin gain in spectrum display, 2 = display long_tone_gain
// 3 = display bin gain multiplied with long_tone_gain
bool smooth_dyn_tune; // Smooth dynamic tune is active?

} TransceiverState;

Expand Down
2 changes: 1 addition & 1 deletion mchf-eclipse/src/uhsdr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ void TransceiverStateInit(void)

ts.debug_vswr_protection_threshold = 1; // OFF

ts.smooth_dyn_tune = false; // Smooth dynamic tune is OFF
//CONFIG LOADED:ts.expflags1 = 0; // Used to hold flags for options in Debag/Expert menu, stored in EEPROM location "EEPROM_EXPFLAGS1"

ts.band_effective = 255; // this is an invalid band number, which will trigger a redisplay of the band name and the effective power
}
Expand Down

0 comments on commit 9af8ab6

Please sign in to comment.