Skip to content

Commit 6e50000

Browse files
committed
change: reordering target uart code
1 parent 4b2a49d commit 6e50000

File tree

25 files changed

+47
-47
lines changed

25 files changed

+47
-47
lines changed
File renamed without changes.

src/esp32/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
src/target_flash.c
44
)
55

src/esp32/src/uart.c renamed to src/esp32/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdint.h>
88
#include <stddef.h>
9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010
#include "soc/reg_base.h"
1111

1212
// These functions are defined in the ROM

src/esp32c2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32c2/src/uart.c renamed to src/esp32c2/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <stdbool.h>
88
#include <stdint.h>
99
#include <stddef.h>
10-
#include <common/uart.h>
10+
#include <common/target_uart.h>
1111

1212
// These functions are defined in the ROM
1313
extern void uartAttach(void *rxBuffer);

src/esp32c3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32c3/src/uart.c renamed to src/esp32c3/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <stdbool.h>
88
#include <stdint.h>
99
#include <stddef.h>
10-
#include <common/uart.h>
10+
#include <common/target_uart.h>
1111

1212
// These functions are defined in the ROM
1313
extern void uartAttach(void *rxBuffer);

src/esp32c5/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32c6/src/uart.c renamed to src/esp32c5/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdint.h>
88
#include <stddef.h>
9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010

1111
// These functions are defined in the ROM
1212
extern void uartAttach(void *rxBuffer);

src/esp32c6/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32h2/src/uart.c renamed to src/esp32c6/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdint.h>
88
#include <stddef.h>
9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010

1111
// These functions are defined in the ROM
1212
extern void uartAttach(void *rxBuffer);

src/esp32c61/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32c61/src/uart.c renamed to src/esp32c61/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdint.h>
88
#include <stddef.h>
9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010

1111
// These functions are defined in the ROM
1212
extern void uartAttach(void *rxBuffer);

src/esp32h2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32c5/src/uart.c renamed to src/esp32h2/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdint.h>
88
#include <stddef.h>
9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010

1111
// These functions are defined in the ROM
1212
extern void uartAttach(void *rxBuffer);

src/esp32p4/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32p4/src/target_uart.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0 OR MIT
5+
*/
6+
7+
#include <stdint.h>
8+
#include <stddef.h>
9+
#include <common/target_uart.h>
10+
11+
// These functions are defined in the ROM
12+
extern void uartAttach(void *rxBuffer);
13+
extern void Uart_Init(uint8_t uart_no);
14+
extern uint32_t ets_clk_get_cpu_freq(void);
15+
extern void ets_update_cpu_frequency(uint32_t ticks_per_us);
16+
extern void uart_tx_switch(uint8_t uart_no);
17+
18+
void stub_target_uart_init(uint8_t uart_num, uint32_t baudrate)
19+
{
20+
(void)baudrate;
21+
ets_update_cpu_frequency(ets_clk_get_cpu_freq() / 1000000);
22+
uartAttach(NULL);
23+
Uart_Init(uart_num);
24+
uart_tx_switch(uart_num);
25+
}

src/esp32p4/src/uart.c

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/esp32s2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32s2/src/uart.c renamed to src/esp32s2/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdint.h>
88
#include <stddef.h>
9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010

1111
// These functions are defined in the ROM
1212
extern void uartAttach(void *rxBuffer);

src/esp32s3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
)
44

55
add_library(${ESP_TARGET_LIB} STATIC ${srcs})

src/esp32s3/src/uart.c renamed to src/esp32s3/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <stdbool.h>
88
#include <stdint.h>
99
#include <stddef.h>
10-
#include <common/uart.h>
10+
#include <common/target_uart.h>
1111

1212
// These functions are defined in the ROM
1313
extern void uartAttach(void *rxBuffer);

src/esp8266/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(srcs
2-
src/uart.c
2+
src/target_uart.c
33
src/target_flash.c
44
src/rom-patched.c
55
)

src/esp8266/src/uart.c renamed to src/esp8266/src/target_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
#include <stdint.h>
8-
#include <common/uart.h>
8+
#include <common/target_uart.h>
99

1010
void stub_target_uart_init(uint8_t uart_num, uint32_t baudrate)
1111
{

src/log_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <stdint.h>
77
#include <stddef.h>
88

9-
#include <common/uart.h>
9+
#include <common/target_uart.h>
1010

1111
extern void ets_install_putc1(void (*p)(char c));
1212
extern void ets_install_putc2(void (*p)(char c));

0 commit comments

Comments
 (0)