Moves JNI internal utility methods to frc namespace (#310)

This commit is contained in:
Thad House
2016-10-31 23:04:49 -07:00
committed by Peter Johnson
parent 137b3d81fb
commit 81221c4874
23 changed files with 52 additions and 0 deletions

View File

@@ -15,6 +15,8 @@
#include "HALUtil.h"
#include "HAL/handles/HandlesInternal.h"
using namespace frc;
// set the logging level
TLogLevel analogGyroJNILogLevel = logWARNING;

View File

@@ -19,6 +19,8 @@
#include "HALUtil.h"
#include "HAL/handles/HandlesInternal.h"
using namespace frc;
// set the logging level
TLogLevel analogJNILogLevel = logWARNING;

View File

@@ -15,6 +15,8 @@
#include "HAL/CAN.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
// TLogLevel canJNILogLevel = logDEBUG;
TLogLevel canJNILogLevel = logERROR;

View File

@@ -10,6 +10,8 @@
#include "HAL/cpp/Log.h"
#include "edu_wpi_first_wpilibj_hal_CompressorJNI.h"
using namespace frc;
extern "C" {
/*

View File

@@ -14,6 +14,8 @@
#include "HAL/Constants.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel constantsJNILogLevel = logWARNING;

View File

@@ -15,6 +15,8 @@
#include "HAL/Errors.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel counterJNILogLevel = logWARNING;

View File

@@ -17,6 +17,8 @@
#include "HAL/Ports.h"
#include "HAL/handles/HandlesInternal.h"
using namespace frc;
// set the logging level
TLogLevel dioJNILogLevel = logWARNING;

View File

@@ -11,6 +11,8 @@
#include "edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI.h"
using namespace frc;
/*
* Class: edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
* Method: setFilterSelect

View File

@@ -15,6 +15,8 @@
#include "HAL/Errors.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel encoderJNILogLevel = logWARNING;

View File

@@ -15,6 +15,8 @@
#include "edu_wpi_first_wpilibj_hal_HAL.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
static TLogLevel netCommLogLevel = logWARNING;

View File

@@ -50,6 +50,8 @@ static jclass canNotInitializedExCls = nullptr;
static jclass uncleanStatusExCls = nullptr;
static jclass pwmConfigDataResultCls = nullptr;
namespace frc {
static void GetStackTrace(JNIEnv *env, std::string &res, std::string &func) {
// create a throwable
static jmethodID constructorId = nullptr;
@@ -269,6 +271,10 @@ jobject CreatePWMConfigDataResult(JNIEnv *env, int32_t maxPwm,
minPwm);
}
} // namespace frc
using namespace frc;
extern "C" {
//

View File

@@ -14,6 +14,8 @@
extern JavaVM *jvm;
namespace frc {
void ReportError(JNIEnv *env, int32_t status, bool do_throw = true);
void ThrowError(JNIEnv *env, int32_t status, int32_t minRange, int32_t maxRange,
@@ -49,5 +51,7 @@ void ThrowBoundaryException(JNIEnv *env, double value, double lower,
jobject CreatePWMConfigDataResult(JNIEnv *env, int32_t maxPwm,
int32_t deadbandMaxPwm, int32_t centerPwm,
int32_t deadbandMinPwm, int32_t minPwm);
} // namespace frc
#endif // HALUTIL_H

View File

@@ -14,6 +14,8 @@
#include "HAL/I2C.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel i2cJNILogLevel = logWARNING;

View File

@@ -18,6 +18,8 @@
#include "edu_wpi_first_wpilibj_hal_InterruptJNI.h"
#include "support/SafeThread.h"
using namespace frc;
TLogLevel interruptJNILogLevel = logERROR;
#define INTERRUPTJNI_LOG(level) \

View File

@@ -19,6 +19,8 @@
#include "edu_wpi_first_wpilibj_hal_NotifierJNI.h"
#include "support/SafeThread.h"
using namespace frc;
// set the logging level
TLogLevel notifierJNILogLevel = logWARNING;

View File

@@ -10,6 +10,8 @@
#include "HALUtil.h"
#include "edu_wpi_first_wpilibj_hal_PDPJNI.h"
using namespace frc;
extern "C" {
/*

View File

@@ -17,6 +17,8 @@
#include "HALUtil.h"
#include "HAL/handles/HandlesInternal.h"
using namespace frc;
// set the logging level
TLogLevel pwmJNILogLevel = logWARNING;

View File

@@ -14,6 +14,8 @@
#include "HAL/Ports.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel portsJNILogLevel = logWARNING;

View File

@@ -10,6 +10,8 @@
#include "HALUtil.h"
#include "edu_wpi_first_wpilibj_hal_PowerJNI.h"
using namespace frc;
extern "C" {
/*

View File

@@ -16,6 +16,8 @@
#include "HALUtil.h"
#include "HAL/handles/HandlesInternal.h"
using namespace frc;
// set the logging level
TLogLevel relayJNILogLevel = logWARNING;

View File

@@ -14,6 +14,8 @@
#include "HAL/SPI.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel spiJNILogLevel = logWARNING;

View File

@@ -14,6 +14,8 @@
#include "HAL/SerialPort.h"
#include "HALUtil.h"
using namespace frc;
// set the logging level
TLogLevel serialJNILogLevel = logWARNING;

View File

@@ -14,6 +14,8 @@
#include "HALUtil.h"
using namespace frc;
TLogLevel solenoidJNILogLevel = logERROR;
#define SOLENOIDJNI_LOG(level) \