1 % Copyright (C) 2013 Czech Technical University in Prague
4 % - Carlos Jenkins <carlos@jenkins.co.cr>
6 % This program is free software; you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation; either version 2 of the License, or
9 % (at your option) any later version.
11 % This program is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
16 % You should have received a copy of the GNU General Public License
17 % along with this program. If not, see <http://www.gnu.org/licenses/>.
21 % RPP Target install script.
23 % IMPORTANT: This script _MUST_ be run by user after extracting the target
24 % package and before using the target. To execute:
27 % 2. Change directory (cd) to this file folder.
28 % 3. Execute rpp_setup() on command window.
36 % Get current target path in user's filesystem
38 targetPath = currentPath(1:end-length('/rpp'));
40 % Add target system folders to Matlab path
41 addpath(fullfile(targetPath, 'rpp'));
42 addpath(fullfile(targetPath, 'demos'));
43 addpath(fullfile(targetPath, 'blocks'));
44 %addpath(fullfile(targetPath, 'help'));
47 % Ask user setup variables
48 possiblePath = '/usr/local/ti/ccsv5/tools/compiler/arm_5.0.1';
50 CompilerRoot = fix_slash(uigetdir(possiblePath, ...
51 'CCS Compiler root directory: (<ccs_root>/tools/compiler/arm_5.X.X)'));
52 CCSRoot = fileparts(fileparts(fileparts(CompilerRoot)));
53 TargetRoot = fix_slash(currentPath);
54 RppLibRoot = fullfile(fileparts(TargetRoot), 'lib');
60 addpref('rpp', 'CompilerRoot', CompilerRoot);
61 addpref('rpp', 'CCSRoot' , CCSRoot);
62 addpref('rpp', 'TargetRoot' , TargetRoot);
63 addpref('rpp', 'RppLibRoot' , RppLibRoot);
72 % FIXME: Write and generate help
73 %cd('../help/source');
77 % Apply changes and finish
78 sl_refresh_customizations();
79 disp('<strong>RPP</strong> Target setup is complete!');
80 disp(' Current configuration:');
81 disp([' CompilerRoot : ', CompilerRoot]);
82 disp([' CCSRoot : ', CCSRoot]);
83 disp([' TargetRoot : ', TargetRoot]);
84 disp([' RppLibRoot : ', RppLibRoot]);
85 disp('Explore <a href="matlab:cd([getpref(''rpp'',''TargetRoot''),''/../demos''])">demos</a> directory.');
86 %disp('Explore <a href="matlab:cd([getpref(''rpp'',''TargetRoot''),''/../demos''])">demos</a> directory and access <a href="matlab:doc -classic">documentation</a>');
90 function path = fix_slash(path0)