Kevin Jaget
fa809b2c4b
[wpilibc] Clean up include files ( #2708 )
...
Based on run of include-what-you-use.org to identify unused include files in various .h and .cpp files.
The changes mostly fall into 3 categories:
- Actually unused includes - copy-paste errors, not removing includes after cleaning up code, etc
- A too-broad include used where a more specific (and hopefully smaller) header will do
- Interface .h files including headers only needed by the .cpp implementation - moving from .h to .cpp
will mean that code which uses the .h doesn't pay the price of processing the header file they don't need
2020-10-03 09:21:03 -07:00
Peter Johnson
c3b3fb8b74
[sim] Change StepTiming to wait for notifiers ( #2603 )
...
Old behavior is available via StepTimingAsync.
This makes it significantly easier to use simulation timing with notifiers.
Also update tests to use simulation framework. This also speeds up the
timing-dependent tests by using simulation timing. ResourceLock is used
in the Java tests to prevent parallel execution.
While we're here, tweak HAL Notifier implementation:
- Use wait_for instead of wait_until in WaitForNotifierAlarm
- Check for triggerTime = UINT64_MAX in UpdateNotifierAlarm
2020-09-27 13:27:53 -07:00
Peter Johnson
f1b1bdb121
[hal] Add HAL_Shutdown and simulation shutdown callbacks
...
This is useful for clean shutdown of simulation extensions.
2020-09-04 16:26:09 -07:00
Peter Johnson
47cc71ea01
[hal] Add HALSIM_GetJoystickCounts
2020-09-02 21:13:38 -07:00
Thad House
7548fdae5d
[hal] Fix InitialzeInterrupts naming ( #2673 )
...
Closes #2605
2020-08-31 00:33:49 -07:00
sciencewhiz
3e41d92c18
[wpilib] Use misspell to fix spelling errors (NFC) ( #2674 )
2020-08-31 00:33:11 -07:00
sciencewhiz
ad6c8b882e
[hal] Fix PDP Energy Calculation ( #2672 )
...
Fixes #2642
2020-08-31 00:31:30 -07:00
Peter Johnson
dc9e560f9b
[sim] Add callback for NotifyNewData
2020-08-15 13:47:30 -07:00
Peter Johnson
ae5b07ba01
[hal] Add stubs for sim joysticks and match info on Rio
2020-08-15 13:47:30 -07:00
Thad House
a6a71f8c76
[hal] Fix RoboRIO notifier never starting ( #2611 )
2020-07-23 18:09:00 -07:00
Peter Johnson
b9feb81226
[sim] Add joystick simulation support ( #2595 )
...
This adds joystick functions to DriverStationSim, and new GenericHIDSim,
JoystickSim, and XboxControllerSim classes.
2020-07-15 00:33:57 -07:00
Peter Johnson
16ef372b53
[hal] Merge WaitForCachedData into WaitForDSData ( #2587 )
...
Remove WaitForCachedData as it's no longer required.
Also properly handle caching / transition detection logic that occurs at the
WPILib level.
This also changes DriverStation::IsNewControlData() to check for WPILib-level
caching instead of wrapping the HAL function.
2020-07-13 21:57:54 -07:00
Peter Johnson
227084e92e
[hal] Implement stub mockdata on RoboRIO ( #2575 )
...
This makes it much more user-friendly to use simulation classes without needing
to ifdef for C++ to avoid linker errors or be very careful about construction
to avoid runtime errors in Java.
2020-07-07 21:49:05 -07:00
Thad House
21aafea098
[hal] Use std::thread for Notifier thread on Rio ( #2152 )
...
This gives us more control over the thread than using the NI manager.
2020-04-03 08:38:00 -07:00
Thad House
7b7f44d937
Use netcomm function to get target class rather then hardcoded ( #2391 )
...
It reports the correct value now, and helps for future proofing
2020-03-14 22:04:12 -07:00
Thad House
6cf89aa0f3
Fix interrupt cancellation ( #2406 )
2020-03-14 22:03:04 -07:00
Thad House
554bda3332
HAL: Expose NetComm SendConsoleLine ( #2337 )
...
This can be use to synchronize writes between threads, assuming writes all go through this and not stdout.
2020-02-18 20:44:40 -08:00
Thad House
2a968df779
Add method for releasing a waiting interrupt ( #2347 )
...
Useful for a new high level interrupt implementation.
2020-02-18 20:41:42 -08:00
Thad House
dbe1e6f466
Fix missing SetDutyCycleSimDevice on Rio ( #2274 )
2020-01-15 21:33:35 -08:00
Thad House
bdc1cab013
Add support for configuring SPI Auto Stall Config ( #2193 )
2019-12-24 12:52:58 -06:00
Thad House
0b80d566ad
Use ChipObject HMB function for LED ( #2173 )
...
It's fixed in v9 and up.
2019-12-14 21:15:32 -08:00
Thad House
24c031d692
Increase SPI auto byte count to allow 32 bytes to be sent ( #2163 )
...
The FPGA now supports 32 bytes.
2019-12-07 17:18:25 -08:00
Thad House
6b4eecf5fe
Add hidden functions to get the SPI system and SPI DMA ( #2162 )
...
With the addition of stall configuration, its not very clear how it works, and seems like it would be different
per use. So adding ways to manually get them, so the functionality can be figured out how to be used.
2019-12-07 17:16:14 -08:00
Tyler Veness
5c6b8a0f45
Replace std::is_pod_v with std::is_standard_layout_v ( #2159 )
...
The former is deprecated in C++20.
2019-12-07 13:34:52 -08:00
Thad House
d8f11eb149
Hardcode channels for LSB weight ( #2153 )
...
Avoids a mutex and a lookup.
2019-12-06 20:56:40 -08:00
Thad House
d003ec2dc9
Update to 2020v9 image ( #2154 )
...
- Fix VISA include and FPGA header
- Fix missing VISA lib from executables
2019-12-04 20:38:43 -08:00
sciencewhiz
b67d049ac2
Check status of PDP CAN reads ( #2126 )
...
Fixes #2124
2019-11-25 21:47:35 -08:00
Thad House
3fcfc8ea72
Fix double disable segfaulting interrupts ( #2132 )
...
Also fixes DigitalOutput not closing correctly.
2019-11-25 21:43:58 -08:00
Tyler Veness
ffa4b907c0
Fix C++ floating point literal formatting ( #2114 )
...
Found formatting errors with this regex
"([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false
positives.
Fixes #2112 .
2019-11-20 21:48:15 -08:00
Thad House
6f6c6da9f5
Updates to addressable LED ( #2098 )
...
Only PWM Headers are supported, so enforce that.
Also fixes some init checks and init order checks.
2019-11-18 15:25:04 -08:00
Peter Johnson
a4c9e4ec28
Add AddressableLED simulation support
2019-11-18 00:51:59 -08:00
Thad House
8ed2059074
Add AddressableLED ( #2092 )
2019-11-17 16:39:38 -08:00
Thad House
db2c3dddd7
Use DMA Global Number for DMA Index ( #2085 )
2019-11-15 17:32:29 -08:00
Thad House
82b2170feb
Add DMA support to HAL and WPILibC ( #2080 )
2019-11-14 22:52:34 -08:00
Thad House
5510960068
Use kNumSystems for DutyCycle count in Ports ( #2083 )
2019-11-14 12:15:47 -08:00
Thad House
b7bc1ea745
Update to 2020v6 image ( #2078 )
2019-11-13 21:35:52 -08:00
Peter Johnson
3e049e02f0
Add name to HAL Notifier
2019-11-11 22:03:29 -08:00
Thad House
326aecc9a0
Add error message for CAN Write Overrun ( #2062 )
2019-11-08 22:51:11 -08:00
Thad House
384d00f9e6
Fix various duty cycle bugs ( #2047 )
2019-11-06 14:05:25 -08:00
Thad House
39f46ceab6
Don't allow rising and falling values to be read from AnalogTrigger ( #2039 )
...
They can't be caught from user code
2019-11-05 20:42:01 -08:00
Thad House
d93aa2b6b2
Add missing lock in FRCDriverStation ( #2034 )
...
Switch newDataCounter to atomic
2019-11-05 20:41:16 -08:00
Thad House
1d695a1660
Add FPGA Duty Cycle support ( #1987 )
2019-11-01 23:41:30 -07:00
Thad House
2ad15cae19
Add multi PDP getter and sim PCM/PDP multi arg functions ( #2014 )
2019-11-01 21:55:35 -07:00
Thad House
6f159d1426
Add way to atomically check for new data, and wait otherwise ( #2015 )
2019-11-01 17:09:28 -07:00
Thad House
f6b844ea30
Move HAL Interrupt struct to anonymous namespace ( #2003 )
2019-10-28 22:32:28 -07:00
Thad House
a3820bbdfa
Remove HAL_BaseInitialize ( #1981 )
2019-10-24 20:26:11 -07:00
Thad House
a83fb47933
Update to 2020v5 image ( #1983 )
...
* Update to 2020v5 image
2019-10-24 12:14:22 -07:00
Thad House
103c1b121c
Remove DS caching from the HAL level ( #1971 )
...
With updates to netcomm, this is no longer required.
2019-10-23 20:25:07 -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