Skip to content

Commit 34509c6

Browse files
authored
Warn and don't start program if NoApp is triggered (#700)
1 parent 1bd5bf1 commit 34509c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/edu/wpi/first/gradlerio/deploy/roborio/FRCProgramStartArtifact.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ public FRCProgramStartArtifact(String name, StagedDeployTarget target) {
1919
@Override
2020
public void deploy(DeployContext ctx) {
2121
ctx.execute("sync");
22-
ctx.execute(". /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r 2> /dev/null");
22+
String result = ctx.execute("/usr/local/natinst/bin/nirtcfg --file=/etc/natinst/share/ni-rt.ini --get section=systemsettings,token=NoApp.enabled,value=unknown").getResult();
23+
if (result != null && result.trim().equalsIgnoreCase("true")) {
24+
ctx.getLogger().logError("NoApp is set on the device. Robot program cannot be started. Disable NoApp either with the imaging tool or by holding the User button for 5 seconds");
25+
} else {
26+
ctx.execute(". /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r 2> /dev/null");
27+
}
2328
}
2429

2530
}

0 commit comments

Comments
 (0)