Commit Graph

5 Commits

Author SHA1 Message Date
Peter Johnson
e2ec34090a Keep track of FPGA time rollovers with 64-bit time.
This allows both greater than 72 minute (2^32 * 1 us) timeouts and also
gracefully handles notifiers across the FPGA time counter rollover.

Change-Id: Ibde0b903155f60b618b0ca4d5f8f6dd49f90b020
2016-01-02 06:29:59 -08:00
Peter Johnson
5dc5ed83b3 Rewrite Java Notifier and update Interrupt JNI.
Notifier takes advantage of the multi-notifier support now in HAL.

Each Notifier is now handled by a separate thread at the JNI level, so
one notifier taking longer to process (or being breakpointed) does not
stop the other notifiers from running.  These threads are configured as
daemon threads.

In both Notifier and Interrupt JNI, the JNI thread attachment no longer
repeatedly calls AttachCurrentThread().  This improves performance but more
importantly avoids impacting the Eclipse debugger, which attempts to
track each call to AttachCurrentThread() as a separate Java thread.

Note: There is currently no way to free an interrupt handler.  Repeatedly
calling attachInterruptHandler() will result in leaking previous handlers.

Change-Id: Ib12e3df88943c03e0269d3906e5b153767139391
2015-12-29 18:33:22 -08:00
Peter Johnson
03c43a46d7 HAL: Add support for multiple Notifiers.
This is a poor man's version of the multi-instance Notifier support in
the higher level languages.  It's intended primarily so that notifiers
can be created internal to the HAL.

One benefit of this change is that the current FPGA timestamp is passed
as the first parameter to the ProcessQueue function (rather than the
useless interrupt mask).

Caution for other languages wrapping the HAL: this adds a parameter to
initializeNotifier().

An atexit hook is used for safe cleanup at program termination.

Change-Id: I782b3a74c10215588ae9b7191906fb4186a81028
2015-11-30 22:00:19 -08:00
Tyler Veness
fd4c169658 artf4149: Removed references to VxWorks
Implemented setTaskPriority() and getTaskPriority() in Task HAL API

Removed all other unimplemented functions in HAL and removed spawnTask()

Replaced instances of pthread_t* with TASK typedef

Removed unused HAL error constants and removed commented-out classes and functions in wpilibj's HALLibrary

Changed Task class API to match the construction semantics of a std::thread

Change-Id: I3bc951a3da90d24c5589fae4d1ca2bb60225c873
2015-07-20 11:49:29 -04:00
Patrick Plenefisch
9b831ed34c Reverting back to static .a files for C++ and fixing lots of other assorted items 2014-05-27 21:26:10 -04:00