diff --git a/cores/esp8266/esp8266_undocumented.h b/cores/esp8266/esp8266_undocumented.h index 277d467698..5e68e53fa1 100644 --- a/cores/esp8266/esp8266_undocumented.h +++ b/cores/esp8266/esp8266_undocumented.h @@ -52,12 +52,22 @@ calls to ets_install_putc1(). */ extern void uart_buff_switch(uint8_t); +/* + ROM function, ets_install_uart_printf, is used to installs the internal ROM + putc1 driver used to print on UART0 or UART1. The installed driver is use by ets_printf. + Side note, ets_install_uart_printf just happens to return the address of the + internal putc1 driver installed. +*/ +extern void ets_install_uart_printf(void); + /* ROM function, ets_uart_printf(), prints on the UART selected by uart_buff_switch(). Supported format options are the same as vprintf(). Also has cooked newline behavior. No flash format/string support; however, ISR safe. - Also, uses a static function in ROM to print characters which is only - controlled by uart_buff_switch(). + It also uses a static function in ROM to print characters. The UART selection + is handled by a prior call to uart_buff_switch(). An advantage over ets_printf, + this call is not affected by calls made to ets_install_putc1 or + ets_install_putc2. */ extern int ets_uart_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); @@ -236,7 +246,6 @@ extern void Cache_Read_Disable(); extern int32_t system_func1(uint32_t); extern void clockgate_watchdog(uint32_t); extern void pm_open_rf(); -extern void ets_install_uart_printf(uint32_t uart_no); extern void UartDwnLdProc(uint8_t* ram_addr, uint32_t size, void (**user_start_ptr)()); extern int boot_from_flash(); extern void ets_run() __attribute__((noreturn)); diff --git a/cores/esp8266/reboot_uart_dwnld.cpp b/cores/esp8266/reboot_uart_dwnld.cpp index 7b58fb2224..d234c9c026 100644 --- a/cores/esp8266/reboot_uart_dwnld.cpp +++ b/cores/esp8266/reboot_uart_dwnld.cpp @@ -106,7 +106,7 @@ static inline void __wsr_vecbase(uint32_t vector_base) { const uint32_t uart_no = 0; uartAttach(); Uart_Init(uart_no); - ets_install_uart_printf(uart_no); + ets_install_uart_printf(); /* reverse engineered from boot_from_something() */ const uint16_t divlatch = uart_baudrate_detect(uart_no, 0); @@ -148,4 +148,3 @@ static inline void __wsr_vecbase(uint32_t vector_base) { esp8266UartDownloadMode(); } - diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino index 8e9f4cd5b2..185914f305 100644 --- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino +++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino @@ -173,10 +173,14 @@ void processKey(Print& out, int hotKey) { } break; } - case 'P': +#ifdef DEBUG_ESP_PORT + // From this context stack_thunk_dump_stack() will only work when Serial + // debug is enabled. + case 'p': out.println(F("Calling stack_thunk_dump_stack();")); stack_thunk_dump_stack(); break; +#endif case 'R': out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n")); ESP.restart(); @@ -191,7 +195,9 @@ void processKey(Print& out, int hotKey) { out.println(F(" h - Free Heap Report;")); out.println(F(" i - iRAM umm_info(null, true);")); out.println(F(" d - dRAM umm_info(null, true);")); +#ifdef DEBUG_ESP_PORT out.println(F(" p - call stack_thunk_dump_stack();")); +#endif out.println(F(" R - Restart, ESP.restart();")); out.println(F(" ? - Print Help")); out.println(); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy