Adding delay startup for slow crystals and updates to the build system (#81)
* syncing * Updating action definitions * Update cmake.yml * Update cmake.yml * Update cmake.yml * fixing npm * change directory * fixing merge issue * fixing keyboard issue * Update cmake.yml * Update to use board definitions * sync latest and delete config_autogen * updating www * Adding flatbox Rev 5 custom board definition * syncing www * Removing product reference in docs, replacing with category. * updating cmake yml file * Create node.js.yml * updating builds * Update node.js.yml * Update node.js.yml * updating node yaml * sync * updating node adding waveshare * removing fsdata.c adding delete to node action * artifact download * More piipeline updates * adding depenency between workflow files * lots of changes * cleaning up gitignore items * Time to test in the actions * Adding new ENV variables * Disabling extra builds * Update cmake.yml * add generated pio file back to the repo, until fix * Preparing for PR * add env variables to the docs * adding missing environment variable * Updating board definition builds --------- Co-authored-by: Darren <fortinbra@becauseimclever.com>
This commit is contained in:
45
.github/workflows/cmake.yml
vendored
45
.github/workflows/cmake.yml
vendored
@@ -11,7 +11,10 @@ env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
call-node-workflow:
|
||||
uses: ./.github/workflows/node.js.yml
|
||||
build:
|
||||
needs: call-node-workflow
|
||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
@@ -23,14 +26,20 @@ jobs:
|
||||
uses: carlosperate/arm-none-eabi-gcc-action@v1.5.2
|
||||
|
||||
- name: Checkout GP2040-CE
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout submodules
|
||||
working-directory: ${{github.workspace}}
|
||||
run: git submodule update --init
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# - name: Checkout submodules
|
||||
# working-directory: ${{github.workspace}}
|
||||
# run: git submodule update --init
|
||||
|
||||
- name: Download a Build Artifact
|
||||
uses: actions/download-artifact@v3.0.2
|
||||
with:
|
||||
name: fsData
|
||||
path: ${{github.workspace}}/lib/httpd/
|
||||
|
||||
- name: Checkout pico-sdk/1.4.0
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: raspberrypi/pico-sdk
|
||||
ref: 1.4.0
|
||||
@@ -47,11 +56,7 @@ jobs:
|
||||
|
||||
- name: Pico Build Configure CMake
|
||||
shell: bash
|
||||
run: cmake --help -version
|
||||
|
||||
- name: Pico Build Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=Pico cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=Pico SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Pico Build
|
||||
shell: bash
|
||||
@@ -64,10 +69,10 @@ jobs:
|
||||
path: ${{github.workspace}}/build/GP2040-CE_*_Pico.uf2
|
||||
if-no-files-found: error
|
||||
|
||||
# #BentoBox
|
||||
#BentoBox
|
||||
- name: BentoBox Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=BentoBox cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=BentoBox SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: BentoBox Build
|
||||
shell: bash
|
||||
@@ -83,7 +88,7 @@ jobs:
|
||||
#DURAL
|
||||
- name: DURAL Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=DURAL cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=DURAL SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: DURAL Build
|
||||
shell: bash
|
||||
@@ -99,7 +104,7 @@ jobs:
|
||||
#FlatboxRev4
|
||||
- name: FlatboxRev4 Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=FlatboxRev4 cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=FlatboxRev4 SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: FlatboxRev4 Build
|
||||
shell: bash
|
||||
@@ -115,7 +120,7 @@ jobs:
|
||||
#FlatboxRev5
|
||||
- name: FlatboxRev5 Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=FlatboxRev5 cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=FlatboxRev5 SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: FlatboxRev5 Build
|
||||
shell: bash
|
||||
@@ -131,7 +136,7 @@ jobs:
|
||||
#PicoAnn
|
||||
- name: PicoAnn Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=PicoAnn cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=PicoAnn SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: PicoAnn Build
|
||||
shell: bash
|
||||
@@ -147,7 +152,7 @@ jobs:
|
||||
#PicoFightingBoard
|
||||
- name: PicoFightingBoard Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=PicoFightingBoard cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=PicoFightingBoard SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: PicoFightingBoard Build
|
||||
shell: bash
|
||||
@@ -163,7 +168,7 @@ jobs:
|
||||
#SparkFunProMicro
|
||||
- name: SparkFunProMicro Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=SparkFunProMicro cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=SparkFunProMicro SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_BOARD=sparkfun_promicro
|
||||
|
||||
- name: SparkFunProMicro Build
|
||||
shell: bash
|
||||
@@ -179,7 +184,7 @@ jobs:
|
||||
#WaveshareZero
|
||||
- name: WaveshareZero Configure CMake
|
||||
shell: bash
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=WaveshareZero cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
run: PICO_SDK_PATH=../pico-sdk GP2040_BOARDCONFIG=WaveshareZero SKIP_WEBBUILD=TRUE cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_BOARD=waveshare_rp2040_zero
|
||||
|
||||
- name: WaveshareZero Build
|
||||
shell: bash
|
||||
|
||||
40
.github/workflows/node.js.yml
vendored
Normal file
40
.github/workflows/node.js.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout submodules
|
||||
working-directory: ${{github.workspace}}
|
||||
run: git submodule update --init
|
||||
- name: Make Executable
|
||||
working-directory: ${{github.workspace}}/tools
|
||||
run: sudo chmod +x makefsdata
|
||||
# - name: Delete existing file
|
||||
# working-directory: ${{github.workspace}}/lib/httpd/
|
||||
# run: rm fsdata.c
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
- name: clean install
|
||||
working-directory: ${{github.workspace}}/www
|
||||
run: npm ci
|
||||
- name: Build WWW
|
||||
working-directory: ${{github.workspace}}/www
|
||||
run: CI=false npm run build --if-present
|
||||
- name: Upload www Artifact
|
||||
uses: actions/upload-artifact@v3.1.1
|
||||
with:
|
||||
name: fsData
|
||||
path: ${{github.workspace}}/lib/httpd/fsdata.c
|
||||
if-no-files-found: error
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,4 +5,5 @@ configs/MyBoard
|
||||
.DS_Store
|
||||
/www/package-lock.json
|
||||
build/
|
||||
**/generated
|
||||
|
||||
lib/httpd/fsdata.c
|
||||
|
||||
7
.vscode/extensions.json
vendored
7
.vscode/extensions.json
vendored
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"dqisme.sync-scroll",
|
||||
"ms-vscode.cmake-tools",
|
||||
"twxs.cmake"
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
|
||||
|
||||
|
||||
# initialize the SDK based on PICO_SDK_PATH
|
||||
# note: this must happen before project()
|
||||
@@ -11,12 +15,76 @@ endif()
|
||||
project(GP2040-CE LANGUAGES C CXX ASM VERSION 0.6.0)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
if(DEFINED ENV{GP2040_BOARDCONFIG})
|
||||
set(GP2040_BOARDCONFIG $ENV{GP2040_BOARDCONFIG})
|
||||
else()
|
||||
set(GP2040_BOARDCONFIG Pico)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{SKIP_SUBMODULES})
|
||||
set(SKIP_SUBMODULES $ENV{SKIP_SUBMODULES})
|
||||
else()
|
||||
set(SKIP_SUBMODULES FALSE)
|
||||
endif()
|
||||
|
||||
|
||||
if(DEFINED ENV{SKIP_WEBBUILD})
|
||||
set(SKIP_WEBBUILD $ENV{SKIP_WEBBUILD})
|
||||
else()
|
||||
set(SKIP_WEBBUILD FALSE)
|
||||
endif()
|
||||
|
||||
|
||||
if(SKIP_SUBMODULES)
|
||||
cmake_print_variables(SKIP_SUBMODULES)
|
||||
else()
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
||||
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
|
||||
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
|
||||
else()
|
||||
message("Submodules updated")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SKIP_WEBBUILD)
|
||||
cmake_print_variables(SKIP_WEBBUILD)
|
||||
else()
|
||||
message(STATUS "Not Skipping WebBuild")
|
||||
include(${CMAKE_SOURCE_DIR}/modules/FindNodeJS.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/modules/FindNPM.cmake)
|
||||
if(NODEJS_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/www")
|
||||
if(NPM_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/www/package.json")
|
||||
execute_process(COMMAND ${NPM_EXECUTABLE} ci
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/www
|
||||
RESULT_VARIABLE NPM_CI_RESULT)
|
||||
if(NOT NPM_CI_RESULT EQUAL "0")
|
||||
message(FATAL_ERROR "npm ci failed with ${NPM_CI_RESULT}")
|
||||
endif()
|
||||
execute_process(COMMAND ${NPM_EXECUTABLE} run build
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/www
|
||||
RESULT_VARIABLE NPM_BUILD_RESULT)
|
||||
if(NOT NPM_BUILD_RESULT EQUAL "0")
|
||||
message(FATAL_ERROR "npm run build failed with ${NPM_BUILD_RESULT}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
if(DEFINED ENV{GP2040_BOARDCONFIG})
|
||||
set(GP2040_BOARDCONFIG $ENV{GP2040_BOARDCONFIG})
|
||||
else()
|
||||
set(GP2040_BOARDCONFIG Pico)
|
||||
endif()
|
||||
set(PICO_BOARD_HEADER_DIRS ${CMAKE_SOURCE_DIR}/configs/${GP2040_BOARDCONFIG})
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(ArduinoJson
|
||||
GIT_REPOSITORY https://github.com/bblanchon/ArduinoJson.git
|
||||
@@ -80,6 +148,10 @@ headers/addons
|
||||
configs/${GP2040_BOARDCONFIG}
|
||||
)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC
|
||||
PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
GP2040-CE is a gamepad firmware for the Raspberry Pi Pico and other boards based on the RP2040 microcontroller, and provides high performance with a rich feature set across multiple platforms. GP2040-CE is compatible with PC, MiSTer, Android, Raspberry Pi, Nintendo Switch, PS3 and PS4 (legacy controller support).
|
||||
|
||||
Full documentation can be found at <https://www.gp2040-ce.info>.
|
||||
Full documentation can be found at <https://gp2040-ce.info>.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -19,9 +19,9 @@ Full documentation can be found at <https://www.gp2040-ce.info>.
|
||||
* Support for 128x64 monochrome I2C displays - SSD1306, SH1106, and SH1107 compatible
|
||||
* Custom startup splash screen and easy image upload via web configuration
|
||||
* Support for passive buzzer speaker (3v or 5v)
|
||||
* [Built-in, embedded web configuration](https://www.gp2040-ce.info/#/web-configurator) - no download required!
|
||||
* [Built-in, embedded web configuration](https://gp2040-ce.info/#/web-configurator) - no download required!
|
||||
|
||||
Visit the [GP2040-CE Usage](https://www.gp2040-ce.info/#/usage) page for more details.
|
||||
Visit the [GP2040-CE Usage](https://gp2040-ce.info/#/usage) page for more details.
|
||||
|
||||
## Performance
|
||||
|
||||
@@ -89,7 +89,7 @@ No! GP2040-CE dedicates a processing core to just reading and writing player inp
|
||||
|
||||
#### Why do the buttons have weird labels like B3, A1, S2, etc.?
|
||||
|
||||
GP2040-CE uses a generic system for handling button inputs that resembles a traditional PlayStation controller layout with a few extra buttons. This means 4 face buttons (B1-B4), 4 shoulder buttons (L1, L2, R1, R2), Select and Start (S1, S2), 2 stick buttons (L3, R3) and 2 auxiliary buttons for things like Home and Capture (A1, A2) on the Switch. The GP2040-CE documentation and web configurator have a dropdown to change the labels to more familiar controller layouts. You can refer to the button mapping table on the [GP2040 Usage](http://www.gp2040-ce.info/#/usage?id=buttons) page.
|
||||
GP2040-CE uses a generic system for handling button inputs that resembles a traditional PlayStation controller layout with a few extra buttons. This means 4 face buttons (B1-B4), 4 shoulder buttons (L1, L2, R1, R2), Select and Start (S1, S2), 2 stick buttons (L3, R3) and 2 auxiliary buttons for things like Home and Capture (A1, A2) on the Switch. The GP2040-CE documentation and web configurator have a dropdown to change the labels to more familiar controller layouts. You can refer to the button mapping table on the [GP2040 Usage](http://gp2040-ce.info/#/usage?id=buttons) page.
|
||||
|
||||
#### What kind of voodoo is that embedded web configurator?
|
||||
|
||||
|
||||
@@ -1,208 +1,208 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2021 Jason Skuby (mytechtoybox.com)
|
||||
*/
|
||||
|
||||
#ifndef PICO_BOARD_CONFIG_H_
|
||||
#define PICO_BOARD_CONFIG_H_
|
||||
|
||||
#include <GamepadEnums.h>
|
||||
|
||||
// This is the main pin definition section.
|
||||
// This will let you specify which GPIO pin each button is assigned too.
|
||||
// You can set any of the main pins as `-1` to disable it.
|
||||
// The Turbo pin and LS + RS slider pins can also be set to `-1` to disable that functionality.
|
||||
// Please note that only when `PIN_BUTTON_TURBO` is set to `-1` will the `T##` be removed from a connected display.
|
||||
// Please note that only when `PIN_SLIDER_LS` and `PIN_SLIDER_RS` are set to `-1` will the button combo shortcut for DP/LS/RS work.
|
||||
// The buttons are listed in GP2040 configuration, beside each the listed order is *GP2040 / Xinput / Switch / PS3 / Directinput / Arcade*
|
||||
|
||||
#define PIN_DPAD_UP 2 // UP
|
||||
#define PIN_DPAD_DOWN 12 // DOWN
|
||||
#define PIN_DPAD_RIGHT 11 // RIGHT
|
||||
#define PIN_DPAD_LEFT 13 // LEFT
|
||||
#define PIN_BUTTON_B1 3 // B1 / A / B / Cross / 2 / K1
|
||||
#define PIN_BUTTON_B2 4 // B2 / B / A / Circle / 3 / K2
|
||||
#define PIN_BUTTON_R2 5 // R2 / RT / ZR / R2 / 8 / K3
|
||||
#define PIN_BUTTON_L2 6 // L2 / LT / ZL / L2 / 7 / K4
|
||||
#define PIN_BUTTON_B3 10 // B3 / X / Y / Square / 1 / P1
|
||||
#define PIN_BUTTON_B4 9 // B4 / Y / X / Triangle / 4 / P2
|
||||
#define PIN_BUTTON_R1 8 // R1 / RB / R / R1 / 6 / P3
|
||||
#define PIN_BUTTON_L1 7 // L1 / LB / L / L1 / 5 / P4
|
||||
#define PIN_BUTTON_S1 21 // S1 / Back / Minus / Select / 9 / Coin
|
||||
#define PIN_BUTTON_S2 22 // S2 / Start / Plus / Start / 10 / Start
|
||||
#define PIN_BUTTON_L3 18 // L3 / LS / LS / L3 / 11 / LS
|
||||
#define PIN_BUTTON_R3 17 // R3 / RS / RS / R3 / 12 / RS
|
||||
#define PIN_BUTTON_A1 20 // A1 / Guide / Home / PS / 13 / ~
|
||||
#define PIN_BUTTON_A2 19 // A2 / ~ / Capture / ~ / 14 / ~
|
||||
#define PIN_BUTTON_TURBO -1 // Turbo
|
||||
#define PIN_BUTTON_REVERSE -1 // UDLR Reverse
|
||||
#define PIN_SLIDER_LS -1 // Left Stick Slider
|
||||
#define PIN_SLIDER_RS -1 // Right Stick Slider
|
||||
|
||||
|
||||
// This is the SOCD section.
|
||||
// SOCD stands for `simultaneous opposing cardinal directions`.
|
||||
// There are three options for `DEFAULT_SOCD_MODE` currently:
|
||||
// 1 - `SOCD_MODE_NEUTRAL` - This is a neutral SOCD. EG. when you press `up` + `down` no input will be registered.
|
||||
// 2 - `SOCD_MODE_UP_PRIORITY` - This is up priority SOCD. EG. when you press `up` + `down` `up` will be registered.
|
||||
// 3 - `SOCD_MODE_SECOND_INPUT_PRIORITY` - This is last priority SOCD. EG. when you press and hold `up` then press `down` `down` will be registered.
|
||||
|
||||
#define DEFAULT_SOCD_MODE SOCD_MODE_NEUTRAL
|
||||
|
||||
|
||||
// This is the LEDs section.
|
||||
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
|
||||
// The Turbo LED will flash at a speed consistant with the set speed of the Turbo when a Turbo button is active.
|
||||
// It is recommended to disable the `TURBO_LED_PIN` by setting it to `-1` if you are sensitive of flashing lights.
|
||||
// The default `BOARD_LEDS_PIN` pin is set to `28`.
|
||||
// The board LED pin will allow you to connect addressible RGB LEDs on the Pico.
|
||||
// Addressible RGB LEDs should be connected to the `VBUS` pin (#40), an avalible ground pin and the defined `BOARD_LEDS_PIN`.
|
||||
// Special note - You should only ever use addressible RGB LEDs that are rated for 5v operation on the Pico.
|
||||
// The defualt `LED_BRIGHTNESS_MAXIMUM` value is `50`.
|
||||
// This will change how bright the LEDs are with `0` being off and `100` being full brightness.
|
||||
// The minimum `LED_BRIGHTNESS_MAXIMUM` value is `0`.
|
||||
// The maximum `LED_BRIGHTNESS_MAXIMUM` value is `100`.
|
||||
// The defualt `LED_BRIGHTNESS_STEPS` value is `5`.
|
||||
// This will change how many brightness steps there are when increasing or decreasing the brightness of the LEDs via the onboard shortcut.
|
||||
// It is recommend to keep this value at `5` or `10`.
|
||||
// The defualt `LED_FORMAT` is `LED_FORMAT_GRB`.
|
||||
// You can also choose the `LED_FORMAT` of `LED_FORMAT_RGB` if your addressible RGB LEDs are not working as intended.
|
||||
// The defualt `LEDS_PER_PIXEL` is set to `1`.
|
||||
// This will change how many addressible RGB LEDs there are per button.
|
||||
// The default LEDS_[BUTTON] is an order and has nothing to do with what GPIO pin something is connected to.
|
||||
// Unless you are planning on running custom animations I would recommmend you leave this as is.
|
||||
|
||||
#define TURBO_LED_PIN -1
|
||||
#define REVERSE_LED_PIN -1
|
||||
|
||||
#define BOARD_LEDS_PIN 15
|
||||
|
||||
#define LED_BRIGHTNESS_MAXIMUM 255
|
||||
#define LED_BRIGHTNESS_STEPS 10
|
||||
#define LED_FORMAT LED_FORMAT_GRB
|
||||
#define LEDS_PER_PIXEL 2
|
||||
|
||||
#define LEDS_DPAD_LEFT 0
|
||||
#define LEDS_DPAD_DOWN 1
|
||||
#define LEDS_DPAD_RIGHT 2
|
||||
#define LEDS_DPAD_UP 11
|
||||
#define LEDS_BUTTON_B3 3
|
||||
#define LEDS_BUTTON_B4 4
|
||||
#define LEDS_BUTTON_R1 5
|
||||
#define LEDS_BUTTON_L1 6
|
||||
#define LEDS_BUTTON_B1 10
|
||||
#define LEDS_BUTTON_B2 9
|
||||
#define LEDS_BUTTON_R2 8
|
||||
#define LEDS_BUTTON_L2 7
|
||||
|
||||
|
||||
// This is the Player LED section.
|
||||
// In this section you can specify if Player LEDs will be active, and, if active, which pins will be used for them.
|
||||
// The defualt is `PLED_TYPE_NONE` which will turn the Player LEDs off.
|
||||
// The default pin for each Player LED is `-1` which disables it.
|
||||
// To enable a `PLED#_PIN`, replace the `-1` with the GPIO pin number that is desired.
|
||||
// There are three options for `PLED_TYPE` currently:
|
||||
// 1 - `PLED_TYPE_NONE` - This will disable the Player LEDs
|
||||
// 2 - `PLED_TYPE_PWM` - This will enable the Player LEDs ( it is recommended to run through 3V3(OUT) with a resistor)
|
||||
// 3 - `PLED_TYPE_RGB` - This will enable the Player LEDs as addressible RGB LEDs (please not that this has not been implemented yet)
|
||||
|
||||
#define PLED_TYPE PLED_TYPE_NONE
|
||||
#define PLED1_PIN -1
|
||||
#define PLED2_PIN -1
|
||||
#define PLED3_PIN -1
|
||||
#define PLED4_PIN -1
|
||||
|
||||
|
||||
// This is the Analog section.
|
||||
// In this section you can specify if Analog is enabled, and, if endabled, which pins will be used for it.
|
||||
// The default for `ANALOG_ADC_VRX` and `ANALOG_ADC_VRY` is `-1` which disables them.
|
||||
// To enable a `ANALOG_ADC_VRX` and `ANALOG_ADC_VRY`, replace the `-1` with the GPIO pin numbers that are desired.
|
||||
|
||||
#define ANALOG_ADC_VRX -1
|
||||
#define ANALOG_ADC_VRY -1
|
||||
|
||||
|
||||
// This is the I2C Display section (commonly known as the OLED display section).
|
||||
// In this section you can specify if a display as been enabled, which pins are assined to it, the block address and speed.
|
||||
// The default for `HAS_I2C_DISPLAY` is `1` which enables it.
|
||||
// To disable the display you can change `HAS_I2C_DISPLAY` to `-1`.
|
||||
// The default `I2C_SDA_PIN` is `0`.
|
||||
// The defualt `I2C_SCL_PIN` is `1`.
|
||||
// The defualt `I2C_BLOCK` is `12c0`.
|
||||
// If you change the `I2C_SDA_PIN` and `I2C_SCL_PIN` pin mapping, you may need to change the `I2C_BLOCK` as well.
|
||||
// The defualt `I2C_SPEED` is `400000`.
|
||||
// This should be more than fast enough for most displays.
|
||||
// Some smaller displays (like 0.96" and 1.31") can go up to `800000` or even `1000000`.
|
||||
// The default `DISPLAY_FLIP` is `0`.
|
||||
// This can be changed to `1` to have the dispaly output flipped.
|
||||
// The default `DISPLAY_INVERY` is `0`.
|
||||
// This can be changed to `1` to have the color on the display inverted.
|
||||
// The default `BUTTON_LAYOUT` is `BUTTON_LAYOUT_STICK` which will show an arcade stick on the left hand side of the display.
|
||||
// There are seven options for `BUTTON_LAYOUT` currently:
|
||||
// 1 - BUTTON_LAYOUT_STICK - This is a basic joystick layout
|
||||
// 2 - BUTTON_LAYOUT_STICKLESS - This is a basic stickless (all button) layout
|
||||
// 3 - BUTTON_LAYOUT_BUTTONS_ANGLED - This a WASD button layout that is angled
|
||||
// 4 - BUTTON_LAYOUT_BUTTONS_BASIC - This a WASD button layout that is straight
|
||||
// 5 - BUTTON_LAYOUT_KEYBOARD_ANGLED - This is a WASD keyboard layout that is angled
|
||||
// 6 - BUTTON_LAYOUT_KEYBOARDA - This is a WASD keyboard layout that is straight
|
||||
// 7 - BUTTON_LAYOUT_DANCEPADA - This is a dance pad layout (must be used with `BUTTON_LAYOUT_DANCEPADB` in `BUTTON_LAYOUT_RIGHT`)
|
||||
// The default `BUTTON_LAYOUT_RIGHT` is `BUTTON_LAYOUT_NOIR8` which will show eight buttons on the right hand side of the display.
|
||||
// There are eleven options for `BUTTON_LAYOUT_RIGHT` currently:
|
||||
// 1 - BUTTON_LAYOUT_ARCADE - This is a standard 8 button arcade layout
|
||||
// 2 - BUTTON_LAYOUT_STICKLESSB - This is a basic stickless (all button) layout
|
||||
// 3 - BUTTON_LAYOUT_BUTTONS_ANGLEDB - This is a standard 8 button arcade layout that is angled
|
||||
// 4 - BUTTON_LAYOUT_VEWLIX - This is the standard 8 button Vewlix layout
|
||||
// 5 - BUTTON_LAYOUT_VEWLIX7 - This is the standard 7 button Vewlix layout
|
||||
// 6 - BUTTON_LAYOUT_CAPCOM - This is the standard 8 button Capcom layout
|
||||
// 7 - BUTTON_LAYOUT_CAPCOM6 - This is the stndard 6 button Capcom layout
|
||||
// 8 - BUTTON_LAYOUT_SEGA2P - This is the standard 8 button Sega2P layout
|
||||
// 9 - BUTTON_LAYOUT_NOIR8 - This is the standard 8 button Noir layout
|
||||
// 10 - BUTTON_LAYOUT_KEYBOARDB - This is a WASD keyboard layout that is straight
|
||||
// 11 - BUTTON_LAYOUT_DANCEPADB - This is a dance pad layout (must be used with `BUTTON_LAYOUT_DANCEPADA` in `BUTTON_LAYOUT`)
|
||||
// The default `SPLASH_MODE` is `NOSPLASH`.
|
||||
// There are four options for `SPLASH_MODE` currently:
|
||||
// 1 - `STATICSPLASH` - This will display the static splash image
|
||||
// 2 - `CLOSEIN` - This will display the static splash image as a top and bottom coming together animation
|
||||
// 3 - `CLOSEINCUSTOM` - This will display the custom splash image as a top and bottom coming together animation
|
||||
// 4 - `NOSPLASH` - This will not display a splash screen on boot
|
||||
// Special note - All of the splash screen images can be changed via `include/bitmaps.h`
|
||||
|
||||
#define HAS_I2C_DISPLAY 1
|
||||
#define I2C_SDA_PIN 26
|
||||
#define I2C_SCL_PIN 27
|
||||
#define I2C_BLOCK i2c1
|
||||
#define I2C_SPEED 800000
|
||||
#define DISPLAY_FLIP 0
|
||||
#define DISPLAY_INVERT 0
|
||||
|
||||
#define REVERSE_UP_DEFAULT 1
|
||||
#define REVERSE_DOWN_DEFAULT 1
|
||||
#define REVERSE_LEFT_DEFAULT 1
|
||||
#define REVERSE_RIGHT_DEFAULT 1
|
||||
|
||||
#define BUTTON_LAYOUT BUTTON_LAYOUT_STICKLESS
|
||||
#define BUTTON_LAYOUT_RIGHT BUTTON_LAYOUT_STICKLESSB
|
||||
#define SPLASH_MODE NOSPLASH
|
||||
#define SPLASH_CHOICE MAIN
|
||||
|
||||
// Board LED Add-on Setting
|
||||
// BOARD_LED_OFF - Turns the on-board LED off
|
||||
// MODE_INDICATOR - On-board LED blinks on various frequencies depending
|
||||
// on the current mode (config, normal, or no USB data)
|
||||
// INPUT_TEST - Blinks whenever any input is made
|
||||
|
||||
#define BOARD_LED_TYPE BOARD_LED_OFF
|
||||
|
||||
// Dual Directional Add-on Options
|
||||
|
||||
#define PIN_DUAL_DIRECTIONAL_UP -1
|
||||
#define PIN_DUAL_DIRECTIONAL_DOWN -1
|
||||
#define PIN_DUAL_DIRECTIONAL_LEFT -1
|
||||
#define PIN_DUAL_DIRECTIONAL_RIGHT -1
|
||||
#define DUAL_DIRECTIONAL_STICK_MODE DPAD_MODE_DIGITAL
|
||||
#define DUAL_DIRECTIONAL_COMBINE_MODE DUAL_COMBINE_MODE_MIXED
|
||||
|
||||
// BOOTSEL Button Add-on setting
|
||||
#define BOOTSEL_BUTTON_MASK 0 // 0 means none, get other mask from GamepadState.h
|
||||
|
||||
#endif
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2021 Jason Skuby (mytechtoybox.com)
|
||||
*/
|
||||
|
||||
#ifndef PICO_BOARD_CONFIG_H_
|
||||
#define PICO_BOARD_CONFIG_H_
|
||||
|
||||
#include <GamepadEnums.h>
|
||||
|
||||
// This is the main pin definition section.
|
||||
// This will let you specify which GPIO pin each button is assigned too.
|
||||
// You can set any of the main pins as `-1` to disable it.
|
||||
// The Turbo pin and LS + RS slider pins can also be set to `-1` to disable that functionality.
|
||||
// Please note that only when `PIN_BUTTON_TURBO` is set to `-1` will the `T##` be removed from a connected display.
|
||||
// Please note that only when `PIN_SLIDER_LS` and `PIN_SLIDER_RS` are set to `-1` will the button combo shortcut for DP/LS/RS work.
|
||||
// The buttons are listed in GP2040 configuration, beside each the listed order is *GP2040 / Xinput / Switch / PS3 / Directinput / Arcade*
|
||||
|
||||
#define PIN_DPAD_UP 2 // UP
|
||||
#define PIN_DPAD_DOWN 12 // DOWN
|
||||
#define PIN_DPAD_RIGHT 11 // RIGHT
|
||||
#define PIN_DPAD_LEFT 13 // LEFT
|
||||
#define PIN_BUTTON_B1 3 // B1 / A / B / Cross / 2 / K1
|
||||
#define PIN_BUTTON_B2 4 // B2 / B / A / Circle / 3 / K2
|
||||
#define PIN_BUTTON_R2 5 // R2 / RT / ZR / R2 / 8 / K3
|
||||
#define PIN_BUTTON_L2 6 // L2 / LT / ZL / L2 / 7 / K4
|
||||
#define PIN_BUTTON_B3 10 // B3 / X / Y / Square / 1 / P1
|
||||
#define PIN_BUTTON_B4 9 // B4 / Y / X / Triangle / 4 / P2
|
||||
#define PIN_BUTTON_R1 8 // R1 / RB / R / R1 / 6 / P3
|
||||
#define PIN_BUTTON_L1 7 // L1 / LB / L / L1 / 5 / P4
|
||||
#define PIN_BUTTON_S1 21 // S1 / Back / Minus / Select / 9 / Coin
|
||||
#define PIN_BUTTON_S2 22 // S2 / Start / Plus / Start / 10 / Start
|
||||
#define PIN_BUTTON_L3 18 // L3 / LS / LS / L3 / 11 / LS
|
||||
#define PIN_BUTTON_R3 17 // R3 / RS / RS / R3 / 12 / RS
|
||||
#define PIN_BUTTON_A1 20 // A1 / Guide / Home / PS / 13 / ~
|
||||
#define PIN_BUTTON_A2 19 // A2 / ~ / Capture / ~ / 14 / ~
|
||||
#define PIN_BUTTON_TURBO -1 // Turbo
|
||||
#define PIN_BUTTON_REVERSE -1 // UDLR Reverse
|
||||
#define PIN_SLIDER_LS -1 // Left Stick Slider
|
||||
#define PIN_SLIDER_RS -1 // Right Stick Slider
|
||||
|
||||
|
||||
// This is the SOCD section.
|
||||
// SOCD stands for `simultaneous opposing cardinal directions`.
|
||||
// There are three options for `DEFAULT_SOCD_MODE` currently:
|
||||
// 1 - `SOCD_MODE_NEUTRAL` - This is a neutral SOCD. EG. when you press `up` + `down` no input will be registered.
|
||||
// 2 - `SOCD_MODE_UP_PRIORITY` - This is up priority SOCD. EG. when you press `up` + `down` `up` will be registered.
|
||||
// 3 - `SOCD_MODE_SECOND_INPUT_PRIORITY` - This is last priority SOCD. EG. when you press and hold `up` then press `down` `down` will be registered.
|
||||
|
||||
#define DEFAULT_SOCD_MODE SOCD_MODE_NEUTRAL
|
||||
|
||||
|
||||
// This is the LEDs section.
|
||||
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
|
||||
// The Turbo LED will flash at a speed consistant with the set speed of the Turbo when a Turbo button is active.
|
||||
// It is recommended to disable the `TURBO_LED_PIN` by setting it to `-1` if you are sensitive of flashing lights.
|
||||
// The default `BOARD_LEDS_PIN` pin is set to `28`.
|
||||
// The board LED pin will allow you to connect addressible RGB LEDs on the Pico.
|
||||
// Addressible RGB LEDs should be connected to the `VBUS` pin (#40), an avalible ground pin and the defined `BOARD_LEDS_PIN`.
|
||||
// Special note - You should only ever use addressible RGB LEDs that are rated for 5v operation on the Pico.
|
||||
// The defualt `LED_BRIGHTNESS_MAXIMUM` value is `50`.
|
||||
// This will change how bright the LEDs are with `0` being off and `100` being full brightness.
|
||||
// The minimum `LED_BRIGHTNESS_MAXIMUM` value is `0`.
|
||||
// The maximum `LED_BRIGHTNESS_MAXIMUM` value is `100`.
|
||||
// The defualt `LED_BRIGHTNESS_STEPS` value is `5`.
|
||||
// This will change how many brightness steps there are when increasing or decreasing the brightness of the LEDs via the onboard shortcut.
|
||||
// It is recommend to keep this value at `5` or `10`.
|
||||
// The defualt `LED_FORMAT` is `LED_FORMAT_GRB`.
|
||||
// You can also choose the `LED_FORMAT` of `LED_FORMAT_RGB` if your addressible RGB LEDs are not working as intended.
|
||||
// The defualt `LEDS_PER_PIXEL` is set to `1`.
|
||||
// This will change how many addressible RGB LEDs there are per button.
|
||||
// The default LEDS_[BUTTON] is an order and has nothing to do with what GPIO pin something is connected to.
|
||||
// Unless you are planning on running custom animations I would recommmend you leave this as is.
|
||||
|
||||
#define TURBO_LED_PIN -1
|
||||
#define REVERSE_LED_PIN -1
|
||||
|
||||
#define BOARD_LEDS_PIN 15
|
||||
|
||||
#define LED_BRIGHTNESS_MAXIMUM 255
|
||||
#define LED_BRIGHTNESS_STEPS 10
|
||||
#define LED_FORMAT LED_FORMAT_GRB
|
||||
#define LEDS_PER_PIXEL 2
|
||||
|
||||
#define LEDS_DPAD_LEFT 0
|
||||
#define LEDS_DPAD_DOWN 1
|
||||
#define LEDS_DPAD_RIGHT 2
|
||||
#define LEDS_DPAD_UP 11
|
||||
#define LEDS_BUTTON_B3 3
|
||||
#define LEDS_BUTTON_B4 4
|
||||
#define LEDS_BUTTON_R1 5
|
||||
#define LEDS_BUTTON_L1 6
|
||||
#define LEDS_BUTTON_B1 10
|
||||
#define LEDS_BUTTON_B2 9
|
||||
#define LEDS_BUTTON_R2 8
|
||||
#define LEDS_BUTTON_L2 7
|
||||
|
||||
|
||||
// This is the Player LED section.
|
||||
// In this section you can specify if Player LEDs will be active, and, if active, which pins will be used for them.
|
||||
// The defualt is `PLED_TYPE_NONE` which will turn the Player LEDs off.
|
||||
// The default pin for each Player LED is `-1` which disables it.
|
||||
// To enable a `PLED#_PIN`, replace the `-1` with the GPIO pin number that is desired.
|
||||
// There are three options for `PLED_TYPE` currently:
|
||||
// 1 - `PLED_TYPE_NONE` - This will disable the Player LEDs
|
||||
// 2 - `PLED_TYPE_PWM` - This will enable the Player LEDs ( it is recommended to run through 3V3(OUT) with a resistor)
|
||||
// 3 - `PLED_TYPE_RGB` - This will enable the Player LEDs as addressible RGB LEDs (please not that this has not been implemented yet)
|
||||
|
||||
#define PLED_TYPE PLED_TYPE_NONE
|
||||
#define PLED1_PIN -1
|
||||
#define PLED2_PIN -1
|
||||
#define PLED3_PIN -1
|
||||
#define PLED4_PIN -1
|
||||
|
||||
|
||||
// This is the Analog section.
|
||||
// In this section you can specify if Analog is enabled, and, if endabled, which pins will be used for it.
|
||||
// The default for `ANALOG_ADC_VRX` and `ANALOG_ADC_VRY` is `-1` which disables them.
|
||||
// To enable a `ANALOG_ADC_VRX` and `ANALOG_ADC_VRY`, replace the `-1` with the GPIO pin numbers that are desired.
|
||||
|
||||
#define ANALOG_ADC_VRX -1
|
||||
#define ANALOG_ADC_VRY -1
|
||||
|
||||
|
||||
// This is the I2C Display section (commonly known as the OLED display section).
|
||||
// In this section you can specify if a display as been enabled, which pins are assined to it, the block address and speed.
|
||||
// The default for `HAS_I2C_DISPLAY` is `1` which enables it.
|
||||
// To disable the display you can change `HAS_I2C_DISPLAY` to `-1`.
|
||||
// The default `I2C_SDA_PIN` is `0`.
|
||||
// The defualt `I2C_SCL_PIN` is `1`.
|
||||
// The defualt `I2C_BLOCK` is `12c0`.
|
||||
// If you change the `I2C_SDA_PIN` and `I2C_SCL_PIN` pin mapping, you may need to change the `I2C_BLOCK` as well.
|
||||
// The defualt `I2C_SPEED` is `400000`.
|
||||
// This should be more than fast enough for most displays.
|
||||
// Some smaller displays (like 0.96" and 1.31") can go up to `800000` or even `1000000`.
|
||||
// The default `DISPLAY_FLIP` is `0`.
|
||||
// This can be changed to `1` to have the dispaly output flipped.
|
||||
// The default `DISPLAY_INVERY` is `0`.
|
||||
// This can be changed to `1` to have the color on the display inverted.
|
||||
// The default `BUTTON_LAYOUT` is `BUTTON_LAYOUT_STICK` which will show an arcade stick on the left hand side of the display.
|
||||
// There are seven options for `BUTTON_LAYOUT` currently:
|
||||
// 1 - BUTTON_LAYOUT_STICK - This is a basic joystick layout
|
||||
// 2 - BUTTON_LAYOUT_STICKLESS - This is a basic stickless (all button) layout
|
||||
// 3 - BUTTON_LAYOUT_BUTTONS_ANGLED - This a WASD button layout that is angled
|
||||
// 4 - BUTTON_LAYOUT_BUTTONS_BASIC - This a WASD button layout that is straight
|
||||
// 5 - BUTTON_LAYOUT_KEYBOARD_ANGLED - This is a WASD keyboard layout that is angled
|
||||
// 6 - BUTTON_LAYOUT_KEYBOARDA - This is a WASD keyboard layout that is straight
|
||||
// 7 - BUTTON_LAYOUT_DANCEPADA - This is a dance pad layout (must be used with `BUTTON_LAYOUT_DANCEPADB` in `BUTTON_LAYOUT_RIGHT`)
|
||||
// The default `BUTTON_LAYOUT_RIGHT` is `BUTTON_LAYOUT_NOIR8` which will show eight buttons on the right hand side of the display.
|
||||
// There are eleven options for `BUTTON_LAYOUT_RIGHT` currently:
|
||||
// 1 - BUTTON_LAYOUT_ARCADE - This is a standard 8 button arcade layout
|
||||
// 2 - BUTTON_LAYOUT_STICKLESSB - This is a basic stickless (all button) layout
|
||||
// 3 - BUTTON_LAYOUT_BUTTONS_ANGLEDB - This is a standard 8 button arcade layout that is angled
|
||||
// 4 - BUTTON_LAYOUT_VEWLIX - This is the standard 8 button Vewlix layout
|
||||
// 5 - BUTTON_LAYOUT_VEWLIX7 - This is the standard 7 button Vewlix layout
|
||||
// 6 - BUTTON_LAYOUT_CAPCOM - This is the standard 8 button Capcom layout
|
||||
// 7 - BUTTON_LAYOUT_CAPCOM6 - This is the stndard 6 button Capcom layout
|
||||
// 8 - BUTTON_LAYOUT_SEGA2P - This is the standard 8 button Sega2P layout
|
||||
// 9 - BUTTON_LAYOUT_NOIR8 - This is the standard 8 button Noir layout
|
||||
// 10 - BUTTON_LAYOUT_KEYBOARDB - This is a WASD keyboard layout that is straight
|
||||
// 11 - BUTTON_LAYOUT_DANCEPADB - This is a dance pad layout (must be used with `BUTTON_LAYOUT_DANCEPADA` in `BUTTON_LAYOUT`)
|
||||
// The default `SPLASH_MODE` is `NOSPLASH`.
|
||||
// There are four options for `SPLASH_MODE` currently:
|
||||
// 1 - `STATICSPLASH` - This will display the static splash image
|
||||
// 2 - `CLOSEIN` - This will display the static splash image as a top and bottom coming together animation
|
||||
// 3 - `CLOSEINCUSTOM` - This will display the custom splash image as a top and bottom coming together animation
|
||||
// 4 - `NOSPLASH` - This will not display a splash screen on boot
|
||||
// Special note - All of the splash screen images can be changed via `include/bitmaps.h`
|
||||
|
||||
#define HAS_I2C_DISPLAY 1
|
||||
#define I2C_SDA_PIN 26
|
||||
#define I2C_SCL_PIN 27
|
||||
#define I2C_BLOCK i2c1
|
||||
#define I2C_SPEED 800000
|
||||
#define DISPLAY_FLIP 0
|
||||
#define DISPLAY_INVERT 0
|
||||
|
||||
#define REVERSE_UP_DEFAULT 1
|
||||
#define REVERSE_DOWN_DEFAULT 1
|
||||
#define REVERSE_LEFT_DEFAULT 1
|
||||
#define REVERSE_RIGHT_DEFAULT 1
|
||||
|
||||
#define BUTTON_LAYOUT BUTTON_LAYOUT_STICKLESS
|
||||
#define BUTTON_LAYOUT_RIGHT BUTTON_LAYOUT_STICKLESSB
|
||||
#define SPLASH_MODE NOSPLASH
|
||||
#define SPLASH_CHOICE MAIN
|
||||
|
||||
// Board LED Add-on Setting
|
||||
// BOARD_LED_OFF - Turns the on-board LED off
|
||||
// MODE_INDICATOR - On-board LED blinks on various frequencies depending
|
||||
// on the current mode (config, normal, or no USB data)
|
||||
// INPUT_TEST - Blinks whenever any input is made
|
||||
|
||||
#define BOARD_LED_TYPE BOARD_LED_OFF
|
||||
|
||||
// Dual Directional Add-on Options
|
||||
|
||||
#define PIN_DUAL_DIRECTIONAL_UP -1
|
||||
#define PIN_DUAL_DIRECTIONAL_DOWN -1
|
||||
#define PIN_DUAL_DIRECTIONAL_LEFT -1
|
||||
#define PIN_DUAL_DIRECTIONAL_RIGHT -1
|
||||
#define DUAL_DIRECTIONAL_STICK_MODE DPAD_MODE_DIGITAL
|
||||
#define DUAL_DIRECTIONAL_COMBINE_MODE DUAL_COMBINE_MODE_MIXED
|
||||
|
||||
// BOOTSEL Button Add-on setting
|
||||
#define BOOTSEL_BUTTON_MASK 0 // 0 means none, get other mask from GamepadState.h
|
||||
|
||||
#endif
|
||||
|
||||
88
configs/FlatboxRev4/flatboxrev4.h
Normal file
88
configs/FlatboxRev4/flatboxrev4.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------
|
||||
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
|
||||
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
|
||||
// -----------------------------------------------------
|
||||
|
||||
|
||||
#ifndef _BOARDS_FLATBOXREV4_H
|
||||
#define _BOARDS_FLATBOXREV4_H
|
||||
|
||||
// For board detection
|
||||
#define FLATBOXREV4
|
||||
|
||||
//For crappy crystal
|
||||
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
|
||||
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
|
||||
#endif
|
||||
|
||||
// --- UART ---
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
// --- LED ---
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
// no PICO_DEFAULT_WS2812_PIN
|
||||
|
||||
// --- I2C ---
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 4
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 5
|
||||
#endif
|
||||
|
||||
// --- SPI ---
|
||||
#ifndef PICO_DEFAULT_SPI
|
||||
#define PICO_DEFAULT_SPI 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_SCK_PIN
|
||||
#define PICO_DEFAULT_SPI_SCK_PIN 18
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_TX_PIN
|
||||
#define PICO_DEFAULT_SPI_TX_PIN 19
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_RX_PIN
|
||||
#define PICO_DEFAULT_SPI_RX_PIN 16
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_CSN_PIN
|
||||
#define PICO_DEFAULT_SPI_CSN_PIN 17
|
||||
#endif
|
||||
|
||||
// --- FLASH ---
|
||||
|
||||
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
|
||||
#define PICO_SMPS_MODE_PIN 23
|
||||
|
||||
#ifndef PICO_RP2040_B0_SUPPORTED
|
||||
#define PICO_RP2040_B0_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
87
configs/FlatboxRev5/flatboxrev5.h
Normal file
87
configs/FlatboxRev5/flatboxrev5.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------
|
||||
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
|
||||
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_FLATBOXREV5_H
|
||||
#define _BOARDS_FLATBOXREV5_H
|
||||
|
||||
// For board detection
|
||||
#define FLATBOXREV5
|
||||
|
||||
// For crappy crystal
|
||||
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
|
||||
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
|
||||
#endif
|
||||
|
||||
// --- UART ---
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
// --- LED ---
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
// no PICO_DEFAULT_WS2812_PIN
|
||||
|
||||
// --- I2C ---
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 4
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 5
|
||||
#endif
|
||||
|
||||
// --- SPI ---
|
||||
#ifndef PICO_DEFAULT_SPI
|
||||
#define PICO_DEFAULT_SPI 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_SCK_PIN
|
||||
#define PICO_DEFAULT_SPI_SCK_PIN 18
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_TX_PIN
|
||||
#define PICO_DEFAULT_SPI_TX_PIN 19
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_RX_PIN
|
||||
#define PICO_DEFAULT_SPI_RX_PIN 16
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_CSN_PIN
|
||||
#define PICO_DEFAULT_SPI_CSN_PIN 17
|
||||
#endif
|
||||
|
||||
// --- FLASH ---
|
||||
|
||||
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
|
||||
#define PICO_SMPS_MODE_PIN 23
|
||||
|
||||
#ifndef PICO_RP2040_B0_SUPPORTED
|
||||
#define PICO_RP2040_B0_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
88
configs/WaveshareZero/wavesharezero.h
Normal file
88
configs/WaveshareZero/wavesharezero.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------
|
||||
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
|
||||
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
|
||||
// -----------------------------------------------------
|
||||
|
||||
|
||||
#ifndef _BOARDS_WAVESHAREZERO_H
|
||||
#define _BOARDS_WAVESHAREZERO_H
|
||||
|
||||
// For board detection
|
||||
#define WAVESHAREZERO
|
||||
|
||||
//For crappy crystal
|
||||
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
|
||||
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
|
||||
#endif
|
||||
|
||||
// --- UART ---
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
// --- LED ---
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
// no PICO_DEFAULT_WS2812_PIN
|
||||
|
||||
// --- I2C ---
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 4
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 5
|
||||
#endif
|
||||
|
||||
// --- SPI ---
|
||||
#ifndef PICO_DEFAULT_SPI
|
||||
#define PICO_DEFAULT_SPI 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_SCK_PIN
|
||||
#define PICO_DEFAULT_SPI_SCK_PIN 18
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_TX_PIN
|
||||
#define PICO_DEFAULT_SPI_TX_PIN 19
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_RX_PIN
|
||||
#define PICO_DEFAULT_SPI_RX_PIN 16
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_SPI_CSN_PIN
|
||||
#define PICO_DEFAULT_SPI_CSN_PIN 17
|
||||
#endif
|
||||
|
||||
// --- FLASH ---
|
||||
|
||||
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
|
||||
#define PICO_SMPS_MODE_PIN 23
|
||||
|
||||
#ifndef PICO_RP2040_B0_SUPPORTED
|
||||
#define PICO_RP2040_B0_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -107,6 +107,24 @@ This setup script requires approximately 2.5GB of disk space on your SD card.
|
||||
|
||||
## Building
|
||||
|
||||
### Environment Variables
|
||||
|
||||
A number of new environment variables have been setup to control parts of the build flow.
|
||||
|
||||
| Name | Default | Description |
|
||||
| ----------- | --------- | ----------- |
|
||||
|GP2040_BOARDCONFIG |Pico |The boards.h config file to use for the build.|
|
||||
|SKIP_WEBBUILD|FALSE|Determines whether the web configurator is built during the cmake configuration step.|
|
||||
|SKIP_SUBMODULES|FALSE|Determines whether the submodule init command is run automatically during the cmake configuration step.|
|
||||
|
||||
#### SDK Variables
|
||||
|
||||
There are a few SDK variables we take advantage of for our builds.
|
||||
|
||||
| Name | Default | Description |
|
||||
| ----------- | --------- | ----------- |
|
||||
|PICO_BOARD|pico| This is the embeded board that the RP2040 chip is part of. By default, it assumes the Pico. This variable would match the `<boardname.h>` file in the board's configs folder.|
|
||||
|
||||
### Windows
|
||||
|
||||
Start in the GP2040-CE folder
|
||||
@@ -148,6 +166,8 @@ Start in the GP2040-CE folder
|
||||
|
||||
## Configuration
|
||||
|
||||
> Note: We're moving away from compile time configuration, in favor of runtime configuration.
|
||||
|
||||
There are two simple options for building GP2040 for your board. You can either edit an existing board definition, or create your own. Several example configurations are located in the repository **[configs](https://github.com/OpenStickFoundation/GP2040-CE/tree/main/configs)** folder. This document will outline setting up a new build configuration.
|
||||
|
||||
### Board Configuration Folder
|
||||
@@ -159,6 +179,7 @@ Each subfolder in [`configs`](https://github.com/OpenStickFoundation/GP2040-CE/t
|
||||
| `BoardConfig.h` | Yes | The configuration file used when building GP2040 for a specific controller/board. Contains initial pin mappings, LED configuration, etc. |
|
||||
| `README.md` | No | Provides information related to this board configuration. Not required for the build process, but suggested for pull requests of new board configurations. |
|
||||
| `assets/` | No | Folder for containing assets included in the `README.md`. Not required for the build process.
|
||||
|'<boardname.h>'|No| Board definition file, named after the board itself, used by the Pico SDK for configuring board specific SDK features. [Pico Example](https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/include/boards/pico.h)
|
||||
|
||||
### Board Configuration (`BoardConfig.h`)
|
||||
|
||||
@@ -168,7 +189,7 @@ The following board options are available in the `BoardConfig.h` file:
|
||||
| ---------------- | ---------------------------- | --------- |
|
||||
| **PIN_DPAD_*X***<br>**PIN_BUTTON_*X*** | The GPIO pin for the button. Replace the *`X`* with GP2040 button or D-pad direction. | Yes |
|
||||
| **DEFAULT_SOCD_MODE** | The default SOCD mode to use, defaults to `SOCD_MODE_NEUTRAL`.<br>Available options are:<br>`SOCD_MODE_NEUTRAL`<br>`SOCD_MODE_UP_PRIORITY`<br>`SOCD_MODE_SECOND_INPUT_PRIORITY` | No |
|
||||
| **BUTTON_LAYOUT** | The layout of controls/buttons for use with per-button LEDs and external displays.<br>Available options are:<br>`BUTTON_LAYOUT_`<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_WASD` | Yes |
|
||||
| **BUTTON_LAYOUT** | The layout of controls/buttons for use with per-button LEDs and external displays.<br>Available options are:<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_WASD` | Yes |
|
||||
|
||||
Create `configs/NewBoard/BoardConfig.h` and add your pin configuration and options. An example `BoardConfig.h` file:
|
||||
|
||||
@@ -211,7 +232,7 @@ The following RGB LED options are available in the `BoardConfig.h` file:
|
||||
|
||||
| Name | Description | Required? |
|
||||
| ---------------- | ---------------------------- | --------- |
|
||||
| **BUTTON_LAYOUT** | The layout of controls/buttons for use with per-button LEDs and external displays.<br>Available options are:<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_WASD` | Yes |
|
||||
| **BUTTON_LAYOUT** | The layout of controls/buttons for use with per-button LEDs and external displays.<br>Available options are:<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_WASD` | Yes |
|
||||
| **BOARD_LEDS_PIN** | Data PIN for your LED strand | Yes |
|
||||
| **LED_FORMAT** | The color data format for the LED chain.<br>Available options are:<br>`LED_FORMAT_GRB`<br>`LED_FORMAT_RGB`<br>`LED_FORMAT_GRBW`<br>`LED_FORMAT_RGBW` | No, default value `LED_FORMAT_GRB` |
|
||||
| **LEDS_PER_PIXEL** | The number of LEDs per button. | Yes |
|
||||
@@ -292,7 +313,7 @@ GP2040 supports 128x64 monochrome displays that run on the SSD1306, SH1106 or SH
|
||||
|
||||
| Name | Description | Required? |
|
||||
| - | - | - |
|
||||
| **BUTTON_LAYOUT** | The layout of controls/buttons for use with per-button LEDs and external displays.<br>Available options are:<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_WASD` | Yes |
|
||||
| **BUTTON_LAYOUT** | The layout of controls/buttons for use with per-button LEDs and external displays.<br>Available options are:<br>`BUTTON_LAYOUT_STICKLESS`<br>`BUTTON_LAYOUT_WASD` | Yes |
|
||||
| **HAS_I2C_DISPLAY** | Flag to indicate the controller contains an I2C display module. | No |
|
||||
| **DISPLAY_I2C_ADDR** | The I2C address of the display. | No, defaults to `0x3C` |
|
||||
| **I2C_SDA_PIN** | The GPIO pin for the I2C SDA line. | If `HAS_I2C_DISPLAY` is enabled |
|
||||
|
||||
@@ -28,14 +28,10 @@ No! The RP2040 chip contains two processing cores. GP2040 dedicates one core to
|
||||
|
||||
### Why do the buttons have weird labels like B3, A1, S2, etc.?
|
||||
|
||||
GP2040 uses a generic system for handling button inputs that most closely maps to a traditional PlayStation controller layout with a few extra buttons. This means 4 face buttons (B1-B4), 4 shoulder buttons (L1, L2, R1, R2), Select and Start (S1, S2), 2 stick buttons (L3, R3) and 2 auxiliary buttons for things like Home and Capture (A1, A2) on the Switch. The GP2040 documentation and web configurator have a dropdown to change the labels to more familiar controller layouts. You can also refer to the button mapping table on the [GP2040 Usage](https://www.gp2040-CE.info/#/usage?id=buttons) page.
|
||||
GP2040 uses a generic system for handling button inputs that most closely maps to a traditional PlayStation controller layout with a few extra buttons. This means 4 face buttons (B1-B4), 4 shoulder buttons (L1, L2, R1, R2), Select and Start (S1, S2), 2 stick buttons (L3, R3) and 2 auxiliary buttons for things like Home and Capture (A1, A2) on the Switch. The GP2040 documentation and web configurator have a dropdown to change the labels to more familiar controller layouts. You can also refer to the button mapping table on the [GP2040 Usage](https://gp2040-CE.info/#/usage?id=buttons) page.
|
||||
|
||||
## Technical Questions
|
||||
|
||||
### Why use PlatformIO instead of \<insert favorite project setup\>?
|
||||
|
||||
Setting up a development environment to build Pico SDK projects is a manual process which requires several components to be installed and configured. Using PlatformIO allows easy installation and updating of build and project dependencies, and makes for a less confusing experience for new developers and people that just want to make a few tweaks for a custom build.
|
||||
|
||||
### What kind of voodoo is that built-in web configurator?
|
||||
|
||||
There's no magic here, just a few cool libraries working together:
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef CONFIG_AUTOGEN_H_
|
||||
#define CONFIG_AUTOGEN_H_
|
||||
|
||||
// Boards supported in PlatformIO build configuration
|
||||
|
||||
#ifdef BOARD_ADAFRUIT_FEATHER_RP2040
|
||||
#include "boards/adafruit_feather_rp2040.h"
|
||||
#elif BOARD_ADAFRUIT_ITSYBITSY_RP2040
|
||||
#include "boards/adafruit_itsybitsy_rp2040.h"
|
||||
#elif BOARD_SPARKFUN_MICRO_RP2040
|
||||
#include "boards/sparkfun_promicro.h"
|
||||
#elif BOARD_SPARKFUN_THING_PLUS
|
||||
#include "boards/sparkfun_thingplus.h"
|
||||
#elif BOARD_ARDUINO_NANO_CONNECT
|
||||
#include "boards/arduino_nano_rp2040_connect.h"
|
||||
#elif BOARD_PIMORONI_PICO_LIPO
|
||||
#include "boards/pimoroni_picolipo_4mb.h"
|
||||
#else
|
||||
#include "boards/pico.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
21345
lib/httpd/fsdata.c
21345
lib/httpd/fsdata.c
File diff suppressed because it is too large
Load Diff
31
modules/FindNPM.cmake
Normal file
31
modules/FindNPM.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
# Find the Node.js executable
|
||||
#
|
||||
# The following variables are set:
|
||||
# NPM_FOUND True if npm was found
|
||||
# NPM_EXECUTABLE Path to the npm executable
|
||||
# NPM_VERSION npm version
|
||||
|
||||
find_program(NPM_EXECUTABLE NAMES npm)
|
||||
|
||||
if (${NPM_EXECUTABLE} MATCHES "NOTFOUND")
|
||||
message(STATUS "Could not find npm")
|
||||
set(NPM_FOUND FALSE CACHE INTERNAL "")
|
||||
unset(NPM_EXECUTABLE)
|
||||
else()
|
||||
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
|
||||
set(NPM_EXECUTABLE ${NPM_EXECUTABLE}.cmd)
|
||||
endif()
|
||||
execute_process(COMMAND ${NPM_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE VERSION_VAR
|
||||
ERROR_VARIABLE ERROR_VAR
|
||||
RESULT_VARIABLE RESULT_VAR)
|
||||
if (RESULT_VAR EQUAL 0)
|
||||
string(REGEX REPLACE "[v]" "" VERSION_VAR ${VERSION_VAR})
|
||||
string(STRIP ${VERSION_VAR} VERSION_VAR)
|
||||
set(NPM_VERSION ${VERSION_VAR} CACHE INTERNAL "")
|
||||
set(NPM_FOUND TRUE CACHE INTERNAL "")
|
||||
message(STATUS "Found npm version ${NPM_VERSION}: ${NPM_EXECUTABLE}")
|
||||
else()
|
||||
message(WARNING "Failed to execute npm --version command: ${ERROR_VAR}")
|
||||
endif()
|
||||
endif()
|
||||
29
modules/FindNodeJS.cmake
Normal file
29
modules/FindNodeJS.cmake
Normal file
@@ -0,0 +1,29 @@
|
||||
# Find the Node.js executable
|
||||
#
|
||||
# The following variables are set:
|
||||
# NODEJS_FOUND True if Node.js was found
|
||||
# NODEJS_EXECUTABLE Path to the Node.js executable
|
||||
# NODEJS_VERSION Node.js version
|
||||
|
||||
find_program(NODEJS_EXECUTABLE NAMES node nodejs)
|
||||
|
||||
if (${NODEJS_EXECUTABLE} MATCHES "NOTFOUND")
|
||||
message(STATUS "Could not find Node.js")
|
||||
set(NODEJS_FOUND FALSE CACHE INTERNAL "")
|
||||
unset(NODEJS_EXECUTABLE)
|
||||
else()
|
||||
execute_process(COMMAND ${NODEJS_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE VERSION_VAR
|
||||
ERROR_VARIABLE ERROR_VAR
|
||||
RESULT_VARIABLE RESULT_VAR)
|
||||
|
||||
if (RESULT_VAR EQUAL 0)
|
||||
string(REGEX REPLACE "[v]" "" VERSION_VAR ${VERSION_VAR})
|
||||
string(STRIP ${VERSION_VAR} VERSION_VAR)
|
||||
set(NODEJS_VERSION ${VERSION_VAR} CACHE INTERNAL "")
|
||||
set(NODEJS_FOUND TRUE CACHE INTERNAL "")
|
||||
message(STATUS "Found Node.js version ${NODEJS_VERSION}: ${NODEJS_EXECUTABLE}")
|
||||
else()
|
||||
message(WARNING "Failed to execute NodeJS --version command: ${ERROR_VAR}")
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user