Skip to content

Commit

Permalink
Merge pull request #3817 from BennyE/reserve-pins-only-for-debug
Browse files Browse the repository at this point in the history
esp32s2: Reserve UART pins only if DEBUG=1 is set to address issue 3811
  • Loading branch information
tannewt authored Dec 15, 2020
2 parents a1f773d + 81c4871 commit d6ee17c
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/esp32s2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5

#Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -ggdb
CFLAGS += -DDEBUG -ggdb
OPTIMIZATION_FLAGS ?= -Og
# You may want to enable these flags to make setting breakpoints easier.
# CFLAGS += -fno-inline -fno-ipa-sra
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */

busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL);
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/electroniccats_bastwifi/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */
}

bool board_requests_safe_mode(void) {
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/espressif_kaluga_1/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */
}

bool board_requests_safe_mode(void) {
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/espressif_saola_1_wroom/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */
}

bool board_requests_safe_mode(void) {
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/espressif_saola_1_wrover/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */
}

bool board_requests_safe_mode(void) {
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/microdev_micro_s2/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */

// SPI Flash and RAM
common_hal_never_reset_pin(&pin_GPIO26);
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/muselab_nanoesp32_s2/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */
}

bool board_requests_safe_mode(void) {
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/targett_module_clip_wroom/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */

// Crystal
common_hal_never_reset_pin(&pin_GPIO15);
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/targett_module_clip_wrover/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */

//Crystal
common_hal_never_reset_pin(&pin_GPIO15);
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32s2/boards/unexpectedmaker_feathers2/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */

// SPI Flash and RAM
common_hal_never_reset_pin(&pin_GPIO26);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO20);

// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */

// SPI Flash and RAM
common_hal_never_reset_pin(&pin_GPIO26);
Expand Down

0 comments on commit d6ee17c

Please sign in to comment.