WPILibC++
unspecified
|
Contains global utility functions. More...
#include <stdint.h>
#include <string>
Go to the source code of this file.
Macros | |
#define | wpi_assert(condition) wpi_assert_impl(condition, #condition, "", __FILE__, __LINE__, __FUNCTION__) |
#define | wpi_assertWithMessage(condition, message) |
#define | wpi_assertEqual(a, b) wpi_assertEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__) |
#define | wpi_assertEqualWithMessage(a, b, message) wpi_assertEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, __FUNCTION__) |
#define | wpi_assertNotEqual(a, b) wpi_assertNotEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__) |
#define | wpi_assertNotEqualWithMessage(a, b, message) |
Functions | |
bool | wpi_assert_impl (bool conditionValue, const char *conditionText, const char *message, const char *fileName, uint32_t lineNumber, const char *funcName) |
Assert implementation. More... | |
bool | wpi_assertEqual_impl (int valueA, int valueB, const char *valueAString, const char *valueBString, const char *message, const char *fileName, uint32_t lineNumber, const char *funcName) |
Assert equal implementation. More... | |
bool | wpi_assertNotEqual_impl (int valueA, int valueB, const char *valueAString, const char *valueBString, const char *message, const char *fileName, uint32_t lineNumber, const char *funcName) |
Assert not equal implementation. More... | |
void | wpi_suspendOnAssertEnabled (bool enabled) |
uint16_t | GetFPGAVersion () |
Return the FPGA Version number. More... | |
uint32_t | GetFPGARevision () |
Return the FPGA Revision number. More... | |
uint64_t | GetFPGATime () |
Read the microsecond-resolution timer on the FPGA. More... | |
bool | GetUserButton () |
Get the state of the "USER" button on the RoboRIO. More... | |
std::string | GetStackTrace (uint32_t offset) |
Get a stack trace, ignoring the first "offset" symbols. More... | |
Contains global utility functions.
#define wpi_assertNotEqualWithMessage | ( | a, | |
b, | |||
message | |||
) |
#define wpi_assertWithMessage | ( | condition, | |
message | |||
) |
uint32_t GetFPGARevision | ( | ) |
Return the FPGA Revision number.
The format of the revision is 3 numbers. The 12 most significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least significant bits are the Build Number.
uint64_t GetFPGATime | ( | ) |
Read the microsecond-resolution timer on the FPGA.
uint16_t GetFPGAVersion | ( | ) |
Return the FPGA Version number.
For now, expect this to be competition year.
std::string GetStackTrace | ( | uint32_t | offset | ) |
Get a stack trace, ignoring the first "offset" symbols.
offset | The number of symbols at the top of the stack to ignore |
bool GetUserButton | ( | ) |
Get the state of the "USER" button on the RoboRIO.
bool wpi_assert_impl | ( | bool | conditionValue, |
const char * | conditionText, | ||
const char * | message, | ||
const char * | fileName, | ||
uint32_t | lineNumber, | ||
const char * | funcName | ||
) |
Assert implementation.
This allows breakpoints to be set on an assert. The users don't call this, but instead use the wpi_assert macros in Utility.h.
bool wpi_assertEqual_impl | ( | int | valueA, |
int | valueB, | ||
const char * | valueAString, | ||
const char * | valueBString, | ||
const char * | message, | ||
const char * | fileName, | ||
uint32_t | lineNumber, | ||
const char * | funcName | ||
) |
Assert equal implementation.
This determines whether the two given integers are equal. If not, the value of each is printed along with an optional message string. The users don't call this, but instead use the wpi_assertEqual macros in Utility.h.
bool wpi_assertNotEqual_impl | ( | int | valueA, |
int | valueB, | ||
const char * | valueAString, | ||
const char * | valueBString, | ||
const char * | message, | ||
const char * | fileName, | ||
uint32_t | lineNumber, | ||
const char * | funcName | ||
) |
Assert not equal implementation.
This determines whether the two given integers are equal. If so, the value of each is printed along with an optional message string. The users don't call this, but instead use the wpi_assertNotEqual macros in Utility.h.