Skip to content

Commit

Permalink
when using ECMA-419 IO, reserve pins used by debugger serial connection
Browse files Browse the repository at this point in the history
  • Loading branch information
phoddie committed Nov 22, 2023
1 parent d2dd272 commit dc3c10f
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/devices/esp32/xsProj-esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(TO_CMAKE_PATH "${TMP_DIR}" C_TMP_DIR)

idf_component_register(
SRCS "main.c"
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${C_TMP_DIR}
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/modules/io ${C_TMP_DIR}
)

if (mxDebug EQUAL "1")
Expand Down
8 changes: 8 additions & 0 deletions build/devices/esp32/xsProj-esp32/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@

#include "mc.defines.h"

#if MODDEF_ECMA419_ENABLED
#include "common/builtinCommon.h"
#endif

#ifndef DEBUGGER_SPEED
#define DEBUGGER_SPEED 921600
#endif
Expand Down Expand Up @@ -249,6 +253,10 @@ void app_main() {
QueueHandle_t uartQueue;
uart_driver_install(USE_UART, UART_FIFO_LEN * 2, 0, 8, &uartQueue, 0);
xTaskCreate(debug_task, "debug", (768 + XT_STACK_EXTRA) / sizeof(StackType_t), uartQueue, 8, NULL);
#if MODDEF_ECMA419_ENABLED
builtinUsePin(USE_UART_TX);
builtinUsePin(USE_UART_RX);
#endif
#else
uart_driver_install(USE_UART, UART_FIFO_LEN * 2, 0, 0, NULL, 0);
#endif
Expand Down
2 changes: 1 addition & 1 deletion build/devices/esp32/xsProj-esp32c3/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(TO_CMAKE_PATH "${TMP_DIR}" C_TMP_DIR)

idf_component_register(
SRCS "main.c"
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${C_TMP_DIR}
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${ENV_MODDABLE}/modules/io ${C_TMP_DIR}
)

if (mxDebug EQUAL "1")
Expand Down
8 changes: 8 additions & 0 deletions build/devices/esp32/xsProj-esp32c3/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@

#include "mc.defines.h"

#if MODDEF_ECMA419_ENABLED
#include "common/builtinCommon.h"
#endif

#ifndef DEBUGGER_SPEED
#define DEBUGGER_SPEED 921600
#endif
Expand Down Expand Up @@ -291,6 +295,10 @@ void app_main() {
QueueHandle_t uartQueue;
uart_driver_install(USE_UART, UART_FIFO_LEN * 2, 0, 8, &uartQueue, 0);
xTaskCreate(debug_task, "debug", (768 + XT_STACK_EXTRA) / sizeof(StackType_t), uartQueue, 8, NULL);
#if MODDEF_ECMA419_ENABLED
builtinUsePin(USE_UART_TX);
builtinUsePin(USE_UART_RX);
#endif
#else
uart_driver_install(USE_UART, UART_FIFO_LEN * 2, 0, 0, NULL, 0);
#endif
Expand Down
2 changes: 1 addition & 1 deletion build/devices/esp32/xsProj-esp32c6/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(TO_CMAKE_PATH "${TMP_DIR}" C_TMP_DIR)

idf_component_register(
SRCS "main.c"
INCLUDE_DIRS ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${C_TMP_DIR}
INCLUDE_DIRS ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${ENV_MODDABLE}/modules/io ${C_TMP_DIR}
)

if (mxDebug EQUAL "1")
Expand Down
8 changes: 8 additions & 0 deletions build/devices/esp32/xsProj-esp32c6/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

#include "mc.defines.h"

#if MODDEF_ECMA419_ENABLED
#include "common/builtinCommon.h"
#endif

#define XS_STACK_EXTRA 512
#define XS_STACK_EXTRA_CLIB 1024

Expand Down Expand Up @@ -504,6 +508,10 @@ void app_main() {

#ifdef mxDebug
xTaskCreate(debug_task, "debug", (768 + XT_STACK_EXTRA) / sizeof(StackType_t), uartQueue, 8, NULL);
#if MODDEF_ECMA419_ENABLED
builtinUsePin(USE_UART_TX);
builtinUsePin(USE_UART_RX);
#endif
#endif

#endif // ! USE_USB
Expand Down
2 changes: 1 addition & 1 deletion build/devices/esp32/xsProj-esp32h2/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(TO_CMAKE_PATH "${TMP_DIR}" C_TMP_DIR)

idf_component_register(
SRCS "main.c"
INCLUDE_DIRS ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${C_TMP_DIR}
INCLUDE_DIRS ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${ENV_MODDABLE}/modules/io ${C_TMP_DIR}
)

if (mxDebug EQUAL "1")
Expand Down
8 changes: 8 additions & 0 deletions build/devices/esp32/xsProj-esp32h2/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

#include "mc.defines.h"

#if MODDEF_ECMA419_ENABLED
#include "common/builtinCommon.h"
#endif

#define XS_STACK_EXTRA 512
#define XS_STACK_EXTRA_CLIB 1024

Expand Down Expand Up @@ -504,6 +508,10 @@ void app_main() {

#ifdef mxDebug
xTaskCreate(debug_task, "debug", (768 + XT_STACK_EXTRA) / sizeof(StackType_t), uartQueue, 8, NULL);
#if MODDEF_ECMA419_ENABLED
builtinUsePin(USE_UART_TX);
builtinUsePin(USE_UART_RX);
#endif
#endif

#endif // ! USE_USB
Expand Down
2 changes: 1 addition & 1 deletion build/devices/esp32/xsProj-esp32s2/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(TO_CMAKE_PATH "${TMP_DIR}" C_TMP_DIR)

idf_component_register(
SRCS "main.c"
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${C_TMP_DIR}
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${ENV_MODDABLE}/modules/io ${C_TMP_DIR}
)

if (mxDebug EQUAL "1")
Expand Down
8 changes: 8 additions & 0 deletions build/devices/esp32/xsProj-esp32s2/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@

#include "mc.defines.h"

#if MODDEF_ECMA419_ENABLED
#include "common/builtinCommon.h"
#endif

#ifndef DEBUGGER_SPEED
#define DEBUGGER_SPEED 921600
#endif
Expand Down Expand Up @@ -237,6 +241,10 @@ void setup(void)
QueueHandle_t uartQueue;
uart_driver_install(USE_UART, UART_FIFO_LEN * 2, 0, 8, &uartQueue, 0);
xTaskCreate(debug_task, "debug", (768 + XT_STACK_EXTRA) / sizeof(StackType_t), uartQueue, 8, NULL);
#if MODDEF_ECMA419_ENABLED
builtinUsePin(USE_UART_TX);
builtinUsePin(USE_UART_RX);
#endif
#else
uart_driver_install(USE_UART, UART_FIFO_LEN * 2, 0, 0, NULL, 0);
#endif
Expand Down
2 changes: 1 addition & 1 deletion build/devices/esp32/xsProj-esp32s3/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(TO_CMAKE_PATH "${TMP_DIR}" C_TMP_DIR)

idf_component_register(
SRCS "main.c"
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${C_TMP_DIR}
INCLUDE_DIRS "." ${ENV_MODDABLE}/xs/platforms/esp ${ENV_MODDABLE}/xs/platforms/mc ${ENV_MODDABLE}/xs/includes ${ENV_MODDABLE}/modules/base/instrumentation ${ENV_MODDABLE}/modules/io ${C_TMP_DIR}
)

if (mxDebug EQUAL "1")
Expand Down
8 changes: 8 additions & 0 deletions build/devices/esp32/xsProj-esp32s3/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

#include "mc.defines.h"

#if MODDEF_ECMA419_ENABLED
#include "common/builtinCommon.h"
#endif

#define WEAK __attribute__((weak))

#ifndef DEBUGGER_SPEED
Expand Down Expand Up @@ -502,6 +506,10 @@ void app_main() {

#ifdef mxDebug
xTaskCreate(debug_task, "debug", (768 + XT_STACK_EXTRA) / sizeof(StackType_t), uartQueue, 8, NULL);
#if MODDEF_ECMA419_ENABLED
builtinUsePin(USE_UART_TX);
builtinUsePin(USE_UART_RX);
#endif
#endif

#endif // ! USE_USB
Expand Down
5 changes: 5 additions & 0 deletions modules/io/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"build": {
"IO": "$(MODDABLE)/modules/io"
},
"defines": {
"ECMA419": {
"enabled": 1
}
},
"platforms": {
"esp": {
"include": "./manifests/esp/manifest.json"
Expand Down

0 comments on commit dc3c10f

Please sign in to comment.