Skip to content

Commit

Permalink
Warn user if logging to RoboRIO 1 internal storage
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Sep 8, 2023
1 parent a6157f1 commit a87aba6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions wpilibc/src/main/native/cpp/DataLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "frc/DriverStation.h"
#include "frc/Filesystem.h"
#include "frc/RobotBase.h"

using namespace frc;

Expand Down Expand Up @@ -69,6 +70,11 @@ static std::string MakeLogDir(std::string_view dir) {
(s.permissions() & fs::perms::others_write) != fs::perms::none) {
return std::string{usbDir};
}
if (frc::RobotBase::GetRuntimeType() == kRoboRIO) {
FRC_ReportError(warn::Warning,
"DataLogManager: Logging to RoboRIO 1 internal storage is "
"not recommended! Plug in a FAT32 formatted flash drive!");
}
#endif
return frc::filesystem::GetOperatingDirectory();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ private static String makeLogDir(String dir) {
// ignored
}
}

if (RobotBase.getRuntimeType() == RuntimeType.kRoboRIO) {
DriverStation.reportWarning(
"DataLogManager: Logging to RoboRIO 1 internal storage is not recommended! Plug in a FAT32 formatted flash drive!",
false);
}
return Filesystem.getOperatingDirectory().getAbsolutePath();
}

Expand Down

0 comments on commit a87aba6

Please sign in to comment.