Commit Graph

1487 Commits

Author SHA1 Message Date
Thad House
ea6876e81f Some general HAL cleanups (#153) 2016-07-09 17:38:18 -07:00
Tyler Veness
aa9c2b2c92 Made Log.h use std::chrono (#136) 2016-07-09 16:58:31 -07:00
Thad House
43a2eccdc9 Finishes Prefix Renames (#152) 2016-07-09 01:12:37 -07:00
Thad House
b637b9ee4c Prepends all HAL functions with HAL_ (#146) 2016-07-09 00:24:26 -07:00
Thad House
5ad28d58ec Switches PWMs to do scaling at the HAL level. (#143) 2016-07-08 21:29:29 -07:00
Thad House
be2647d44e Switches Java to use HAL Constants (#145) 2016-07-08 00:08:07 -07:00
Thad House
4a3e3a6324 Changes DigitalSource API for HAL ease of use (#144) 2016-07-07 21:43:55 -07:00
Thad House
7597e3c274 Switches handle resources to dynamic arrays (#142) 2016-07-07 21:32:41 -07:00
Thad House
0a983eeeb8 Moves Gyros to the HAL (#131) 2016-07-07 21:31:45 -07:00
Austin Shalit
b036bf2e34 Add method to get the port number of a Joystick (#137) 2016-07-04 09:18:28 -07:00
Tyler Veness
73602e6cb4 Added missing include for robot startup macro (#135) 2016-07-03 23:24:56 -07:00
Thad House
72455280a9 Removes unneeded resource includes from WPILibC files (#134) 2016-07-03 23:18:45 -07:00
Thad House
ea95bb85aa Adds Constants from new constants class to encoders (#133) 2016-07-03 21:52:49 -07:00
Thad House
fb865d3ee7 Adds a special exception and status message for a handle error (#127) 2016-07-03 17:27:06 -07:00
Thad House
36ac37db8c Moves Encoders to Handles and Moves WPILib Encoders to HAL (#124) 2016-07-03 15:22:22 -07:00
Thad House
b45e0917ae Adds port constants to the HAL (#130) 2016-07-02 23:19:14 -07:00
Thad House
0e127679c1 Removes some unused variables from DigitalInternal (#128) 2016-07-02 16:33:19 -07:00
Fredric Silberberg
2f36d508c4 Gradle 2.14 (#118)
Updates the gradle version to 2.14. In doing so, some model elements have changed. Additionally, some redundant elements have been removed from the gradle scripts.
2016-07-02 16:32:14 -07:00
Thad House
cf29d4560b Moves HAL PCM objects to header and HAL namespace (#129) 2016-07-02 11:58:49 -07:00
Thad House
8c4ad62422 Switches Solenoids to Handles (#126) 2016-07-02 09:24:54 -07:00
Thad House
62c217cd01 Switches compressor to handles (#125) 2016-07-02 08:22:44 -07:00
Thad House
0f105a26f7 Switches Counters to Handles (#123) 2016-07-01 00:29:08 -07:00
Thad House
47694ef810 Switches DigitalPWM to Handles (#121) 2016-06-30 23:43:00 -07:00
Thad House
f77a976fbb Switches resource errors to AllocationExceptions in JNI (#122) 2016-06-30 21:39:55 -07:00
Thad House
3593ecb17e Switches PWM and DIO to Handles (#120) 2016-06-30 21:39:09 -07:00
Thad House
9b2af0d090 Switches relays to handles (#119) 2016-06-29 19:58:14 -06:00
Thad House
e8e052712e Switches AnalogInputs and AnalogTriggers to Handles (#117)
Results in a breaking change to AnalogTrigger int constructor. If a user wants
multiple AnalogTriggers, they must use the AnalogInput constructor.
2016-06-27 21:32:30 -07:00
Thad House
77a1af44c4 Removes freePort from the HAL (#116)
It was a no-op, and most likely in the future it will be that way too.
Removing to clean up the API.
2016-06-27 13:38:33 -07:00
Thad House
5e2a76147c Moves handle definitions to main handle header (#115) 2016-06-27 13:36:38 -07:00
Thad House
e1d4845ccd Move Analog Outputs to Handles (#112) 2016-06-27 11:32:40 -07:00
PatrickPenguinTurtle
95d40ed01f Fixed issue with digital outputs used as pwm on mxp (#14)
When a digital output object that was tied to an mxp pin had enable pwm called on it
it would pwm on a pin 6 lower
 (although if this wasn't an mxp pin it wouldn't do anything at all.)
Fixed in Digital.cpp by adding 6 if it is an MXP pin in setPWMOutputChannel()
This should fix the CanJaguar test because when digitalOutputs used as PWM
were freed, the PWM generator was set to the number of pins, which meant it
was actually outputing on pin 20.

Change-Id: Ib48db3e6e3bf78659622145969d24011cc231ea6

Updated Hal to include some documentation about swaping mxp pins.

Cannot find NI related documentation as to the pin numbers being wrong though

Change-Id: I71d84431dc9bc7bf22aa29b6633e49723311b5f7

fixed formatting on changed files

Change-Id: I5b7c16cd798132b6b20c1d03f334a95b42d2ee11
2016-06-24 19:46:43 -07:00
Tyler Veness
aa22d4c33b Clarified that PID controller runs in discrete time (#107)
This was added to explain the apparent oversight with respect to controller behavior with different sample rates.
2016-06-20 23:25:23 -07:00
Thad House
046e043c4e Moves Interrupts over to Handles instead of pointers (#99) 2016-06-20 23:22:48 -07:00
Thad House
74fc10999b Fixes preferences formatting (#108) 2016-06-20 22:17:40 -07:00
Tyler Veness
cee9b2609d Added std:: prefix to more C standard library uses (#106) 2016-06-19 00:19:45 -07:00
Tyler Veness
daa0260a4e Deduplicated UsageReporting definitions (#104) 2016-06-19 00:15:57 -07:00
Tyler Veness
d66c61a36e Cleaned up robot startup and cleanup/shutdown code (#77)
Cleaned up RobotBase, removed singleton list from SensorBase, and removed unused typedefs and NULL_TASK macro from HAL's Task.hpp. Making the robot class instance static fixed non-POD statics used by the instance during destruction from being destroyed first.
2016-06-19 00:13:18 -07:00
Tyler Veness
ecc210f99a Rename Notifier::m_handlerMutex to Notifier::m_notifyMutex (#105)
A month ago, we discussed renaming this mutex to better reflect its current use, and this commit does that. The inline comment was also updated.
2016-06-18 02:20:29 -07:00
Thad House
3cacc2aba6 Switches indexed handles to shared_ptr (#101)
As discussed, the old method of was going to have issues, and was not
going to help in the case of the structs containing pointers. I think we
are just going to have to be careful, as guarenteeing the internal
pointers are const is going to be very difficult.
2016-06-18 00:59:53 -07:00
Peter Johnson
085c47b671 Unbreak wpilibc WritePreferencesToFile test. (#103)
ntcore recently changed GlobalDeleteAll() to not delete persistent values.
This test was relying on the old behavior to provide a clean slate.
2016-06-18 00:58:22 -07:00
Thad House
039515082a Fixes formatting in error.cpp (#102) 2016-06-17 21:35:00 -07:00
Thad House
c3908660b1 Switches all HAL Handle errors to be zero (#100)
As discussed, we don't really need the error checking specifically, as
we are just going to throw exceptions anyway, so this will make sure you
can check for 0 and be sure you catch any handle errors.
2016-06-17 20:21:25 -07:00
Thad House
fc515f4572 Changes HAL Port from a pointer to a handle (#93)
HAL Port is using a special handle, where the module and pin are bit
shifted straight into the handle. This is one of the few special cases
we have, but for the way port is used it is much cleaner and uses much
less memory.  Plus it is generic and not specific to one type.
2016-06-05 15:23:58 -07:00
Tyler Veness
5a82f73d9b Replaced .h C headers with c-prefixed version and added std:: prefix to C standard library usage (#90)
This was not done to stdint.h for brevity in type names. Also removed "using namespace std;".
2016-06-05 07:33:37 -07:00
Thad House
776a991d61 Moves Notifier over to handles (#97)
Internally, the linked list now uses shared_ptrs instead of raw
pointers. In addition, in the WPILib the notifier handle is now made
atomic. Then before the class is destructed, the handle is now set to 0.
This should help solve one of the existing race conditions. A 0 handle
is correctly handled down at the HAL level.
2016-06-05 07:29:47 -07:00
Thad House
8527f2c2a1 Fixes HandleResource classes (#95)
Issues were found when adding unit testing. The classes should now work
properly.
2016-06-03 11:24:58 -07:00
Thad House
c85b72b952 Fixes a few bugs in the initial handle implementation (#94)
Failure to check for invalid type on handle creation, and handle type
check was broken.
2016-06-01 20:12:50 -07:00
Peter Johnson
f0d9e19b5c ErrorBase: change to ostringstream. (#66)
This fixes a snprintf issue on 64-bit platforms by avoiding the use
of snprintf.
2016-06-01 00:12:55 -07:00
Tyler Veness
c7c011813f Made include ordering/organization more explicit in style guide (#86) 2016-05-31 23:46:44 -07:00
Thad House
d76f0d4022 Adds support for Handles to the HAL (#91)
Handles will be replacing opaque pointers in the HAL for better compatibility and easier error checking. This commits adds the initial resource manangement and definition for handles.
2016-05-31 23:45:47 -07:00