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:
Thad House
2016-07-13 20:29:28 -07:00
committed by Peter Johnson
parent 05c00430b3
commit d2aa168f66
51 changed files with 175 additions and 70 deletions

View File

@@ -14,6 +14,8 @@
#include "HAL/DIO.h"
#include "HAL/PWM.h"
#include "HALUtil.h"
#include "HAL/Ports.h"
#include "HAL/handles/HandlesInternal.h"
// set the logging level
TLogLevel dioJNILogLevel = logWARNING;
@@ -41,7 +43,8 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_initializeDIOPort(
auto dio = HAL_InitializeDIOPort((HAL_PortHandle)id, (uint8_t)input, &status);
DIOJNI_LOG(logDEBUG) << "Status = " << status;
DIOJNI_LOG(logDEBUG) << "DIO Handle = " << dio;
CheckStatus(env, status);
CheckStatusRange(env, 0, HAL_GetNumDigitalPins(),
hal::getPortHandlePin((HAL_PortHandle)id), status);
return (jint)dio;
}