mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
I also updated the C++ and Java code some. For C++, this meant making it compile and adding in the framework for the closed-loop control of the motor. For Java, I updated the JNI bindings with SWIG and created an GetTemperature accessor function to demonstrate how to use the accessors because swig does funny stuff with pass-by-reference functions. Change-Id: If51bf61d0a9bc65a8d497f8d91a5be8d6ff4fdcc
19 lines
847 B
Bash
Executable File
19 lines
847 B
Bash
Executable File
#!/bin/bash
|
|
#This script should be able to generate the JNI
|
|
# bindings for the CANTalon using swig.At some point,
|
|
# it should be integrated into the build system,
|
|
# but I[james 18 November 2014] don't know how to do that.
|
|
# Assumes running from allwpilib/wpilibj/wpilibJavaJNI/swigTalon
|
|
# Get files that we node to generate from.
|
|
cp ../../../hal/lib/Athena/ctre/CanTalonSRX.cpp ./
|
|
cp ../../../wpilibc/wpilibC++Devices/include/ctre/* ./
|
|
# Clean up from previous run.
|
|
rm *.java
|
|
# Run SWIG.
|
|
swig -c++ -package edu.wpi.first.wpilibj.hal -java CanTalonSRX.i
|
|
# Stick generated files into appropriate places.
|
|
cp CanTalonSRX_wrap.cxx ../lib/CanTalonSRXJNI.cpp
|
|
mv CanTalonJNI.java ../../wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/hal/
|
|
rm CanTalon.java # useless file.
|
|
cp *.java ../../wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/
|