mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Update headers and .sos to v15 image + most API changes
Java still does not work Change-Id: I172ac401a07b6703909068f82b7b6cc67e6075c0
This commit is contained in:
@@ -13,7 +13,8 @@ void* initializeInterrupts(uint32_t interruptIndex, bool watcher, int32_t *statu
|
||||
// Expects the calling leaf class to allocate an interrupt index.
|
||||
anInterrupt->anInterrupt = tInterrupt::create(interruptIndex, status);
|
||||
anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status);
|
||||
anInterrupt->manager = new tInterruptManager(1 << interruptIndex, watcher, status);
|
||||
anInterrupt->manager = new tInterruptManager(
|
||||
(1 << interruptIndex) | (1 << (interruptIndex + 8)), watcher, status);
|
||||
return anInterrupt;
|
||||
}
|
||||
|
||||
@@ -29,16 +30,29 @@ void cleanInterrupts(void* interrupt_pointer, int32_t *status)
|
||||
/**
|
||||
* In synchronous mode, wait for the defined interrupt to occur.
|
||||
* @param timeout Timeout in seconds
|
||||
* @param ignorePrevious If true, ignore interrupts that happened before
|
||||
* waitForInterrupt was called.
|
||||
* @return The mask of interrupts that fired.
|
||||
*/
|
||||
void waitForInterrupt(void* interrupt_pointer, double timeout, int32_t *status)
|
||||
uint32_t waitForInterrupt(void* interrupt_pointer, double timeout, bool ignorePrevious, int32_t *status)
|
||||
{
|
||||
uint32_t result;
|
||||
Interrupt* anInterrupt = (Interrupt*)interrupt_pointer;
|
||||
anInterrupt->manager->watch((int32_t)(timeout * 1e3), status);
|
||||
|
||||
result = anInterrupt->manager->watch((int32_t)(timeout * 1e3), ignorePrevious, status);
|
||||
|
||||
// Don't report a timeout as an error - the return code is enough to tell
|
||||
// that a timeout happened.
|
||||
if(*status == -NiFpga_Status_IrqTimeout) {
|
||||
*status = NiFpga_Status_Success;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable interrupts to occur on this input.
|
||||
* oInterrupts are disabled when the RequestInterrupt call is made. This gives time to do the
|
||||
* Interrupts are disabled when the RequestInterrupt call is made. This gives time to do the
|
||||
* setup of the other options before starting to field interrupts.
|
||||
*/
|
||||
void enableInterrupts(void* interrupt_pointer, int32_t *status)
|
||||
@@ -52,21 +66,31 @@ void enableInterrupts(void* interrupt_pointer, int32_t *status)
|
||||
*/
|
||||
void disableInterrupts(void* interrupt_pointer, int32_t *status)
|
||||
{
|
||||
|
||||
Interrupt* anInterrupt = (Interrupt*)interrupt_pointer;
|
||||
anInterrupt->manager->disable(status);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the timestamp for the interrupt that occurred most recently.
|
||||
* Return the timestamp for the rising interrupt that occurred most recently.
|
||||
* This is in the same time domain as GetClock().
|
||||
* @return Timestamp in seconds since boot.
|
||||
*/
|
||||
double readInterruptTimestamp(void* interrupt_pointer, int32_t *status)
|
||||
double readRisingTimestamp(void* interrupt_pointer, int32_t *status)
|
||||
{
|
||||
Interrupt* anInterrupt = (Interrupt*)interrupt_pointer;
|
||||
uint32_t timestamp = anInterrupt->anInterrupt->readTimeStamp(status);
|
||||
uint32_t timestamp = anInterrupt->anInterrupt->readRisingTimeStamp(status);
|
||||
return timestamp * 1e-6;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the timestamp for the falling interrupt that occurred most recently.
|
||||
* This is in the same time domain as GetClock().
|
||||
* @return Timestamp in seconds since boot.
|
||||
*/
|
||||
double readFallingTimestamp(void* interrupt_pointer, int32_t *status)
|
||||
{
|
||||
Interrupt* anInterrupt = (Interrupt*)interrupt_pointer;
|
||||
uint32_t timestamp = anInterrupt->anInterrupt->readFallingTimeStamp(status);
|
||||
return timestamp * 1e-6;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user