Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 1 | #include "frc971/wpilib/ahal/Utility.h" |
| 2 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 3 | #include "frc971/wpilib/ahal/ErrorBase.h" |
Austin Schuh | f6b9463 | 2019-02-02 22:11:27 -0800 | [diff] [blame] | 4 | #include "hal/HAL.h" |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 5 | |
| 6 | namespace frc { |
| 7 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 8 | int GetFPGAVersion() { |
| 9 | int32_t status = 0; |
| 10 | int version = HAL_GetFPGAVersion(&status); |
| 11 | wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); |
| 12 | return version; |
| 13 | } |
| 14 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 15 | int64_t GetFPGARevision() { |
| 16 | int32_t status = 0; |
| 17 | int64_t revision = HAL_GetFPGARevision(&status); |
| 18 | wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); |
| 19 | return revision; |
| 20 | } |
| 21 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 22 | uint64_t GetFPGATime() { |
| 23 | int32_t status = 0; |
| 24 | uint64_t time = HAL_GetFPGATime(&status); |
| 25 | wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); |
| 26 | return time; |
| 27 | } |
| 28 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 29 | bool GetUserButton() { |
| 30 | int32_t status = 0; |
| 31 | |
| 32 | bool value = HAL_GetFPGAButton(&status); |
| 33 | wpi_setGlobalError(status); |
| 34 | |
| 35 | return value; |
| 36 | } |
| 37 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 38 | } // namespace frc |