diff --git a/chprintf.c b/chprintf.c index 90736ba..1e43cc7 100644 --- a/chprintf.c +++ b/chprintf.c @@ -331,11 +331,11 @@ int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap) { state|=DEFAULT_PRESCISION; //Get [length] if (c == 'l' || c == 'L') { - state|=IS_LONG; + // state|=IS_LONG; // Ignore Long if (*fmt) c = *fmt++; } - /* + /* else if ((c >= 'A') && (c <= 'Z')) state|=IS_LONG; */ diff --git a/nanovna.h b/nanovna.h index 00e74d0..f4e03ca 100644 --- a/nanovna.h +++ b/nanovna.h @@ -326,7 +326,7 @@ void set_attack(int); void set_noise(int); void toggle_tracking_output(void); extern int32_t frequencyExtra; -void set_30mhz(freq_t f); +void set_30mhz(freq_t); void set_modulation(int); void set_modulation_frequency(int); int search_maximum(int m, freq_t center, int span); @@ -563,7 +563,7 @@ typedef struct config { int16_t touch_cal[4]; uint32_t _serial_speed; #ifdef __VNA__ - uint32_t harmonic_freq_threshold; + freq_t harmonic_freq_threshold; #endif uint16_t dac_value; uint16_t vbat_offset; @@ -588,7 +588,7 @@ typedef struct config { int8_t ultra; uint32_t dummy; // uint8_t _reserved[22]; - uint32_t checksum; + freq_t checksum; } config_t; extern config_t config; diff --git a/sa_core.c b/sa_core.c index d928ce0..e5fc958 100644 --- a/sa_core.c +++ b/sa_core.c @@ -60,6 +60,8 @@ void clear_frequency_cache(void) ADF4351_force_refresh(); } +static freq_t old_freq[4] = { 0, 0, 0, 0}; +static freq_t real_old_freq[4] = { 0, 0, 0, 0}; //int setting.refer = -1; // Off by default const int reffer_freq[] = {30000000, 15000000, 10000000, 4000000, 3000000, 2000000, 1000000}; @@ -1601,7 +1603,7 @@ void update_rbw(void) // calculate the actual_rbw and the vbwSteps (# } else { setting.vbw_x10 = 3000; // trick to get right default rbw in zero span mode } - uint32_t temp_actual_rbw_x10 = setting.rbw_x10; // requested rbw , 32 bit !!!!!! + freq_t temp_actual_rbw_x10 = setting.rbw_x10; // requested rbw , 32 bit !!!!!! if (temp_actual_rbw_x10 == 0) { // if auto rbw if (setting.step_delay_mode==SD_FAST) { // if in fast scanning #ifdef __SI4432__ @@ -2462,7 +2464,7 @@ modulation_again: if (MODE_OUTPUT(setting.mode)) { // No substepping and no RSSI in output mode if (break_on_operation && operation_requested) // break subscanning if requested return(0); // abort - if (i == 1 && MODE_OUTPUT(setting.mode) && setting.modulation != MO_NONE && setting.modulation != MO_EXTERNAL) { // if in output mode with modulation + if ( i==1 && MODE_OUTPUT(setting.mode) && setting.modulation != MO_NONE && setting.modulation != MO_EXTERNAL) { // if in output mode with modulation and LO setup done // i = 1; // Everything set so skip LO setting goto modulation_again; // Keep repeating sweep loop till user aborts by input } @@ -2950,7 +2952,7 @@ sweep_again: // stay in sweep loop when output mo #define AUTO_TARGET_LEVEL -30 #define AUTO_TARGET_WINDOW 2 - if (!in_selftest && setting.mode == M_LOW && setting.auto_attenuation && max_index[0] > 0) { // calculate and apply auto attenuate + if (!in_selftest && setting.mode == M_LOW && setting.auto_attenuation) { // calculate and apply auto attenuate setting.atten_step = false; // No step attenuate in low mode auto attenuate int changed = false; int delta = 0; @@ -3892,7 +3894,7 @@ void self_test(int test) setting.frequency_step = 30000; if (setting.test_argument > 0) setting.frequency_step=setting.test_argument; - uint32_t f = 400000; // Start search at 400kHz + freq_t f = 400000; // Start search at 400kHz // int i = 0; // Index in spur table (temp_t) set_RBW(setting.frequency_step/100); last_spur = 0; diff --git a/ui.c b/ui.c index ef6b254..d8c86c9 100644 --- a/ui.c +++ b/ui.c @@ -1276,6 +1276,7 @@ menu_move_back(void) if (current_menu_is_form()) { redraw_frame(); + redraw_request |= REDRAW_BATTERY; area_width = 0; } else { // redraw_frame(); @@ -1311,6 +1312,7 @@ menu_push_submenu(const menuitem_t *submenu) ensure_selection(); if (menu_is_form(submenu)) { redraw_frame(); + redraw_request |= REDRAW_BATTERY; area_width = 0; } else { // redraw_frame(); @@ -2119,7 +2121,7 @@ menu_select_touch(int i, int pos) step = setting.slider_span; break; } - if (step < 0 && get_sweep_frequency(ST_CENTER) < (unsigned int)-step) + if (step < 0 && get_sweep_frequency(ST_CENTER) < (freq_t)(-step)) uistat.value = 0; else uistat.value = get_sweep_frequency(ST_CENTER) + step;