Version 4 Image

Updated the HAL library to work with the new version 3 headers
from NI. There were multiple changes in this verison: more PWM
generators were added, so the functions for setting PWM signals have
been updated. UserWatchdog has been removed, and Watchdog has been
removed from WPILib to accomodate for this. Digital selection has been
consolidated to one function in the NI headers, so this has been updated
in the HAL. New SPI and I2C libraries have been added, but need to
be implemented in the HAL before they will work.
This commit is contained in:
Fredric Silberberg
2014-02-25 18:43:40 -05:00
committed by Brad Miller
parent b1ef116104
commit 4546abc8c5
238 changed files with 757 additions and 21785 deletions

View File

@@ -9,11 +9,11 @@
#else
#include <stdint.h>
#endif
#include <cmath>
#include "Analog.h"
#include "Digital.h"
#include "Solenoid.h"
#include "Watchdog.h"
#include "Notifier.h"
#include "Interrupts.h"
#include "Errors.h"
@@ -244,11 +244,11 @@ struct HALCommonControlData{
inline float intToFloat(int value) {
return *(float*) &value;
return (float)value;
}
inline int floatToInt(float value) {
return *(int*) &value;
return round(value);
}
extern "C" {

View File

@@ -1,27 +0,0 @@
#ifdef __vxworks
#include <vxWorks.h>
#else
#include <stdint.h>
#endif
#ifndef HAL_WATCHDOG_H
#define HAL_WATCHDOG_H
extern "C" {
extern const double kDefaultWatchdogExpiration;
void* initializeWatchdog(int32_t *status);
void cleanWatchdog(void* watchdog_pointer, int32_t *status);
bool feedWatchdog(void* watchdog_pointer, int32_t *status);
void killWatchdog(void* watchdog_pointer, int32_t *status);
double getWatchdogLastFed(void* watchdog_pointer, int32_t *status);
double getWatchdogExpiration(void* watchdog_pointer, int32_t *status);
void setWatchdogExpiration(void* watchdog_pointer, double expiration, int32_t *status);
bool getWatchdogEnabled(void* watchdog_pointer, int32_t *status);
void setWatchdogEnabled(void* watchdog_pointer, bool enabled, int32_t *status);
bool isWatchdogAlive(void* watchdog_pointer, int32_t *status);
bool isWatchdogSystemActive(void* watchdog_pointer, int32_t *status);
}
#endif