dlcpro-gui
This commit is contained in:
parent
6c1d312ab2
commit
ec3e6b7878
@ -2,6 +2,7 @@ command -nargs=1 -complete=dir DlcPro call s:ProjectSet('dlcpro', '<args>')
|
|||||||
command -nargs=1 -complete=dir DlcProOld call s:ProjectSet('dlcpro-old', '<args>')
|
command -nargs=1 -complete=dir DlcProOld call s:ProjectSet('dlcpro-old', '<args>')
|
||||||
command -nargs=1 -complete=dir DlcProShg call s:ProjectSet('shg', '<args>')
|
command -nargs=1 -complete=dir DlcProShg call s:ProjectSet('shg', '<args>')
|
||||||
command -nargs=1 -complete=dir DlcProGui call s:ProjectSet('dlcpro-gui', '<args>')
|
command -nargs=1 -complete=dir DlcProGui call s:ProjectSet('dlcpro-gui', '<args>')
|
||||||
|
command -nargs=1 -complete=dir DlcProGuiOld call s:ProjectSet('dlcpro-gui-old', '<args>')
|
||||||
command -nargs=1 -complete=dir DlcProTui call s:ProjectSet('dlcpro-tui', '<args>')
|
command -nargs=1 -complete=dir DlcProTui call s:ProjectSet('dlcpro-tui', '<args>')
|
||||||
command -nargs=1 -complete=dir DlcProTuiSimulator call s:ProjectSet('dlcpro-tui-simulator', '<args>')
|
command -nargs=1 -complete=dir DlcProTuiSimulator call s:ProjectSet('dlcpro-tui-simulator', '<args>')
|
||||||
command -nargs=1 -complete=dir DlcProCan call s:ProjectSet('dlcpro-can', '<args>')
|
command -nargs=1 -complete=dir DlcProCan call s:ProjectSet('dlcpro-can', '<args>')
|
||||||
@ -138,9 +139,11 @@ function! s:ProjectSet(project_type, project_base_dir)
|
|||||||
let s:jlink_path = '/home/stefan/opt/SEGGER/JLink_Linux_V796k_x86_64'
|
let s:jlink_path = '/home/stefan/opt/SEGGER/JLink_Linux_V796k_x86_64'
|
||||||
|
|
||||||
let s:use_invoke = v:false
|
let s:use_invoke = v:false
|
||||||
|
let s:invoke_tasks = ''
|
||||||
|
|
||||||
if (g:project_type == 'dlcpro')
|
if (g:project_type == 'dlcpro')
|
||||||
let s:use_invoke = v:true
|
let s:use_invoke = v:true
|
||||||
|
let s:invoke_tasks = ' -c ~/tools/invoke/'.g:project_type.'/tasks'
|
||||||
set wildignore-=**/firmware/src/device-control/**
|
set wildignore-=**/firmware/src/device-control/**
|
||||||
set wildignore+=**/shg-firmware/**
|
set wildignore+=**/shg-firmware/**
|
||||||
set titlestring=%<%t\ (%{expand('%:p:h')})%=project:\ %{g:project_type}\ \ \ \ compiler:\ %{Compiler_version()}
|
set titlestring=%<%t\ (%{expand('%:p:h')})%=project:\ %{g:project_type}\ \ \ \ compiler:\ %{Compiler_version()}
|
||||||
@ -227,6 +230,16 @@ function! s:ProjectSet(project_type, project_base_dir)
|
|||||||
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: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"
|
let g:SshOpts2 = "-L localhost:1998:localhost:1998 -L localhost:1999:localhost:1999"
|
||||||
elseif (g:project_type == 'dlcpro-gui')
|
elseif (g:project_type == 'dlcpro-gui')
|
||||||
|
let s:use_invoke = v:true
|
||||||
|
let s:invoke_tasks = ' -c ~/tools/invoke/'.g:project_type.'/tasks'
|
||||||
|
let g:ProjectBuildDir = s:ProjectSrcDir.'/.build' " FIXME (for DeviceDebug)
|
||||||
|
let s:Program = '/TOPAS_DLC_pro'
|
||||||
|
let s:Elffile = s:Program
|
||||||
|
" let s:makegoals = []
|
||||||
|
" let s:makeprg = 'make'
|
||||||
|
let g:termdebugger = 'gdb'
|
||||||
|
let g:DebugRemote = v:false
|
||||||
|
elseif (g:project_type == 'dlcpro-gui-old')
|
||||||
let s:Program = '/TOPAS_DLC_pro'
|
let s:Program = '/TOPAS_DLC_pro'
|
||||||
let s:Elffile = s:Program
|
let s:Elffile = s:Program
|
||||||
let s:makegoals = []
|
let s:makegoals = []
|
||||||
@ -235,6 +248,7 @@ function! s:ProjectSet(project_type, project_base_dir)
|
|||||||
let g:DebugRemote = v:false
|
let g:DebugRemote = v:false
|
||||||
elseif (g:project_type == 'topmode')
|
elseif (g:project_type == 'topmode')
|
||||||
let s:use_invoke = v:true
|
let s:use_invoke = v:true
|
||||||
|
let s:invoke_tasks = ' -c ~/tools/invoke/'.g:project_type.'/tasks'
|
||||||
let g:DeviceIP = 'topmode_stefan'
|
let g:DeviceIP = 'topmode_stefan'
|
||||||
call s:set_oselas_gcc4()
|
call s:set_oselas_gcc4()
|
||||||
let g:termdebugger = '/opt/OSELAS.Toolchain-2022.10.2/arm-v7a-linux-gnueabihf/gcc-12.3.1-glibc-2.33-binutils-2.39-kernel-5.4-sanitized/bin/arm-v7a-linux-gnueabihf-gdb'
|
let g:termdebugger = '/opt/OSELAS.Toolchain-2022.10.2/arm-v7a-linux-gnueabihf/gcc-12.3.1-glibc-2.33-binutils-2.39-kernel-5.4-sanitized/bin/arm-v7a-linux-gnueabihf-gdb'
|
||||||
@ -254,6 +268,7 @@ function! s:ProjectSet(project_type, project_base_dir)
|
|||||||
call s:set_oselas_gcc4()
|
call s:set_oselas_gcc4()
|
||||||
elseif (g:project_type == 'topmode-gui')
|
elseif (g:project_type == 'topmode-gui')
|
||||||
let s:use_invoke = v:true
|
let s:use_invoke = v:true
|
||||||
|
let s:invoke_tasks = ' -c ~/tools/invoke/'.g:project_type.'/tasks'
|
||||||
let g:new_compiler = v:false
|
let g:new_compiler = v:false
|
||||||
let g:DebugRemote = v:false
|
let g:DebugRemote = v:false
|
||||||
elseif (g:project_type == 'topmode-gui-old')
|
elseif (g:project_type == 'topmode-gui-old')
|
||||||
@ -386,7 +401,7 @@ function! s:ProjectSet(project_type, project_base_dir)
|
|||||||
if g:new_compiler
|
if g:new_compiler
|
||||||
let l:options .= ' --new-compiler'
|
let l:options .= ' --new-compiler'
|
||||||
endif
|
endif
|
||||||
execute '!invoke -c ~/tools/invoke/'.g:project_type.'/tasks -e flash-and-run --target-ip '.g:DeviceIP.l:options
|
execute '!invoke '.s:invoke_tasks.' -e flash-and-run --target-ip '.g:DeviceIP.l:options
|
||||||
elseif (g:project_type == 'dlcpro-can')
|
elseif (g:project_type == 'dlcpro-can')
|
||||||
call s:DeviceUpdateProgramLinux()
|
call s:DeviceUpdateProgramLinux()
|
||||||
elseif ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor') || (g:project_type == 'pfd'))
|
elseif ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor') || (g:project_type == 'pfd'))
|
||||||
@ -427,7 +442,7 @@ function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos)
|
|||||||
if s:use_invoke
|
if s:use_invoke
|
||||||
let CmdList = split(a:CmdLine)
|
let CmdList = split(a:CmdLine)
|
||||||
let makegoals = []
|
let makegoals = []
|
||||||
let makegoals += split(system('invoke -c ~/tools/invoke/'.g:project_type.'/tasks --complete --'))
|
let makegoals += split(system('invoke '.s:invoke_tasks.' --complete --'))
|
||||||
if len(CmdList) > 1
|
if len(CmdList) > 1
|
||||||
let last_goal = CmdList[-1]
|
let last_goal = CmdList[-1]
|
||||||
if a:ArgLead[0] == '-' || a:ArgLead == '' && last_goal[0] == '-'
|
if a:ArgLead[0] == '-' || a:ArgLead == '' && last_goal[0] == '-'
|
||||||
@ -439,11 +454,11 @@ function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos)
|
|||||||
endif
|
endif
|
||||||
" Expand option
|
" Expand option
|
||||||
if count(makegoals, last_goal) > 0
|
if count(makegoals, last_goal) > 0
|
||||||
let makegoals += split(system('invoke -c ~/tools/invoke/'.g:project_type.'/tasks --complete -- '.last_goal.' -'))
|
let makegoals += split(system('invoke '.s:invoke_tasks.' --complete -- '.last_goal.' -'))
|
||||||
endif
|
endif
|
||||||
if exists('last_opt')
|
if exists('last_opt')
|
||||||
" Expand values of option
|
" Expand values of option
|
||||||
let helptext = systemlist('invoke -c ~/tools/invoke/'.g:project_type.'/tasks '.last_goal.' --help')
|
let helptext = systemlist('invoke '.s:invoke_tasks.' '.last_goal.' --help')
|
||||||
let i = match(helptext, last_opt)
|
let i = match(helptext, last_opt)
|
||||||
if i > 0
|
if i > 0
|
||||||
let values = []
|
let values = []
|
||||||
@ -464,17 +479,25 @@ function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" let l:options = ' --project=dlcpro'
|
||||||
|
" if g:new_compiler
|
||||||
|
" let l:options .= ' --new-compiler'
|
||||||
|
" endif
|
||||||
|
" execute '!invoke '.s:invoke_tasks.' -e flash-and-run --target-ip '.g:DeviceIP.l:options
|
||||||
function! s:Make(args, async_mode)
|
function! s:Make(args, async_mode)
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
if s:use_invoke
|
if s:use_invoke
|
||||||
let l:makeprg = 'invoke -c ~/tools/invoke/'.g:project_type.'/tasks -e'
|
let l:makeprg = 'invoke '.s:invoke_tasks.' -e'
|
||||||
let l:args = a:args
|
let l:args = a:args
|
||||||
|
" echom 'l:args1:'.l:args.':'
|
||||||
if l:args == ''
|
if l:args == ''
|
||||||
let l:args = 'build' " default
|
let l:args = 'build' " default
|
||||||
endif
|
endif
|
||||||
|
" echom 'l:args2:'.l:args.':'
|
||||||
if l:args =~ ' build ' && g:new_compiler
|
if l:args =~ ' build ' && g:new_compiler
|
||||||
let l:args .= ' --new-compiler'
|
let l:args .= ' --new-compiler'
|
||||||
endif
|
endif
|
||||||
|
" echom 'l:args3:'.l:args.':'
|
||||||
let &makeprg = l:makeprg
|
let &makeprg = l:makeprg
|
||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make @ '.l:args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make @ '.l:args
|
||||||
else
|
else
|
||||||
@ -515,7 +538,7 @@ function! s:Cmake(options, async_mode)
|
|||||||
let l:options .= ' --no-new-compiler'
|
let l:options .= ' --no-new-compiler'
|
||||||
endif
|
endif
|
||||||
execute '!echo "invoke cmake '.l:options.'"'
|
execute '!echo "invoke cmake '.l:options.'"'
|
||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 @ invoke -c ~/tools/invoke/'.g:project_type.'/tasks -e cmake '.l:options
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 @ invoke '.s:invoke_tasks.' -e cmake '.l:options
|
||||||
else
|
else
|
||||||
if !isdirectory(g:ProjectBuildDir)
|
if !isdirectory(g:ProjectBuildDir)
|
||||||
call mkdir(g:ProjectBuildDir)
|
call mkdir(g:ProjectBuildDir)
|
||||||
@ -668,7 +691,7 @@ endfunction
|
|||||||
function! s:DeviceStartGdbServer()
|
function! s:DeviceStartGdbServer()
|
||||||
if (g:project_type == 'pfd')
|
if (g:project_type == 'pfd')
|
||||||
call system('killall --quiet JLinkGDBServer')
|
call system('killall --quiet JLinkGDBServer')
|
||||||
call s:Call_and_log('invoke -c ~/tools/invoke/'.g:project_type.'/tasks -e jlink&')
|
call s:Call_and_log('invoke '.s:invoke_tasks.' -e jlink&')
|
||||||
autocmd User TermdebugStopPost call system('killall --quiet JLinkGDBServer')
|
autocmd User TermdebugStopPost call system('killall --quiet JLinkGDBServer')
|
||||||
sleep 1
|
sleep 1
|
||||||
elseif ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor'))
|
elseif ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor'))
|
||||||
@ -729,16 +752,22 @@ let g:DlcproBasePath = "/jenkins/workspace/pro--firmware_release_1.9.0-DCESJ5C5R
|
|||||||
function! s:DeviceDebug(attach)
|
function! s:DeviceDebug(attach)
|
||||||
if s:use_invoke
|
if s:use_invoke
|
||||||
if g:DebugRemote
|
if g:DebugRemote
|
||||||
execute "!invoke -c ~/tools/invoke/'.g:project_type.'/tasks -e gdb-server --target-ip=".g:DeviceIP
|
execute '!invoke '.s:invoke_tasks.' -e gdb-server --target-ip='.g:DeviceIP
|
||||||
autocmd! User TermdebugStartPre
|
autocmd! User TermdebugStartPre
|
||||||
autocmd! User TermdebugStartPost
|
autocmd! User TermdebugStartPost
|
||||||
autocmd! User TermdebugStopPost
|
autocmd! User TermdebugStopPost
|
||||||
autocmd User TermdebugStartPost call term_sendkeys('',"cd .build/dlcpro-new\nsource ../../gdb-connect.txt\n")
|
" autocmd User TermdebugStartPost call term_sendkeys('',"cd .build/dlcpro-new\nsource ../../gdb-connect.txt\n")
|
||||||
|
autocmd User TermdebugStartPost call term_sendkeys('',"cd .build/dlcpro-new\nsource ~/tools/invoke/".g:project_type."/gdb-connect.txt\n")
|
||||||
autocmd User TermdebugStopPost call system('pkill --full gdbserver')
|
autocmd User TermdebugStopPost call system('pkill --full gdbserver')
|
||||||
endif
|
|
||||||
Termdebug
|
Termdebug
|
||||||
" Close Program window
|
" Close Program window
|
||||||
execute '2hide'
|
execute '2hide'
|
||||||
|
else
|
||||||
|
call s:StartDebugger(g:Elffile, a:attach)
|
||||||
|
call s:SendToDebugger('file '.g:Elffile)
|
||||||
|
call s:SendToDebugger('break main')
|
||||||
|
call s:SendToDebugger('run')
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
if (a:attach == 0)
|
if (a:attach == 0)
|
||||||
" let r = s:DeviceFirmwareUpdate()
|
" let r = s:DeviceFirmwareUpdate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user