chore: remove warnings

pull/76/head
TT 6 years ago
parent bfd45c715d
commit f7e712798a

@ -34,9 +34,11 @@
#define ENABLED_DUMP #define ENABLED_DUMP
static void apply_error_term(void);
static void apply_error_term_at(int i); static void apply_error_term_at(int i);
static void apply_edelay_at(int i);
static void cal_interpolate(int s); static void cal_interpolate(int s);
void update_frequencies(void);
void set_frequencies(uint32_t start, uint32_t stop, int16_t points);
bool sweep(bool break_on_operation); bool sweep(bool break_on_operation);
@ -47,7 +49,7 @@ static MUTEX_DECL(mutex);
#define IS_HARMONIC_MODE(f) ((f) > FREQ_HARMONICS) #define IS_HARMONIC_MODE(f) ((f) > FREQ_HARMONICS)
int32_t frequency_offset = 5000; int32_t frequency_offset = 5000;
int32_t frequency = 10000000; uint32_t frequency = 10000000;
int8_t drive_strength = DRIVE_STRENGTH_AUTO; int8_t drive_strength = DRIVE_STRENGTH_AUTO;
int8_t sweep_enabled = TRUE; int8_t sweep_enabled = TRUE;
int8_t sweep_once = FALSE; int8_t sweep_once = FALSE;
@ -146,7 +148,7 @@ transform_domain(void)
// and calculate ifft for time domain // and calculate ifft for time domain
float* tmp = (float*)spi_buffer; float* tmp = (float*)spi_buffer;
uint8_t window_size, offset; uint8_t window_size = 101, offset = 0;
uint8_t is_lowpass = FALSE; uint8_t is_lowpass = FALSE;
switch (domain_mode & TD_FUNC) { switch (domain_mode & TD_FUNC) {
case TD_FUNC_BANDPASS: case TD_FUNC_BANDPASS:
@ -280,7 +282,7 @@ adjust_gain(int newfreq)
return delay; return delay;
} }
int set_frequency(int freq) int set_frequency(uint32_t freq)
{ {
int delay = 0; int delay = 0;
if (frequency == freq) if (frequency == freq)
@ -827,7 +829,7 @@ freq_mode_centerspan(void)
#define STOP_MAX 1500000000 #define STOP_MAX 1500000000
void void
set_sweep_frequency(int type, uint32_t freq) set_sweep_frequency(int type, int32_t freq)
{ {
int cal_applied = cal_status & CALSTAT_APPLY; int cal_applied = cal_status & CALSTAT_APPLY;
switch (type) { switch (type) {
@ -1110,6 +1112,7 @@ eterm_calc_et(void)
cal_status |= CALSTAT_ET; cal_status |= CALSTAT_ET;
} }
#if 0
void apply_error_term(void) void apply_error_term(void)
{ {
int i; int i;
@ -1141,6 +1144,7 @@ void apply_error_term(void)
measured[1][i][1] = s21ai; measured[1][i][1] = s21ai;
} }
} }
#endif
void apply_error_term_at(int i) void apply_error_term_at(int i)
{ {
@ -1171,7 +1175,7 @@ void apply_error_term_at(int i)
measured[1][i][1] = s21ai; measured[1][i][1] = s21ai;
} }
void apply_edelay_at(int i) static void apply_edelay_at(int i)
{ {
float w = 2 * M_PI * electrical_delay * frequencies[i] * 1E-12; float w = 2 * M_PI * electrical_delay * frequencies[i] * 1E-12;
float s = sin(w); float s = sin(w);
@ -2127,5 +2131,6 @@ void HardFault_Handler(void)
void hard_fault_handler_c(uint32_t* sp) void hard_fault_handler_c(uint32_t* sp)
{ {
(void)sp;
while (true) {} while (true) {}
} }

@ -71,7 +71,7 @@ enum {
ST_START, ST_STOP, ST_CENTER, ST_SPAN, ST_CW ST_START, ST_STOP, ST_CENTER, ST_SPAN, ST_CW
}; };
void set_sweep_frequency(int type, uint32_t frequency); void set_sweep_frequency(int type, int32_t frequency);
uint32_t get_sweep_frequency(int type); uint32_t get_sweep_frequency(int type);
float my_atof(const char *p); float my_atof(const char *p);
@ -106,7 +106,7 @@ void calculate_gamma(float *gamma);
void fetch_amplitude(float *gamma); void fetch_amplitude(float *gamma);
void fetch_amplitude_ref(float *gamma); void fetch_amplitude_ref(float *gamma);
int si5351_set_frequency_with_offset(int freq, int offset, uint8_t drive_strength); int si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_strength);
/* /*
@ -195,7 +195,7 @@ typedef struct {
uint16_t trace_color[TRACES_MAX]; uint16_t trace_color[TRACES_MAX];
int16_t touch_cal[4]; int16_t touch_cal[4];
int8_t default_loadcal; int8_t default_loadcal;
int32_t harmonic_freq_threshold; uint32_t harmonic_freq_threshold;
int32_t checksum; int32_t checksum;
} config_t; } config_t;
@ -237,6 +237,7 @@ void redraw_marker(int marker, int update_info);
void trace_get_info(int t, char *buf, int len); void trace_get_info(int t, char *buf, int len);
void plot_into_index(float measured[2][101][2]); void plot_into_index(float measured[2][101][2]);
void force_set_markmap(void); void force_set_markmap(void);
void draw_frequencies(void);
void draw_all(bool flush); void draw_all(bool flush);
void draw_cal_status(void); void draw_cal_status(void);
@ -361,6 +362,8 @@ void ui_hide(void);
extern uint8_t operation_requested; extern uint8_t operation_requested;
void touch_start_watchdog(void);
void touch_position(int *x, int *y);
void handle_touch_interrupt(void); void handle_touch_interrupt(void);
#define TOUCH_THRESHOLD 2000 #define TOUCH_THRESHOLD 2000

@ -8,7 +8,6 @@
#define SWAP(x,y) do { int z=x; x = y; y = z; } while(0) #define SWAP(x,y) do { int z=x; x = y; y = z; } while(0)
static void cell_draw_marker_info(int m, int n, int w, int h); static void cell_draw_marker_info(int m, int n, int w, int h);
void draw_frequencies(void);
void frequency_string(char *buf, size_t len, int32_t freq); void frequency_string(char *buf, size_t len, int32_t freq);
void markmap_all_markers(void); void markmap_all_markers(void);
@ -614,7 +613,7 @@ gamma2imp(char *buf, int len, const float coeff[2], uint32_t frequency)
} }
static void static void
gamma2resistance(char *buf, int len, const float coeff[2], uint32_t frequency) gamma2resistance(char *buf, int len, const float coeff[2])
{ {
float z0 = 50; float z0 = 50;
float d = z0 / ((1-coeff[0])*(1-coeff[0])+coeff[1]*coeff[1]); float d = z0 / ((1-coeff[0])*(1-coeff[0])+coeff[1]*coeff[1]);
@ -623,7 +622,7 @@ gamma2resistance(char *buf, int len, const float coeff[2], uint32_t frequency)
} }
static void static void
gamma2reactance(char *buf, int len, const float coeff[2], uint32_t frequency) gamma2reactance(char *buf, int len, const float coeff[2])
{ {
float z0 = 50; float z0 = 50;
float d = z0 / ((1-coeff[0])*(1-coeff[0])+coeff[1]*coeff[1]); float d = z0 / ((1-coeff[0])*(1-coeff[0])+coeff[1]*coeff[1]);
@ -665,10 +664,10 @@ trace_get_value_string(int t, char *buf, int len, float coeff[2], uint32_t frequ
chsnprintf(buf, len, "%.2fj", coeff[1]); chsnprintf(buf, len, "%.2fj", coeff[1]);
break; break;
case TRC_R: case TRC_R:
gamma2resistance(buf, len, coeff, frequency); gamma2resistance(buf, len, coeff);
break; break;
case TRC_X: case TRC_X:
gamma2reactance(buf, len, coeff, frequency); gamma2reactance(buf, len, coeff);
break; break;
//case TRC_ADMIT: //case TRC_ADMIT:
case TRC_POLAR: case TRC_POLAR:
@ -744,7 +743,7 @@ clear_markmap(void)
memset(markmap[current_mappage], 0, sizeof markmap[current_mappage]); memset(markmap[current_mappage], 0, sizeof markmap[current_mappage]);
} }
void inline inline void
force_set_markmap(void) force_set_markmap(void)
{ {
memset(markmap[current_mappage], 0xff, sizeof markmap[current_mappage]); memset(markmap[current_mappage], 0xff, sizeof markmap[current_mappage]);

@ -304,7 +304,7 @@ int current_band = -1;
*/ */
#define CLK2_FREQUENCY 8000000L #define CLK2_FREQUENCY 8000000L
int int
si5351_set_frequency_with_offset(int freq, int offset, uint8_t drive_strength) si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_strength)
{ {
int band; int band;
int delay = 3; int delay = 3;

@ -20,6 +20,7 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
#include "chprintf.h"
#include "nanovna.h" #include "nanovna.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

Loading…
Cancel
Save

Powered by TurnKey Linux.