blob: 3cc39df1f102d0ce6b6cd4b6712c251840dbf63c [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"
Parker Schuhd3b7a8872018-02-19 16:42:27 -080014#include "frc971/wpilib/ahal/WPILibVersion.h"
15
16using namespace frc;
17
18/**
19 * Constructor for a generic robot program.
20 *
21 * User code should be placed in the constructor that runs before the Autonomous
22 * or Operator Control period starts. The constructor will run to completion
23 * before Autonomous is entered.
24 *
25 * This must be used to ensure that the communications code starts. In the
26 * future it would be nice to put this code into it's own task that loads on
27 * boot so ensure that it runs.
28 */
29RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
30 std::FILE *file = nullptr;
31 file = std::fopen("/tmp/frc_versions/FRC_Lib_Version.ini", "w");
32
33 if (file != nullptr) {
34 std::fputs("C++ ", file);
35 std::fputs(WPILibVersion, file);
36 std::fclose(file);
37 }
38}