diff --git a/.github/workflows/platformio.yaml b/.github/workflows/platformio.yaml new file mode 100644 index 0000000..f681aca --- /dev/null +++ b/.github/workflows/platformio.yaml @@ -0,0 +1,41 @@ +name: PlatformIO CI + +on: + release: + types: [published] + + push: + branches: + - main + - 'releases/**' + + pull_request: + # Sequence of patterns matched against refs/heads + branches: + - main + - 'releases/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install PlatformIO Core + run: pip install --upgrade platformio + + - name: Build PlatformIO Project + run: pio run diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/ESP32RET.ino b/ESP32RET.ino index ed9abb9..a4e170e 100644 --- a/ESP32RET.ino +++ b/ESP32RET.ino @@ -283,7 +283,8 @@ void setup() //if nothing is connected. But, you can't set 0 or writing rapidly to USB will lose data. It needs //some sort of timeout but I'm not sure exactly how much is needed or if there is a better way //to deal with this issue. - Serial.setTxTimeoutMs(2); + // TODO: there is no such method =( + // Serial.setTxTimeoutMs(2); #endif Serial.begin(1000000); //for production //Serial.begin(115200); //for testing diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..69013a8 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,27 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = ./ + +[env] +platform = espressif32 +framework = arduino +lib_deps = + fastled/FastLED @ 3.10.0 + https://github.com/collin80/can_common#8585f9dc807ebbeedeb509d74159f40f538d2d65 + https://github.com/collin80/esp32_can#6d835ae82d46748e8267b350680c851a46b38eea + https://github.com/collin80/esp32_mcp2517fd#15624220ba3bc2c3e461dc4a0c8e2e3a20d4e94d + +[env:esp32-s3] +board = esp32-s3-devkitm-1 + +[env:esp32] +board = esp32dev