toptica updates
This commit is contained in:
parent
d3f0c1496e
commit
de26f7c44d
@ -2,6 +2,7 @@ command -nargs=1 -complete=dir DlcPro call s:ProjectSet('dlcpro', '<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 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 DlcProCan call s:ProjectSet('dlcpro-can', '<args>')
|
command -nargs=1 -complete=dir DlcProCan call s:ProjectSet('dlcpro-can', '<args>')
|
||||||
command -nargs=1 -complete=dir DlcProSpecalyser call s:ProjectSet('dlcpro-specalyser', '<args>')
|
command -nargs=1 -complete=dir DlcProSpecalyser call s:ProjectSet('dlcpro-specalyser', '<args>')
|
||||||
command -nargs=1 -complete=dir Topmode call s:ProjectSet('topmode', '<args>')
|
command -nargs=1 -complete=dir Topmode call s:ProjectSet('topmode', '<args>')
|
||||||
@ -19,7 +20,7 @@ command SetOselasGcc11 call s:set_oselas_gcc()
|
|||||||
|
|
||||||
let s:path_orig = $PATH
|
let s:path_orig = $PATH
|
||||||
|
|
||||||
function s:ProjectSet(project_type, project_base_dir)
|
function! s:ProjectSet(project_type, project_base_dir)
|
||||||
let g:project_type = a:project_type
|
let g:project_type = a:project_type
|
||||||
let g:jenkins_url = 'http://jenkins.toptica.com'
|
let g:jenkins_url = 'http://jenkins.toptica.com'
|
||||||
|
|
||||||
@ -38,6 +39,8 @@ function s:ProjectSet(project_type, project_base_dir)
|
|||||||
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware'
|
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware'
|
||||||
elseif (g:project_type == 'dlcpro-tui')
|
elseif (g:project_type == 'dlcpro-tui')
|
||||||
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware'
|
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware'
|
||||||
|
elseif (g:project_type == 'dlcpro-tui-simulator')
|
||||||
|
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware.tui-simulator'
|
||||||
elseif (g:project_type == 'dlcpro-can')
|
elseif (g:project_type == 'dlcpro-can')
|
||||||
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware'
|
let s:ProjectBaseDir = '/home/stefan/dlcpro/firmware'
|
||||||
elseif (g:project_type == 'dlcpro-specalyser')
|
elseif (g:project_type == 'dlcpro-specalyser')
|
||||||
@ -95,6 +98,18 @@ function s:ProjectSet(project_type, project_base_dir)
|
|||||||
let g:new_compiler = ' -DNEW_COMPILER=ON'
|
let g:new_compiler = ' -DNEW_COMPILER=ON'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! g:Compiler_version()
|
||||||
|
let cmakefile = g:ProjectBuildDir . '/CMakeCache.txt'
|
||||||
|
for line in readfile(cmakefile)
|
||||||
|
if match(line, 'NEW_COMPILER:BOOL=OFF') >= 0
|
||||||
|
return 'old'
|
||||||
|
elseif match(line, 'NEW_COMPILER:BOOL=ON') >= 0
|
||||||
|
return 'new'
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
" vim path
|
" vim path
|
||||||
execute 'cd '.s:ProjectSrcDir
|
execute 'cd '.s:ProjectSrcDir
|
||||||
execute 'set path-=./**'
|
execute 'set path-=./**'
|
||||||
@ -108,6 +123,7 @@ function s:ProjectSet(project_type, project_base_dir)
|
|||||||
let g:ProgramRemote = '/opt/app/bin/device-control'
|
let g:ProgramRemote = '/opt/app/bin/device-control'
|
||||||
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')})%=compiler:\ %{Compiler_version()}
|
||||||
let s:makegoals = ['artifacts-firmware', 'artifacts-docu', 'artifacts', 'device-control', 'user-interface', 'doxygen', 'fw-updates', 'shg-firmware', 'can-updater', 'specalyser', 'docu-ul0', 'code-generation', 'dependency-graphs', 'decof', 'decof-sdk', 'clean', 'distclean', 'help', 'jamplayer', 'dlcpro-slot']
|
let s:makegoals = ['artifacts-firmware', 'artifacts-docu', 'artifacts', 'device-control', 'user-interface', 'doxygen', 'fw-updates', 'shg-firmware', 'can-updater', 'specalyser', 'docu-ul0', 'code-generation', 'dependency-graphs', 'decof', 'decof-sdk', 'clean', 'distclean', 'help', 'jamplayer', 'dlcpro-slot']
|
||||||
let s:makeprg = 'make'
|
let s:makeprg = 'make'
|
||||||
let g:DeviceIP = 'dlc_pro__040083'
|
let g:DeviceIP = 'dlc_pro__040083'
|
||||||
@ -119,7 +135,7 @@ function s:ProjectSet(project_type, project_base_dir)
|
|||||||
command DlcproEmissionOn call s:DlcproEmission('1')
|
command DlcproEmissionOn call s:DlcproEmission('1')
|
||||||
command DlcproEmissionOff call s:DlcproEmission('0')
|
command DlcproEmissionOff call s:DlcproEmission('0')
|
||||||
command DlcproShutup call s:DlcproShutup()
|
command DlcproShutup call s:DlcproShutup()
|
||||||
elseif (g:project_type == 'dlcpro-tui')
|
elseif ((g:project_type == 'dlcpro-tui') || (g:project_type == 'dlcpro-tui-simulator'))
|
||||||
let s:Program = '/user-interface/src/user-interface'
|
let s:Program = '/user-interface/src/user-interface'
|
||||||
let s:Elffile = s:Program
|
let s:Elffile = s:Program
|
||||||
let g:ProgramRemote = '/opt/app/bin/user-interface'
|
let g:ProgramRemote = '/opt/app/bin/user-interface'
|
||||||
@ -345,18 +361,18 @@ endfunction
|
|||||||
" ====
|
" ====
|
||||||
" Make
|
" Make
|
||||||
" ====
|
" ====
|
||||||
function GetAllMakeCompletions(ArgLead, CmdLine, CursorPos)
|
function! GetAllMakeCompletions(ArgLead, CmdLine, CursorPos)
|
||||||
return join(s:makegoals + s:makeopts + glob(a:ArgLead.'*', 1, 1), "\n")
|
return join(s:makegoals + s:makeopts + glob(a:ArgLead.'*', 1, 1), "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Make(args, async_mode)
|
function! s:Make(args, async_mode)
|
||||||
let &makeprg = s:makeprg
|
let &makeprg = s:makeprg
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
" execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make @ --directory='.g:ProjectBuildDir.' '.a:args
|
" execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make @ --directory='.g:ProjectBuildDir.' '.a:args
|
||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make -cwd='.g:ProjectBuildDir. ' @ '.a:args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make -cwd='.g:ProjectBuildDir. ' @ '.a:args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:MakeTestBuild()
|
function! s:MakeTestBuild()
|
||||||
let &makeprg = s:makeprg
|
let &makeprg = s:makeprg
|
||||||
call s:BuildDirStash('save')
|
call s:BuildDirStash('save')
|
||||||
call s:Cmake('-DCMAKE_BUILD_TYPE=Release', 1)
|
call s:Cmake('-DCMAKE_BUILD_TYPE=Release', 1)
|
||||||
@ -365,7 +381,7 @@ function s:MakeTestBuild()
|
|||||||
call s:BuildDirUnStash('save')
|
call s:BuildDirUnStash('save')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:MakeCheck(filename, async_mode)
|
function! s:MakeCheck(filename, async_mode)
|
||||||
let &makeprg = s:ProjectSrcDir.'/tools/static-check.py'
|
let &makeprg = s:ProjectSrcDir.'/tools/static-check.py'
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
if a:filename != ''
|
if a:filename != ''
|
||||||
@ -379,7 +395,7 @@ function s:MakeCheck(filename, async_mode)
|
|||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make -cwd='.g:ProjectBuildDir. ' @ '.args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make -cwd='.g:ProjectBuildDir. ' @ '.args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Cmake(options, async_mode)
|
function! s:Cmake(options, async_mode)
|
||||||
if !isdirectory(g:ProjectBuildDir)
|
if !isdirectory(g:ProjectBuildDir)
|
||||||
call mkdir(g:ProjectBuildDir)
|
call mkdir(g:ProjectBuildDir)
|
||||||
endif
|
endif
|
||||||
@ -393,11 +409,11 @@ function s:Cmake(options, async_mode)
|
|||||||
let args .= " --graphviz=dependencies.dot"
|
let args .= " --graphviz=dependencies.dot"
|
||||||
let args .= " ".a:options
|
let args .= " ".a:options
|
||||||
let args .= " -DCMAKE_EXPORT_COMPILE_COMMANDS=1"
|
let args .= " -DCMAKE_EXPORT_COMPILE_COMMANDS=1"
|
||||||
if (g:project_type == 'dlcpro')
|
if ((g:project_type == 'dlcpro') || (g:project_type == 'dlcpro-tui'))
|
||||||
let args .= " -DCMAKE_TOOLCHAIN_FILE=../".g:ProjectSrcDirRel."/Toolchain-target.cmake"
|
let args .= " -DCMAKE_TOOLCHAIN_FILE=../".g:ProjectSrcDirRel."/Toolchain-target.cmake"
|
||||||
let args .= " -DBUILD_TARGET=target"
|
let args .= " -DBUILD_TARGET=target"
|
||||||
let args .= g:new_compiler
|
let args .= g:new_compiler
|
||||||
elseif (g:project_type == 'dlcpro-tui')
|
elseif (g:project_type == 'dlcpro-tui-simulator')
|
||||||
let args .= " -DBUILD_TARGET=simulation"
|
let args .= " -DBUILD_TARGET=simulation"
|
||||||
let args .= " -DQT5_INSTALL_PATH=/usr/lib/x86_64-linux-gnu/qt5"
|
let args .= " -DQT5_INSTALL_PATH=/usr/lib/x86_64-linux-gnu/qt5"
|
||||||
elseif (g:project_type == 'topmode')
|
elseif (g:project_type == 'topmode')
|
||||||
@ -417,13 +433,13 @@ function s:Cmake(options, async_mode)
|
|||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.g:ProjectBuildDir.' @ cmake '.args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.g:ProjectBuildDir.' @ cmake '.args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Ctest(args, async_mode)
|
function! s:Ctest(args, async_mode)
|
||||||
let cmd = 'ctest --build-and-test ../src . --build-generator "Unix Makefiles" --build-target unit_tests --nocompress-output -T Test --build-options -DCMAKE_BUILD_TYPE=Debug --test-command ctest'
|
let cmd = 'ctest --build-and-test ../src . --build-generator "Unix Makefiles" --build-target unit_tests --nocompress-output -T Test --build-options -DCMAKE_BUILD_TYPE=Debug --test-command ctest'
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.s:ProjectBaseDir.'/unit-tests @ ' . cmd .' '. a:args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.s:ProjectBaseDir.'/unit-tests @ ' . cmd .' '. a:args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Ctestx(args, async_mode)
|
function! s:Ctestx(args, async_mode)
|
||||||
let unit_test_dirname = 'unit-tests'
|
let unit_test_dirname = 'unit-tests'
|
||||||
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
||||||
if !isdirectory('./unit-tests')
|
if !isdirectory('./unit-tests')
|
||||||
@ -438,7 +454,7 @@ function s:Ctestx(args, async_mode)
|
|||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.unit_test_dir.' @ ' . ctest_cmd .' '. a:args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.unit_test_dir.' @ ' . ctest_cmd .' '. a:args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Ctest1(args, async_mode)
|
function! s:Ctest1(args, async_mode)
|
||||||
let unit_test_dirname = 'unit-tests'
|
let unit_test_dirname = 'unit-tests'
|
||||||
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
||||||
if !isdirectory(unit_test_dir)
|
if !isdirectory(unit_test_dir)
|
||||||
@ -450,7 +466,7 @@ function s:Ctest1(args, async_mode)
|
|||||||
execute 'AsyncRun -mode=1 -save=2 -cwd='.unit_test_dir.' @ ' . cmake_cmd
|
execute 'AsyncRun -mode=1 -save=2 -cwd='.unit_test_dir.' @ ' . cmake_cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Ctest2(args, async_mode)
|
function! s:Ctest2(args, async_mode)
|
||||||
let unit_test_dirname = 'unit-tests'
|
let unit_test_dirname = 'unit-tests'
|
||||||
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
||||||
let build_cmd = 'cmake --build . -j --target unit_tests ' . a:args
|
let build_cmd = 'cmake --build . -j --target unit_tests ' . a:args
|
||||||
@ -458,7 +474,7 @@ function s:Ctest2(args, async_mode)
|
|||||||
execute 'AsyncRun -mode=1 -save=2 -cwd='.unit_test_dir.' @ ' . build_cmd
|
execute 'AsyncRun -mode=1 -save=2 -cwd='.unit_test_dir.' @ ' . build_cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Ctest3(args, async_mode)
|
function! s:Ctest3(args, async_mode)
|
||||||
let unit_test_dirname = 'unit-tests'
|
let unit_test_dirname = 'unit-tests'
|
||||||
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
let unit_test_dir = s:ProjectBaseDir . '/' . unit_test_dirname
|
||||||
let ctest_cmd = 'ctest --nocompress-output -T Test'
|
let ctest_cmd = 'ctest --nocompress-output -T Test'
|
||||||
@ -466,7 +482,7 @@ function s:Ctest3(args, async_mode)
|
|||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.unit_test_dir.' @ ' . ctest_cmd .' '. a:args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.unit_test_dir.' @ ' . ctest_cmd .' '. a:args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Call_and_log(cmd)
|
function! s:Call_and_log(cmd)
|
||||||
echom a:cmd
|
echom a:cmd
|
||||||
let r = system(a:cmd)
|
let r = system(a:cmd)
|
||||||
let e = v:shell_error
|
let e = v:shell_error
|
||||||
@ -476,14 +492,14 @@ function s:Call_and_log(cmd)
|
|||||||
return v:shell_error
|
return v:shell_error
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DlcproTuiStart()
|
function! s:DlcproTuiStart()
|
||||||
let workdir = s:ProjectSrcDir . '/user-interface/src'
|
let workdir = s:ProjectSrcDir . '/user-interface/src'
|
||||||
let cmd = g:ProjectBuildDir . '/user-interface/src/user-interface'
|
let cmd = g:ProjectBuildDir . '/user-interface/src/user-interface'
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
execute 'AsyncRun -mode=async -save=2 -cwd='.workdir.' @ ' . cmd
|
execute 'AsyncRun -mode=async -save=2 -cwd='.workdir.' @ ' . cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"function s:CopyFirmware(command)
|
"function! s:CopyFirmware(command)
|
||||||
" let command = 'bash '.s:GdbSlave.' -h '.g:DeviceIP.' '.a:command
|
" let command = 'bash '.s:GdbSlave.' -h '.g:DeviceIP.' '.a:command
|
||||||
"" if a:command == 'update' || a:command == 'start-debug'
|
"" if a:command == 'update' || a:command == 'start-debug'
|
||||||
" let command .= ' '.g:Program
|
" let command .= ' '.g:Program
|
||||||
@ -492,25 +508,25 @@ endfunction
|
|||||||
" call system(command)
|
" call system(command)
|
||||||
"endfunction
|
"endfunction
|
||||||
|
|
||||||
function s:DlcproEmission(state)
|
function! s:DlcproEmission(state)
|
||||||
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "echo '.a:state.' > /sys/bus/i2c/devices/200-0028/emission_button_state"')
|
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "echo '.a:state.' > /sys/bus/i2c/devices/200-0028/emission_button_state"')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DlcproShutup()
|
function! s:DlcproShutup()
|
||||||
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "modprobe -r tam3517_buzzer"')
|
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "modprobe -r tam3517_buzzer"')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:JLinkFlashProgram()
|
function! s:JLinkFlashProgram()
|
||||||
call term_start(s:ProjectSrcDir.'/flash_firmware.py -j '.s:jlink_path.'/JLinkExe -a 0x8000000 '.g:Program)
|
call term_start(s:ProjectSrcDir.'/flash_firmware.py -j '.s:jlink_path.'/JLinkExe -a 0x8000000 '.g:Program)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function g:JLinkSWOviewer()
|
function! g:JLinkSWOviewer()
|
||||||
let cmd = s:jlink_path.'/JLinkSWOViewerCLExe -device STM32H743ZI -itmmask 0xffffffff -swofreq 450000'
|
let cmd = s:jlink_path.'/JLinkSWOViewerCLExe -device STM32H743ZI -itmmask 0xffffffff -swofreq 450000'
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
execute 'AsyncRun -mode=async @ ' . cmd
|
execute 'AsyncRun -mode=async @ ' . cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DeviceUpdateProgramLinux()
|
function! s:DeviceUpdateProgramLinux()
|
||||||
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q gdbserver start-dc.sh '.fnamemodify(g:ProgramRemote, ':t').'"')
|
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q gdbserver start-dc.sh '.fnamemodify(g:ProgramRemote, ':t').'"')
|
||||||
sleep 2
|
sleep 2
|
||||||
" call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q -9 gdbserver start-dc.sh '.g:ProgramRemote.'"')
|
" call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q -9 gdbserver start-dc.sh '.g:ProgramRemote.'"')
|
||||||
@ -519,15 +535,15 @@ function s:DeviceUpdateProgramLinux()
|
|||||||
return r
|
return r
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DeviceFirmwareUpdateStartLinux()
|
function! s:DeviceFirmwareUpdateStartLinux()
|
||||||
let r = s:DeviceUpdateProgramLinux()
|
let r = s:DeviceUpdateProgramLinux()
|
||||||
if (r == 0)
|
if (r == 0)
|
||||||
let workdir = 'cd /opt/app &&'
|
let cd_workdir = 'cd ' . fnamemodify(g:ProgramRemote, ":h") . ' && '
|
||||||
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' -f root@'.g:DeviceIP.' "{ '.workdir.' '.g:ProgramRemote.' 2>&1 | logger -t "'.g:ProgramRemote.'" -p user.err; } &"')
|
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' -f root@'.g:DeviceIP.' "{ '.cd_workdir.' '.g:ProgramRemote.' 2>&1 | logger -t "'.g:ProgramRemote.'" -p user.err; } &"')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DeviceStartGdbServer()
|
function! s:DeviceStartGdbServer()
|
||||||
if ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor'))
|
if ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor'))
|
||||||
call s:Call_and_log('pkill --full JLinkGDBServer')
|
call s:Call_and_log('pkill --full JLinkGDBServer')
|
||||||
call s:Call_and_log(s:jlink_path.'/JLinkGDBServer -if SWD -device STM32H743ZI &')
|
call s:Call_and_log(s:jlink_path.'/JLinkGDBServer -if SWD -device STM32H743ZI &')
|
||||||
@ -541,7 +557,7 @@ function s:DeviceStartGdbServer()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DeviceStartGdbServerAttach()
|
function! s:DeviceStartGdbServerAttach()
|
||||||
if ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor'))
|
if ((g:project_type == 'digifalc') || (g:project_type == 'servoboard') || (g:project_type == 'dl-motor'))
|
||||||
else
|
else
|
||||||
call s:Call_and_log('pkill --full gdbserver')
|
call s:Call_and_log('pkill --full gdbserver')
|
||||||
@ -549,15 +565,15 @@ function s:DeviceStartGdbServerAttach()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:SendToTerm(command)
|
function! s:SendToTerm(command)
|
||||||
call term_sendkeys('', a:command . "\n")
|
call term_sendkeys('', a:command . "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:SendToConque(command)
|
function! s:SendToConque(command)
|
||||||
execute 'ConqueGdbCommand ' . a:command
|
execute 'ConqueGdbCommand ' . a:command
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:SendToDebugger(command)
|
function! s:SendToDebugger(command)
|
||||||
if !exists("s:UseConqueGdb")
|
if !exists("s:UseConqueGdb")
|
||||||
call s:SendToTerm(a:command)
|
call s:SendToTerm(a:command)
|
||||||
else
|
else
|
||||||
@ -565,7 +581,7 @@ function s:SendToDebugger(command)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:StartDebugger(elffile, attach)
|
function! s:StartDebugger(elffile, attach)
|
||||||
if !exists("s:UseConqueGdb")
|
if !exists("s:UseConqueGdb")
|
||||||
if (a:attach == 0)
|
if (a:attach == 0)
|
||||||
Termdebug
|
Termdebug
|
||||||
@ -583,7 +599,7 @@ function s:StartDebugger(elffile, attach)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let g:DlcproBasePath = "/jenkins/workspace/pro--firmware_release_1.9.0-DCESJ5C5R577IG5QFEWTML22UFDDZCJDGFLMDA4DCD3V2ZAGVEJA/source/"
|
let g:DlcproBasePath = "/jenkins/workspace/pro--firmware_release_1.9.0-DCESJ5C5R577IG5QFEWTML22UFDDZCJDGFLMDA4DCD3V2ZAGVEJA/source/"
|
||||||
function s:DeviceDebug(attach)
|
function! s:DeviceDebug(attach)
|
||||||
if (a:attach == 0)
|
if (a:attach == 0)
|
||||||
" let r = s:DeviceFirmwareUpdate()
|
" let r = s:DeviceFirmwareUpdate()
|
||||||
let r = 0
|
let r = 0
|
||||||
@ -635,25 +651,25 @@ endfunction
|
|||||||
" ================
|
" ================
|
||||||
" Regression Tests
|
" Regression Tests
|
||||||
" ================
|
" ================
|
||||||
function g:DlcproRegtestCmd(arguments)
|
function! g:DlcproRegtestCmd(arguments)
|
||||||
return s:DlcproRegtestCmd('', '', '0', '1', '', '--capture=no', a:arguments)
|
return s:DlcproRegtestCmd('', '', '0', '1', '', '--capture=no', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
function g:DlcproRegtestDlProCmd(arguments)
|
function! g:DlcproRegtestDlProCmd(arguments)
|
||||||
return s:DlcproRegtestCmd('dlc_pro__040011', 'elab-dlcpro2', '2', '1', 'DLpro', '', a:arguments)
|
return s:DlcproRegtestCmd('dlc_pro_proto_050003', 'elab-dlcpro2', '2', '1', 'DLpro', '', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
function g:DlcproRegtestTaProCmd(arguments)
|
function! g:DlcproRegtestTaProCmd(arguments)
|
||||||
return s:DlcproRegtestCmd('dlc_pro_020372', 'elab-dlcpro2', '3', '1', 'TApro', '-m "not usb and not usbstick"', a:arguments)
|
return s:DlcproRegtestCmd('dlc_pro_045396', 'elab-dlcpro2', '3', '1', 'TApro', '-m "not usb and not usbstick"', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
function g:DlcproRegtestCtlCmd(arguments)
|
function! g:DlcproRegtestCtlCmd(arguments)
|
||||||
return s:DlcproRegtestCmd('dlc_pro__040120', 'elab-dlcpro2', '1', '1', 'CTL', '-m "not usb and not usbstick"', a:arguments)
|
return s:DlcproRegtestCmd('dlc_pro__040120', 'elab-dlcpro2', '1', '1', 'CTL', '-m "not usb and not usbstick"', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
function g:DlcproRegtestDualDlCmd(arguments)
|
function! g:DlcproRegtestDualDlCmd(arguments)
|
||||||
return s:DlcproRegtestCmd('dlc_pro_041299', 'elab-dlcpro2', '4', '2', 'DLpro', '-m "not usb and not usbstick"', a:arguments)
|
return s:DlcproRegtestCmd('dlc_pro_041299', 'elab-dlcpro2', '4', '2', 'DLpro', '-m "not usb and not usbstick"', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
function g:DlcproRegtestDualDl1Cmd(arguments)
|
function! g:DlcproRegtestDualDl1Cmd(arguments)
|
||||||
return s:DlcproRegtestCmd('dlc_pro_041299', 'elab-dlcpro2', '4', '1', 'DLpro', '-m "not usb and not usbstick"', a:arguments)
|
return s:DlcproRegtestCmd('dlc_pro_041299', 'elab-dlcpro2', '4', '1', 'DLpro', '-m "not usb and not usbstick"', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
function g:DlcproRegtestShgProCmd(arguments)
|
function! g:DlcproRegtestShgProCmd(arguments)
|
||||||
return s:DlcproRegtestCmd('dlc_pro_041355', 'elab-dlcpro2', '7', '1', 'TA-SHGpro', '-m "not usb and not usbstick"', a:arguments)
|
return s:DlcproRegtestCmd('dlc_pro_041355', 'elab-dlcpro2', '7', '1', 'TA-SHGpro', '-m "not usb and not usbstick"', a:arguments)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -666,12 +682,12 @@ command -nargs=1 -complete=file DlcproRegtestDualDl1 call s:DlcproRegtest(g:Dlcp
|
|||||||
command -nargs=1 -complete=file DlcproRegtestShgPro call s:DlcproRegtest(g:DlcproRegtestShgProCmd('<args>'))
|
command -nargs=1 -complete=file DlcproRegtestShgPro call s:DlcproRegtest(g:DlcproRegtestShgProCmd('<args>'))
|
||||||
|
|
||||||
let g:DlcproRegtest_fast_restart = 1
|
let g:DlcproRegtest_fast_restart = 1
|
||||||
"let g:DlcproRegtest_marks = '"-m (no_crash_without_mc_fpga and not usb and not usbstick and not si1 and not servo_control and not eom and not cavity and not cell_spectroscopy)"'
|
let g:DlcproRegtest_marks = '"-m (no_crash_without_mc_fpga and not usb and not usbstick and not si and not si1 and not servo_control and not eom and not cavity and not cell_spectroscopy and not falc and not pfd and not smc)"'
|
||||||
let g:DlcproRegtest_marks = ""
|
"let g:DlcproRegtest_marks = ""
|
||||||
let g:DlcproRegtest_lasertype = "DLpro"
|
let g:DlcproRegtest_lasertype = "DLpro"
|
||||||
let g:DlcproRegtest_powerswitch_ip = ""
|
let g:DlcproRegtest_powerswitch_ip = ""
|
||||||
|
|
||||||
function s:DlcproRegtestCmd(ip, powerswitch_ip, powerplug, laser_count, laser_type, opts, arguments)
|
function! s:DlcproRegtestCmd(ip, powerswitch_ip, powerplug, laser_count, laser_type, opts, arguments)
|
||||||
if (a:ip == '')
|
if (a:ip == '')
|
||||||
let ip = g:DeviceIP
|
let ip = g:DeviceIP
|
||||||
else
|
else
|
||||||
@ -711,8 +727,7 @@ function s:DlcproRegtestCmd(ip, powerswitch_ip, powerplug, laser_count, laser_ty
|
|||||||
\"--firmware_file=".archive_dir."/DLCpro-archive.fw ".
|
\"--firmware_file=".archive_dir."/DLCpro-archive.fw ".
|
||||||
\"--license_tool=".licensetool." ".
|
\"--license_tool=".licensetool." ".
|
||||||
\"--license_keyfile=".s:ProjectSrcDir."/license/libdlcprolicense/rsa-private.key ".
|
\"--license_keyfile=".s:ProjectSrcDir."/license/libdlcprolicense/rsa-private.key ".
|
||||||
\"--skip_shutdown_after_test ".
|
\"--log-cli-level=INFO "
|
||||||
\"--skip_fw_update ".
|
|
||||||
\"--log-file-level=DEBUG "
|
\"--log-file-level=DEBUG "
|
||||||
\""
|
\""
|
||||||
|
|
||||||
@ -721,14 +736,13 @@ function s:DlcproRegtestCmd(ip, powerswitch_ip, powerplug, laser_count, laser_ty
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" hint: --collect-only
|
" hint: --collect-only
|
||||||
"--log-cli-level=DEBUG --log-file-level=DEBUG
|
|
||||||
|
|
||||||
let test_cmd .= a:opts." ". g:DlcproRegtest_marks." ".a:arguments
|
let test_cmd .= a:opts." ". g:DlcproRegtest_marks." ".a:arguments
|
||||||
let @+ = test_cmd
|
let @+ = test_cmd
|
||||||
return test_cmd
|
return test_cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:DlcproRegtest(test_cmd)
|
function! s:DlcproRegtest(test_cmd)
|
||||||
execute "wa"
|
execute "wa"
|
||||||
|
|
||||||
" Build license tool
|
" Build license tool
|
||||||
@ -779,7 +793,7 @@ endfunction
|
|||||||
" ===============
|
" ===============
|
||||||
" Stash / Unstash
|
" Stash / Unstash
|
||||||
" ===============
|
" ===============
|
||||||
function s:BuildDirStash(suffix)
|
function! s:BuildDirStash(suffix)
|
||||||
if a:suffix != ''
|
if a:suffix != ''
|
||||||
let suffix = a:suffix
|
let suffix = a:suffix
|
||||||
else
|
else
|
||||||
@ -799,7 +813,7 @@ function s:BuildDirStash(suffix)
|
|||||||
call execute('!cp '.target_dir.'/.project '.g:ProjectBuildDir, 'silent!')
|
call execute('!cp '.target_dir.'/.project '.g:ProjectBuildDir, 'silent!')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:BuildDirUnStash(suffix)
|
function! s:BuildDirUnStash(suffix)
|
||||||
if a:suffix != ''
|
if a:suffix != ''
|
||||||
let suffix = a:suffix
|
let suffix = a:suffix
|
||||||
else
|
else
|
||||||
@ -817,7 +831,7 @@ function s:BuildDirUnStash(suffix)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function GetAllStashedBuildDirs(ArgLead, CmdLine, CursorPos)
|
function! GetAllStashedBuildDirs(ArgLead, CmdLine, CursorPos)
|
||||||
return system('ls '.s:ProjectBaseDir.' | grep build.')
|
return system('ls '.s:ProjectBaseDir.' | grep build.')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -841,7 +855,7 @@ command TopticaBeamer execute('!pandoc -s -t beamer -H toptica-style.tex -o %:r.
|
|||||||
" -----------------
|
" -----------------
|
||||||
" Jenkins validator
|
" Jenkins validator
|
||||||
" -----------------
|
" -----------------
|
||||||
function s:Jenkins_linter(jenkinsfile)
|
function! s:Jenkins_linter(jenkinsfile)
|
||||||
if a:jenkinsfile == ''
|
if a:jenkinsfile == ''
|
||||||
let jenkinsfile = expand("%")
|
let jenkinsfile = expand("%")
|
||||||
else
|
else
|
||||||
|
@ -320,7 +320,7 @@ let g:clang_format#enable_fallback_style = 0
|
|||||||
" -------------
|
" -------------
|
||||||
" YouCompleteMe
|
" YouCompleteMe
|
||||||
" -------------
|
" -------------
|
||||||
let g:ycm_clangd_binary_path = exepath('clangd-13')
|
"let g:ycm_clangd_binary_path = exepath('clangd-13')
|
||||||
let g:ycm_clangd_uses_ycmd_caching = 0 " Let clangd fully control code completion
|
let g:ycm_clangd_uses_ycmd_caching = 0 " Let clangd fully control code completion
|
||||||
"let g:ycm_clangd_args = ['--all-scopes-completion', '--clang-tidy', '--header-insertion=iwyu', '--suggest-missing-includes', '--enable-config']
|
"let g:ycm_clangd_args = ['--all-scopes-completion', '--clang-tidy', '--header-insertion=iwyu', '--suggest-missing-includes', '--enable-config']
|
||||||
let g:ycm_clangd_args = ['--all-scopes-completion', '--header-insertion=iwyu', '--suggest-missing-includes', '--enable-config']
|
let g:ycm_clangd_args = ['--all-scopes-completion', '--header-insertion=iwyu', '--suggest-missing-includes', '--enable-config']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user