Skip to content

Commit

Permalink
Warn and don't start program if NoApp is triggered (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse authored Dec 12, 2023
1 parent 1bd5bf1 commit 34509c6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ public FRCProgramStartArtifact(String name, StagedDeployTarget target) {
@Override
public void deploy(DeployContext ctx) {
ctx.execute("sync");
ctx.execute(". /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r 2> /dev/null");
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();
if (result != null && result.trim().equalsIgnoreCase("true")) {
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");
} else {
ctx.execute(". /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r 2> /dev/null");
}
}

}

0 comments on commit 34509c6

Please sign in to comment.