mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Switches HAL to fixed length signed integers, and adds our own HAL_Bool Type (#155)
* Switches HAL to fixed length signed integers, and adds our own HAL_Bool type * Replaces HAL Floats with Doubles Doubles are just as fast as floats with optimizations turned on, so switches to all doubles. All made doubles for consistency. * Prepends HAL/ to HAL include files. Also fixes some range errors
This commit is contained in:
committed by
Peter Johnson
parent
4a98e68815
commit
b51e85ae26
@@ -35,7 +35,7 @@ AnalogTrigger::AnalogTrigger(int32_t channel)
|
||||
AnalogTrigger::AnalogTrigger(AnalogInput* input) {
|
||||
m_analogInput = input;
|
||||
int32_t status = 0;
|
||||
uint32_t index = 0;
|
||||
int32_t index = 0;
|
||||
m_trigger = HAL_InitializeAnalogTrigger(input->m_port, &index, &status);
|
||||
if (status != 0) {
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
@@ -128,8 +128,8 @@ void AnalogTrigger::SetFiltered(bool useFilteredValue) {
|
||||
*
|
||||
* @return The index of the analog trigger.
|
||||
*/
|
||||
uint32_t AnalogTrigger::GetIndex() const {
|
||||
if (StatusIsFatal()) return std::numeric_limits<uint32_t>::max();
|
||||
int32_t AnalogTrigger::GetIndex() const {
|
||||
if (StatusIsFatal()) return -1;
|
||||
return m_index;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user