Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2008-2017. All Rights Reserved. */ |
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
| 4 | /* must be accompanied by the FIRST BSD license file in the root directory of */ |
| 5 | /* the project. */ |
| 6 | /*----------------------------------------------------------------------------*/ |
| 7 | |
| 8 | #include "frc971/wpilib/ahal/RobotBase.h" |
| 9 | |
| 10 | #include <cstdio> |
| 11 | |
| 12 | #include "HAL/HAL.h" |
| 13 | #include "frc971/wpilib/ahal/DriverStation.h" |
| 14 | #include "frc971/wpilib/ahal/Utility.h" |
| 15 | #include "frc971/wpilib/ahal/WPILibVersion.h" |
| 16 | |
| 17 | using namespace frc; |
| 18 | |
| 19 | /** |
| 20 | * Constructor for a generic robot program. |
| 21 | * |
| 22 | * User code should be placed in the constructor that runs before the Autonomous |
| 23 | * or Operator Control period starts. The constructor will run to completion |
| 24 | * before Autonomous is entered. |
| 25 | * |
| 26 | * This must be used to ensure that the communications code starts. In the |
| 27 | * future it would be nice to put this code into it's own task that loads on |
| 28 | * boot so ensure that it runs. |
| 29 | */ |
| 30 | RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) { |
| 31 | std::FILE *file = nullptr; |
| 32 | file = std::fopen("/tmp/frc_versions/FRC_Lib_Version.ini", "w"); |
| 33 | |
| 34 | if (file != nullptr) { |
| 35 | std::fputs("C++ ", file); |
| 36 | std::fputs(WPILibVersion, file); |
| 37 | std::fclose(file); |
| 38 | } |
| 39 | } |