From 9aa42e7400c217b319f3f6491d4b54cb7a66a742 Mon Sep 17 00:00:00 2001 From: Filip Ayazi Date: Sat, 4 Sep 2021 01:19:15 +0100 Subject: [PATCH] Add support for ESP32 platform --- README.md | 2 +- platformio.ini | 7 ++++++- src/boards.h | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ede89fe..c01259c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The code is split into the main part which mostly handles command parsing and mo Motor moves now do not block command processing and a new command `stop` was added which aborts any move in progress. ## Hardware -This is mainly intended for Sangaboard control boards and all configuration for these is already in `boards.h`, but it can also be used on different platforms (pi pico, stm32 (bluepill)). To use a custom board based on any of these platforms adjust `boards.h` to match your wiring. +This is mainly intended for Sangaboard control boards and all configuration for these is already in `boards.h`, but it can also be used on different platforms (pi pico, stm32 (bluepill), ESP32). To use a custom board based on any of these platforms adjust `boards.h` to match your wiring. If you have additional hardware connected to the board (Endstops, Light sensor) support for these can be enabled in `config.h`. diff --git a/platformio.ini b/platformio.ini index c24ad32..c933fb4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -47,4 +47,9 @@ build_flags = -D USBD_PID=0x5740 -D USB_MANUFACTURER="Unknown" -D USB_PRODUCT="\"BLUEPILL_F103C8\"" - -D HAL_PCD_MODULE_ENABLED \ No newline at end of file + -D HAL_PCD_MODULE_ENABLED + +[env:esp32] +platform = espressif32 +board = esp-wrover-kit +build_flags = -D MCU_ESP32 \ No newline at end of file diff --git a/src/boards.h b/src/boards.h index 8ee5580..e98835f 100644 --- a/src/boards.h +++ b/src/boards.h @@ -7,6 +7,8 @@ #define BOARD_CUSTOM_BLUEPILL #elif defined(MCU_PICO) #define BOARD_CUSTOM_PICO + #elif defined(MCU_ESP32) + #define BOARD_CUSTOM #else #error "Invalid build config - must specify MCU type" #endif