Skip to content

Commit

Permalink
mkdoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesadawork committed Feb 22, 2024
1 parent cefeb5f commit 391da26
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 57 deletions.
78 changes: 24 additions & 54 deletions docs/firmware_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,20 @@ Parameters:

# Compiling + flashing firmware

Note: Both ESP-IDF **v4.4** and **v5.0** are supported. For simplicity, only the instructions for v5.0 are mentioned.
!!! Note

Although Bluepad32 works both with ESP-IDF v4.4 and 5.x, Unijoysticle, NINA and MightyMiggy require ESP-IDF v4.4.

## For Windows

1. Install [ESP-IDF v5.0][esp-idf-windows-installer]. For further info,
1. Install [ESP-IDF v4.4][esp-idf-windows-installer]. For further info,
read: [ESP-IDF Getting Started for Windows][esp-idf-windows-setup]

* Either the Online or Offline version should work
* When asked which components to install, don't change anything. Default options are Ok.
* When asked whether ESP can modify the system, answer "Yes"

2. Launch the "ESP-IDF v5.0 CMD" (type that in the Windows search box)
2. Launch the "ESP-IDF v4.4 CMD" (type that in the Windows search box)

3. From the ESP-IDF cmd, clone Bluepad32 repo

Expand Down Expand Up @@ -126,7 +128,7 @@ Note: Both ESP-IDF **v4.4** and **v5.0** are supported. For simplicity, only the
[esp-idf-windows-setup]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html
[esp-idf-windows-installer]: https://dl.espressif.com/dl/esp-idf/?idf=5.0
[esp-idf-windows-installer]: https://dl.espressif.com/dl/esp-idf/?idf=4.4
## For Linux / macOS
Expand All @@ -153,7 +155,7 @@ Note: Both ESP-IDF **v4.4** and **v5.0** are supported. For simplicity, only the
# Needs to be done just once
# Clone the ESP-IDF git repo
mkdir ~/esp && cd ~/esp
git clone -b release/v5.0 --recursive https://github.com/espressif/esp-idf.git
git clone -b release/v4.4 --recursive https://github.com/espressif/esp-idf.git
# Then install the toolchain
cd ~/esp/esp-idf
Expand All @@ -165,64 +167,32 @@ Note: Both ESP-IDF **v4.4** and **v5.0** are supported. For simplicity, only the
```sh
git clone --recursive https://github.com/ricardoquesada/bluepad32.git
```
4. Setup
```sh
# Setup BTstack
cd ${BLUEPAD32}/external/btstack/port/esp32
# This will install BTstack as a component inside Bluepad32 source code (recommended).
# Remove "IDF_PATH=../../../../src" if you want it installed in the ESP-IDF folder
IDF_PATH=../../../../src ./integrate_btstack.py
```
```sh
# Setup Bluepad32 Platform
cd ${BLUEPAD32}/src
idf.py menuconfig
```
And select `Component config` -> `Bluepad32` -> `Target platform` (choose the right one for you).
5. Compile it
```sh
# Compile it
cd ${BLUEPAD32}/src
idf.py build
# Flash + open debug terminal
idf.py flash monitor
```
[toolchain-deps]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-setup.html
[ttyusb0]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#linux-dialout-group
## Optional: Linux as a target device
Only if you target Linux as a device (not an ESP32 device):
1. Install dependencies
4. Patch BTstack
```sh
sudo apt install libusb-1.0.0-dev
cd ${BLUEPAD32_SRC}/external/btstack
git apply ../patches/*.patch
```
2. Setup BTstack for libusb
5. Setup
```sh
cd ${BLUEPAD32}/external/btstack/port/libusb
make
# Setup BTstack
cd ${BLUEPAD32}/external/btstack/port/esp32
# This will install BTstack as a component inside Bluepad32 source code (recommended).
# Remove "IDF_PATH=../../../../src" if you want it installed in the ESP-IDF folder
IDF_PATH=../../../../src ./integrate_btstack.py
```
3. Compile Bluepad32
6. Compile it
```sh
cd ${BLUEPAD32}/tools/pc_debug
make
sudo ./bluepad32
# Compile it
cd ${BLUEPAD32}/tools/fw
./build.py all
```
Put the gamepad in discovery mode. The gamepad should be recognized and when you press buttons, you should see them on
the console.
[toolchain-deps]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-setup.html
[ttyusb0]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#linux-dialout-group
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Bluepad32 supports different IDEs, and different microcontrollers. These are the
| Arduino Core | :material-check: | | | |
| CircuitPython | | | :material-check: | |
| ESP-IDF (raw API) | :material-check: | | | |
| PICO SDK (raw API) | | | | :material-check: |
| Pico SDK (raw API) | | | | :material-check: |

Choose the right one depending on your knowledge, devkit board and requirements:

Expand Down
2 changes: 1 addition & 1 deletion external/patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ To apply the patches, do:

```
cd ${BLUEPAD32_SRC}/external/btstack
git apply < ../patches/0002-l2cap-allow-incoming-connection-with-not-enough.patch
git apply ../patches/*.patch
```

And after applying the patch, you have to install btstack. E.g:
Expand Down
2 changes: 1 addition & 1 deletion src/components/bluepad32/include/uni_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef UNI_VERSION_H
#define UNI_VERSION_H

#define UNI_VERSION "4.0-beta1"
#define UNI_VERSION "4.0-beta2"

extern const char* uni_version;

Expand Down

0 comments on commit 391da26

Please sign in to comment.