Merge branch 'master' into master

This commit is contained in:
DiSlord 2020-05-14 18:08:30 +03:00 committed by GitHub
commit dedae1ea82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 14 deletions

View file

@ -81,6 +81,10 @@ endif
# Project, sources and paths # Project, sources and paths
# #
# Dvice node to flash
DEVICE = /dev/cu.usbmodem401
#DEVICE = /dev/ttyACM0
# Define project name here # Define project name here
PROJECT = ch PROJECT = ch
@ -225,6 +229,4 @@ flash: build/ch.bin
dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin
dfu: dfu:
-@printf "reset dfu\r" >/dev/cu.usbmodem401 -printf "reset dfu\r" >$(DEVICE) && sleep 1

13
main.c
View file

@ -708,7 +708,6 @@ config_t config = {
// .touch_cal = { 693, 605, 124, 171 }, // 2.4 inch LCD panel // .touch_cal = { 693, 605, 124, 171 }, // 2.4 inch LCD panel
.touch_cal = { 338, 522, 153, 192 }, // 2.8 inch LCD panel .touch_cal = { 338, 522, 153, 192 }, // 2.8 inch LCD panel
// .touch_cal = { 252, 450, 111, 150 }, //4.0" LCD // .touch_cal = { 252, 450, 111, 150 }, //4.0" LCD
.freq_mode = FREQ_MODE_START_STOP,
.harmonic_freq_threshold = FREQUENCY_THRESHOLD, .harmonic_freq_threshold = FREQUENCY_THRESHOLD,
.vbat_offset = 500, .vbat_offset = 500,
.bandwidth = BANDWIDTH_1000 .bandwidth = BANDWIDTH_1000
@ -748,6 +747,8 @@ void load_default_properties(void)
current_props._active_marker = 0; current_props._active_marker = 0;
current_props._domain_mode = 0; current_props._domain_mode = 0;
current_props._marker_smith_format = MS_RLC; current_props._marker_smith_format = MS_RLC;
current_props._freq_mode = FREQ_MODE_START_STOP;
//Checksum add on caldata_save //Checksum add on caldata_save
//current_props.checksum = 0; //current_props.checksum = 0;
} }
@ -1036,7 +1037,7 @@ set_sweep_frequency(int type, uint32_t freq)
ensure_edit_config(); ensure_edit_config();
switch (type) { switch (type) {
case ST_START: case ST_START:
config.freq_mode &= ~FREQ_MODE_CENTER_SPAN; freq_mode &= ~FREQ_MODE_CENTER_SPAN;
if (frequency0 != freq) { if (frequency0 != freq) {
frequency0 = freq; frequency0 = freq;
// if start > stop then make start = stop // if start > stop then make start = stop
@ -1044,7 +1045,7 @@ set_sweep_frequency(int type, uint32_t freq)
} }
break; break;
case ST_STOP: case ST_STOP:
config.freq_mode &= ~FREQ_MODE_CENTER_SPAN; freq_mode &= ~FREQ_MODE_CENTER_SPAN;
if (frequency1 != freq) { if (frequency1 != freq) {
frequency1 = freq; frequency1 = freq;
// if start > stop then make start = stop // if start > stop then make start = stop
@ -1052,7 +1053,7 @@ set_sweep_frequency(int type, uint32_t freq)
} }
break; break;
case ST_CENTER: case ST_CENTER:
config.freq_mode |= FREQ_MODE_CENTER_SPAN; freq_mode |= FREQ_MODE_CENTER_SPAN;
uint32_t center = frequency0 / 2 + frequency1 / 2; uint32_t center = frequency0 / 2 + frequency1 / 2;
if (center != freq) { if (center != freq) {
uint32_t span = frequency1 - frequency0; uint32_t span = frequency1 - frequency0;
@ -1067,7 +1068,7 @@ set_sweep_frequency(int type, uint32_t freq)
} }
break; break;
case ST_SPAN: case ST_SPAN:
config.freq_mode |= FREQ_MODE_CENTER_SPAN; freq_mode |= FREQ_MODE_CENTER_SPAN;
if (frequency1 - frequency0 != freq) { if (frequency1 - frequency0 != freq) {
uint32_t center = frequency0 / 2 + frequency1 / 2; uint32_t center = frequency0 / 2 + frequency1 / 2;
if (center < START_MIN + freq / 2) { if (center < START_MIN + freq / 2) {
@ -1081,7 +1082,7 @@ set_sweep_frequency(int type, uint32_t freq)
} }
break; break;
case ST_CW: case ST_CW:
config.freq_mode |= FREQ_MODE_CENTER_SPAN; freq_mode |= FREQ_MODE_CENTER_SPAN;
if (frequency0 != freq || frequency1 != freq) { if (frequency0 != freq || frequency1 != freq) {
frequency0 = freq; frequency0 = freq;
frequency1 = freq; frequency1 = freq;

View file

@ -295,7 +295,7 @@ typedef struct properties {
int8_t _active_marker; int8_t _active_marker;
uint8_t _domain_mode; /* 0bxxxxxffm : where ff: TD_FUNC m: DOMAIN_MODE */ uint8_t _domain_mode; /* 0bxxxxxffm : where ff: TD_FUNC m: DOMAIN_MODE */
uint8_t _marker_smith_format; uint8_t _marker_smith_format;
uint8_t reserved; uint8_t _freq_mode;
uint32_t checksum; uint32_t checksum;
} properties_t; } properties_t;
//on POINTS_COUNT = 101, sizeof(properties_t) == 4152 (need reduce size on 56 bytes to 4096 for more compact save slot size) //on POINTS_COUNT = 101, sizeof(properties_t) == 4152 (need reduce size on 56 bytes to 4096 for more compact save slot size)
@ -414,7 +414,6 @@ void show_logo(void);
#define SAVE_CONFIG_SIZE 0x00000800 #define SAVE_CONFIG_SIZE 0x00000800
// Depend from properties_t size, should be aligned by FLASH_PAGESIZE // Depend from properties_t size, should be aligned by FLASH_PAGESIZE
#define SAVE_PROP_CONFIG_SIZE 0x00001800 #define SAVE_PROP_CONFIG_SIZE 0x00001800
// Save config_t and properties_t flash area (see flash7 : org = 0x08018000, len = 32k from *.ld settings) // Save config_t and properties_t flash area (see flash7 : org = 0x08018000, len = 32k from *.ld settings)
// Properties save area follow after config // Properties save area follow after config
// len = SAVE_CONFIG_SIZE + SAVEAREA_MAX * SAVE_PROP_CONFIG_SIZE 0x00008000 32k // len = SAVE_CONFIG_SIZE + SAVEAREA_MAX * SAVE_PROP_CONFIG_SIZE 0x00008000 32k
@ -439,9 +438,10 @@ extern int16_t lastsaveid;
#define domain_mode current_props._domain_mode #define domain_mode current_props._domain_mode
#define velocity_factor current_props._velocity_factor #define velocity_factor current_props._velocity_factor
#define marker_smith_format current_props._marker_smith_format #define marker_smith_format current_props._marker_smith_format
#define freq_mode current_props._freq_mode
#define FREQ_IS_STARTSTOP() (!(config.freq_mode&FREQ_MODE_CENTER_SPAN)) #define FREQ_IS_STARTSTOP() (!(freq_mode & FREQ_MODE_CENTER_SPAN))
#define FREQ_IS_CENTERSPAN() (config.freq_mode&FREQ_MODE_CENTER_SPAN) #define FREQ_IS_CENTERSPAN() (freq_mode & FREQ_MODE_CENTER_SPAN)
#define FREQ_IS_CW() (frequency0 == frequency1) #define FREQ_IS_CW() (frequency0 == frequency1)
int caldata_save(uint32_t id); int caldata_save(uint32_t id);

4
ui.c
View file

@ -636,7 +636,7 @@ menu_points_cb(int item, uint8_t data)
draw_menu(); draw_menu();
} }
static void static void
choose_active_marker(void) choose_active_marker(void)
{ {
int i; int i;
@ -766,9 +766,11 @@ menu_marker_search_cb(int item, uint8_t data)
break; break;
case 2: /* search Left */ case 2: /* search Left */
i = marker_search_left(markers[active_marker].index); i = marker_search_left(markers[active_marker].index);
uistat.marker_tracking = false;
break; break;
case 3: /* search right */ case 3: /* search right */
i = marker_search_right(markers[active_marker].index); i = marker_search_right(markers[active_marker].index);
uistat.marker_tracking = false;
break; break;
case 4: /* tracking */ case 4: /* tracking */
uistat.marker_tracking = !uistat.marker_tracking; uistat.marker_tracking = !uistat.marker_tracking;