Version updated

pull/34/head
erikkaashoek 3 years ago
parent a392ee02ec
commit 8be3f86e55

@ -25,7 +25,7 @@
* Board identifier.
*/
#define BOARD_NANOVNA_STM32_F303
#define BOARD_NAME "tinySA4"
#define BOARD_NAME "tinySA ULTRA"
#include <stm32f303xc.h>
//#include "..\nanovna.h"

@ -1845,12 +1845,36 @@ VNA_SHELL_FUNCTION(cmd_test)
const char TINYSA_VERSION[] = VERSION;
#ifdef TINYSA4
typedef struct version_t {
const uint16_t min_adc;
const uint16_t max_adc;
const char *text;
} version_t;
#define MAX_VERSION_TEXT 1
const version_t hw_version_text[MAX_VERSION_TEXT] =
{
{ 160, 169, "V0.4.5.1"}
};
const char *get_hw_version_text(void)
{
int v = adc1_single_read(0);
for (int i=0; i<MAX_VERSION_TEXT;i++) {
if (hw_version_text[i].min_adc <= v && v <= hw_version_text[i].max_adc)
return hw_version_text[i].text;
}
return "Unknown";
}
#endif
VNA_SHELL_FUNCTION(cmd_version)
{
(void)argc;
(void)argv;
#ifdef TINYSA4
shell_printf("%s\r\nHW Version:%d\r\n", TINYSA_VERSION, adc1_single_read(0));
shell_printf("%s\r\nHW Version:%s\r\n", TINYSA_VERSION, get_hw_version_text());
#else
shell_printf("%s\r\n", TINYSA_VERSION);
#endif

@ -7376,7 +7376,6 @@ float get_jump_config(int i) {
}
enum {CS_NORMAL, CS_LNA, CS_SWITCH, CS_ULTRA, CS_ULTRA_LNA, CS_DIRECT_REF, CS_DIRECT, CS_DIRECT_LNA, CS_MAX };
#define DRIRECT_CAL_FREQ 990000000 // 960MHz
#define ULTRA_HARMONIC_CAL_FREQ 5340000000
#else
enum {CS_NORMAL, CS_SWITCH, CS_MAX };
@ -7565,18 +7564,18 @@ void calibrate(void)
force_signal_path = true;
break;
case CS_DIRECT_REF:
set_sweep_frequency(ST_CENTER, DRIRECT_CAL_FREQ);
set_sweep_frequency(ST_CENTER, direct_test_freq);
test_path = 2; // Ultra
force_signal_path = true;
break;
case CS_DIRECT:
set_sweep_frequency(ST_CENTER, DRIRECT_CAL_FREQ);
set_sweep_frequency(ST_CENTER, direct_test_freq);
test_path = 4; // Direct path at 900MHz
force_signal_path = true;
config.direct_level_offset -= 1.0;
break;
case CS_DIRECT_LNA:
set_sweep_frequency(ST_CENTER, DRIRECT_CAL_FREQ);
set_sweep_frequency(ST_CENTER, direct_test_freq);
test_path = 5; // Direct lna path at 900MHz
force_signal_path = true;
config.direct_lna_level_offset += 1.0;

@ -480,6 +480,9 @@ touch_position(int *x, int *y)
*x = tx;
*y = ty;
}
#ifdef TINYSA4
extern const char *get_hw_version_text(void);
#endif
void
show_version(void)
@ -513,7 +516,7 @@ show_version(void)
ili9341_drawstring_7x13(info_about[i++], x, y+=bFONT_STR_HEIGHT+2-5);
}
char buf[96];
plot_printf(buf, sizeof(buf), "HW Version:%d", adc1_single_read(0));
plot_printf(buf, sizeof(buf), "HW Version:%s", get_hw_version_text());
ili9341_drawstring_7x13(buf, x, y+=bFONT_STR_HEIGHT);
extern const char *states[];

Loading…
Cancel
Save

Powered by TurnKey Linux.