Commit graph

154 commits

Author SHA1 Message Date
DiSlord 02a5715bb4 Big code redisign (increase CELL draw size, more faster screen render), also save about 4-5kB flash size
Try remove all hardcoded values from code (use definition if set)
Some error fix

main.c:
Rewrite Shell, now it run on main thread and require less RAM (not need stack)
 (possible run it as thread if define VNA_SHELL_THREAD
Remove not used trace_info[].scale_unit in set_trace_scale/get_trace_scale (it just divede on set and multiple on get, better use it for default scale set)

Replace some hardcoded values
 MARKERS_MAX
 SAVEAREA_MAX
 TRACES_MAX

plot.c
Rewrite CELLWIDTH and CELLHEIGHT use, now possible set any CELL width and height (CELLWIDTH * CELLHEIGHT <= spi_buffer size)
Free RAM from shell stack use fore increase spi_buffer size now it have 2048 pixel (64x32)
Rewrite cell index and markmap use (now correct use cell size, and more faster), correct use CELLWIDTH and CELLHEIGHT in calculation
Fore set update area use invalidateRect (still need use some hardcoded values :( )
Rewrite cell_draw_line
Rewrite many hardcoded size definitions
Refrence point now draw as bitmap (less size, more costumable)
Fix drag marker (now correct search closest index in search_nearest_index)
Rewrite plot_into_index, now correct use size definitions, moe

ui.c
Small rewrite keyboard definitions, for use less flash size
Define KP_WIDTH, KP_HEIGHT for set key size
Better look some big font symvols

All:
use static fore some local functions (use less space on calls)
replace tabs on spaces (code style)
Use M_PI from math.h fore define pi value

Fix printf on print HEX values
2020-02-22 10:50:54 +03:00
DiSlord e9f65b1426 Huge rework chsnprintf function (basic functional more compact and faster):
I can`t upload my version chprintf.c to ChibiOS\os\hal\lib\streams upload it to root :(
 now support print float and Suffix if use example %.1F on 1.234e-3 print 1.234m, %F print 1.23m
 now support + flag %+d on 8 print +8, %+d on -8 print -8
 now support freq output if use %q example %q on 1234567890 print 1.234 567 890 GHz, %.8q print 1.234567GHz
 fix rounding errors on print float example if print use %.2f on 2.199 print 2.20 (before 2.19)
Use it in code - made more compact (save about 2k bytes) and easy display values (set output more digits after . for some values)
Made some font glyph more compact, allow 3px glyph

More correct create frequencies table on big span (not use float operations), also produce more compact code
Use double value input from keyboard (not lost Hz on input)
Set sweep_points as uint Optimize set_sweep_frequency size

Fix freq commands broken after freq set as uint32 (add str to uint32 functions for freq bigger then 2 147 483 647):
 cmd_freq
 cmd_offset
 cmd_threshold
 cmd_scan
 cmd_sweep

Define _isdigit macro (replace isdigit() function, its too big)

Rewrite std universal atoi() to more compact my_atoi and write new unsigned variant my_atoui
2020-02-11 11:54:05 +03:00
DiSlord 3639b7bb14 Revert marker SPAN callback changes 2020-01-27 07:00:13 +03:00
DiSlord 91cc17eb04 Remove compilation warning 2020-01-27 06:55:41 +03:00
DiSlord 1d6f09a355 Fix warning 2020-01-26 21:36:13 +03:00
DiSlord b10e29c01f Fix velocity factor on numeric value input multiple
Remove comments
Little code optimisation
2020-01-26 20:56:45 +03:00
ВшЫдщкв 5a4d02208f define POINTS_COUNT in nanovna.h
fix 'micro' char in font
fix draw STOP distance in frequency field
fix x position calc in plot_into_index
fix frequencies delta defined as int in plot.c
fix frequencies defined as int in ui.c
2020-01-25 20:54:03 +03:00
ВшЫдщкв 4a0ba6741e Continue size optimization (save 700-900 bytes)
Set menuitem_t size align as WORD (more compact on flash)
Add data to menuitem_t (more easy use callback functions, and save its sizing)
Rewrite some ui callback functions for use data field

More better look infinity and delta symbols
Fix grid sizing in update_grid (broken after frequency0 and frequency1 set as uint)
2020-01-25 15:46:09 +03:00
DiSlord e7bdead77a
Merge branch 'master' into master 2020-01-21 20:45:02 +03:00
TT 066027f5b5 fix: prototype mismatch 2020-01-21 21:43:58 +09:00
ВшЫдщкв 6f666cf31b Change Font size (more readable)
Rework display spi driver:
 use DMA for read, write
 add blitBitmap functions
 Use DMA for color fill
 More correct SPI bus control
Move color definitions to nanovna.h
Some code optimization for speed and size (save about 3k bytes)
Change grid Y resolution to 10
Fix convert from float to int (fix some rounding errors on plot)
Disable unused HAL serial
Change battery icon
2020-01-19 11:16:18 +03:00
TT 18a1ca4e6e feat: add marker tracking 2020-01-18 22:27:56 +09:00
TT e1ba0c77f0 chore: store velocity factor in float 2020-01-18 13:03:38 +09:00
TT 38e64a616f chore: remove keypad icon 2020-01-10 00:26:07 +09:00
Damiano Bortolato aa503ceb96 BUGFIX #79: Numpad editor freeze
There code was exiting from ui_process_keypad without redrawing and switching ui_mode.
2019-12-26 18:38:33 +01:00
TT 0bfa2c073e feat: add marker smith value format menu 2019-11-30 10:17:14 +09:00
TT a534a89c89 feat: add marker delta mode 2019-11-29 21:53:07 +09:00
TT 1422e5fd49 feat: show each markers when multiple markers are active 2019-11-23 17:47:14 +09:00
TT a3eb29ea04 feat: add marker operation groupdelay->edelay 2019-11-23 11:04:45 +09:00
TT dd4eaed475 fix: change to marker lever mode on transform enabled 2019-11-17 11:16:08 +09:00
TT c7af840f53 feat: add feedback of lever mode 2019-11-17 11:00:07 +09:00
TT b909ccb716 feat: add lever operations (center, span, search) 2019-11-17 11:00:01 +09:00
TT 3f209e4986 feat: add marker search 2019-10-22 14:00:25 +09:00
TT 7adba06333 chore: reduce foot-print of numfont20x24 2019-10-21 20:25:44 +09:00
TT 0e982aa834 add: support negative time value 2019-10-11 21:22:00 +09:00
TT 4a9dee96a4 ui: remove close menu item 2019-10-08 23:59:49 +09:00
TT 9d41719fdc use time mode for scale for group delay 2019-10-08 07:18:39 +09:00
TT 342c5ff669 add trace format of group delay 2019-10-08 07:18:39 +09:00
TT 3fc17e18f9 fix: break sweep loop on frequency change 2019-10-07 22:24:32 +09:00
TT f7e712798a chore: remove warnings 2019-10-06 07:56:25 +09:00
TT 0f24a6bd7f feat: select active on marker menu, disable if the item is active 2019-09-29 11:20:47 +09:00
TT 65a36fbf91 feat: from clicking trace menu, change active, but not make disable 2019-09-29 11:20:47 +09:00
TT e89c9bd6a7
Merge pull request #32 from cho45/timedomain
[proposal] Time Domain Operation
2019-09-19 06:17:23 +09:00
TT 118f3b3758 ui: close version on lever click 2019-09-14 19:49:02 +09:00
cho45 aa4faa5a6e rename TDR -> TD 2019-09-11 23:05:01 +09:00
cho45 a3b511f468 show time domain range 2019-09-11 21:22:42 +09:00
cho45 6bad9de606 change menu name to 'TRANSFORM' 2019-09-11 20:47:17 +09:00
cho45 8f0bfacf3d setting velocity factor 2019-09-11 00:24:06 +09:00
cho45 95ab399567 save domain mode 2019-09-10 23:49:08 +09:00
cho45 889d675836 TDR feature 2019-09-10 22:39:20 +09:00
cho45 73e0c19e8e move enter dfu to submenu of config 2019-09-06 21:11:44 +09:00
cho45 5e9756e4e0 append reset dfu command and CONFIG -> ENTER DFU 2019-09-06 21:11:33 +09:00
TT 496b41fa1c minor fix 2019-09-06 08:52:56 +09:00
TT 7a2d06c315
Merge pull request #25 from cho45/fix-backspace-on-touchpad
fix backspace rendering
2019-09-06 08:31:52 +09:00
cho45 39b7fdf95e append version info screen to UI 2019-09-05 23:58:30 +09:00
cho45 2d1b2fcfbd fix backspace rendering 2019-09-05 20:58:45 +09:00
cho45 480ad0f745 static inline reduce stack memory usage 2019-08-29 01:05:55 +09:00
TT 71386575d0
Merge pull request #17 from cho45/config-menu 2019-08-25 23:12:23 +09:00
cho45 18ba0a53c3 call touchcal from menu 2019-08-24 09:36:03 +09:00
cho45 f9a5d2e3ef Add REAL IMAG R X trace format 2019-08-24 07:45:53 +09:00
TT b823a8060d ui: enable and all off in marker selection 2019-08-18 08:18:52 +09:00
TT 36c1d79e3c ui: toggle marker selection 2019-08-18 08:06:05 +09:00
TT e29a46ca28 feat: toggle on trace menu (omit sub menu) 2019-08-16 05:17:24 +09:00
TT fcabdf0d1b menu: split save and recall menu and place save in cal 2019-08-12 00:21:04 +09:00
TT b815a5b2fe menu: add feedback at correction/pause menu item 2019-08-11 23:57:36 +09:00
TT dd724da327 view: add left arrow on menu items 2019-08-11 23:30:41 +09:00
TT 0807816e09 ui: add pad icon, electrical delay unit 2019-08-10 14:15:35 +09:00
TT 63d19f3f6f WIP: up/down touch operation on numeric area 2017-10-01 11:14:41 +09:00
TT e0197b8381 WIP: touch operation on numeric input area 2017-10-01 08:59:33 +09:00
TT b64826b76a add numeric input support scale and electrical delay 2017-10-01 00:56:43 +09:00
TT f3a473bffa work with keypad 2017-09-30 23:58:31 +09:00
TT 7228ebd5fa add numeric input (WIP) 2017-09-30 23:06:21 +09:00
TT 5d1934d85f support electrical delay 2017-09-21 00:48:33 +09:00
TT 5a441edc6b update marker position on sweep frequency change 2017-09-17 20:19:12 +09:00
TT a20f3770da select trace on drag marker 2017-09-17 19:02:19 +09:00
TT 043972e6ca fix segv on active trace 4, apply error term inside sweep loop, show active trace on marker info 2017-09-17 18:52:02 +09:00
TT 8ce6b7b6e0 omit redraw_all to fix to be ignored first push 2017-09-16 04:11:18 +09:00
TT c121731b04 draw delta frequency of two markers 2017-09-16 00:48:34 +09:00
TT 95b3ac2a4b enable marker->span menu function. rearange menu 2017-09-15 23:22:01 +09:00
TT 0ce695b886 rearange trace menu 2017-02-08 06:17:14 +09:00
TT ee6f5a9d83 change keypads on scale, scale handling 2017-02-03 21:18:33 +09:00
TT c30a2730f3 skip redrawing after touch cal to avoid hanging up 2017-02-03 19:54:00 +09:00
TT 5a63fe6890 make smooth touch and lever operation, rearange cal menu 2017-02-03 07:28:20 +09:00
TT 75288abb91 clear selection focus on touch operation 2017-02-03 05:58:50 +09:00
TT b42749e57d fix jump of touch sense, add touchtest command, draw on touch cal, fix gap of drag marker position 2017-02-03 05:40:57 +09:00
TT 295ec105e6 set scale and refpos temporally 2017-01-17 23:06:32 +09:00
TT cb50a0e6c3 add toggle sweep operation 2017-01-17 01:49:22 +09:00
TT c083fb9298 add refpos indicator, make marker able to be sticking out 2017-01-15 23:27:05 +09:00
TT ee4576dc33 menu attribute change on trace selection and cal operations 2017-01-05 23:28:32 +09:00
TT 5ebb3330ff add menu item delay (but not work) 2017-01-05 09:04:28 +09:00
TT 3852f9cb21 move menu_color and touch_cal to config 2017-01-04 18:28:52 +09:00
TT 7943a3fe96 add dragging marker 2017-01-03 16:39:00 +09:00
TT 9037593831 add save and restore dac value in flash 2017-01-02 22:03:20 +09:00
TT a76698c166 add menu item of marker all off 2017-01-02 16:59:10 +09:00
TT 6c7da59a57 add marker to sweep freq function 2017-01-02 16:33:10 +09:00
TT 6a704c8588 rewind sweep again when frequency updated 2017-01-02 15:45:25 +09:00
TT ef63476219 add single trace command, fix failure on changing polar to rect 2017-01-01 22:54:12 +09:00
TT 74cfdb93a3 arrange code, add notice at head of each file 2017-01-01 20:03:21 +09:00
TT 1c3f2df97a move touch_position into apply_touch 2017-01-01 15:03:41 +09:00
TT ed6aeb873c add touch operation on keypad 2016-12-17 20:33:04 +09:00
TT 0bf87f42aa work touch menu operation 2016-12-17 18:56:57 +09:00
TT 8038df8c66 change adc driver not to use chibios hal 2016-12-17 13:16:56 +09:00
TT 6d0ea0e1dd remove fstart/fstop 2016-12-12 23:45:49 +09:00
TT aa91bc23fc add CW, mod freq from limits 2016-12-12 21:03:43 +09:00
TT 52dce51f31 add freq center/span 2016-12-11 21:51:54 +09:00
TT 8014d3442e add button repeat. change numeric input 2016-12-11 17:26:33 +09:00
TT 9c3296ad0d resistitive touch work in progress. add adc and gpt 2016-12-07 03:34:33 +09:00
TT a50517bf3f add keypad for freq and scale, add save menu 2016-12-04 16:19:31 +09:00
TT d84a212a3b add channel menu, narrow and ensure selection, reverse marker moving direction 2016-12-01 01:08:13 +09:00
TT 4e55ca4f70 add atof of my own 2016-11-30 20:17:55 +09:00