]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Undefined variable fixed
authorMichal Horn <hornmich@fel.cvut.cz>
Wed, 3 Sep 2014 12:37:40 +0000 (14:37 +0200)
committerMichal Horn <hornmich@fel.cvut.cz>
Wed, 3 Sep 2014 12:37:40 +0000 (14:37 +0200)
rpp/rpp/rpp_download.m

index 5ccb018df7a7f222d0559f62ef89252ca0194217..1539d24db3efd4c23c9b0ca327470b7e2439e597 100644 (file)
 
 function rpp_download(modelName, buildDirectory, use_openocd, use_sdram)
        RppLibRoot = getpref('rpp', 'RppLibRoot');
-
+       CCSRoot    = getpref('rpp', 'CCSRoot');
+       
        %TODO: parse the EXE_FILE_EXT from target_tools.mk
        outfile     = fullfile(buildDirectory, [modelName, '.out']);
        downloadLog = fullfile(buildDirectory, 'download.log');
 
        if use_openocd
-               disp(['OpenOCD will be used.'])
                if use_sdram
-                       disp(['Will download to SDRAM'])
                        command = [...
                                RppLibRoot '/../loadopenocd/loadopenocd.sh -d flash -b -s ' ...
                                , outfile, ' 2> ' , downloadLog ];
@@ -45,26 +44,26 @@ function rpp_download(modelName, buildDirectory, use_openocd, use_sdram)
                        end
                        disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);                    
                else
-                       disp(['Will download to Flash'])
-                       command = [...
-                               RppLibRoot '/../loadopenocd/loadopenocd.sh -d flash -b -s ' ...
-                               , outfile, ' 2> ' , downloadLog ];
-                       disp('### Running downloader script:');
-                       disp(command);
-                       status = system(command);
-                       if status ~= 0,
-                               throw(MException('rpp:targetDlErr', ['Failed to download ' modelName ' to the target']))
+                       if isunix
+                               command = [...
+                                       RppLibRoot '/../loadopenocd/loadopenocd.sh -d flash -b -s ' ...
+                                       , outfile, ' 2> ' , downloadLog ];
+                               disp('### Running downloader script:');
+                               disp(command);
+                               status = system(command);
+                               if status ~= 0,
+                                       throw(MException('rpp:targetDlErr', ['Failed to download ' modelName ' to the target']))
+                               end
+                               disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);                    
+                       else
+                               disp(['### Sorry code download is available for UNIX systems only.']);
+                               disp(['###     -> Add support for non UNIX systems in <targetroot>/rpp/rpp_download.m file.']);
                        end
-                       disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);                    
                end
        else
-               disp(['TI DSS Generic Loader will be used.'])
                if use_sdram
-                       disp(['Will download to SDRAM'])
-                       disp(['Not yet implemented'])
+                       disp(['### Sorry, Downloading to the SDRAM is not yet implemented.'])
                else
-                       disp(['Will download to Flash'])
-
                        if isunix
 
                                disp(['### Downloading ', modelName, ' to RPP board...']);