Peter Johnson
46ad95512e
SimDeviceData: Add missing null check
2019-10-21 16:16:17 -07:00
Thad House
46303a8221
Add messaging to extension loading in the HAL ( #1926 )
2019-10-09 22:25:02 -07:00
Peter Johnson
55a844a3e1
HAL sim: Add encoder channel B access
2019-10-06 17:28:39 -07:00
Peter Johnson
aa90645865
Add ability to associate other devices with a SimDevice
...
Implemented only for AnalogInput, DIO, and Encoder.
2019-10-05 22:39:00 -07:00
Peter Johnson
81c2c8a7de
Add simulation generic device/value support
...
This allows high-level library classes to implement enhanced simulation
support even if no low-level corresponding simulation library exists, and
avoids the need for bit-banging complex interfaces like SPI or CAN.
2019-10-05 22:39:00 -07:00
Peter Johnson
e8d6f8a2c1
Move mockdata/HAL_Value.h to hal/Value.h
...
Also prefix the MakeBoolean et al functions with HAL_ to avoid namespace
pollution.
2019-10-05 22:39:00 -07:00
Thad House
cb54602d49
Add support for writing RTR CAN Frames to the CAN API ( #1900 )
2019-09-28 16:49:34 -07:00
Thad House
9f740e5905
Use OS for serial port instead of NI VISA ( #1875 )
2019-09-28 16:49:11 -07:00
Peter Johnson
b23baf611a
Add ability to run robot main loop in a separate thread ( #1895 )
...
Default behavior is still to run the robot main loop in the main thread.
The ability to run the robot main loop in a separate thread and add a hook
for running a different function in the main thread is needed for simulation
GUI support on some platforms.
2019-09-28 15:43:24 -07:00
Thad House
8858ec55c7
Remove periodic can read call ( #1868 )
...
It is not necessary anymore, and is a complicated and confusing API to keep around.
2019-09-28 15:38:58 -07:00
CodingWithFusion
41efb8015d
Update CANAPITypes.h ( #1860 )
...
Add Playing With Fusion to CAN manufacturer list.
2019-09-28 15:33:18 -07:00
Thad House
c93be1b2d5
Remove LabVIEW HAL support ( #1901 )
2019-09-28 15:31:43 -07:00
Thad House
f49859ebfd
Remove NI VISA headers, as they are now included in NI Libraries ( #1879 )
2019-09-07 23:01:27 -05:00
Thad House
dd928b4cbf
Remove JNI logging ( #1872 )
2019-09-06 20:42:40 -05:00
Thad House
516cbef2c4
Remove RoboRIO ifdef from simulation headers ( #1859 )
2019-09-03 19:55:17 -07:00
Tyler Veness
1fb3011235
Add MathUtils.clamp() for Java ( #1861 )
...
Also use std::clamp() and MathUtils.clamp() in as many places as
possible in place of custom clamp functions or if statements.
2019-08-28 23:24:30 -07:00
Peter Johnson
a0be07c370
Refactor HAL handle move construction/assignment ( #1845 )
...
A templated hal::Handle class is used to wrap handles to make them move-only.
This eliminates a lot of boilerplate move constructor/assignment code
in the main WPILib classes. HAL_SPIPort and HAL_I2CPort are also wrapped.
The wrapper class does not implement destruction. This would require the
wrapper class to be handle-specific (rather than generic) and would result
in more code added than it removed, plus would add header dependencies on
more HAL headers. In addition, some HAL handle release functions are more
complex (e.g. have return values) and can't be easily mapped to a destructor.
2019-08-25 18:42:00 -07:00
Thad House
a4530243e1
HAL sim: Fix incorrectly setting dio port to initialized on cleanup ( #1813 )
2019-08-09 16:14:46 -07:00
Thad House
6411bd79c6
InterruptableSensorBase: Fix callback function deletion ( #1807 )
...
Save the callback function into a unique_ptr member instead.
2019-08-04 20:25:25 -07:00
Austin Shalit
df12fc2a86
Java cleanups ( #1776 )
...
* Remove extra ';'s
* Remove unnecessary conversions to String
* Use StandardCharsets object
* Replace infinite while with check for interrupted thread
* Remove redundant local vars
* Remove redundant throws clause
* Remove redundant primitive wrapping
* Fix malformed Nested class test
* Remove unnecessary unboxing
* Remove unnecessary explicit type argument
* Replace lambdas with method references
* Replace statement lambdas with expression lambdas
* Replace null check with method call
* Replace number comparison with method call
* Fix broken javadoc comments
* Replace Arrays.asList with singletonLists
* Remove excessive lambda usage
* Remove redundant string operation
* Remove redundant type casts
* Remove unnecessary returns
* Remove redundant suppressions
* Fix unresolved file reference
* static analysis fixes
2019-07-31 22:19:48 -07:00
Thad House
48fe54271a
Add HALSIM_SetSendError implementation ( #1773 )
2019-07-23 23:55:51 -07:00
Tyler Veness
62be0392b6
Replace std::lock_guard and std::lock with std::scoped_lock ( #1758 )
...
std::scoped_lock was introduced in C++17 and is strictly better than
std::lock_guard as it supports locking any number of mutexes safely.
It's also easier to use than std::lock for locking multiple mutexes at
once.
2019-07-08 22:58:39 -07:00
Tyler Veness
841ef5d739
Remove template types from lock RAII wrapper usages ( #1756 )
...
C++17 has template type autodeduction. These wrappers include
std::lock_guard and std::unique_lock.
2019-07-07 19:17:14 -07:00
Thad House
a6b0e9b856
Only disable execution of cross compile google tests ( #1741 )
...
Still build them and link them, just don't execute them.
Google test is still disabled completely for the HAL and wpilibc.
2019-06-29 21:31:27 -07:00
Austin Shalit
f7cfdd7cee
Replace crlf line endings with lf ( #1731 )
2019-06-28 20:55:14 -07:00
Thad House
3dfb01d45b
Update to new Native Utils ( #1696 )
...
Also update to azure 2019 windows image
2019-06-28 14:09:10 -07:00
Benjamin Ward
c08fd6682f
Update CAN manufacturer list ( #1706 )
2019-06-26 14:16:12 -07:00
Peter Johnson
372ca4f456
cmake: Enable googletest unit tests ( #1720 )
...
Also don't inherit compile warnings from wpiutil
There's not a good way to disable inherited compiler flags.
2019-06-23 12:44:28 -07:00
Peter Johnson
223d47af0e
HALSIM: support mocking of HAL_SendError() ( #1728 )
2019-06-23 11:48:04 -07:00
Thad House
221e66f46d
Allow disabling static init of JNI libraries ( #1672 )
2019-06-10 22:29:32 -07:00
Thad House
221011494d
Update for C++17 and fix MSVC warnings ( #1694 )
...
* Update MSVC arguments
* Fix json allocator
* Fix simulation diamond
* Bump gtest
* Remove empty varargs in unit tests
* Replace test case with test suite
* Remove deprecation warning in optional
* Remove need for NOMIXMAX to be defined in wpilib headers
2019-05-31 15:43:32 -05:00
Thad House
90957aeea4
Move libuv to its own subfolder in build ( #1661 )
...
Allows using system libuv
* Fix Gradle Build and include dirs
* Update cmake find to support vcpkg libuv
2019-05-30 15:59:26 -07:00
Tyler Veness
f432f65bef
Update copyright year in license to 2019 ( #1524 )
...
Also update clang-format to 6.0.
2019-05-17 17:35:09 -07:00
David Vo
f42905b32e
Include missing headers in HAL.h ( #1660 )
...
* Include CANAPI.h and Encoder.h in HAL.h
* Include Threads.h in HAL.h
* Make Threads.h C compatible
Also changes the #define to a typedef.
2019-04-27 21:52:54 -07:00
Tyler Veness
d3affb16bc
Make failure of HAL_GetFPGATime() more descriptive ( #1633 )
2019-04-27 20:34:14 -07:00
Thad House
4e0c10f488
Fix CAN Clean using wrong ID ( #1668 )
2019-04-27 20:24:40 -07:00
Thad House
655763a9a7
Limit length of message sent to DS SendError call ( #1618 )
...
If total length is over 65536, the packet will get thrown out.
This can be a problem in stack overflow cases (e.g. infinite recursion).
2019-03-03 15:43:04 -08:00
Thad House
99e4f7dd2c
Fix SPI CS1 not working correctly ( #1614 )
...
It was failing the check when remapping digital sources
2019-02-25 18:48:22 -08:00
Thad House
997d4fdf47
Update HAL GetStackTrace to properly report user errors ( #1594 )
...
With the move of the HAL, the old value no longer worked, as the JNI call is in a different namespace
2019-02-11 20:17:31 -08:00
Thad House
8a9822a96b
Allow multiple instances of the same PDP ( #1582 )
...
Previously multiple instances would overrun with each other. This make all instances get the same HAL handle.
2019-02-06 22:51:34 -08:00
Peter Johnson
453a9047e4
Fix cmake hal sim build ( #1539 )
...
A source directory was named incorrectly in CamelCase.
2019-01-11 02:38:35 -08:00
Peter Johnson
e97e7a7611
Add DriverStationSim.notifyNewData ( #1537 )
2019-01-09 23:47:42 -08:00
Thad House
d46ce13ffe
Fix CAN API timing out incorrectly ( #1497 )
...
HAL_GetFPGATime returns 0 if it starts with a non zero status.
Always use monotonic clock for CAN times, rather then trying to sync FPGA.
Change timeout from 50 ms to 100 ms.
2018-12-29 13:57:23 -08:00
Thad House
6593f4346e
Default to DS attached to true in sim ( #1500 )
...
Otherwise, it is required to be set manually, which isn't obvious.
This is because the HighLevel DS classes check that the ds is attached before enabling
2018-12-24 02:06:53 -06:00
Thad House
ca2acec88c
Update to NI Libraries 2019v12 ( #1492 )
2018-12-21 00:24:44 -08:00
Thad House
3721463eb3
Don't use symbolic path searching for USB detection ( #1491 )
...
The USB directories we care about are not symbolic links, so we can ignore them.
There was a recursive symbolic link, which was causing failure.
2018-12-19 14:40:01 -08:00
Thad House
1823cb2b68
Fix periodic can packets not being received properly ( #1488 )
...
Constant calls would result in timeout, because a valid packet wasn't being returned early.
Also fix data copies (was copying in wrong direction).
2018-12-14 17:43:48 -08:00
Peter Johnson
dcbf02a1ec
Update auto SPI for timestamp changes ( #1457 )
...
The 2019 FPGA image switched the output of auto SPI from plain bytes to a
sequence of 32-bit words (timestamp, then words with the byte values in the
least significant byte of each word).
In addition to changing the HAL and simulators to reflect this, add piecewise
integration support to wpilibc/wpilibj SPI to take advantage of the timestamps
and use it in the ADXRS450 gyro.
2018-12-06 22:29:20 -08:00
Thad House
7e1ec28839
NI image 2019v9 ( #1467 )
2018-12-06 21:59:13 -08:00
Dustin Spicuzza
0d0492bfcc
HAL: Add additional error messages to HAL_GetErrorMessage ( #965 )
2018-12-01 00:06:30 -08:00