blob: 1ce1d4e167bd1d085c267d7ec936ddf2c28ef138 [file] [log] [blame]
Parker Schuhd3b7a8872018-02-19 16:42:27 -08001/*----------------------------------------------------------------------------*/
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
Austin Schuhf6b94632019-02-02 22:11:27 -080012#include "hal/HAL.h"
Parker Schuhd3b7a8872018-02-19 16:42:27 -080013#include "frc971/wpilib/ahal/DriverStation.h"
14#include "frc971/wpilib/ahal/Utility.h"
15#include "frc971/wpilib/ahal/WPILibVersion.h"
16
17using 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 */
30RobotBase::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}