--- /dev/null
+# Copyright (C) 2013 Czech Technical University in Prague
+#
+# Authors:
+# - Michal Horn <hornmich@fel.cvut.cz>
+#
+# This document contains proprietary information belonging to Czech
+# Technical University in Prague. Passing on and copying of this
+# document, and communication of its contents is not permitted
+# without prior written authorization.
+#
+# File : Makefile.var
+# Abstract:
+# Variables defining sets of demos for targets
+
+include ../lib/Makefile.var
+
+rpp_demo_set = $(rpp_$(TARGET)_demos)
+
+rpp_target_file = $(rpp_$(TARGET)_target_file)
+
+rpp_rm48_hdk_demos = \
+ 'adc_demo_hdk', \
+ 'can_ext_mode_demo', \
+ 'can_simple_demo', \
+ 'cantransmit', \
+ 'continuous_hdk', \
+ 'demo_board_hdk', \
+ 'echo_char', \
+ 'gio_demo_hdk', \
+ 'hello_world', \
+ 'multirate_st_hdk'
+
+rpp_rm48_hdk_target_file = 'rpp_rm48_hdk.tlc'
+
+rpp_tms570_hdk_demos = \
+ 'adc_demo_hdk', \
+ 'can_ext_mode_demo', \
+ 'can_simple_demo', \
+ 'cantransmit', \
+ 'continuous_hdk', \
+ 'demo_board_hdk', \
+ 'echo_char', \
+ 'gio_demo_hdk', \
+ 'hello_world', \
+ 'multirate_st_hdk'
+
+rpp_tms570_hdk_target_file = 'rpp_tms570_hdk.tlc'
--- /dev/null
+% Copyright (C) 2013-2014 Czech Technical University in Prague
+%
+% Authors:
+% - Michal Horn <hornmich@fel.cvut.cz>
+%
+% This document contains proprietary information belonging to Czech
+% Technical University in Prague. Passing on and copying of this
+% document, and communication of its contents is not permitted
+% without prior written authorization.
+%
+% File : rpp_demos_set_tg.m
+% Abstract:
+% Set target file for demo, preserving selected solver and
+% continuous time support
+%
+% References:
+% http://www.mathworks.com/help/matlab/ref/mex.html
+% http://www.mathworks.com/help/matlab/matlab_external/custom-building-mex-files.html
+
+
+function rpp_demos_set_tg(varargin)
+ d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos');
+ cd(d)
+
+ if nargin > 1,
+ reqTarget = varargin{1};
+ demos_set_tg(reqTarget, varargin)
+ else
+ error('Not enough arguments for the function.');
+ end
+
+function demos_set_tg(reqTg, files)
+ for i=2:length(files),
+ disp(['Processing system: ', files{i}]);
+ load_system(files{i});
+ continuousTime = get_param(files{i}, 'SupportContinuousTime');
+ solver = get_param(files{i}, 'Solver');
+ disp([' Set SystemTargetFile to ', reqTg, ' with continuousTime ', continuousTime, ' and solver ', solver]);
+ set_param(files{i}, 'SystemTargetFile', reqTg);
+ set_param(files{i}, 'SupportContinuousTime', continuousTime);
+ set_param(files{i}, 'Solver', solver);
+ disp(' Saving and closing model.');
+ close_system(files{i}, 1);
+ end
+