Commit graph

424 commits

Author SHA1 Message Date
TT 0d407577f8 style: uniform code style and untabify 2020-03-21 09:33:33 +09:00
TT a4821604a5
Merge pull request #126 from DiSlord/master
Fix screen artifacts, change start/stop or center/span mode set, remove Mutex use
2020-03-21 09:22:06 +09:00
DiSlord 597c2c2958 Better solutiom of prev fixes (reload si5351 settings on sweep begin) 2020-03-15 16:02:22 +03:00
DiSlord 23c765b719 Fix very strange bug, on band 2
!!!!! Don`t understand why si5351 non stable on band 2 then change from band 3
It fixed if set before sweep one frequency from band 1 (for example 50MHz)
Possibly problem in tlv320aic3204_set_gain, call only si5351_set_frequency_with_offset not work

Little faster call command from shell

Fix interpolation if points < POINTS_COUNT
2020-03-15 14:14:52 +03:00
DiSlord 3eb8a4cfe9 Fix interpolation range if sweep_points!=source calibration points count
use sweep_points exept POINTS_COUNT on marker search and so

Now possible change sweep_points in process (for faster sweep)
2020-03-14 21:23:02 +03:00
DiSlord fdb3886b0f Move define to str macro in nanovna.h (it allow output define valuer in error messages) 2020-03-14 16:50:35 +03:00
DiSlord 45dfd7d970 Fix sweep if points < maximum (mot sweep if frequency[i] == 0)
Fix my tupo in extended scan command (not correctly parse point count)
2020-03-14 16:48:36 +03:00
DiSlord 8a11eaa764 Extend scan command, now in have additional input variable (optional), allow more faster get measured data
usage: scan {start(Hz)} {stop(Hz)} [points] [outmask]
[outmask] - optional, allow output measured data, its a mask (allow dec, hex, bin, oct)
0b001 - output frequency
0b010 - output CH0 data
0b100 - output CH1 data
Example:
'scan 1000000 5000000 101 0b111' - output data in format: freq ch0[0] ch0[1] ch1[0] ch1[1]
'scan 1000000 5000000 101 0b101' - output data in format: freq ch1[0] ch1[1]
'scan 1000000 5000000 101 0x7'   - output data as 0b111
2020-03-14 16:05:26 +03:00
DiSlord ec81a01226 Not use float in vbat measure (faster, less size), yes get little error (but less then 1mV) 2020-03-14 15:21:26 +03:00
DiSlord 922b66abdb Move offset variable to si5351.c (better use it as independent library)
Define and move constants in nanovna.h, and use it
Fix command 'marker' - display marker freq (not current freq)
2020-03-14 15:18:14 +03:00
DiSlord 88617a31fe In ili9341.c remove tabs, add palette mode blit function
In plot.c prepare for 8bit/pixel mode (test, allow increase cell buffer size by use 4 or 8bit/pixel mode, but not need for now)
main.c little change wait execute shell command in sweep thread
2020-03-13 22:42:28 +03:00
DiSlord 8bdb650212 Implement color command, allow change color settings in config (enabled bu default ENABLE_COLOR_COMMAND)
Usage: usage: color {id} {rgb24}
- Grid color: id = -3
- Menu bg color: id = -2
- Selected menu: id = -1
- Trace 1-4: id = 0..3
Color in hex RGB format (but possible any type input, dec, hex, bin. oct)
2020-03-12 21:43:35 +03:00
DiSlord 6f25d0d43f Remove Mutex use (CH_CFG_USE_MUTEXES = FALSE), now all Mutex depend functions run in sweep thread
It allow:
- reduce shell thread stack size
- more compact code
- fix some hardcoded scan command code, allow write better scan version
- run calibrate (not depend from pause sweep flag)

Rewrite uint32_t my_atoui(const char *p), now its allow read:
hex 0xaAbBcC1122
dec 12345678
bin 0b00011100
oct 0o12345678

Add some comments
2020-03-12 19:53:58 +03:00
DiSlord 51b5cce016 Fix Random jitters at band 1 and band change on some freq ranges
Improve frequency stability on band change (100 MHz, 150MHz, 300 MHz, 450MHz)

Restore freq cache in CW mode
2020-03-11 20:11:46 +03:00
DiSlord 10ae59e786 Little cleanup 2020-03-09 23:57:03 +03:00
DiSlord 3714e05395 Fix artifacts after marker move
(For faster screen update on marker move, all old area update info invalidate after use draw_all_cells(TRUE) on page switch)
Force redraw all cells after end marker move
2020-03-09 22:47:35 +03:00
DiSlord eebb625b9d Always update marker info 2020-03-09 22:28:05 +03:00
DiSlord 04fb661b1a Add flag in config for sweep mode
#define FREQ_MODE_START_STOP    0x0
#define FREQ_MODE_CENTER_SPAN   0x1
Now sweep mode not defined from frequency0 > frequency1 or frequency0 < frequency1
frequency0 always < frequency1

All freq must get by use get_sweep_frequency(mode)

Revert Select CH0 reflect channel before set freq, add additional delay on 0 sweep point
2020-03-09 18:24:31 +03:00
DiSlord f9074149bb Size fixes, use define exept const, typdef index_t for indexes 2020-03-09 16:18:29 +03:00
DiSlord 19121b3371 Auto determine mark_map mask size from MAX_MARKMAP_X on compilation (up to MAX_MARKMAP_X = 32) 2020-03-09 14:40:17 +03:00
DiSlord 2d273a5548 Fix typo 2020-03-09 14:22:59 +03:00
DiSlord a19722cdc3 Reduce last patch fix size (use pointers) 2020-03-09 14:08:06 +03:00
DiSlord 90407d5730 Fix screen artifacts:
In mark_cells_from_index(void) mark all rectangle (in most cases this not decrease render speed, and more fast in calculation, and no errors)
2020-03-09 13:12:01 +03:00
DiSlord 5cf86ee1a6 Revert dsp changes, need more research 2020-03-09 10:28:33 +03:00
DiSlord a2d90a5e91 Try not lost data on dsp (Less noise on small signals)
Use int64_t acc for values
Use double on calculation

Not cache freq on si5351_set_frequency_with_offset (to fast change in rare cases on cw mode, and process wrong DSP block) as i write before need change DSP delay tactic
2020-03-09 01:25:46 +03:00
DiSlord 77b5d0bcc8 Select CH0 reflect channel before set freq (in some rare cases dsp started but CH not ready)
Little code optimization
Add commented 600kHz I2C bus timings (work, give x1.5 speed, but need change DSP ready timings not by wait_count, need use chVTGetSystemTimeX() its better)
2020-03-08 22:48:36 +03:00
TT c40d78d80f env: clean Makefile 2020-03-08 20:03:54 +09:00
TT 608482a970 env: add debug conf for vscode 2020-03-08 19:56:37 +09:00
TT ba5bf9c1ad fix: board definition 2020-03-08 19:55:57 +09:00
TT 6befd57bc1 fix: segv in sample command 2020-03-08 19:37:26 +09:00
TT 7c2e4364e6
Merge pull request #125 from DiSlord/master
Speedup and fix Si5351 clock generator
2020-03-08 19:33:13 +09:00
DiSlord 45f04420cb Implement info command, move info_about[] to main.c
Command enabled by default: ENABLE_INFO_COMMAND
This feature not increase flash size
2020-03-08 08:32:38 +03:00
DiSlord fc6e090595 Add vbat_offset to config
Implement vbat_offset command (if defined ENABLE_VBAT_OFFSET_COMMAND)
Reduce code size
2020-03-07 23:37:39 +03:00
DiSlord bb7127fdd0 Remove variable, use speep_mode flag 2020-03-07 22:21:02 +03:00
DiSlord e896f32803 Replace function wait_dsp(delay) by definition:
DSP_START(delay)
//================================================
// Place some code thats need execute while delay
//================================================
DSP_WAIT_READY

Fix Band table description

Add power stabilization delay on sweep start
2020-03-07 20:57:43 +03:00
DiSlord 12d53738bc Revert some changes:
Start/stop generation feature (unstable on segment scan from CPU)
 Calibration on paused sweep (need more stack, need find better solution)
 Variable use optimization
2020-03-07 17:19:43 +03:00
DiSlord a43b6e3acc si5351.c and si5351.h
Cleanup and optimize  code
Add comments, fix definitions
Fix rounding errors
Fix band 1 stability

mcuconf.h
Set I2C bus clock to SYSCLK (more fast)
Apply 400kHz bus I2C clock timings for 8MHz and 48Mhz clock

main.c
Remove and reset some variables
Add separate sweep for calibration (allow calibrate if sweep paused)

Increase main thread stack (need for run calibrate, possibly need execute some commands in sweep threads for reduce stack usage)
2020-03-07 14:54:51 +03:00
DiSlord b77e1d6680 Big work around si5351 generator
Improve sweep speed about 60%
Stop generation on pause sweep
Remove all hack for si5351
Reduce code size
Fix integer overflow on big freq values

Additional
Change I2C

Others:
 move marker_tracking variable to ui config
 move some definition to correct place
 reduce tlv320aic3204 code size
 Speedup marker move from lever (BUTTON_REPEAT_TICKS = 625)

Need test stability
2020-03-05 22:36:44 +03:00
TT f1cc60e99e feat: add lever mode for electrical delay 2020-03-01 09:29:28 +09:00
TT f6b28c2c14
Merge pull request #121 from DiSlord/master
Fix crash on trace command, reduce flash usage by 8k, up to 2x faster screen render
2020-03-01 09:19:28 +09:00
TT 18c5ca9157 feat: add lever operation of electrical delay 2020-03-01 08:50:46 +09:00
TT 7f5948c4b8 chore: add scope name onto struct and enum 2020-03-01 08:18:12 +09:00
DiSlord 153585ff1f Move more address constants to nanovna.h 2020-02-28 23:52:01 +03:00
DiSlord ccb3693516 Huge reduce flash usage (about 5k), remove cal_data and _frequencies properties from data section
Use void loadDefaultProps() for load default properties (default loaded also on error load from flash)
Move some constants to nanovna.h
2020-02-28 23:15:38 +03:00
DiSlord cc3370c962 si5351.c
Remove unused function from header
Set static calls for functions (less size)
Set static constants (less size)
2020-02-28 18:57:18 +03:00
DiSlord a164a5765a Disable HAL_USE_RTC usage (need for cmd_time)
Add ENABLE_TIME_COMMAND for enable cmd_time if need

Fix incorrect data on run cmd_scan cmd_data if Tansform enabled on NanoVNA (remove transform_domain() from sweep, add in front of plot_into_index in sweep thread)
Remove pause/run in reload (not need, command run vs CMD_WAIT_MUTEX flag)
2020-02-28 18:52:25 +03:00
DiSlord 0116c529ea Restore sweep stack size as 640 2020-02-28 00:50:12 +03:00
DiSlord cb587d05a4 Makefile:
Remove compile
 #include $(CHIBIOS)/test/rt/test.mk
 #include $(CHIBIOS)/os/various/shell/shell.mk

Shell not used, test not used
2020-02-27 22:11:32 +03:00
DiSlord 95b3f6f7d0 Disable ChibiOS option CH_CFG_USE_MUTEXES_RECURSIVE
All calls chMtxLock - chMtxUnlock not recursive
2020-02-27 21:21:54 +03:00
DiSlord 17734f257d Disable unused ChibiOS options:
CH_CFG_USE_WAITEXIT (used only is Shell run as thread)
CH_CFG_USE_EVENTS (NanoVNA not use events)
CH_CFG_USE_EVENTS_TIMEOUT (NanoVNA not use events)

Implement stack use check in "threads" command, now free stack space show in table as "stk free" in hex
Check stack usage by sweep, and main threads (seems all ok, but add 64 bytes to sweep)

Replace some const values to defined
2020-02-27 20:53:45 +03:00