Fixes ultrasonic declaration (#328)

Also adds test to ensure this doens't happen again
This commit is contained in:
Thad House
2016-11-04 15:02:29 -07:00
committed by Peter Johnson
parent 2235a809c4
commit 81212d80c6
2 changed files with 33 additions and 0 deletions

View File

@@ -38,5 +38,37 @@ model {
}
}
}
// Shared target used just to check that wpilib is fully linked
// Use the static target for normal linking
myRobotcppShared(NativeExecutableSpec) {
targetPlatform 'arm'
binaries.all {
tasks.withType(CppCompile) {
addNiLibraryLinks(linker, targetPlatform)
addNetworkTablesLibraryLinks(it, linker, targetPlatform)
}
cppCompiler.args '-pthread', '-Wno-unused-variable'
linker.args '-pthread', '-Wno-unused-variable', '-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a'
}
sources {
cpp {
source {
srcDir 'src'
include '**/*.cpp'
}
exportedHeaders {
srcDirs = ['include',
"${project.athena}/include", "${project.shared}/include",
"${project.hal}/include/HAL", netTablesInclude, wpiUtilInclude]
include '**/*.h'
}
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
lib project: ':hal', library: 'HALAthena', linkage: 'shared'
}
}
}
}
}

View File

@@ -28,6 +28,7 @@ constexpr double Ultrasonic::kSpeedOfSoundInchesPerSec;
// automatic round robin mode
std::atomic<bool> Ultrasonic::m_automaticEnabled{false};
std::set<Ultrasonic*> Ultrasonic::m_sensors;
std::thread Ultrasonic::m_thread;
/**
* Background task that goes through the list of ultrasonic sensors and pings