jerrym | f157933 | 2013-02-07 01:56:28 +0000 | [diff] [blame] | 1 | /*---------------------------------------------------------------------------*/
|
| 2 | /* Copyright (c) FIRST 2008. 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 $(WIND_BASE)/WPILib. */
|
| 5 | /*---------------------------------------------------------------------------*/
|
| 6 |
|
| 7 | #ifndef UTILITY_H_
|
| 8 | #define UTILITY_H_
|
| 9 |
|
| 10 | #include <taskLib.h>
|
| 11 |
|
| 12 | #define wpi_assert(condition) wpi_assert_impl(condition, #condition, NULL, __FILE__, __LINE__, __FUNCTION__)
|
| 13 | #define wpi_assertWithMessage(condition, message) wpi_assert_impl(condition, #condition, message, __FILE__, __LINE__, __FUNCTION__)
|
| 14 |
|
| 15 | #define wpi_assertEqual(a, b) wpi_assertEqual_impl(a, b, NULL, __FILE__, __LINE__, __FUNCTION__)
|
| 16 | #define wpi_assertEqualWithMessage(a, b, message) wpi_assertEqual_impl(a, b, message, __FILE__, __LINE__, __FUNCTION__)
|
| 17 |
|
| 18 | #define wpi_assertNotEqual(a, b) wpi_assertNotEqual_impl(a, b, NULL, __FILE__, __LINE__, __FUNCTION__)
|
| 19 | #define wpi_assertNotEqualWithMessage(a, b, message) wpi_assertNotEqual_impl(a, b, message, __FILE__, __LINE__, __FUNCTION__)
|
| 20 |
|
| 21 | bool wpi_assert_impl(bool conditionValue, const char *conditionText, const char *message, const char *fileName, UINT32 lineNumber, const char *funcName);
|
| 22 | bool wpi_assertEqual_impl(int valueA, int valueB, const char *message, const char *fileName,UINT32 lineNumber, const char *funcName);
|
| 23 | bool wpi_assertNotEqual_impl(int valueA, int valueB, const char *message, const char *fileName,UINT32 lineNumber, const char *funcName);
|
| 24 |
|
| 25 | char *wpi_getLabel(UINT addr, INT32 *found = NULL);
|
| 26 | void wpi_selfTrace();
|
| 27 | void wpi_suspendOnAssertEnabled(bool enabled);
|
| 28 | void wpi_stackTraceOnAssertEnable(bool enabled);
|
| 29 |
|
| 30 | UINT16 GetFPGAVersion();
|
| 31 | UINT32 GetFPGARevision();
|
| 32 | UINT32 GetFPGATime();
|
| 33 | INT32 GetRIOUserSwitch();
|
| 34 | void SetRIOUserLED(UINT32 state);
|
| 35 | INT32 GetRIOUserLED();
|
| 36 | INT32 ToggleRIOUserLED();
|
| 37 | void SetRIO_FPGA_LED(UINT32 state);
|
| 38 | INT32 GetRIO_FPGA_LED();
|
| 39 | INT32 ToggleRIO_FPGA_LED();
|
| 40 |
|
| 41 | #endif // UTILITY_H_
|