Skip to content
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ body:
label: Issue checklist
description: Please double-check that you have done each of the following things before submitting the issue.
options:
- label: I searched for previous reports in [the issue tracker](https://github.com/m5stack/M5Stack/issues?q=)
- label: I searched for previous reports in [the issue tracker](https://github.com/m5stack/M5StopWatch-UserDemo/issues?q=)
required: true
- label: My report contains all necessary details
required: true
27 changes: 0 additions & 27 deletions .github/workflows/Arduino-Lint-Check.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
matrix:
path:
- check: './' # path to include
exclude: '' # path to exclude
exclude: '/(assets|hal/drivers)' # path to exclude
#- check: 'src'
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
#- check: 'examples'
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@v4.10.2 # Using include-regex 10.x or later
with:
clang-format-version: '18'
clang-format-version: '22'
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
include-regex: ${{ env.INCLUDE_REGEX }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# Build files
build/
cmake-build-*/
/components/
managed_components/

# PlatformIO
Expand All @@ -59,3 +60,6 @@ bin/
obj/

*.code-workspace

sdkconfig
sdkconfig.old
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(StopWatch-UserDemo)
56 changes: 17 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,26 @@
# Product Name
# M5StopWatch-UserDemo
M5Stack StopWatch user demo for hardware evaluation.

## Overview
## Build

### SKU:xxx
### Fetch Dependencies

Description of the product
```bash
python3 ./fetch_repos.py
```

## Related Link
### Tool Chains

- [Document & Datasheet](https://docs.m5stack.com/en/unit/product_Link)
[ESP-IDF v5.5.4](https://docs.espressif.com/projects/esp-idf/en/v5.5.4/esp32s3/index.html)

## Required Libraries:
### Build

- [Adafruit_BMP280_Library](https://github.com/adafruit/Required_Libraries_Link)
```bash
idf.py build
```

## License
### Flash

- [Product Name- MIT](LICENSE)

## Remaining steps(Editorial Staff Look,After following the steps, remember to delete all the content below)

1. Change [clang format check path](./.github/workflows/clang-format-check.yml#L42-L47).
2. Add License content to [LICENSE](/LICENSE).
3. Change link on line 78 of [bug-report.yml](./.github/ISSUE_TEMPLATE/bug-report.yml#L79).

```cpp
Example
# M5Unit-ENV

## Overview

### SKU:U001 & U001-B & U001-C

Contains M5Stack-**UNIT ENV** series related case programs.ENV is an environmental sensor with integrated SHT30 and QMP6988 internally to detect temperature, humidity, and atmospheric pressure data.

## Related Link

- [Document & Datasheet](https://docs.m5stack.com/en/unit/envIII)

## Required Libraries:

- [Adafruit_BMP280_Library](https://github.com/adafruit/Adafruit_BMP280_Library)

## License

- [M5Unit-ENV - MIT](LICENSE)
```
```bash
idf.py flash
```
58 changes: 58 additions & 0 deletions dependencies.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
dependencies:
espressif/cmake_utilities:
component_hash: 351350613ceafba240b761b4ea991e0f231ac7a9f59a9ee901f751bddc0bb18f
dependencies:
- name: idf
require: private
version: '>=4.1'
source:
registry_url: https://components.espressif.com/
type: service
version: 0.5.3
espressif/esp-dsp:
component_hash: 12e44db246517a627bc0fe2b255b8335410c0215c98bfba2df5a8e3edea839ef
dependencies:
- name: idf
require: private
version: '>=4.2'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.8.0
espressif/esp_codec_dev:
component_hash: 0d9e9bc288156eb55f79338d312e1ebf8c9dfbd5e7d13ef0f20ccb031b4e15cf
dependencies:
- name: idf
require: private
version: '>=4.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.5.4
espressif/i2c_bus:
component_hash: 4e990dc11734316186b489b362c61d41f23f79d58bc169795cec215e528cba14
dependencies:
- name: espressif/cmake_utilities
registry_url: https://components.espressif.com
require: private
version: '*'
- name: idf
require: private
version: '>=4.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.5.0
idf:
source:
type: idf
version: 5.5.4
direct_dependencies:
- espressif/cmake_utilities
- espressif/esp-dsp
- espressif/esp_codec_dev
- espressif/i2c_bus
- idf
manifest_hash: 15747d3f6d40317f72fb137333bc3df1641a97ff034c88e9444fca5348997c95
target: esp32s3
version: 2.0.0
61 changes: 61 additions & 0 deletions fetch_repos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import os
import subprocess
import json


def clone_or_update_repo(
repo_url, path, ref=None, with_submodules=False, patch_path=None
):
import os

if not os.path.exists(path):
subprocess.run(["git", "clone", repo_url, path], check=True)
else:
subprocess.run(["git", "-C", path, "fetch"], check=True)

if ref:
subprocess.run(["git", "-C", path, "checkout", ref], check=True)

if with_submodules:
subprocess.run(
["git", "-C", path, "submodule", "update", "--init", "--recursive"],
check=True,
)

# 应用 patch
if patch_path:
patch_full_path = (
patch_path
if os.path.isabs(patch_path)
else os.path.join(os.getcwd(), patch_path)
)
# 使用 git apply --check 先检测补丁是否能应用,避免报错
check_result = subprocess.run(
["git", "-C", path, "apply", "--check", patch_full_path]
)
if check_result.returncode == 0:
subprocess.run(["git", "-C", path, "apply", patch_full_path], check=True)
print(f"Applied patch {patch_path} to {path}")
else:
print(f"Patch {patch_path} cannot be applied cleanly to {path}, skipped.")


def fetch_dependencies():
script_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(script_dir, "repos.json")

with open(config_path) as f:
repos = json.load(f)

for repo in repos:
repo_path = os.path.join(script_dir, repo["path"])
branch = repo.get("branch")
with_submodules = repo.get("with_submodules", False)
patch = repo.get("patch")
if patch and not os.path.isabs(patch):
patch = os.path.join(script_dir, patch)
clone_or_update_repo(repo["url"], repo_path, branch, with_submodules, patch)


if __name__ == "__main__":
fetch_dependencies()
27 changes: 27 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
file(GLOB_RECURSE MY_SRCS
"apps/*.c"
"apps/*.cc"
"apps/*.cpp"
"assets/*.c"
"assets/*.cc"
"assets/*.cpp"
"hal/*.c"
"hal/*.cc"
"hal/*.cpp"
)

set(MY_INCS
"."
)

idf_component_register(
SRCS
"main.cpp"
${MY_SRCS}
INCLUDE_DIRS
${MY_INCS}
EMBED_FILES
"assets/sfx/boot_sfx.bin"
EMBED_TXTFILES
"hal/utils/config_ap/assets/badge_config_ap.html"
)
Loading
Loading