Skip to content

Commit

Permalink
Merge ci into main
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbl committed Jun 21, 2024
2 parents be4e8d7 + 5df8a4b commit 7334345
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Project
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build Project
run: pio ci --board esp32-s3-devkitc-1 --lib='.' examples/test_all_features.cpp
25 changes: 25 additions & 0 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Static Code Analysis
on: [push]
jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Check code
run: pio check --fail-on-defect low
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
2 changes: 1 addition & 1 deletion examples/test_all_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void loop() {
if (Yboard.get_button(1)) {
Yboard.set_led_color(3, 255, 0, 0);
while (Yboard.get_button(1)) {
Yboard.play_note(NOTE_C4, 10);
Yboard.play_note_background(NOTE_C4, 10);
delay(10);
}
} else {
Expand Down
1 change: 0 additions & 1 deletion include/yboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class YBoardV2 {

private:
Adafruit_NeoPixel strip;
hw_timer_t *interrupt_timer;

void setup_leds();
void setup_switches();
Expand Down
16 changes: 16 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
check_tool = cppcheck
check_flags = --suppress=unusedFunction --suppress=cstyleCast
3 changes: 2 additions & 1 deletion src/yboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ void YBoardV2::setup() {
setup_leds();
setup_switches();
setup_buttons();
setup_timer();
}

////////////////////////////// LEDs ///////////////////////////////
Expand Down Expand Up @@ -83,7 +84,7 @@ int YBoardV2::get_knob() {
void timer_isr() {}
void YBoardV2::setup_timer() {
// Prescaler = 80, So timer clock = 80MHZ/80 = 1MHz = 1us period
interrupt_timer = timerBegin(0, 80, true);
hw_timer_t *interrupt_timer = timerBegin(0, 80, true);

timerAttachInterrupt(interrupt_timer, &timer_isr, true);

Expand Down

0 comments on commit 7334345

Please sign in to comment.