Compare commits

...

5 Commits

Author SHA1 Message Date
Neale Pickett 13825855d3 twiddling things trying to get drums working on CH
Mockband / build (push) Failing after 16s Details
2024-01-06 15:08:12 -07:00
Neale Pickett e54595e630 Merge branch 'main' into builder 2024-01-05 18:18:18 -07:00
Neale Pickett 703b070844 Remove dpad kludge for drums - it messes up CH 2024-01-05 18:16:29 -07:00
Neale Pickett 3c80053cb7 Build log formatting
Mockband / build (push) Successful in 27s Details
2024-01-04 23:19:10 -07:00
Neale Pickett 7f32dec9f3 Smarter build
Mockband / build (push) Successful in 20s Details
`arduino-builder` lets you override stuff from `boards.txt`.
That's nice, because the way I was doing it before was bananas.
2024-01-04 23:07:43 -07:00
4 changed files with 26 additions and 16 deletions

View File

@ -16,6 +16,11 @@ for path in "$@"; do
fn=$(basename "$path")
echo "=== Upload $VERSION/$fn"
curl \
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
--request DELETE \
$BASE/$fn
curl \
--fail \
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \

View File

@ -15,6 +15,11 @@ firmwares: build/MockBand.drums.hex
build/MockBand.drums.hex: VID=0x1bad
build/MockBand.drums.hex: PID=0x3110
firmwares: build/MockBand.drums1.hex
build/MockBand.drums1.hex: VID=0x1bad
build/MockBand.drums1.hex: PID=00005
build/MockBand.%.hex: MockBand.ino
mkdir -p build/cache
rm -f build/build.options.json

View File

@ -142,8 +142,8 @@ void loop() {
}
#else // DRUMS
buttonState.buttons |= (buttons >> 10) & 0b01011; // Cymbals
bitWrite(buttonState.buttons, 10, buttons & (0b01111 << 0)); // Drum pad modifier
bitWrite(buttonState.buttons, 11, buttons & (0b01011 << 10)); // Cymbals modifier
bitWrite(buttonState.buttons, 10, (buttons >> 0) & 0b01111); // Drum pad modifier
bitWrite(buttonState.buttons, 11, (buttons >> 10) & 0b01011); // Cymbals modifier
buttonState.axis[3] = bitRead(buttons, 12)?255:0; // High hat
// rbdrum2midi wants these set
@ -152,14 +152,8 @@ void loop() {
buttonState.velocity[2] = bitRead(buttonState.buttons, 1)?127:0; // G
buttonState.velocity[3] = bitRead(buttonState.buttons, 0)?127:0; // B
// Use the cymbals for up and down, since I don't have a D-pad
if bitRead(buttons, 13) {
buttonState.hatAndConstant = 0; // up
} else if bitRead(buttons, 10) {
buttonState.hatAndConstant = 4; // down
} else {
buttonState.hatAndConstant = 8; // nothing
}
// Say the D-pad is centered
buttonState.hatAndConstant = 8;
#endif
#ifdef DPAD

View File

@ -70,13 +70,19 @@ Here's what each bit means:
hatAndConstant
--------------
Here's what the values mean:
The HAT switch reports its position like a clock.
* 2: right
* 6: left
* 0: up
* 4: down
* 8: nothing
7 0 1
6 8 2
5 4 3
0 is up,
2 is right,
4 is down,
6 is left,
and 8 is centered.
velocity