Add ESD protection dependencies

Removed_REF_marker
erikkaashoek 5 years ago
parent 5185435e36
commit 6e72f4549d

@ -247,7 +247,7 @@
PIN_MODE_OUTPUT(GPIO_RF_PWR) | \ PIN_MODE_OUTPUT(GPIO_RF_PWR) | \
PIN_MODE_OUTPUT(GPIO_SPI2_CLK) | \ PIN_MODE_OUTPUT(GPIO_SPI2_CLK) | \
PIN_MODE_OUTPUT(11) | \ PIN_MODE_OUTPUT(11) | \
PIN_MODE_OUTPUT(12) | \ PIN_MODE_INPUT(12) | \
PIN_MODE_OUTPUT(13) | \ PIN_MODE_OUTPUT(13) | \
PIN_MODE_INPUT(GPIO_SPI2_SDO) | \ PIN_MODE_INPUT(GPIO_SPI2_SDO) | \
PIN_MODE_OUTPUT(GPIO_SPI2_SDI)) PIN_MODE_OUTPUT(GPIO_SPI2_SDI))

@ -123,13 +123,13 @@ const char *info_about[]={
}; };
bool dirty = true; bool dirty = true;
bool completed = false; bool completed = false;
#ifdef TINYSA4 #ifdef TINYSA4
static THD_WORKING_AREA(waThread1, 1124); static THD_WORKING_AREA(waThread1, 1124);
#else #else
static THD_WORKING_AREA(waThread1, 768); static THD_WORKING_AREA(waThread1, 768);
bool has_esd = false;
#endif #endif
static THD_FUNCTION(Thread1, arg) static THD_FUNCTION(Thread1, arg)
{ {
@ -1022,7 +1022,7 @@ config_t config = {
.cor_am = 0, .cor_am = 0,
.cor_wfm = 0, .cor_wfm = 0,
.cor_nfm = 0, .cor_nfm = 0,
.ultra = false, .ultra = true,
.high_out_adf4350 = true, .high_out_adf4350 = true,
.ext_zero_level = 174, .ext_zero_level = 174,
#endif #endif
@ -2278,6 +2278,10 @@ VNA_SHELL_FUNCTION(cmd_info)
int i = 0; int i = 0;
while (info_about[i]) while (info_about[i])
shell_printf("%s\r\n", info_about[i++]); shell_printf("%s\r\n", info_about[i++]);
#ifdef TINYSA3
if (has_esd)
shell_printf("ESD protected\r\n");
#endif
} }
#endif #endif
@ -2851,6 +2855,11 @@ int main(void)
si5351_init(); si5351_init();
#endif #endif
#ifdef TINYSA3
has_esd = ((palReadPort(GPIOB) & (1<<12)) ? false : true );
#endif
#ifdef __SI4432__ #ifdef __SI4432__
/* /*
* Powercycle the RF part to reset SI4432 * Powercycle the RF part to reset SI4432

@ -84,7 +84,7 @@
#define HIGH_MAX_FREQ_MHZ 960 #define HIGH_MAX_FREQ_MHZ 960
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
#define DEFAULT_IF ((freq_t)977100000) #define DEFAULT_IF ((freq_t)977400000)
#define DEFAULT_SPUR_OFFSET ((freq_t)1500000) #define DEFAULT_SPUR_OFFSET ((freq_t)1500000)
#define DEFAULT_MAX_FREQ ((freq_t)800000000) #define DEFAULT_MAX_FREQ ((freq_t)800000000)
#define HIGH_MIN_FREQ_MHZ 136// 825 #define HIGH_MIN_FREQ_MHZ 136// 825
@ -120,6 +120,7 @@
#ifdef TINYSA3 #ifdef TINYSA3
typedef uint32_t freq_t; typedef uint32_t freq_t;
typedef int32_t long_t; typedef int32_t long_t;
extern bool has_esd;
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
typedef uint64_t freq_t; typedef uint64_t freq_t;

@ -1301,7 +1301,7 @@ static void cell_draw_marker_info(int x0, int y0)
#ifdef __CHANNEL_POWER__ #ifdef __CHANNEL_POWER__
if (setting.measurement==M_CP) { if (setting.measurement==M_CP) {
for (int c=0; c<3;c++) { for (int c=0; c<3;c++) {
plot_printf(buf, sizeof buf, "%4.1fdB", channel_power[c]); plot_printf(buf, sizeof buf, "%4.1fdBm", channel_power[c]);
int xpos = 10 + (c)*(WIDTH/3) + CELLOFFSETX - x0; int xpos = 10 + (c)*(WIDTH/3) + CELLOFFSETX - x0;
int ypos = 1 - y0; int ypos = 1 - y0;
ili9341_set_foreground(LCD_FG_COLOR); ili9341_set_foreground(LCD_FG_COLOR);

@ -835,7 +835,7 @@ VNA_SHELL_FUNCTION(cmd_correction)
if (argc == 0) { if (argc == 0) {
shell_printf("index frequency value\r\n"); shell_printf("index frequency value\r\n");
for (int i=0; i<CORRECTION_POINTS; i++) { for (int i=0; i<CORRECTION_POINTS; i++) {
shell_printf("%d %D%.1f\r\n", i, setting.correction_frequency[i], setting.correction_value[i]); shell_printf("%d %D %.1f\r\n", i, setting.correction_frequency[i], setting.correction_value[i]);
} }
return; return;
} }

@ -2240,7 +2240,7 @@ static void calculate_static_correction(void) // Calculate the
#ifdef TINYSA4 #ifdef TINYSA4
- (S_STATE(setting.agc)? 0 : 33) - (S_STATE(setting.agc)? 0 : 33)
- (S_STATE(setting.lna)? 0 : 0) - (S_STATE(setting.lna)? 0 : 0)
+ (setting.extra_lna ? -23.0 : 0) // TODO <------------------------- set correct value + (setting.extra_lna ? -25.5 : 0) // TODO <------------------------- set correct value
#endif #endif
- setting.external_gain); - setting.external_gain);
} }
@ -3946,11 +3946,11 @@ enum {
#define W2P(w) (sweep_points * w / 100) // convert width in % to actual sweep points #define W2P(w) (sweep_points * w / 100) // convert width in % to actual sweep points
//#ifdef TINYSA4 #ifdef TINYSA4
//#define CAL_LEVEL -30 #define CAL_LEVEL -29.5
//#else #else
#define CAL_LEVEL -25 #define CAL_LEVEL (has_esd ? -26.2 : -25)
//#endif #endif
// TODO made more compact this structure (need use aligned data) // TODO made more compact this structure (need use aligned data)
typedef struct test_case { typedef struct test_case {

@ -504,6 +504,10 @@ show_version(void)
do {shift>>=1; y+=5;} while (shift&1); do {shift>>=1; y+=5;} while (shift&1);
ili9341_drawstring(info_about[i++], x, y+=5); ili9341_drawstring(info_about[i++], x, y+=5);
} }
#ifdef TINYSA3
if (has_esd)
ili9341_drawstring("ESD protected", x, y+=5);
#endif
#ifdef TINYSA4 #ifdef TINYSA4
extern const char *states[]; extern const char *states[];
#define ENABLE_THREADS_COMMAND #define ENABLE_THREADS_COMMAND

Loading…
Cancel
Save

Powered by TurnKey Linux.