1 % RPP_SETUP Setup RPP code generation target.
2 % RPP_SETUP asks for the path to the Code Composer Studio's compiler.
3 % RPP_SETUP(PATH) uses the PATH argument as the path to the compiler.
5 % Copyright (C) 2013 Czech Technical University in Prague
8 % - Carlos Jenkins <carlos@jenkins.co.cr>
10 % This document contains proprietary information belonging to Czech
11 % Technical University in Prague. Passing on and copying of this
12 % document, and communication of its contents is not permitted
13 % without prior written authorization.
17 % RPP Target install script.
19 % IMPORTANT: This script _MUST_ be run by user after extracting the target
20 % package and before using the target. To execute:
23 % 2. Change directory (cd) to this file folder.
24 % 3. Execute rpp_setup on command window.
30 function rpp_setup(varargin)
31 % Get current target path in user's filesystem
33 targetPath = currentPath(1:end-length('/rpp'));
35 % Add target system folders to Matlab path
36 addpath(fullfile(targetPath, 'rpp'));
37 addpath(fullfile(targetPath, 'demos'));
38 addpath(fullfile(targetPath, 'blocks'));
39 %addpath(fullfile(targetPath, 'help'));
43 % Ask user setup variables
44 if ispref('rpp', 'CompilerRoot')
45 possiblePath = getpref('rpp', 'CompilerRoot');
47 possiblePath = '/usr/local/ti/ccsv5/tools/compiler/arm_5.0.1';
50 CompilerRoot = fix_slash(uigetdir(possiblePath, ...
51 ['CCS Compiler root ' ...
52 'directory: (<ccs_root>/tools/compiler/arm_5.X.X)']));
54 CompilerRoot = fix_slash(varargin{1});
56 CCSRoot = fileparts(fileparts(fileparts(CompilerRoot)));
57 TargetRoot = fix_slash(currentPath);
58 RppLibRoot = fullfile(fileparts(TargetRoot), 'lib');
60 armcl = fullfile(CompilerRoot, 'bin', 'armcl');
62 disp(sprintf('Error: "%s" does not exist!', armcl));
70 addpref('rpp', 'CompilerRoot', CompilerRoot);
71 addpref('rpp', 'CCSRoot' , CCSRoot);
72 addpref('rpp', 'TargetRoot' , TargetRoot);
73 addpref('rpp', 'RppLibRoot' , RppLibRoot);
82 % FIXME: Write and generate help
83 %cd('../help/source');
87 % Apply changes and finish
88 sl_refresh_customizations();
89 disp('<strong>RPP</strong> Target setup is complete!');
90 disp(' Current configuration:');
91 disp([' CompilerRoot : ', CompilerRoot]);
92 disp([' CCSRoot : ', CCSRoot]);
93 disp([' TargetRoot : ', TargetRoot]);
94 disp([' RppLibRoot : ', RppLibRoot]);
95 disp('Explore <a href="matlab:cd([getpref(''rpp'',''TargetRoot''),''/../demos''])">demos</a> directory.');
96 %disp('Explore <a href="matlab:cd([getpref(''rpp'',''TargetRoot''),''/../demos''])">demos</a> directory and access <a href="matlab:doc -classic">documentation</a>');
100 function path = fix_slash(path0)