diff --git a/vimfiles.stefan/plugin/toptica.vim b/vimfiles.stefan/plugin/toptica.vim index 331a6a0..c4adfb0 100644 --- a/vimfiles.stefan/plugin/toptica.vim +++ b/vimfiles.stefan/plugin/toptica.vim @@ -86,9 +86,9 @@ function! s:ProjectSet(project_type, project_base_dir) \ statusline=%t\ [%{g:asyncrun_status}]\ %{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P augroup END - " ==== - " Make - " ==== + " ====== + " Invoke + " ====== compiler gcc let g:BuildType = 'Debug' @@ -130,16 +130,16 @@ function! s:ProjectSet(project_type, project_base_dir) return commandline endfunction - " Tab completion for MakeCmd is done by bash-completion - function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos) + " Tab completion for Invoke is done by bash-completion + function! GetAllInvokeCompletions(ArgLead, CmdLine, CursorPos) let l:words = split(a:CmdLine) let l:words[0] = 'invoke' let l:command = join(l:words) return bash#complete(l:command) endfunction - command! -complete=customlist,GetAllMakeCompletions -nargs=* MakeCmd call s:Make('', 'async') + command! -complete=customlist,GetAllInvokeCompletions -nargs=* Invoke call s:Invoke('', 'async') - function! s:Make(args, async_mode) + function! s:Invoke(args, async_mode) " Add defaults for options let l:options = s:SetDefaultsForAllOptions(a:args) @@ -164,17 +164,17 @@ function! s:ProjectSet(project_type, project_base_dir) " Get some configurations from the project " ---------------------------------------- - let l:tasks = s:Make('--list', 'sync') + let l:tasks = s:Invoke('--list', 'sync') let g:DebugRemote = (l:tasks =~ 'gdb-server') - let g:ProjectBuildDir = s:Make('build-dir', 'sync') + let g:ProjectBuildDir = s:Invoke('get-build-dir', 'sync') " Fallback if g:ProjectBuildDir == '' let g:ProjectBuildDir = s:ProjectBaseDir.'.build/'.g:project_type endif - let g:Elffile = s:Make('elf-file', 'sync') + let g:Elffile = s:Invoke('get-elf-file', 'sync') - let l:is_arm = s:Make('is-arm', 'sync') + let l:is_arm = s:Invoke('is-arm', 'sync') let g:termdebug_config = {} if l:is_arm =~ 'True' if g:project_type == 'topmode' || g:project_type == 'dlcpro' @@ -221,16 +221,12 @@ function! s:ProjectSet(project_type, project_base_dir) " let g:DebugRemote = v:true " let g:GdbPort = '6666' " let g:SshOpts = '-o ForwardAgent=yes -o ProxyCommand="ssh -o RemoteCommand=none -q -W shg:22 root@%h" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR' - " let g:SshOpts2 = "-L localhost:1998:localhost:1998 -L localhost:1999:localhost:1999" - elseif (g:project_type == 'dlcpro-gui') - command! DlcProGuiStart execute("!~/dlcpro/pc-gui/start-gui&") + " let g:SshOpts2 = '-L localhost:1998:localhost:1998 -L localhost:1999:localhost:1999' elseif (g:project_type == 'topmode') let g:DeviceIP = 'topmode_stefan' let g:PowerswitchIP = 'elab-stefan' let g:Powerplug = '3' command! TopmodeGuiStart execute("!~/topmode/pc-gui/start-gui&") - elseif (g:project_type == 'topmode-gui') - command! TopmodeGuiStart execute("!~/topmode/pc-gui/start-gui&") elseif (g:project_type == 'operation-panel-f1') let g:stm32_target = 'STM32F10X' elseif (g:project_type == 'operation-panel-f4') @@ -238,9 +234,9 @@ function! s:ProjectSet(project_type, project_base_dir) endif function! s:DeviceFirmwareUpdate() - call s:Make('kill', 'bang') - call s:Make('flash', 'bang') - call s:Make('run', 'bang') + call s:Invoke('kill', 'bang') + call s:Invoke('flash', 'bang') + call s:Invoke('run', 'bang') endfunction function! g:JLinkSWOviewer() @@ -266,13 +262,13 @@ function! s:ProjectSet(project_type, project_base_dir) command! DeviceDebugAttach call s:DeviceDebug(1) function! s:DeviceDebug(attach) if g:DebugRemote - call s:Make('kill', 'bang') + call s:Invoke('kill', 'bang') " Close quickfix window execute 'cclose' autocmd! User TermdebugStartPre autocmd! User TermdebugStartPost autocmd! User TermdebugStopPost - call s:Make('gdb-server', 'background') + call s:Invoke('gdb-server', 'background') sleep 2 let s:gdb_connect_script = g:ProjectBuildDir.'/gdbinit' if file_readable(s:gdb_connect_script) @@ -285,8 +281,8 @@ function! s:ProjectSet(project_type, project_base_dir) else call s:StartDebugger(g:Elffile, a:attach) call s:SendToDebugger('file '.g:Elffile) - call s:SendToDebugger('break main') - call s:SendToDebugger('run') + " call s:SendToDebugger('break main') + " call s:SendToDebugger('run') endif endfunction