Skip to content

test github merge workflow #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c5bcf6d
arduino_tinyusb: compile support for DFU mode (#116)
pillo79 Apr 19, 2023
a6a8714
Allow deploy with env variable
me-no-dev Apr 24, 2023
d4a770a
Do not include ESP_SR for IDF 4.4
me-no-dev May 12, 2023
8fe3a0b
Do not compile ESP-Insights separately, because RainMaker already doe…
me-no-dev Jun 13, 2023
685f87d
Fix infinite loop if repo clone is renamed (#75)
rtrbt Jul 18, 2023
6aa85b6
Merge branch 'master' into release/v4.4
me-no-dev Jul 18, 2023
45a4845
Fix warnings from outdated GH actions (#131)
Jason2866 Jul 20, 2023
29d1440
Merge branch 'master' into release/v4.4
me-no-dev Jul 20, 2023
7f8dda8
Fix builds caused by esp-dl requirement
me-no-dev Aug 10, 2023
6ab7033
Fix esp-df commit to last working on IDF v4.4
me-no-dev Aug 12, 2023
3bd942c
merge into v4.4 release branch
ricardoquesada May 20, 2023
b94ab9d
Update instructions
ricardoquesada Jun 18, 2023
11adc7c
v3.7.3
ricardoquesada Jun 18, 2023
01aef77
Update boards.txt, platform.txt and README
ricardoquesada Aug 10, 2023
a907fc4
v3.9.0 changes
ricardoquesada Sep 17, 2023
3083b47
v3.10.1
ricardoquesada Nov 6, 2023
49279c8
v3.10.2
ricardoquesada Nov 14, 2023
70e534a
v4.0-beta.0
ricardoquesada Feb 4, 2024
68b515b
Update sketch to use new "hasData" API
ricardoquesada Feb 11, 2024
892541b
From bluepad32/bluepad32_arduino upstream
ricardoquesadawork Feb 28, 2024
08c58c3
from bluepad32 / btstack upstream
ricardoquesada Mar 3, 2024
8aa221b
re-add missing component
ricardoquesada Mar 3, 2024
4de8712
From Bluepad32/BTstack upstream
ricardoquesada Mar 9, 2024
62fa423
Only show Bluepad32 errors. Keep log messages to the minimum.
ricardoquesada Mar 10, 2024
239e974
v4.0-beta.2 release
ricardoquesada Mar 10, 2024
b916e24
Bluepad32/BTstack v4.0-rc0
ricardoquesada Mar 21, 2024
38523c8
missing files in bluepad32
ricardoquesada Mar 21, 2024
1ad64e3
Use new rumble API
ricardoquesada Mar 21, 2024
760fa8f
better defaults for play dual rumble
ricardoquesada Mar 21, 2024
5f36bd5
update pacakge
ricardoquesada Mar 21, 2024
83c0403
from v4.0 upstream
ricardoquesada Mar 25, 2024
a97379d
version 4.0
ricardoquesada Mar 25, 2024
ae4b3d2
Blueapd32 v4.0.1
ricardoquesada Apr 3, 2024
67faff3
v4.0.1
ricardoquesada Apr 3, 2024
6dedb4f
fix pacakge_json
ricardoquesada Apr 3, 2024
2ed008f
4.0.2
ricardoquesada Apr 4, 2024
dfeb7b9
4.0.2
ricardoquesada Apr 4, 2024
2cb03a8
Bluepad32 to v4.0.4 and BTstack
ricardoquesada Apr 20, 2024
a6f4eaa
updated boards.txt from 2.0.15
ricardoquesada Apr 20, 2024
a24165f
example: print pressed keys
ricardoquesada Apr 21, 2024
ce6a0d7
v4.0.4
ricardoquesada Apr 21, 2024
a8ed121
Bluepad32 v4.1.0 / BTstack 1.6.1
ricardoquesada Jun 4, 2024
5939325
version 4.1.0
ricardoquesada Jun 5, 2024
72f0ee2
RAP-84 - Custom board setup. I've added some version control to the …
Jul 30, 2024
849455b
RAP-84 - Set up downloading of ESP32 arduino binaries
Aug 4, 2024
60f110a
RAP-84 - Updating quicksetup, and fixing bug in update components script
Aug 4, 2024
7770864
RAP-84 - fixing bug in update components script
Aug 4, 2024
9f49f65
RAP-84 - automatically filtering esp32s2 settings out of boards.txt file
Aug 4, 2024
80d3dcd
RAP-84 - Arduino board file update
Aug 4, 2024
974d481
RAP-84 - Updating name, adding help back in (need to update that to N…
Aug 4, 2024
2a66b0e
RAP-84 - Changing name of package file
Aug 4, 2024
5c8cb15
RAP-84 - Archive name and structure updates
Aug 4, 2024
396426b
RAP-84 - teaking the name, seems the package name is used for naming …
Aug 5, 2024
576d7b7
RAP-84 - tweaking the name, seems the package name is used for naming…
Aug 5, 2024
613bb69
Merge branch 'master' into boyd_test
Aug 5, 2024
c4b83b0
RAP-84 - updating the build script, reordering the copying of files t…
Aug 5, 2024
c250eaa
RAP-84 - updating the build script, reordering the copying of files t…
Aug 5, 2024
a81c01b
RAP-84 - updating deployment file
Aug 5, 2024
ee2145d
RAP-84 - updating deployment file
Aug 5, 2024
f78c6bf
RAP-84 - updating deployment file
Aug 7, 2024
9ed033c
RAP-84 - updating build script
Aug 7, 2024
298ba83
RAP-84 - updating build script
Aug 7, 2024
5ca1c86
RAP-84 - updating build script
Aug 7, 2024
c2d9163
RAP-84 - updating build script, defaulting copy out to true
Aug 19, 2024
e03ac78
RAP-84 - copying more files around
Aug 19, 2024
38a9819
RAP-84 - updating checksum and size
Aug 19, 2024
57958b7
RAP-84 - updating which include and lib files get copied
Aug 19, 2024
fcb56ae
RAP-84 - updating checksum and size
Aug 19, 2024
9a596b6
RAP-84 - Adding phasedock libraries and integrating them with the board
Aug 19, 2024
a11f96e
RAP-84 - using version numbers in the library directory names (may ch…
Aug 19, 2024
f93eccf
RAP-84 - updating checksum and size
Aug 19, 2024
13bb388
Merge remote-tracking branch 'origin/release/v4.4'
Aug 23, 2024
d6027ed
RAP-84 - Updates for PhaseDock custom board, including some build aut…
Aug 23, 2024
af4e669
Merge remote-tracking branch 'origin/boyd_test'
Aug 23, 2024
7677940
RAP-84 - removing bluepad discord, and updating repo name
Aug 23, 2024
089d690
RAP-84 - rebuilding board
Aug 23, 2024
b580bc9
RAP-84 - updating repo file location and name
Aug 23, 2024
bdd603d
RAP-84 - moving distribution build commands out to own script
Aug 24, 2024
1ecac56
RAP-84 - Update permissions on script file
Aug 24, 2024
1e76676
RAP-84 - moving dependency versions out to config.sh
Aug 24, 2024
8ee12ac
RAP-84 - locking in the versions of the dependencies we use to build,…
Aug 24, 2024
dba0443
RAP-84 - jumping back to previous directory in create distro script t…
Aug 24, 2024
7ac18bd
RAP-84 - Added release script, removed commented out code, updated re…
Aug 25, 2024
6c5bdbf
RAP-84 - minor update to test merge request github ci
Aug 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
v3.10.1
- Bluepad32 v3.10.1
- Updated BTstack
- Keyboard support
- Updated sketch / Controller.ino
  • Loading branch information
ricardoquesada committed Nov 6, 2023
commit 3083b478fa6f7545d42491835e5dcdeaec4fb7c8
Original file line number Diff line number Diff line change
@@ -1,162 +1,252 @@
#include <Bluepad32.h>

GamepadPtr myGamepads[BP32_MAX_GAMEPADS];
ControllerPtr myControllers[BP32_MAX_GAMEPADS];

// This callback gets called any time a new gamepad is connected.
// Up to 4 gamepads can be connected at the same time.
void onConnectedGamepad(GamepadPtr gp) {
bool foundEmptySlot = false;
for (int i = 0; i < BP32_MAX_GAMEPADS; i++) {
if (myGamepads[i] == nullptr) {
Serial.printf("CALLBACK: Gamepad is connected, index=%d\n", i);
// Additionally, you can get certain gamepad properties like:
// Model, VID, PID, BTAddr, flags, etc.
GamepadProperties properties = gp->getProperties();
Serial.printf("Gamepad model: %s, VID=0x%04x, PID=0x%04x\n",
gp->getModelName().c_str(), properties.vendor_id,
properties.product_id);
myGamepads[i] = gp;
foundEmptySlot = true;
break;
void onConnectedController(ControllerPtr ctl) {
bool foundEmptySlot = false;
for (int i = 0; i < BP32_MAX_GAMEPADS; i++) {
if (myControllers[i] == nullptr) {
Serial.printf("CALLBACK: Controller is connected, index=%d\n", i);
// Additionally, you can get certain gamepad properties like:
// Model, VID, PID, BTAddr, flags, etc.
ControllerProperties properties = ctl->getProperties();
Serial.printf("Controller model: %s, VID=0x%04x, PID=0x%04x\n", ctl->getModelName().c_str(), properties.vendor_id,
properties.product_id);
myControllers[i] = ctl;
foundEmptySlot = true;
break;
}
}
if (!foundEmptySlot) {
Serial.println("CALLBACK: Controller connected, but could not found empty slot");
}
}
if (!foundEmptySlot) {
Serial.println(
"CALLBACK: Gamepad connected, but could not found empty slot");
}
}

void onDisconnectedGamepad(GamepadPtr gp) {
bool foundGamepad = false;
void onDisconnectedController(ControllerPtr ctl) {
bool foundController = false;

for (int i = 0; i < BP32_MAX_GAMEPADS; i++) {
if (myGamepads[i] == gp) {
Serial.printf("CALLBACK: Gamepad is disconnected from index=%d\n", i);
myGamepads[i] = nullptr;
foundGamepad = true;
break;
for (int i = 0; i < BP32_MAX_GAMEPADS; i++) {
if (myControllers[i] == ctl) {
Serial.printf("CALLBACK: Controller disconnected from index=%d\n", i);
myControllers[i] = nullptr;
foundController = true;
break;
}
}
}

if (!foundGamepad) {
Serial.println(
"CALLBACK: Gamepad disconnected, but not found in myGamepads");
}
if (!foundController) {
Serial.println("CALLBACK: Controller disconnected, but not found in myControllers");
}
}

// Arduino setup function. Runs in CPU 1
void setup() {
Serial.begin(115200);
Serial.printf("Firmware: %s\n", BP32.firmwareVersion());
const uint8_t *addr = BP32.localBdAddress();
Serial.printf("BD Addr: %2X:%2X:%2X:%2X:%2X:%2X\n", addr[0], addr[1], addr[2],
addr[3], addr[4], addr[5]);

// Setup the Bluepad32 callbacks
BP32.setup(&onConnectedGamepad, &onDisconnectedGamepad);

// "forgetBluetoothKeys()" should be called when the user performs
// a "device factory reset", or similar.
// Calling "forgetBluetoothKeys" in setup() just as an example.
// Forgetting Bluetooth keys prevents "paired" gamepads to reconnect.
// But might also fix some connection / re-connection issues.
BP32.forgetBluetoothKeys();
void dumpGamepad(ControllerPtr ctl) {
Serial.printf(
"idx=%d, dpad: 0x%02x, buttons: 0x%04x, axis L: %4d, %4d, axis R: %4d, %4d, brake: %4d, throttle: %4d, "
"misc: 0x%02x, gyro x:%6d y:%6d z:%6d, accel x:%6d y:%6d z:%6d\n",
ctl->index(), // Controller Index
ctl->dpad(), // DPAD
ctl->buttons(), // bitmask of pressed buttons
ctl->axisX(), // (-511 - 512) left X Axis
ctl->axisY(), // (-511 - 512) left Y axis
ctl->axisRX(), // (-511 - 512) right X axis
ctl->axisRY(), // (-511 - 512) right Y axis
ctl->brake(), // (0 - 1023): brake button
ctl->throttle(), // (0 - 1023): throttle (AKA gas) button
ctl->miscButtons(), // bitmak of pressed "misc" buttons
ctl->gyroX(), // Gyro X
ctl->gyroY(), // Gyro Y
ctl->gyroZ(), // Gyro Z
ctl->accelX(), // Accelerometer X
ctl->accelY(), // Accelerometer Y
ctl->accelZ() // Accelerometer Z
);
}

// Arduino loop function. Runs in CPU 1
void loop() {
// This call fetches all the gamepad info from the NINA (ESP32) module.
// Just call this function in your main loop.
// The gamepads pointer (the ones received in the callbacks) gets updated
// automatically.
BP32.update();

// It is safe to always do this before using the gamepad API.
// This guarantees that the gamepad is valid and connected.
for (int i = 0; i < BP32_MAX_GAMEPADS; i++) {
GamepadPtr myGamepad = myGamepads[i];

if (myGamepad && myGamepad->isConnected()) {
// There are different ways to query whether a button is pressed.
// By query each button individually:
// a(), b(), x(), y(), l1(), etc...
if (myGamepad->a()) {
void dumpMouse(ControllerPtr ctl) {
Serial.printf("idx=%d, buttons: 0x%04x, scrollWheel=0x%04x, delta X: %4d, delta Y: %4d\n",
ctl->index(), // Controller Index
ctl->buttons(), // bitmask of pressed buttons
ctl->scrollWheel(), // Scroll Wheel
ctl->deltaX(), // (-511 - 512) left X Axis
ctl->deltaY() // (-511 - 512) left Y axis
);
}

void dumpKeyboard(ControllerPtr ctl) {
// TODO: Print pressed keys
Serial.printf("idx=%d\n", ctl->index());
}

void dumpBalanceBoard(ControllerPtr ctl) {
Serial.printf("idx=%d, TL=%u, TR=%u, BL=%u, BR=%u, temperature=%d\n",
ctl->index(), // Controller Index
ctl->topLeft(), // top-left scale
ctl->topRight(), // top-right scale
ctl->bottomLeft(), // bottom-left scale
ctl->bottomRight(), // bottom-right scale
ctl->temperature() // temperature: used to adjust the scale value's precision
);
}

void processGamepad(ControllerPtr ctl) {
// There are different ways to query whether a button is pressed.
// By query each button individually:
// a(), b(), x(), y(), l1(), etc...
if (ctl->a()) {
static int colorIdx = 0;
// Some gamepads like DS4 and DualSense support changing the color LED.
// It is possible to change it by calling:
switch (colorIdx % 3) {
case 0:
// Red
myGamepad->setColorLED(255, 0, 0);
break;
case 1:
// Green
myGamepad->setColorLED(0, 255, 0);
break;
case 2:
// Blue
myGamepad->setColorLED(0, 0, 255);
break;
case 0:
// Red
ctl->setColorLED(255, 0, 0);
break;
case 1:
// Green
ctl->setColorLED(0, 255, 0);
break;
case 2:
// Blue
ctl->setColorLED(0, 0, 255);
break;
}
colorIdx++;
}
}

if (myGamepad->b()) {
if (ctl->b()) {
// Turn on the 4 LED. Each bit represents one LED.
static int led = 0;
led++;
// Some gamepads like the DS3, DualSense, Nintendo Wii, Nintendo Switch
// support changing the "Player LEDs": those 4 LEDs that usually
// indicate the "gamepad seat". It is possible to change them by
// calling:
myGamepad->setPlayerLEDs(led & 0x0f);
}
// support changing the "Player LEDs": those 4 LEDs that usually indicate
// the "gamepad seat".
// It is possible to change them by calling:
ctl->setPlayerLEDs(led & 0x0f);
}

if (myGamepad->x()) {
if (ctl->x()) {
// Duration: 255 is ~2 seconds
// force: intensity
// Some gamepads like DS3, DS4, DualSense, Switch, Xbox One S support
// rumble.
// It is possible to set it by calling:
myGamepad->setRumble(0xc0 /* force */, 0xc0 /* duration */);
}

// Another way to query the buttons, is by calling buttons(), or
// miscButtons() which return a bitmask.
// Some gamepads also have DPAD, axis and more.
Serial.printf(
"idx=%d, dpad: 0x%02x, buttons: 0x%04x, axis L: %4d, %4d, axis R: "
"%4d, %4d, brake: %4d, throttle: %4d, misc: 0x%02x, gyro x:%6d y:%6d "
"z:%6d, accel x:%6d y:%6d z:%6d\n",
i, // Gamepad Index
myGamepad->dpad(), // DPAD
myGamepad->buttons(), // bitmask of pressed buttons
myGamepad->axisX(), // (-511 - 512) left X Axis
myGamepad->axisY(), // (-511 - 512) left Y axis
myGamepad->axisRX(), // (-511 - 512) right X axis
myGamepad->axisRY(), // (-511 - 512) right Y axis
myGamepad->brake(), // (0 - 1023): brake button
myGamepad->throttle(), // (0 - 1023): throttle (AKA gas) button
myGamepad->miscButtons(), // bitmak of pressed "misc" buttons
myGamepad->gyroX(), // Gyro X
myGamepad->gyroY(), // Gyro Y
myGamepad->gyroZ(), // Gyro Z
myGamepad->accelX(), // Accelerometer X
myGamepad->accelY(), // Accelerometer Y
myGamepad->accelZ() // Accelerometer Z
);

// You can query the axis and other properties as well. See Gamepad.h
// For all the available functions.
ctl->setRumble(0xc0 /* force */, 0xc0 /* duration */);
}
}

// The main loop must have some kind of "yield to lower priority task" event.
// Otherwise the watchdog will get triggered.
// If your main loop doesn't have one, just add a simple `vTaskDelay(1)`.
// Detailed info here:
// https://stackoverflow.com/questions/66278271/task-watchdog-got-triggered-the-tasks-did-not-reset-the-watchdog-in-time
// Another way to query controller data is by getting the buttons() function.
// See how the different "dump*" functions dump the Controller info.
dumpGamepad(ctl);
}

void processMouse(ControllerPtr ctl) {
// This is just an example.
if (ctl->scrollWheel() > 0) {
// Do Something
} else if (ctl->scrollWheel() < 0) {
// Do something else
}

// See "dumpMouse" for possible things to query.
dumpMouse(ctl);
}

// vTaskDelay(1);
delay(150);
void processKeyboard(ControllerPtr ctl) {
// This is just an example.
if (ctl->isKeyPressed(Keyboard_A)) {
// Do Something
Serial.println("Key 'A' pressed");
}

// Don't do "else" here.
// Multiple keys can be pressed at the same time.
if (ctl->isKeyPressed(Keyboard_LeftShift)) {
// Do something else
Serial.println("Key 'LEFT SHIFT' pressed");
}

// Don't do "else" here.
// Multiple keys can be pressed at the same time.
if (ctl->isKeyPressed(Keyboard_LeftArrow)) {
// Do something else
Serial.println("Key 'Left Arrow' pressed");
}

// See "dumpKeyboard" for possible things to query.
dumpKeyboard(ctl);
}

void processBalanceBoard(ControllerPtr ctl) {
// This is just an example.
if (ctl->topLeft() > 10000) {
// Do Something
}

// See "dumpBalanceBoard" for possible things to query.
dumpBalanceBoard(ctl);
}

// Arduino setup function. Runs in CPU 1
void setup() {
Serial.begin(115200);
Serial.printf("Firmware: %s\n", BP32.firmwareVersion());
const uint8_t* addr = BP32.localBdAddress();
Serial.printf("BD Addr: %2X:%2X:%2X:%2X:%2X:%2X\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);

// Setup the Bluepad32 callbacks
BP32.setup(&onConnectedController, &onDisconnectedController);

// "forgetBluetoothKeys()" should be called when the user performs
// a "device factory reset", or similar.
// Calling "forgetBluetoothKeys" in setup() just as an example.
// Forgetting Bluetooth keys prevents "paired" gamepads to reconnect.
// But might also fix some connection / re-connection issues.
BP32.forgetBluetoothKeys();

// Enables mouse / touchpad support for gamepads that support them.
// When enabled controllers like DualSense and DualShock4 generate two connected devices:
// - First one: the gamepad
// - Second one, which is a "vritual device", is a mouse
// By default it is disabled.
BP32.enableVirtualDevice(false);
}

// Arduino loop function. Runs in CPU 1
void loop() {
// This call fetches all the gamepad info from the NINA (ESP32) module.
// Just call this function in your main loop.
// The gamepads pointer (the ones received in the callbacks) gets updated
// automatically.
BP32.update();

// It is safe to always do this before using the gamepad API.
// This guarantees that the gamepad is valid and connected.
for (int i = 0; i < BP32_MAX_GAMEPADS; i++) {
ControllerPtr myController = myControllers[i];

if (myController && myController->isConnected()) {
if (myController->isGamepad()) {
processGamepad(myController);
} else if (myController->isMouse()) {
processMouse(myController);
} else if (myController->isKeyboard()) {
processKeyboard(myController);
} else if (myController->isBalanceBoard()) {
processBalanceBoard(myController);
} else {
Serial.printf("Data not available yet\n");
continue;
}
// See ArduinoController.h for all the available functions.
}
}
// The main loop must have some kind of "yield to lower priority task" event.
// Otherwise the watchdog will get triggered.
// If your main loop doesn't have one, just add a simple `vTaskDelay(1)`.
// Detailed info here:
// https://stackoverflow.com/questions/66278271/task-watchdog-got-triggered-the-tasks-did-not-reset-the-watchdog-in-time

// vTaskDelay(1);
delay(150);
}
Loading