backup registers added

Speed-test
erikkaashoek 4 years ago
parent 49c13d298d
commit ac759f9fe2

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1591214633354629" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="864143553010007" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>
@ -17,7 +17,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1591214633354629" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="864143553010007" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>

@ -132,6 +132,8 @@ static THD_FUNCTION(Thread1, arg)
// START_PROFILE // START_PROFILE
if (sweep_mode&(SWEEP_ENABLE|SWEEP_ONCE)) { if (sweep_mode&(SWEEP_ENABLE|SWEEP_ONCE)) {
// if (dirty) // if (dirty)
backup.frequency0 = setting.frequency0;
backup.frequency1 = setting.frequency1;
completed = sweep(true); completed = sweep(true);
sweep_mode&=~SWEEP_ONCE; sweep_mode&=~SWEEP_ONCE;
} else if (sweep_mode & SWEEP_SELFTEST) { } else if (sweep_mode & SWEEP_SELFTEST) {
@ -1415,10 +1417,10 @@ show_one:
do_one = true; do_one = true;
goto show_one; goto show_one;
} }
#if MAX_UNIT_TYPE != 4 #if MAX_UNIT_TYPE != 6
#error "Unit type enum possibly changed, check cmd_trace function" #error "Unit type enum possibly changed, check cmd_trace function"
#endif #endif
static const char cmd_type_list[] = "dBm|dBmV|dBuV|V|W"; static const char cmd_type_list[] = "dBm|dBmV|dBuV|RAW|V|W";
if (argc == 1) { if (argc == 1) {
int type = get_str_index(argv[0], cmd_type_list); int type = get_str_index(argv[0], cmd_type_list);
if (type >= 0) { if (type >= 0) {
@ -2453,6 +2455,12 @@ int main(void)
load_LCD_properties(); load_LCD_properties();
} }
if (backup.frequency0 != 0 || backup.frequency1 != 0) {
setting.frequency0 = backup.frequency0;
setting.frequency1 = backup.frequency1;
update_frequencies();
}
set_refer_output(-1); set_refer_output(-1);
// ui_mode_menu(); // Show menu when autostarting mode // ui_mode_menu(); // Show menu when autostarting mode
ui_mode_normal(); ui_mode_normal();

@ -18,7 +18,7 @@
*/ */
#include "ch.h" #include "ch.h"
//#ifdef TINYSA_F303 #ifdef TINYSA_F303
#ifdef TINYSA_F072 #ifdef TINYSA_F072
#error "Remove comment for #ifdef TINYSA_F303" #error "Remove comment for #ifdef TINYSA_F303"
#endif #endif
@ -26,16 +26,16 @@
#define TINYSA4 #define TINYSA4
#endif #endif
#define TINYSA4_PROTO #define TINYSA4_PROTO
//#endif #endif
#ifdef TINYSA_F072 //#ifdef TINYSA_F072
#ifdef TINYSA_F303 #ifdef TINYSA_F303
#error "Remove comment for #ifdef TINYSA_F072" #error "Remove comment for #ifdef TINYSA_F072"
#endif #endif
#ifndef TINYSA3 #ifndef TINYSA3
#define TINYSA3 #define TINYSA3
#endif #endif
#endif //#endif
// Need enable HAL_USE_SPI in halconf.h // Need enable HAL_USE_SPI in halconf.h
#define __USE_DISPLAY_DMA__ #define __USE_DISPLAY_DMA__
@ -129,8 +129,8 @@
//#define LOW_MAX_FREQ 800000000ULL //#define LOW_MAX_FREQ 800000000ULL
#define MIN_BELOW_LO 550000000ULL #define MIN_BELOW_LO 550000000ULL
#ifdef __NEW_SWITCHES__ #ifdef __NEW_SWITCHES__
#define DIRECT_START 822000000ULL #define DIRECT_START 965000000ULL
#define DIRECT_STOP 1130000000ULL #define DIRECT_STOP 985000000ULL
#endif #endif
#endif #endif
/* /*
@ -454,6 +454,13 @@ extern void tlv320aic3204_set_gain(int lgain, int rgain);
extern void tlv320aic3204_select(int channel); extern void tlv320aic3204_select(int channel);
#endif #endif
typedef struct {
freq_t frequency0, frequency1;
} backup_t;
#define backup (*(backup_t *)0x40002850) // backup registers 5 * 32 bits
/* /*
* plot.c * plot.c
*/ */
@ -630,10 +637,11 @@ enum trace_type {
// Electrical Delay // Electrical Delay
// Phase // Phase
#define MAX_UNIT_TYPE 4 #define MAX_UNIT_TYPE 6 // Index of U_DBC
enum unit_type { enum unit_type {
U_DBM=0, U_DBMV, U_DBUV, U_VOLT, U_WATT, U_DBC // dBc only for displaying delta marker info U_DBM=0, U_DBMV, U_DBUV, U_RAW, U_VOLT, U_WATT, U_DBC // dBc only for displaying delta marker info
}; };
#define UNIT_IS_LINEAR(T) ( T >= U_VOLT ? true : false) #define UNIT_IS_LINEAR(T) ( T >= U_VOLT ? true : false)
#define UNIT_IS_LOG(T) ( T >= U_VOLT ? false : true) #define UNIT_IS_LOG(T) ( T >= U_VOLT ? false : true)
@ -1008,6 +1016,7 @@ void spi_init(void);
/* /*
* flash.c * flash.c
*/ */
typedef struct setting typedef struct setting
{ {
uint32_t magic; uint32_t magic;

@ -372,7 +372,8 @@ value(const float v)
// return powf(10.0, v/10.0)/1000.0; // powf(10.0, v /10.0) / 1000.0 // return powf(10.0, v/10.0)/1000.0; // powf(10.0, v /10.0) / 1000.0
return expf(v*(logf(10.0)/10.0)) / 1000.0; // expf(v*logf(10.0)/10.0) / 1000.0 return expf(v*(logf(10.0)/10.0)) / 1000.0; // expf(v*logf(10.0)/10.0) / 1000.0
} }
// case U_DBM: // case U_DBM:
// case U_RAW:
return v; // raw data is in logmag*10 format return v; // raw data is in logmag*10 format
} }
@ -444,6 +445,9 @@ trace_into_index_y_array(index_y_t *y, float *array, int points)
float ref_shift = 0; float ref_shift = 0;
switch (setting.unit){ switch (setting.unit){
case U_DBM: break; case U_DBM: break;
#ifdef TINYSA4
case U_RAW: break;
#endif
case U_DBMV: ref_shift = 30.0 + 20.0*log10f(sqrtf(50.0));break; case U_DBMV: ref_shift = 30.0 + 20.0*log10f(sqrtf(50.0));break;
case U_DBUV: ref_shift = 90.0 + 20.0*log10f(sqrtf(50.0));break; case U_DBUV: ref_shift = 90.0 + 20.0*log10f(sqrtf(50.0));break;
case U_VOLT: vmult = powf(10, -30.0/20.0) * sqrtf(50.0); mult = logf(10.0)/20.0;break; case U_VOLT: vmult = powf(10, -30.0/20.0) * sqrtf(50.0); mult = logf(10.0)/20.0;break;
@ -1485,7 +1489,7 @@ static void trace_print_value_string( // Only used at one place
if (mtype & M_DELTA) { if (mtype & M_DELTA) {
ref_marker = markers[mi].ref; ref_marker = markers[mi].ref;
// *ptr2++ = S_DELTA[0]; // *ptr2++ = S_DELTA[0];
unit_index+= 5; unit_index+= MAX_UNIT_TYPE;
freq_t ref_freq = markers[ref_marker].frequency; freq_t ref_freq = markers[ref_marker].frequency;
int ridx = markers[ref_marker].index; int ridx = markers[ref_marker].index;
if (ridx > idx) {freq = ref_freq - freq; idx = ridx - idx; *ptr2++ = '-';} if (ridx > idx) {freq = ref_freq - freq; idx = ridx - idx; *ptr2++ = '-';}

@ -741,6 +741,10 @@ void set_IF2(int f)
void set_R(int f) void set_R(int f)
{ {
setting.R = f; setting.R = f;
if (f<0) {
f = -f;
ADF4351_R_counter(-(f % 1000));
} else
ADF4351_R_counter(f % 1000); ADF4351_R_counter(f % 1000);
ADF4351_spur_mode(f/1000); ADF4351_spur_mode(f/1000);
dirty = true; dirty = true;
@ -1637,7 +1641,11 @@ void calculate_step_delay(void)
noise_level = step_delay_table[i].noise_level - PURE_TO_float(get_signal_path_loss()); noise_level = step_delay_table[i].noise_level - PURE_TO_float(get_signal_path_loss());
log_averaging_correction = step_delay_table[i].log_aver_correction; log_averaging_correction = step_delay_table[i].log_aver_correction;
#endif #endif
if (setting.step_delay_mode == SD_PRECISE || setting.increased_R) // In precise mode wait twice as long for RSSI to stabilize if (setting.step_delay_mode == SD_PRECISE
#ifdef TINYSA4
|| setting.increased_R
#endif
) // In precise mode wait twice as long for RSSI to stabilize
SI4432_step_delay += (SI4432_step_delay>>2) ; SI4432_step_delay += (SI4432_step_delay>>2) ;
if (setting.fast_speedup >0) if (setting.fast_speedup >0)
SI4432_offset_delay = SI4432_step_delay / setting.fast_speedup; SI4432_offset_delay = SI4432_step_delay / setting.fast_speedup;
@ -2886,24 +2894,21 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
} }
#ifdef TINYSA4 #ifdef TINYSA4
// ----------------------------- set mixer drive -------------------------------------------- // ----------------------------- set mixer drive --------------------------------------------
if (setting.lo_drive & 0x04){ // Automatic mixer drive int target_drive = setting.lo_drive;
int target_drive; if (target_drive & 0x04){ // Automatic mixer drive
if (f < 2400000000ULL) if (f < 100000000ULL)
target_drive = 0;
else if (f < 2400000000ULL)
target_drive = 1; target_drive = 1;
else if (f < 3000000000ULL) else if (f < 3000000000ULL)
target_drive = 2; target_drive = 2;
else else
target_drive = 3; target_drive = 3;
}
if (old_drive != target_drive) { if (old_drive != target_drive) {
ADF4351_drive(target_drive); // Max drive ADF4351_drive(target_drive); // Max drive
old_drive = target_drive; old_drive = target_drive;
} }
} else {
if (old_drive != setting.lo_drive) {
ADF4351_drive(setting.lo_drive);
old_drive = setting.lo_drive;
}
}
#endif #endif
#ifdef TINYSA3 #ifdef TINYSA3
#ifdef __ULTRA__ #ifdef __ULTRA__
@ -3186,10 +3191,11 @@ modulation_again:
enable_ultra(true); enable_ultra(true);
enable_direct(true); enable_direct(true);
enable_high(true); enable_high(true);
ADF4351_enable_out(false); enable_ADF_output(false);
} else { } else
#endif #endif
ADF4351_enable_out(true); {
enable_ADF_output(true);
if (ultra && f > ultra_threshold) { if (ultra && f > ultra_threshold) {
enable_ultra(true); enable_ultra(true);
#ifdef __NEW_SWITCHES__ #ifdef __NEW_SWITCHES__
@ -3515,9 +3521,12 @@ again: // Spur redu
ADF4351_modulo(60); ADF4351_modulo(60);
} }
#endif #endif
freq_t tf = ((lf + actual_rbw_x10*1000) / TCXO) * TCXO; freq_t tf = ((lf + actual_rbw_x10*200) / TCXO) * TCXO;
if (tf + actual_rbw_x10*200 >= lf && tf < lf + actual_rbw_x10*200 && tf != 180000000) { // 30MHz if (tf + actual_rbw_x10*200 >= lf && tf < lf + actual_rbw_x10*200 && tf != 180000000) { // 30MHz
setting.increased_R = true; setting.increased_R = true;
if ( (tf / TCXO) & 1 ) // Odd harmonic of 30MHz
ADF4351_R_counter(-3);
else
ADF4351_R_counter(3); ADF4351_R_counter(3);
} else { } else {
#if 0 #if 0
@ -3931,7 +3940,11 @@ again: // Spur redu
// } // }
#define IGNORE_RSSI 30000 #define IGNORE_RSSI 30000
// pureRSSI_t rssi = (RSSI>0 ? RSSI + correct_RSSI + correct_RSSI_freq : IGNORE_RSSI); // add correction // pureRSSI_t rssi = (RSSI>0 ? RSSI + correct_RSSI + correct_RSSI_freq : IGNORE_RSSI); // add correction
pureRSSI_t rssi = RSSI + correct_RSSI + correct_RSSI_freq; // add correction pureRSSI_t rssi;
if (setting.unit == U_RAW)
rssi = RSSI - float_TO_PURE_RSSI(120); // don't add correction;
else
rssi = RSSI + correct_RSSI + correct_RSSI_freq; // add correction
if (false) { if (false) {
abort: abort:
rssi = 0; rssi = 0;

@ -204,6 +204,7 @@ void enable_ultra(int s);
void enable_rx_output(int s); void enable_rx_output(int s);
void enable_high(int s); void enable_high(int s);
void enable_direct(int s); void enable_direct(int s);
void enable_ADF_output(int f);
#endif #endif

@ -254,6 +254,10 @@ bool PE4302_Write_Byte(unsigned char DATA )
#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit)) #define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit))
#define maskedWrite(reg, bit, mask, value) (reg) &= ~(((uint32_t)mask) << (bit)); (reg) |= ((((uint32_t) (value)) & ((uint32_t)mask)) << (bit));
#define CS_ADF0_HIGH {palSetLine(LINE_LO_SEL);ADF_CS_DELAY;} #define CS_ADF0_HIGH {palSetLine(LINE_LO_SEL);ADF_CS_DELAY;}
#define CS_ADF1_HIGH {ADF_CS_DELAY;palSetLine(LINE_LO_SEL);} #define CS_ADF1_HIGH {ADF_CS_DELAY;palSetLine(LINE_LO_SEL);}
@ -414,8 +418,9 @@ void ADF4351_R_counter(int R)
PFDRFout[channel] = (config.setting_frequency_30mhz * (dbl?2:1)) / R; PFDRFout[channel] = (config.setting_frequency_30mhz * (dbl?2:1)) / R;
} }
clear_frequency_cache(); // When R changes the possible frequencies will change clear_frequency_cache(); // When R changes the possible frequencies will change
registers[2] &= ~(((uint32_t)0x3FF) << 14); maskedWrite(registers[2],14, 0x3FF, R);
registers[2] |= (((uint32_t) R) << 14); // registers[2] &= ~(((uint32_t)0x3FF) << 14);
// registers[2] |= (((uint32_t) R) << 14);
ADF4351_Set(0); ADF4351_Set(0);
} }
@ -427,45 +432,51 @@ void ADF4351_recalculate_PFDRFout(void){
void ADF4351_mux(int R) void ADF4351_mux(int R)
{ {
registers[2] &= ~(((uint32_t) 0x7) << 26); maskedWrite(registers[2],26, 0x7, R);
registers[2] |= (((uint32_t)R & 0x07) << 26); // registers[2] &= ~(((uint32_t) 0x7) << 26);
// registers[2] |= (((uint32_t)R & 0x07) << 26);
ADF4351_Set(0); ADF4351_Set(0);
} }
void ADF4351_csr(int c) void ADF4351_csr(int c)
{ {
registers[3] &= ~(((uint32_t) 0x1) << 18); maskedWrite(registers[3],18, 0x1, c);
registers[3] |= (((uint32_t)c & 0x01) << 18); // registers[3] &= ~(((uint32_t) 0x1) << 18);
// registers[3] |= (((uint32_t)c & 0x01) << 18);
ADF4351_Set(0); ADF4351_Set(0);
} }
void ADF4351_fastlock(int c) void ADF4351_fastlock(int c)
{ {
registers[3] &= ~(((uint32_t) 0x3) << 15); maskedWrite(registers[3],15, 0x3, c);
registers[3] |= (((uint32_t)c & 0x03) << 15); // registers[3] &= ~(((uint32_t) 0x3) << 15);
// registers[3] |= (((uint32_t)c & 0x03) << 15);
ADF4351_Set(0); ADF4351_Set(0);
} }
void ADF4351_CP(int p) void ADF4351_CP(int p)
{ {
registers[2] &= ~(((uint32_t)0xF) << 9); maskedWrite(registers[2],9, 0xF, p);
registers[2] |= (((uint32_t) p) << 9); // registers[2] &= ~(((uint32_t)0xF) << 9);
// registers[2] |= (((uint32_t) p) << 9);
ADF4351_Set(0); ADF4351_Set(0);
} }
void ADF4351_drive(int p) void ADF4351_drive(int p)
{ {
p &= 0x03; maskedWrite(registers[4],3, 0x3, p);
registers[4] &= ~(((uint32_t)0x3) << 3); // p &= 0x03;
registers[4] |= (((uint32_t) p) << 3); // registers[4] &= ~(((uint32_t)0x3) << 3);
// registers[4] |= (((uint32_t) p) << 3);
ADF4351_Set(0); ADF4351_Set(0);
} }
void ADF4351_aux_drive(int p) void ADF4351_aux_drive(int p)
{ {
p &= 0x03; maskedWrite(registers[4],6, 0x3, p);
registers[4] &= ~(((uint32_t)0x3) << 6); // p &= 0x03;
registers[4] |= (((uint32_t) p) << 6); // registers[4] &= ~(((uint32_t)0x3) << 6);
// registers[4] |= (((uint32_t) p) << 6);
ADF4351_Set(0); ADF4351_Set(0);
} }
#if 0 #if 0
@ -587,13 +598,13 @@ void ADF4351_enable_aux_out(int s)
void ADF4351_enable_out(int s) void ADF4351_enable_out(int s)
{ {
if (s) { if (s) {
bitClear(registers[2], 11); // Disable VCO power down bitClear(registers[4], 11); // Disable VCO power down
bitClear(registers[2], 5); // Disable power down bitClear(registers[2], 5); // Disable power down
bitSet(registers[4], 5); // Enable output bitSet(registers[4], 5); // Enable output
} else { } else {
bitClear(registers[4], 5); // Disable output bitClear(registers[4], 5); // Disable output
bitSet(registers[2], 5); // Enable power down bitSet(registers[2], 5); // Enable power down
bitSet(registers[2], 11); // Enable VCO power down bitSet(registers[4], 11); // Enable VCO power down
} }
ADF4351_Set(0); ADF4351_Set(0);
} }
@ -1855,6 +1866,10 @@ void enable_rx_output(int s)
void enable_high(int s) void enable_high(int s)
{ {
static int old_s = 2;
if (s == old_s)
return;
old_s = s;
#ifdef __NEW_SWITCHES__ #ifdef __NEW_SWITCHES__
if (s) if (s)
SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE0); SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE0);
@ -1868,6 +1883,15 @@ void enable_high(int s)
#endif #endif
} }
void enable_ADF_output(int f)
{
static int old_f = 2;
if (f==old_f)
return;
old_f = f;
ADF4351_enable_out(f);
}
#ifdef __NEW_SWITCHES__ #ifdef __NEW_SWITCHES__
void enable_direct(int s) void enable_direct(int s)
{ {

@ -480,7 +480,7 @@ static const struct {
[KM_COR_WFM] = {keypads_plusmin , "COR\nWFM"}, // KM_COR_WFM [KM_COR_WFM] = {keypads_plusmin , "COR\nWFM"}, // KM_COR_WFM
[KM_COR_NFM] = {keypads_plusmin , "COR\nNFM"}, // KM_COR_NFM [KM_COR_NFM] = {keypads_plusmin , "COR\nNFM"}, // KM_COR_NFM
[KM_IF2] = {keypads_freq , "IF2"}, // KM_IF2 [KM_IF2] = {keypads_freq , "IF2"}, // KM_IF2
[KM_R] = {keypads_positive , "R"}, // KM_R #30 [KM_R] = {keypads_plusmin , "R"}, // KM_R #30
[KM_MOD] = {keypads_positive , "MODULO"}, // KM_MOD [KM_MOD] = {keypads_positive , "MODULO"}, // KM_MOD
[KM_CP] = {keypads_positive , "CP"}, // KM_CP [KM_CP] = {keypads_positive , "CP"}, // KM_CP
#endif #endif
@ -2867,13 +2867,13 @@ static const menuitem_t menu_config[] = {
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
{ MT_KEYPAD, KM_REPEAT, "SAMPLE\nREPEAT", "1..100"}, { MT_KEYPAD, KM_REPEAT, "SAMPLE\nREPEAT", "1..100"},
#endif
#ifdef __LCD_BRIGHTNESS__
{ MT_CALLBACK, 0, "BRIGHTNESS", menu_brightness_cb},
#endif #endif
{ MT_SUBMENU, 0, "EXPERT\nCONFIG", menu_settings}, { MT_SUBMENU, 0, "EXPERT\nCONFIG", menu_settings},
#ifndef TINYSA4 #ifndef TINYSA4
{ MT_SUBMENU, 0, S_RARROW" DFU", menu_dfu}, { MT_SUBMENU, 0, S_RARROW" DFU", menu_dfu},
#endif
#ifdef __LCD_BRIGHTNESS__
{ MT_CALLBACK, 0, "BRIGHTNESS", menu_brightness_cb},
#endif #endif
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back { MT_NONE, 0, NULL, menu_back} // next-> menu_back
}; };
@ -2954,6 +2954,9 @@ static const menuitem_t menu_unit[] =
//{ MT_ADV_CALLBACK,U_UVOLT, S_MICRO"Volt", menu_unit_acb}, //{ MT_ADV_CALLBACK,U_UVOLT, S_MICRO"Volt", menu_unit_acb},
{ MT_ADV_CALLBACK,U_WATT, "Watt", menu_unit_acb}, { MT_ADV_CALLBACK,U_WATT, "Watt", menu_unit_acb},
//{ MT_ADV_CALLBACK,U_UWATT, S_MICRO"Watt", menu_unit_acb}, //{ MT_ADV_CALLBACK,U_UWATT, S_MICRO"Watt", menu_unit_acb},
#ifdef TINYSA4
{ MT_ADV_CALLBACK,U_RAW, "RAW", menu_unit_acb},
#endif
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back { MT_NONE, 0, NULL, menu_back} // next-> menu_back
}; };
@ -3443,8 +3446,7 @@ float my_round(float v)
} }
return v; return v;
} }
const char * const unit_string[MAX_UNIT_TYPE*2] = { "dBm", "dBmV", "dB"S_MICRO"V", "RAW", "V", "W", "dB", "dBmV", "dB"S_MICRO"V", "RAW", "V", "W" }; // unit + 6 is delta unit
const char * const unit_string[] = { "dBm", "dBmV", "dB"S_MICRO"V", "V", "W", "dB", "dBmV", "dB"S_MICRO"V", "V", "W" }; // unit + 5 is delta unit
static const float scale_value[]={50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01,0.005,0.002, 0.001,0.0005,0.0002, 0.0001}; static const float scale_value[]={50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01,0.005,0.002, 0.001,0.0005,0.0002, 0.0001};
static const char * const scale_vtext[]= {"50000", "20000", "10000", "5000", "2000", "1000", "500", "200", "100", "50", "20","10","5","2","1","0.5","0.2","0.1","0.05","0.02","0.01", "0.005","0.002","0.001", "0.0005","0.0002","0.0001"}; static const char * const scale_vtext[]= {"50000", "20000", "10000", "5000", "2000", "1000", "500", "200", "100", "50", "20","10","5","2","1","0.5","0.2","0.1","0.05","0.02","0.01", "0.005","0.002","0.001", "0.0005","0.0002","0.0001"};

Loading…
Cancel
Save

Powered by TurnKey Linux.