Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments and corrections #8201

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions cores/esp8266/esp8266_undocumented.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down Expand Up @@ -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));
Expand Down
3 changes: 1 addition & 2 deletions cores/esp8266/reboot_uart_dwnld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -148,4 +148,3 @@ static inline void __wsr_vecbase(uint32_t vector_base) {

esp8266UartDownloadMode();
}

Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down