[hal] Update runtime enum to allow selecting roborio 2 (#3565)

In some cases, knowing roborio 2 might be useful. This also creates a higher level enum that might be usable later for the discussion on more complex runtime types.
This commit is contained in:
Thad House
2021-09-13 22:05:38 -07:00
committed by GitHub
parent 95a12e0ee8
commit 66abb39880
11 changed files with 96 additions and 5 deletions

View File

@@ -15,6 +15,7 @@
#include <wpi/mutex.h>
#include "frc/Errors.h"
#include "frc/RuntimeType.h"
namespace frc {
@@ -211,6 +212,13 @@ class RobotBase {
virtual void EndCompetition() = 0;
/**
* Get the current runtime type.
*
* @return Current runtime type.
*/
static RuntimeType GetRuntimeType();
/**
* Get if the robot is real.
*

View File

@@ -0,0 +1,9 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
namespace frc {
enum RuntimeType { kRoboRIO, kRoboRIO2, kSimulation };
} // namespace frc