[docs] Update code block styles

This commit is contained in:
Kuba Szczodrzyński
2023-01-18 14:02:12 +01:00
parent 4e319b40ed
commit 279c81e431
7 changed files with 18 additions and 16 deletions

View File

@@ -46,7 +46,7 @@ The main window is somewhat similar to [NodeMCU PyFlasher](https://github.com/ma
The content below serves as a short documentation page for [`ltchiptool`](https://github.com/libretuya/ltchiptool) and is mostly meant for advanced users.
```shell
```console
$ ltchiptool --help
Usage: ltchiptool [OPTIONS] COMMAND [ARGS]...
@@ -89,7 +89,7 @@ If you want to flash unrecognized/raw binaries (or fine-tune the flashing parame
### UF2 Example
```shell
```console
$ ltchiptool uf2 info ./arduinotest_22.08.01_wb2l_BK7231T_lt0.8.0.uf2
Family: BK7231T / Beken 7231T
Tags:

View File

@@ -6,9 +6,9 @@ PlatformIO projects developed with LibreTuya can be flashed just like any other
LibreTuya has a built-in firmware uploader, based on [ltchiptool](ltchiptool.md). Pressing `Upload` in PlatformIO IDE does all the work for you.
If you have more than one COM port,configure your PIO project first:
If you have more than one COM port, configure your PIO project first:
```ini
```ini title="platformio.ini"
[env:my_board]
monitor_port = COM96
upload_port = COM96

View File

@@ -2,7 +2,7 @@
This is a tool for converting LibreTuya firmware images to UF2 format for OTA updates.
```bash
```console
$ python uf2ota.py
usage: uf2ota [-h] [--output OUTPUT] [--family FAMILY] [--board BOARD] [--version VERSION] [--fw FW] {info,dump,write} inputs [inputs ...]
uf2ota: error: the following arguments are required: action, inputs
@@ -12,7 +12,7 @@ uf2ota: error: the following arguments are required: action, inputs
Generate a UF2 file from a firmware image or several images.
```bash
```console
$ python uf2ota.py write --family RTL8710B --board wr3 --version 0.4.0 --fw esphome:2022.6.0-dev "ota1;xip1.bin;ota2;xip2.bin"
$ ls -l out.uf2
@@ -28,7 +28,7 @@ Partition name can be suffixed by `+offset`, which causes writing the image file
When using two different firmware binaries, they need to have the same `offset` and be of the same size.
`inputs` parameter can be repeated in order to embed multiple files in the UF2. For example:
```bash
```console
"bootloader;boot.bin" "ota1;xip1.bin;ota2;xip2.bin" "config;config1.bin;config;config2.bin"
```
will:
@@ -41,7 +41,7 @@ will:
This command shows some basic parameters of a UF2 image.
```bash
```console
$ python uf2ota.py info out.uf2
Family: RTL8710B
Tags:
@@ -65,7 +65,7 @@ Total binary size: 302448
Dump UF2 file (only LibreTuya format) into separate firmware binaries.
```bash
```console
$ python uf2ota.py dump out.uf2
$ ls -1 out.uf2_dump/

View File

@@ -37,7 +37,7 @@ TL;DR: Install OpenOCD. Conenct A14 to BCM GPIO#11, A15 to BCM GPIO#25. Remember
Read more [here](https://forums.raspberrypi.com/viewtopic.php?p=1541631&sid=915e8d039f24301b85c060318a44b7f0#p1541631).
Start OpenOCD like this (you also need your config file in the working directory):
```shell
```console
sudo openocd -f interface/raspberrypi2-native.cfg -f amebaz.cfg -c "bindto 0.0.0.0"
```
The bindto line is important, as it will allow remote connections.

View File

@@ -28,7 +28,7 @@ Assuming you have PlatformIO, git and Python installed:
2. Create a YAML config file for your device. You can either:
- use `python -m esphome wizard yourdevice.yml` - type answers to the six questions the wizard asks, OR:
- write a config file manually:
```yaml
```yaml title="yourdevice.yml"
esphome:
name: yourdevice
@@ -73,7 +73,7 @@ You probably want to refer to the [flashing guide](../flashing/esphome.md) to le
All options from [Options & config](../reference/config.md) can be customized in the `libretuya:` block:
```yaml
```yaml title="yourdevice.yml"
libretuya:
framework:
version: latest
@@ -86,7 +86,7 @@ libretuya:
Additionally, few options have their dedicated keys:
```yaml
```yaml title="yourdevice.yml"
libretuya:
framework:
version: latest

View File

@@ -2,7 +2,7 @@
## Project options
```ini
```ini title="platformio.ini"
[env:my_board]
# custom firmware name, present in UF2 output files
# - default: project directory name
@@ -18,7 +18,7 @@ custom_fw_version = 1.2.0
See [LibreTuyaConfig.h](../../ltapi/_libre_tuya_config_8h_source.md) for most options and their defaults.
All options are configurable via C++ defines in PlatformIO project file. For example:
```ini
```ini title="platformio.ini"
[env:my_board]
build_flags =
-D LT_LOGLEVEL=LT_LEVEL_DEBUG
@@ -68,7 +68,7 @@ To see debug messages from i.e. OTA, loglevel must also be changed.
Enabling `LT_DEBUG_ALL` doesn't mean that *every* debugging message will be printed. If loglevel is i.e. `WARN`, debug messages won't be visible anyway.
This can be used, for example, to enable only "important" messages:
```ini
```ini title="platformio.ini"
[env:my_board]
build_flags =
-D LT_LOGLEVEL=LT_LEVEL_WARN

View File

@@ -6,6 +6,8 @@ repo_url: https://github.com/kuba2k2/libretuya
theme:
name: material
features:
- content.code.copy
plugins:
- same-dir