mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Implements Better Error Messages from the HAL (#172)
* Makes the HAL provide a better error message for certain things. * Makes Java error messages better * Updates C++ errors. * Moves handles header folder to HAL directory
This commit is contained in:
committed by
Peter Johnson
parent
05c00430b3
commit
d2aa168f66
@@ -15,7 +15,9 @@
|
||||
#include "HAL/AnalogOutput.h"
|
||||
#include "HAL/AnalogAccumulator.h"
|
||||
#include "HAL/AnalogTrigger.h"
|
||||
#include "HAL/Ports.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
|
||||
// set the logging level
|
||||
TLogLevel analogJNILogLevel = logWARNING;
|
||||
@@ -41,7 +43,8 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogInputPort(
|
||||
auto analog = HAL_InitializeAnalogInputPort((HAL_PortHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << analog;
|
||||
CheckStatus(env, status);
|
||||
CheckStatusRange(env, 0, HAL_GetNumAnalogInputs(),
|
||||
hal::getPortHandlePin((HAL_PortHandle)id), status);
|
||||
return (jint)analog;
|
||||
}
|
||||
|
||||
@@ -70,7 +73,8 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogOutputPort(
|
||||
HAL_AnalogOutputHandle analog = HAL_InitializeAnalogOutputPort((HAL_PortHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << analog;
|
||||
CheckStatus(env, status);
|
||||
CheckStatusRange(env, 0, HAL_GetNumAnalogOutputs(),
|
||||
hal::getPortHandlePin((HAL_PortHandle)id), status);
|
||||
return (jlong)analog;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user