Commit Graph

31 Commits

Author SHA1 Message Date
Tyler Veness
055ee09825 Fixed current and potential bugs caught by Coverity
Change-Id: I9f9d09dc797ffea062eeb49c881be1d5acb63d7b
2015-11-28 11:08:12 -08:00
Thad House
2f2184e8ce Makes HALSetDataSem take a MULTIWAIT_ID rather then a NATIVE_MULTIWAIT_ID
Having the HAL take a NATIVE_MULTIWAIT_ID without any way to get that
structure from extern "C" code is a problem. This makes it so it just
takes a MULTIWAIT_ID, and then grabs the native handle inside the HAL.

Change-Id: I06da18ba34adcea2f16e4e53da672f38be79e28e
Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com>
2015-11-27 22:33:28 -08:00
Thad House
de39877efb artf4153 Adds HAL structure memory management
In the current HAL, once the port structures were created, there was no
way to free the structures. The way the C++ libraries were written this
wasn't a problem, since it grabbed a copy of each and stored them in an
array on bootup. However java does not do this, and grabs new ports
every time an object is created. This causes memory leaks if an object
is ever disposed in java. The same thing looks to be happening in
python, and C# does it too currently, but that would change if this gets
merged.

Adds java memory management fixes

Adds memory management to AnalogInput and Analog Output C++

SolenoidPorts and Digital Ports are all hold static arrays with their
port pointers (although solenoid overwrites them if a new solenoid on
the same module is created), however analog always grabbed new pointers.
I would fix the solenoid one, but I don't know what the ideal way to do
it would be.

Silently ignores free(null) calls by checking passed parameter is non-null.

Change-Id: Id32993b57b53f896e46e55c97541d3bd90b52648
2015-11-27 22:02:02 -08:00
Tyler Veness
231178c26a HALUsageReporting::kFramework_Simple was renamed to match the corresponding robot framework's name
Change-Id: I2ad0f8d48cabe5f6c1adf622cf5377eb5be362f7
2015-11-02 23:23:57 -08:00
peter mitrano
4514e4489a refactored HAL library
builds two libraries, Athena  and Desktop.
Simulation should use Desktop, Robots should use Athena

Also:
 - copied Driverstation and Joystick from Devices into Sim
 - Descreased dependency of pthreads in JNI.
 - removed Simulation ifdef from non simulation
 - added missing decprecated attribute for msvc
 - removed usage reporting from sim
 - removed unused pom.xml and constexpr

Change-Id: If8eb540f9434dce17c77a245fda6985713e80b2d
2015-08-20 11:22:42 -04: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
jmanning
bf4ccf13d9 Added functions to get names, HID types and isXbox descriptors from joysticks.
Change-Id: I3cd6ebc04d64398f05001cd008696e13ee1ab6ea
2015-06-24 10:56:59 -04:00
Kevin O'Connor
8b71ddc30f Fix usage reporting for new motor controllers and Analog output
Change-Id: I574e431ae551ecf8efc90c004abf14568f22c068
2015-06-02 09:46:09 -04:00
Dustin Spicuzza
7636041393 Don't use raw type for HALSetNewDataSem
Change-Id: Ifb6561a33b8e0c49072f9d9c00a2c9c8f4cc3fe3
2014-12-12 15:26:47 -05:00
Kevin O'Connor
dac04cb4a2 Implement Joystick Outputs and Rumble (fixes artf3807)
Change-Id: I7e2fa3990f47b6c51ae498035878a29c02817c1b
2014-12-05 12:24:50 -05:00
James Kuszmaul
28a41e4ac2 Added support for CAN Talon SRX in C++ and Java.
Currently, the JNI bindings are generated by Swig and, unfortunately,
  the interface available through Java is lower-level than that for C++
  (ie, direct access to the ctre code through the JNI bindings, rather
   than an interface on top of that), but it does work.
See eclipse plugins for some short samples.
There are a couple of short unit tests as placeholders.
Still needs some cleaning up.

Change-Id: Iae2f74693ca6b80bf7d5aca0625c66aa6e0b7f85

Added quick samples for C++/Java CAN Talon stuff.

Change-Id: I3acb27d6fd5568d88931e0d678c09973d436735d
2014-11-26 11:55:37 -05:00
Kevin O'Connor
7e5ed03d28 Check if Joystick Button exists when requested and pass 0 and warn if it doesn't
Change-Id: I2194859ef8b263f1a20aba52ec154fb0a1fc8078
2014-11-21 12:07:08 -05:00
Kevin O'Connor
14a1e6ae8e Get MatchTime from NetComms (fixes artf2538)
Change-Id: I7ea438ce4610087bceac696a958e3c1e3ead238a
2014-11-21 10:37:29 -05:00
Kevin O'Connor
e73b3ed7b5 Add methods for checking Watchdog status, ds status, and brownout status
Change-Id: I723c87d0c50612cbffbb81b0e039efd0ef05fcd0
2014-11-18 15:56:59 -05:00
Fredric Silberberg
c6891fc034 Added in new headers and libraries for image version 18. This image contains a change to fix artf3773, which switched setDataSem to be a pthread_cond_t variable instead of a mutex. As a result, a few new HAL functions had to be exposed over JNI, specifically the functions for MultiWait.
Change-Id: I28be07c8102acb078440ee74ded46527328dd271
2014-11-16 17:01:44 -05:00
James Kuszmaul
f1476be276 Reverted accidental commits
Change-Id: Ieee3600da11df698f1025c85972acd979e486aa0
2014-11-14 15:28:48 -05:00
Thomas Clark
c1f68eb2b0 Stick the CanTalonSrx code in, get it to compile
There's a CANTalon class, but it doesn' do anything yet

Change-Id: Ib397db6fc0376f9de95e5efc42a223700be3dbca
2014-11-14 15:21:12 -05:00
Kevin O'Connor
6b6e5d9530 Move SerialPort to HAL and add SerialPort support for Java
Squashed commit of the following:

commit 4359262e2fef69b1646e3d76641fe622a78dfd89
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Wed Oct 29 13:43:12 2014 -0400

    Add SerialPort to JNI and modify Java SerialPort to use it.

    Change-Id: Id3e6fa538a50e6a96274d8fb1be546dc396fc9c6

commit 114b192388c2fb01745cb3d5ad83612e9d66ea83
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Oct 28 15:46:06 2014 -0400

    Move Serial port handling to HAL and define serial errors

    Change-Id: I4cc73b64d71aafacb410bce080cb29e5fdf565a3

Change-Id: I35b729ad502137ee4c877a415d78007861991e31
2014-11-05 13:58:14 -05:00
Thomas Clark
8a541a67ca Add new joystick features
Axis counts other than six and POVs are both present in C++ and Java now

Add dynamic joystick axis counts, up to 12

Change-Id: Ieade5e61a89df822df8702cb32326e4635558778

Add support for POVs in C++

Change-Id: I12dc0fcaca605a256ddcf990eebde45767229171

Make POVs work in Java

Change-Id: Ie2d98adb416c1930f058bdd21c3e7d26289df503
2014-10-17 16:39:10 -04:00
Thomas Clark
d2cd5f3571 Implement DriverStation::GetBatteryVoltage
Make the GetBatteryVoltage method work using the new tPower header

Change-Id: If504f8a46f3f7f737f0b729b72fc6b5da0d29ff9
2014-08-11 11:56:10 -04:00
Thomas Clark
5b8279f404 Remove old driver station code
We don't need to send status data from the user program anymore

Change-Id: Ifbdb037cfb4e36681914dd7a3a2f5c56cbead6a2
2014-08-08 11:23:03 -04:00
Thomas Clark
8abbcf53f4 Update to the v13 headers and libraries
Add all of the most recent headers and .SOs

Also make DriverStation work with the new FRC comm protocol, using the new
functions for getting status data

Change-Id: I1c7fc5f90e72c5fbebf87d9923ce0967ed0ef3bc

Initial HAL support for v13 ds

Change-Id: I9a7f37ef8e24241598fa3981cb3df30c07c52e0f

New ds stuff in the HAL

Change-Id: I025910625453baf63f79f49bbc70ba8b2f093f50

New ds stuff in C++

Joysticks are still todo

Driver station IO is pulled out

Change-Id: I1bb59037c097713bd943e7bef00e12f67f13c3ac

New ds works in C++ and Java.  Joysticks still todo

Change-Id: Ic93f8686856761badc592eceaf05964f52355578

Make joysticks work again with the v13 image protocol

Change-Id: Ief7ee95d3398c2262ca07ab7d60499af3c8f60f7
2014-08-07 16:37:02 -04:00
Thomas Clark
32cafd0efc Removed the User LED functions
There is no "User" LED on the RoboRIO, these functions didn't
do anything.

Change-Id: I8d2eaf0efde90cc444503a79f26d591ddaaa6322
2014-08-05 10:35:00 -04:00
Thomas Clark
6deb196e90 Support for the "USER" button on the RoboRIO
You can get the state of the USER button with GetUserButton() in
C++ or Utility.getUserButton() in java.

Change-Id: I923e62cab5e621ef43fed503acab5c0d751264fb
2014-07-29 14:42:08 -04:00
thomasclark
ec2a455bc7 Added HAL methods for using the built-in accelerometer
Change-Id: I5372f5df9b29c546dab3913fcf983a7a9a5427dc
2014-07-21 08:49:51 -04:00
thomasclark
8bba58b9ab Added generic CAN methods to the HAL
Packing, unpacking, caching, receiving, and sending CAN messages can be done
with a thin wrapper around CANSessionMux now, removing the need for duplicated
code between different CAN devices and languages.

Change-Id: If40181e479f45a443db7a1c264437f7f89ff54d9
2014-07-11 11:38:22 -04:00
thomasclark
187aa7a138 Support for the CAN power distribution panel
Change-Id: If4f8f7f050bf1095221cf16f030a6a8a67532656
2014-05-30 14:11:42 -04:00
thomasclark
5d21444c42 Fixed a missing include
Change-Id: I159dd15cd8f429343e9eda39c0cc49292618bae8
2014-05-29 18:37:31 -04:00
thomasclark
b219d19153 Fixed several files to use .hpp headers
Change-Id: I2a9ed167c18188b32a746e65dc3b08853b371dc4
2014-05-29 18:12:43 -04:00
thomasclark
447cec4df8 Support for the CAN pneumatics module in C++ and Java
Change-Id: Iba66f8b51d7471a60ec33d38354a2f0853cc31df
2014-05-29 15:01:07 -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