Skip to content

Commit 7a1aa06

Browse files
authored
Drop support for Arduino (#59)
* Drop support for Arduino * Update lint CI and test it * Fix lint
1 parent 27ad33a commit 7a1aa06

File tree

22 files changed

+97
-66
lines changed

22 files changed

+97
-66
lines changed

.github/workflows/opensmartmeter.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- name: Run clang-format lint
1818
working-directory: Firmware code/smart_energy_meter
19-
run: clang-format --style=file -n --Werror smart_energy_meter.ino
19+
run: find include/ lib/ src/ \( -name '*.[ch]pp' -o -name '*.h' \) | xargs clang-format --verbose --style=file -n --Werror
2020
editorconfig-checker:
2121
name: Lint EditorConfig
2222
runs-on: ubuntu-latest
@@ -29,21 +29,6 @@ jobs:
2929
- name: Run editorconfig-checker
3030
working-directory: Firmware code/smart_energy_meter
3131
run: ec
32-
compile-firmware-arduino-cli:
33-
name: Compile Firmware with Arduino CLI
34-
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@v3
37-
- name: Install Arduino CLI
38-
uses: arduino/setup-arduino-cli@v1
39-
- name: Install board and platform
40-
working-directory: Firmware code/smart_energy_meter
41-
run: |
42-
make install
43-
- name: Compile the firmware
44-
working-directory: Firmware code/smart_energy_meter
45-
run: |
46-
make compile
4732
compile-firmware-platform-io:
4833
name: Compile Firmware with PlatformIO
4934
runs-on: ubuntu-latest

Firmware code/smart_energy_meter/Makefile

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
This directory is intended for project header files.
3+
4+
A header file is a file containing C declarations and macro definitions
5+
to be shared between several project source files. You request the use of a
6+
header file in your project source file (C, C++, etc) located in `src` folder
7+
by including it, with the C preprocessing directive `#include'.
8+
9+
```src/main.c
10+
11+
#include "header.h"
12+
13+
int main (void)
14+
{
15+
...
16+
}
17+
```
18+
19+
Including a header file produces the same results as copying the header file
20+
into each source file that needs it. Such copying would be time-consuming
21+
and error-prone. With a header file, the related declarations appear
22+
in only one place. If they need to be changed, they can be changed in one
23+
place, and programs that include the header file will automatically use the
24+
new version when next recompiled. The header file eliminates the labor of
25+
finding and changing all the copies as well as the risk that a failure to
26+
find one copy will result in inconsistencies within a program.
27+
28+
In C, the usual convention is to give header files names that end with `.h'.
29+
It is most portable to use only letters, digits, dashes, and underscores in
30+
header file names, and at most one dot.
31+
32+
Read more about using header files in official GCC documentation:
33+
34+
* Include Syntax
35+
* Include Operation
36+
* Once-Only Headers
37+
* Computed Includes
38+
39+
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
This directory is intended for project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link into executable file.
4+
5+
The source code of each library should be placed in a an own separate directory
6+
("lib/your_library_name/[here are source files]").
7+
8+
For example, see a structure of the following two libraries `Foo` and `Bar`:
9+
10+
|--lib
11+
| |
12+
| |--Bar
13+
| | |--docs
14+
| | |--examples
15+
| | |--src
16+
| | |- Bar.c
17+
| | |- Bar.h
18+
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19+
| |
20+
| |--Foo
21+
| | |- Foo.c
22+
| | |- Foo.h
23+
| |
24+
| |- README --> THIS FILE
25+
|
26+
|- platformio.ini
27+
|--src
28+
|- main.c
29+
30+
and a contents of `src/main.c`:
31+
```
32+
#include <Foo.h>
33+
#include <Bar.h>
34+
35+
int main (void)
36+
{
37+
...
38+
}
39+
40+
```
41+
42+
PlatformIO Library Dependency Finder will find automatically dependent
43+
libraries scanning project source files.
44+
45+
More information about PlatformIO Library Dependency Finder
46+
- https://docs.platformio.org/page/librarymanager/ldf.html

Firmware code/smart_energy_meter/platformio.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
; Please visit documentation for the other options and examples
99
; https://docs.platformio.org/page/projectconf.html
1010

11-
[platformio]
12-
# This is needed for interoperability with ArduinoIDE
13-
src_dir = .
14-
1511
[env:bluepill_f103c8_128k]
1612
framework = arduino
1713
# Using a more recent version of STM32 platform fails with
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)