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
Austin Schuh
9207d788ab
Convert ReadInterrupt* to return int64_t time ( #1417 )
...
HAL_ReadInterruptRisingTimestamp and HAL_ReadInterruptFallingTimestamp
return time as a double. Instead, keep the raw integer count and move the
double conversion into the C++ and Java code. This enables comparison of the
time with other timers.
2018-11-15 21:22:03 -08:00
Thad House
ecd376be4c
Export C functions from JNI statically linked library ( #1425 )
...
The JNI libraries are useful from other tools, so they should contain the C functions.
2018-11-12 19:38:35 -08:00
Thad House
2e3e3a47b9
Use a kill -9 after attemting a safe kill ( #1397 )
...
Should fix some deploy deadlocks.
2018-11-01 01:55:26 -07:00
Thad House
1dec0393a1
Fix static deletion race condition in DS thread ( #1396 )
...
The static condition variable was getting destroyed before the DS thread exited,
resulting in a deadlock on program exit when the DS thread tried to notify it.
This change moves the condition variable into the DS thread to avoid the race.
2018-10-30 11:51:17 -07:00
Thad House
f0b0965f9b
Remove large HAL headers from wpilibc headers ( #1386 )
...
Now only includes the types in the wpilib headers.
Should immensely clean up intellisense.
Closes #1383
2018-10-29 12:49:17 -07:00
Tyler Veness
e89d5eb692
Fix stringop truncation warning from GCC 8.2 ( #1393 )
...
The next line adds a null terminator, but it's cleaner to just do a
std::memcpy() since the code already assumes a null terminator exists in
the source string.
2018-10-29 00:09:53 -07:00
Thad House
9174f23f36
Remove some usages of windows.h ( #1370 )
...
For HAL and wpilib, we don't need them, especially where they were being used.
2018-10-28 22:33:55 -07:00
Thad House
a8aacd3657
Update build setup for raspbian and debug binaries ( #1384 )
...
- Build both debug and release binaries
- Append "d" to debug libraries in the style of opencv
- Split shared and static classifiers
- Add raspbian support
2018-10-27 00:19:38 -07:00
Liam Kinne
349e273ecc
AnalogGyro: add "calibrating for n seconds" message ( #1380 )
2018-10-23 00:29:23 -07:00
Tyler Veness
8b1274d744
Replace typedefs in C++ with using declarations ( #1339 )
...
These are more readable than typedefs. C headers were left alone.
2018-09-26 00:09:25 -07:00
Thad House
32ec07ee01
Throw correct exception in HAL_getJoystickAxes/POVs JNI ( #1336 )
...
Was incorrectly not returning immediately after throwing the exception.
Also add more detail to exception.
2018-09-24 22:17:17 -07:00
Tyler Veness
467c9fd686
Add kInvalid value to HAL_I2CPort and HAL_SPIPort ( #1329 )
...
This allows HAL_CloseI2C() and HAL_CloseSPI() to be noops, which makes
enabling move semantics in the I2C and SPI wpilibc classes easier and
cleaner.
Fixes #1328 .
2018-09-23 21:14:04 -07:00
Thad House
f89274fb13
Fix hal header zip task dependencies ( #1327 )
...
Sometimes wouldn't include generated header file
2018-09-21 12:04:11 -07:00
Thad House
e26e3b6aa8
Fix HAL Headers Zip ( #1325 )
...
Was generating file into wrong directory
2018-09-21 10:51:17 -07:00
Thad House
e210073044
Move HAL classes to their own base package ( #1317 )
...
Needed for modularization.
2018-09-20 21:59:46 -07:00
Thad House
d2a5aaafdd
Use external dependencies for NI and NetComm libraries ( #1304 )
...
This removes a number of large binary files from the repo and enables vendors
to depend on these libraries separately.
2018-09-19 21:57:58 -07:00
Peter Johnson
c0ff6198b3
Change hal sim to use spinlocks ( #1291 )
...
This makes callback registration completely thread safe.
This patch also uses templates and macros to dramatically reduce the amount of
manual boilerplate.
2018-09-03 16:08:07 -07:00