mirror of
https://github.com/esphome/esphome.git
synced 2025-04-06 19:00:29 +01:00
add zephyr shell
This commit is contained in:
parent
0b84bb648c
commit
7067150612
@ -128,7 +128,7 @@ async def to_code(config):
|
||||
zephyr_add_prj_conf("MCUMGR_GRP_OS_MCUMGR_PARAMS", True)
|
||||
|
||||
zephyr_add_prj_conf("NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP", True)
|
||||
if config[CONF_HARDWARE_UART]:
|
||||
if CONF_HARDWARE_UART in config:
|
||||
cdc_id = UARTS[config[CONF_HARDWARE_UART]][1]
|
||||
if cdc_id >= 0:
|
||||
zephyr_add_cdc_acm(config, cdc_id)
|
||||
|
31
esphome/components/zephyr_shell/__init__.py
Normal file
31
esphome/components/zephyr_shell/__init__.py
Normal file
@ -0,0 +1,31 @@
|
||||
import esphome.config_validation as cv
|
||||
from esphome.components.zephyr import zephyr_add_prj_conf, zephyr_add_overlay
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema({})
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
zephyr_add_prj_conf("SHELL", True)
|
||||
# zephyr_ble_server
|
||||
zephyr_add_prj_conf("BT_SHELL", True)
|
||||
# ota
|
||||
zephyr_add_prj_conf("MCUBOOT_SHELL", True)
|
||||
# i2c
|
||||
zephyr_add_prj_conf("I2C_SHELL", True)
|
||||
# zigbee
|
||||
zephyr_add_prj_conf("ZIGBEE_SHELL", True)
|
||||
# select uart for shell
|
||||
zephyr_add_overlay(
|
||||
"""
|
||||
/ {
|
||||
chosen {
|
||||
zephyr,shell-uart = &cdc_acm_uart1;
|
||||
};
|
||||
};
|
||||
&zephyr_udc0 {
|
||||
cdc_acm_uart1: cdc_acm_uart1 {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
};
|
||||
};
|
||||
"""
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user