Skip to content

Commit 78e19df

Browse files
committed
new commit
1 parent 24ee5d1 commit 78e19df

File tree

5 files changed

+96
-0
lines changed

5 files changed

+96
-0
lines changed

bsp/ESP32_C3/Kconfig

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,53 @@ PKGS_DIR := packages
99
source "$(RTT_DIR)/Kconfig"
1010
osource "$PKGS_DIR/Kconfig"
1111
rsource "drivers/Kconfig"
12+
# In bsp/ESP32_C3/Kconfig
13+
14+
# Look for the section related to board peripherals or drivers
15+
16+
menu "Board Level Drivers"
17+
18+
# 1. Define the option that allows the user to input the pin number
19+
config RT_BSP_LED_PIN
20+
int "Onboard LED Pin (GPIO Number)"
21+
default 21 # Set a common default (e.g., GPIO 21 is often used on ESP32 boards)
22+
range 0 40 # Set a valid range for ESP32 GPIO pins (0-40)
23+
help
24+
This sets the GPIO number for the on-board LED.
25+
Check your ESP32-C3 board schematic for the correct pin.
26+
27+
endmenu # Board Level Drivers
28+
29+
menu "ESP32-C3 On-Chip Drivers"
30+
31+
# BLE Dependency
32+
config BSP_USING_BLE
33+
bool "Enable Bluetooth Low Energy (BLE) Support"
34+
default y
35+
select ESP32C3_BLE_DRV # Link to the underlying chip driver config (name may vary)
36+
help
37+
Enable this to include the necessary BLE drivers and compile
38+
the BLE-related code blocks in main.c (via #ifdef BSP_USING_BLE).
39+
40+
# WiFi Dependency
41+
config RT_USING_WIFI
42+
bool "Enable Wi-Fi Support"
43+
default y
44+
select RT_USING_WIFI_DRIVER_ESP32C3 # Link to the underlying driver config (name may vary)
45+
help
46+
Enable this to include the Wi-Fi framework and driver support
47+
for network functionality.
48+
49+
endmenu # ESP32-C3 On-Chip Drivers
50+
51+
# --------------------------------------------------------------------------
52+
# Optional: Ensure core features are enabled when necessary
53+
# --------------------------------------------------------------------------
54+
55+
# If your custom feature requires msh, you can select it like this:
56+
config BSP_USING_APP_COMMANDS
57+
bool "Enable Custom Application Commands (app_data_cmd)"
58+
default y
59+
select FINSH_USING_MSH # This ensures the FinSH msh mode is enabled if this is selected
60+
help
61+
This enables the app_data_cmd function in main.c, which relies on the FinSH shell.

bsp/ESP32_C3/main/SConscript

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,24 @@ CPPPATH = []
99
group = DefineGroup('Main', src, depend = [''], CPPPATH = CPPPATH)
1010

1111
Return('group')
12+
13+
# SConscript file content
14+
15+
# Define a list of source files to compile
16+
src = []
17+
18+
# Add common BSP source files (these lines might already exist)
19+
# src += ['board.c', 'drivers/drv_gpio.c']
20+
21+
# >>> ADD YOUR APPLICATION FILES HERE <<<
22+
# Ensure your main.c file is in the list.
23+
src += ['main.c']
24+
# If you add any other custom C files (e.g., app_logic.c), list them too.
25+
# src += ['app_logic.c']
26+
27+
# Pass the source list to the build environment
28+
from building import *
29+
# This line tells SCons to compile the files in the 'src' list
30+
list = SConscript('drivers/SConscript', variant_dir='drivers')
31+
list.append(src)
32+

bsp/ESP32_C3/main/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#include <rtthread.h>
23
#include <stdlib.h> // For atoi()
34
#include <finsh.h> // For MSH_CMD_EXPORT

bsp/ESP32_C3/rtconfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#ifndef RT_CONFIG_H__
22
#define RT_CONFIG_H__
33

4+
// Inside bsp/ESP32_C3/board.h
5+
6+
// ... other existing definitions ...
7+
8+
// Define the GPIO pin number for the on-board LED
9+
// *** You must replace 'X' with the correct physical GPIO number (e.g., 2, 8, 15, etc.) ***
10+
#define RT_BSP_LED_PIN X
411
/* RT-Thread Kernel */
512

613
/* klibc options */

tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"module": "commonjs",
5+
"lib": ["ES2020"],
6+
"outDir": "./dist",
7+
"rootDir": "./",
8+
"strict": true,
9+
"esModuleInterop": true,
10+
"skipLibCheck": true,
11+
"forceConsistentCasingInFileNames": true,
12+
"moduleResolution": "node",
13+
"types": ["node"]
14+
},
15+
"include": ["**/*.ts"],
16+
"exclude": ["node_modules"]
17+
}

0 commit comments

Comments
 (0)