From 391da26c64ca56dc7444fccd66e87d6d6e85917f Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 22 Feb 2024 08:33:42 -0300 Subject: [PATCH] mkdoc fixes --- docs/firmware_setup.md | 78 ++++++------------- docs/getting_started.md | 2 +- external/patches/README.md | 2 +- .../bluepad32/include/uni_version.h | 2 +- 4 files changed, 27 insertions(+), 57 deletions(-) diff --git a/docs/firmware_setup.md b/docs/firmware_setup.md index 1807adea..6eabf2f9 100644 --- a/docs/firmware_setup.md +++ b/docs/firmware_setup.md @@ -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 @@ -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 @@ -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 @@ -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 \ No newline at end of file diff --git a/docs/getting_started.md b/docs/getting_started.md index 131c175c..d0c376e7 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -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: diff --git a/external/patches/README.md b/external/patches/README.md index 2bb2aed8..f614cc1c 100644 --- a/external/patches/README.md +++ b/external/patches/README.md @@ -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: diff --git a/src/components/bluepad32/include/uni_version.h b/src/components/bluepad32/include/uni_version.h index ef7ea51f..50ffeb51 100644 --- a/src/components/bluepad32/include/uni_version.h +++ b/src/components/bluepad32/include/uni_version.h @@ -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;