Skip to content

Commit c596f61

Browse files
Merge pull request #80 from PhyXTGears-programming/develop
v2.0.0
2 parents ab20635 + 4b09da4 commit c596f61

30 files changed

+560
-339
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ bin/
158158

159159

160160
# End of https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode
161+
src/main/deploy/version.txt

Makefile

-16
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,4 @@ build:
1010
@./gradlew build
1111

1212
deploy: build
13-
@$(make-version-file)
1413
@./gradlew deploy
15-
@$(clean-version-file)
16-
17-
define make-version-file
18-
cat > src/main/deploy/version.txt <<'EOF'
19-
========================================
20-
FRC Team 1720 - PhyXTGears
21-
22-
Software version: $(shell git describe --tags)
23-
========================================
24-
EOF
25-
endef
26-
27-
define clean-version-file
28-
@rm src/main/deploy/version.txt
29-
endef

build.gradle

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id "cpp"
33
id "google-test-test-suite"
44
id "edu.wpi.first.GradleRIO" version "2019.4.1"
5+
id "org.ajoberstar.grgit" version "2.3.0"
56
}
67

78
// Define my targets (RoboRIO) and artifacts (deployable files)
@@ -85,3 +86,19 @@ model {
8586
}
8687
}
8788
}
89+
90+
task versionFile {
91+
outputs.upToDateWhen { false }
92+
doFirst {
93+
new File('src/main/deploy/version.txt').text = """
94+
========================================
95+
FRC Team 1720 - PhyXTGears
96+
Robot: Space Walrus
97+
Season: 2019
98+
Software version: ${grgit.describe()}
99+
========================================
100+
"""
101+
}
102+
}
103+
104+
tasks.getByName('deploy').dependsOn(versionFile)

src/main/cpp/Bling.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "Bling.h"
2+
3+
Bling::Bling () {
4+
// TODO
5+
}
6+
7+
void Bling::RunBling () {
8+
if (m_SeqDelay.IsDone()) {
9+
m_Pattern = Default;
10+
m_SeqDelay.Stop();
11+
}
12+
m_Blinkin.Set(m_PwmMap[m_Pattern]);
13+
}
14+
15+
void Bling::SetBling (BlingPattern p) {
16+
m_Pattern = p;
17+
m_SeqDelay.setPeriod(m_DelayMap[p]);
18+
m_SeqDelay.Start();
19+
}

src/main/cpp/OI.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
#include "OI.h"
22

3+
#include "OperatorHID.h"
34
#include <frc/WPILib.h>
45

56
OI::OI() {}
7+
8+
// Pressing buttons in Disabled sends the presses when re-enabling.
9+
// That's bad, so we clear the presses when enabling.
10+
void OI::ClearButtonBuffer() {
11+
for (int i = 1; i <= m_HidDriver.GetButtonCount(); i++) {
12+
m_HidDriver.GetRawButtonPressed(i);
13+
m_HidDriver.GetRawButtonReleased(i);
14+
}
15+
16+
ButtonBoard& board1 = m_HidOperator.GetBoard1();
17+
for (int i = 1; i <= board1.GetButtonCount(); i++) {
18+
board1.GetRawButtonPressed(i);
19+
board1.GetRawButtonReleased(i);
20+
}
21+
22+
ButtonBoard& board2 = m_HidOperator.GetBoard2();
23+
for (int i = 1; i <= board2.GetButtonCount(); i++) {
24+
board2.GetRawButtonPressed(i);
25+
board2.GetRawButtonReleased(i);
26+
}
27+
28+
frc::Joystick& flightstick = m_HidOperator.GetFlightStick();
29+
for (int i = 1; i <= flightstick.GetButtonCount(); i++) {
30+
flightstick.GetRawButtonPressed(i);
31+
flightstick.GetRawButtonReleased(i);
32+
}
33+
}

src/main/cpp/OperatorHID.cpp

-3
This file was deleted.

0 commit comments

Comments
 (0)