Skip to content

Commit a6bb0af

Browse files
authored
Merge pull request #45 from sync2brain/44-add-compatibility-with-matlab-r2022b
Add compatibility with MATLAB R2022b
2 parents eba7125 + 15c8f58 commit a6bb0af

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ jobs:
6060
strategy:
6161
fail-fast: false # Run with every MATLAB version independently
6262
matrix:
63-
matlabVer: [R2023a, R2023b] # List of MATLAB releases to test
63+
matlabVer: [R2022b, R2023a, R2023b] # List of MATLAB releases to test
64+
6465
runs-on: matlab
66+
6567
# Steps represent a sequence of tasks that will be executed as part of the job
6668
steps:
6769
- name: Setup Python
@@ -76,12 +78,12 @@ jobs:
7678
submodules: 'recursive'
7779
token: ${{ secrets.REPO_READ_TOKEN }}
7880

79-
- name: Cache MATLAB build files
80-
uses: actions/cache@v3
81-
with:
82-
key: matlab-buildtool
83-
path: |
84-
buildUtilities/.buildtool
81+
#- name: Cache MATLAB build files
82+
# uses: actions/cache@v3
83+
# with:
84+
# key: matlab-buildtool
85+
# path: |
86+
# buildUtilities/.buildtool
8587

8688
- name: Download firmware artifact
8789
uses: dawidd6/action-download-artifact@v2
@@ -96,8 +98,12 @@ jobs:
9698
if_no_artifact_found: fail
9799

98100
- name: Run MATLAB command
101+
timeout-minutes: 30
99102
run: |
100-
&"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'})"
103+
&"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); updateSGdeps; testTask({'noHW','bdConnected'});"
104+
# MATLAB R2022b does not support input arguments to buildtool
105+
#run: |
106+
# &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'});"
101107

102108
- name: Publish Test Results
103109
uses: EnricoMi/publish-unit-test-result-action/composite@v2
@@ -109,6 +115,7 @@ jobs:
109115
results.xml
110116
111117
- name: Upload Speedgoat dependencies as artifacts
118+
if: ${{ github.ref == 'refs/heads/master' }}
112119
uses: actions/upload-artifact@v3
113120
with:
114121
name: speedgoat-deps-${{ matrix.matlabVer }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![CI](https://github.com/sync2brain/bossdevice-api-matlab/actions/workflows/main.yml/badge.svg)](https://github.com/sync2brain/bossdevice-api-matlab/actions/workflows/main.yml) [![GitHub issues by-label](https://img.shields.io/github/issues-raw/sync2brain/bossdevice-api-matlab/bug)](https://github.com/sync2brain/bossdevice-api-matlab/issues?q=is%3Aissue+is%3Aopen+label%3Abug) ![GitHub](https://img.shields.io/github/license/sync2brain/bossdevice-api-matlab) [![View bossdevice-api-matlab on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/133972-bossdevice-api-matlab) [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=sync2brain/bossdevice-api-matlab&project=Bossdeviceapimatlab.prj)
33

44
## Requirements
5-
- MATLAB® Supported releases are R2023a and R2023b in their latest update available.
5+
- MATLAB® R2022b or newer in their latest update available.
66
- Simulink Real-Time®
77
- [Simulink Real-Time Target Support Package](https://www.mathworks.com/matlabcentral/fileexchange/76387-simulink-real-time-target-support-package)
88
- [bossdevice](https://sync2brain.com/) hardware

buildUtilities/releaseTask.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
end
3131
toolboxOptions.OutputFile = fullfile(projObj.RootFolder,"releases/bossdevice-api-installer.mltbx");
3232

33-
toolboxOptions.MinimumMatlabRelease = "R2023a";
33+
toolboxOptions.MinimumMatlabRelease = "R2022b";
3434
% toolboxOptions.MaximumMatlabRelease = "R2023a"; % Won't limit maximum MATLAB release
3535
toolboxOptions.SupportedPlatforms.Glnxa64 = true;
3636
toolboxOptions.SupportedPlatforms.Maci64 = false;

tests/commonSetupTests.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ function setupBossdevice(testCase)
1717
testCase.bd = bossdevice;
1818
testCase.bd.targetObject.update;
1919

20-
fprintf('Wait 30s for target to reboot after update and set IP address in secondary interface.\n');
21-
pause(30);
20+
fprintf('Wait 40s for target to reboot after update and set IP address in secondary interface.\n');
21+
pause(40);
2222
% Set Ethernet IP in secondary interface
2323
bossapi.setEthernetInterface(testCase.bd.targetObject,'wm1','192.168.200.255/24');
2424
end
@@ -33,9 +33,11 @@ function resetSgPath(testCase)
3333
end
3434

3535
function rebootTarget(testCase)
36-
disp('Rebooting bossdevice to teardown test class.');
37-
testCase.bd.targetObject.reboot;
38-
pause(30);
36+
if ~isempty(testCase.bd)
37+
disp('Rebooting bossdevice to teardown test class.');
38+
testCase.bd.targetObject.reboot;
39+
pause(30);
40+
end
3941
end
4042
end
4143

toolbox/examples/demo_measure_loop_latency.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
bd.start;
1111

1212
% Prepare instrument object with signals to stream
13-
inst = slrealtime.Instrument;
14-
inst.addSignal('mainmodel/UDP/Decode UDP Packet',3); % Former UDP/raw_mrk
15-
inst.addSignal('mainmodel/Unit Delay',1); % Former gen_running
16-
bd.addInstrument(inst);
13+
instObj = slrealtime.Instrument;
14+
instObj.addSignal('biosignal','BusElement','mrk'); % Former UDP/raw_mrk
15+
instObj.addSignal('mainmodel/Unit Delay',1); % Former gen_running
16+
bd.addInstrument(instObj);
1717

1818
%% Configure scopes in SDI
1919

@@ -26,7 +26,7 @@
2626
runObj = Simulink.sdi.Run.getLatest;
2727

2828
% Get signal objects and add to subplot
29-
mrkSig = runObj.getSignalsByName('mrk');
29+
mrkSig = runObj.getSignalsByName('biosignal.mrk');
3030
mrkSig.plotOnSubPlot(1,1,true);
3131

3232
genRunSig = runObj.getSignalsByName('gen_running');

0 commit comments

Comments
 (0)