Skip to content

Commit

Permalink
[wpilib] DataLogManager: Warn user if logging to RoboRIO 1 internal s…
Browse files Browse the repository at this point in the history
…torage (wpilibsuite#5617)
  • Loading branch information
rzblue authored Sep 11, 2023
1 parent 7a9a901 commit 339ef1e
Show file tree
Hide file tree
Showing 2 changed files with 12 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 @@ -204,8 +204,13 @@ private static String makeLogDir(String dir) {
} catch (IOException ex) {
// 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 339ef1e

Please sign in to comment.