WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 /*---------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*---------------------------------------------------------------------------*/ 00006 00007 #ifndef UTILITY_H_ 00008 #define UTILITY_H_ 00009 00010 #include <taskLib.h> 00011 00012 #define wpi_assert(condition) wpi_assert_impl(condition, #condition, NULL, __FILE__, __LINE__, __FUNCTION__) 00013 #define wpi_assertWithMessage(condition, message) wpi_assert_impl(condition, #condition, message, __FILE__, __LINE__, __FUNCTION__) 00014 00015 #define wpi_assertEqual(a, b) wpi_assertEqual_impl(a, b, NULL, __FILE__, __LINE__, __FUNCTION__) 00016 #define wpi_assertEqualWithMessage(a, b, message) wpi_assertEqual_impl(a, b, message, __FILE__, __LINE__, __FUNCTION__) 00017 00018 #define wpi_assertNotEqual(a, b) wpi_assertNotEqual_impl(a, b, NULL, __FILE__, __LINE__, __FUNCTION__) 00019 #define wpi_assertNotEqualWithMessage(a, b, message) wpi_assertNotEqual_impl(a, b, message, __FILE__, __LINE__, __FUNCTION__) 00020 00021 bool wpi_assert_impl(bool conditionValue, const char *conditionText, const char *message, const char *fileName, UINT32 lineNumber, const char *funcName); 00022 bool wpi_assertEqual_impl(int valueA, int valueB, const char *message, const char *fileName,UINT32 lineNumber, const char *funcName); 00023 bool wpi_assertNotEqual_impl(int valueA, int valueB, const char *message, const char *fileName,UINT32 lineNumber, const char *funcName); 00024 00025 char *wpi_getLabel(UINT addr, INT32 *found = NULL); 00026 void wpi_selfTrace(); 00027 void wpi_suspendOnAssertEnabled(bool enabled); 00028 void wpi_stackTraceOnAssertEnable(bool enabled); 00029 00030 UINT16 GetFPGAVersion(); 00031 UINT32 GetFPGARevision(); 00032 UINT32 GetFPGATime(); 00033 INT32 GetRIOUserSwitch(); 00034 void SetRIOUserLED(UINT32 state); 00035 INT32 GetRIOUserLED(); 00036 INT32 ToggleRIOUserLED(); 00037 void SetRIO_FPGA_LED(UINT32 state); 00038 INT32 GetRIO_FPGA_LED(); 00039 INT32 ToggleRIO_FPGA_LED(); 00040 00041 #endif // UTILITY_H_