Skip to content

Commit 0ef56d5

Browse files
committed
Initial commit
0 parents  commit 0ef56d5

20 files changed

Lines changed: 744 additions & 0 deletions

.cargo/config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2+
rustflags = ["-C", "link-arg=-Tlink.x"]
3+
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
4+
5+
[build]
6+
target = "thumbv7em-none-eabihf" # Cortex-M4+ / Cortex-M7+

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
end_of_line = lf
9+
charset = utf-8
10+
max_line_length = 80
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.nix]
15+
indent_size = 2
16+
17+
[*.md]
18+
trim_trailing_whitespace = false

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use nix

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
##
2+
## Application artifacts
3+
##
4+
5+
# direnv cache for Nix shells
6+
/.direnv/
7+
8+
# Rust build directory
9+
/target/
10+
11+
##
12+
## Editor artifacts
13+
##
14+
15+
/.history/
16+
/.vscode/.cortex-debug.*

.gitsetup

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -x
5+
6+
# Setup git-flow
7+
git flow init -d
8+
git config gitflow.prefix.versiontag "v"
9+
git config gitflow.feature.finish.no-ff true
10+
git config gitflow.release.finish.sign true
11+
git config gitflow.hotfix.finish.sign true

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "STM32L4 Debug",
6+
"cwd": "${workspaceRoot}",
7+
"executable": "./target/thumbv7em-none-eabihf/debug/ercp_basic_example",
8+
"type": "cortex-debug",
9+
"request": "launch",
10+
"servertype": "openocd",
11+
"configFiles": [
12+
"openocd.cfg"
13+
],
14+
"preLaunchTask": "rust: cargo build",
15+
"preLaunchCommands": [
16+
"load"
17+
]
18+
}
19+
]
20+
}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic
7+
Versioning](https://semver.org/spec/v2.0.0.html).
8+
9+
## [Unreleased]
10+
11+
### Added
12+
13+
* Initial version
14+
15+
[Unreleased]: https://github.com/ercp/ercp_basic_example/compare/main...develop

CONTRIBUTING.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Contributing to ercp_basic_example
2+
3+
ercp_basic_example is written in [Rust](https://www.rust-lang.org/).
4+
5+
For branching management, this project uses
6+
[git-flow](https://github.com/petervanderdoes/gitflow-avh). The `main` branch is
7+
reserved for releases: the development process occurs on `develop` and feature
8+
branches. **Please never commit to master.**
9+
10+
## Setup
11+
12+
### Local repository
13+
14+
1. Fork the repository
15+
16+
2. Clone your fork to a local repository:
17+
18+
$ git clone https://github.com/you/ercp_basic_example.git
19+
$ cd ercp_basic_example
20+
21+
3. Add the main repository as a remote:
22+
23+
$ git remote add upstream https://github.com/ercp/ercp_basic_example.git
24+
25+
4. Checkout to `develop`:
26+
27+
$ git checkout develop
28+
29+
### Building the project
30+
31+
1. Build the project:
32+
33+
$ cd ercp_basic_example
34+
$ cargo build
35+
36+
2. Run the tests:
37+
38+
$ cargo test
39+
40+
All the tests should pass.
41+
42+
## Workflow
43+
44+
To make a change, please use this workflow:
45+
46+
1. Checkout to `develop` and apply the last upstream changes (use rebase, not
47+
merge!):
48+
49+
$ git checkout develop
50+
$ git fetch --all --prune
51+
$ git rebase upstream/develop
52+
53+
2. For a tiny patch, create a new branch with an explicit name:
54+
55+
$ git checkout -b <my_branch>
56+
57+
Alternatively, if you are working on a feature which would need more work,
58+
you can create a feature branch with `git-flow`:
59+
60+
$ git flow feature start <my_feature>
61+
62+
*Note: always open an issue and ask before starting a big feature, to avoid
63+
it not beeing merged and your time lost.*
64+
65+
3. Work on your feature (don’t forget to write tests):
66+
67+
# Some work
68+
$ git commit -am "My first change"
69+
# Some work
70+
$ git commit -am "My second change"
71+
...
72+
73+
4. When your feature is ready, feel free to use
74+
[interactive rebase](https://help.github.com/articles/about-git-rebase/) so
75+
your history looks clean and is easy to follow. Then, apply the last
76+
upstream changes on `develop` to prepare integration:
77+
78+
$ git checkout develop
79+
$ git fetch --all --prune
80+
$ git rebase upstream/develop
81+
82+
5. If there were commits on `develop` since the beginning of your feature
83+
branch, integrate them by **rebasing** if your branch has few commits, or
84+
merging if you had a long-lived branch:
85+
86+
$ git checkout <my_feature_branch>
87+
$ git rebase develop
88+
89+
*Note: the only case you should merge is when you are working on a big
90+
feature. If it is the case, we should have discussed this before as stated
91+
above.*
92+
93+
6. Run the tests to ensure there is no regression and all works as expected:
94+
95+
$ cargo test
96+
97+
7. If it’s all good, open a pull request to merge your branch into the `develop`
98+
branch on the main repository.
99+
100+
## Coding style
101+
102+
Please format your code with `rustfmt`.

0 commit comments

Comments
 (0)