Skip to content

Commit a76b6b0

Browse files
committed
Repo cleanup
1 parent 2d40f59 commit a76b6b0

File tree

10 files changed

+80
-55
lines changed

10 files changed

+80
-55
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode
2+
.devcontainer
3+
Dockerfile.test_build

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI - Build
2+
3+
on:
4+
push
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 10
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Install deps
14+
run: |
15+
sudo apt install -y git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
16+
17+
- name: Prepare test_app
18+
run: |
19+
cd ~
20+
mkdir -p test_app/components/ESP32Servo
21+
mkdir -p test_app/main/
22+
echo -e "cmake_minimum_required(VERSION 3.5)\ninclude(\$ENV{IDF_PATH}/tools/cmake/project.cmake)\nproject(template-app)" > test_app/CMakeLists.txt
23+
echo -e "idf_component_register(SRCS "main.cpp" INCLUDE_DIRS ".")" > test_app/main/CMakeLists.txt
24+
cp -r $GITHUB_WORKSPACE test_app/components/
25+
cp test_app/components/ESP32Servo/examples/sweep.cpp test_app/main/main.cpp
26+
27+
- name: Install esp-idf
28+
run: |
29+
mkdir -p ~/esp
30+
cd ~/esp
31+
git clone -b v4.4 --recursive https://github.com/espressif/esp-idf.git
32+
cd esp-idf
33+
./install.sh esp32
34+
35+
- name: Build test_app
36+
run: |
37+
. ~/esp/esp-idf/export.sh
38+
cd ~/test_app/
39+
idf.py build

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
set(COMPONENT_ADD_INCLUDEDIRS "src")
2-
set(COMPONENT_SRCDIRS "src")
3-
register_component()
4-
1+
idf_component_register(SRCS "servoControl.cpp" INCLUDE_DIRS "include")

Dockerfile.test_build

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARG IDF_VER=v4.4
2+
FROM espressif/idf:${IDF_VER}
3+
4+
SHELL ["/bin/bash", "-c"]
5+
6+
WORKDIR /test/
7+
8+
RUN mkdir -p test_app/components/ESP32Servo && \
9+
mkdir -p test_app/main/ && \
10+
echo -e "cmake_minimum_required(VERSION 3.5)\ninclude(\$ENV{IDF_PATH}/tools/cmake/project.cmake)\nproject(template-app)" > test_app/CMakeLists.txt && \
11+
echo -e "idf_component_register(SRCS "main.cpp" INCLUDE_DIRS ".")" > test_app/main/CMakeLists.txt
12+
13+
COPY . test_app/components/ESP32Servo/
14+
15+
RUN cp test_app/components/ESP32Servo/examples/sweep.cpp test_app/main/main.cpp
16+
WORKDIR /test/test_app/
17+
RUN source $IDF_PATH/export.sh && \
18+
idf.py build

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# ESP32Servo [![Build Status](https://travis-ci.org/ShellAddicted/ESP32Servo.svg?branch=master)](https://travis-ci.org/ShellAddicted/ESP32Servo)
2-
This idf-component permits to control hobby-grade servo motors using an [Espressif's ESP32 SoC](https://www.espressif.com/en/products/hardware/esp32/overview) (running [esp-idf](https://github.com/espressif/esp-idf))
1+
# ESP32Servo
2+
C++ Interface to control hobby-grade servo motors compatible with [Espressif's ESP32 SoC](https://www.espressif.com/en/products/hardware/esp32/overview) running [esp-idf](https://github.com/espressif/esp-idf)
33

4-
Tested with [TowerPro - SG92R](http://www.towerpro.com.tw/product/sg92r-7/) and ESP32D0WDQ6 (DevKitC).
4+
## Getting Started
5+
***NOTE: this code is not (yet) Production Ready.***
56

6-
# Getting Started
7-
<b>NOTE: this code is not (yet) Production Ready.</b>
8-
You can use this library as a component for your project:
7+
You can use this as a [managed-component](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html) for your project by adding the following to your `idf_component.yml`:
8+
```yaml
9+
ESP32Servo:
10+
path: .
11+
git: https://github.com/ShellAddicted/ESP32Servo.git
912
```
10-
cd <YOUR_PROJECT_ROOT>
13+
14+
Alternatively, you can use this as a component for your project:
15+
```bash
1116
mkdir components/
1217
cd components/
1318
git clone https://github.com/ShellAddicted/ESP32Servo.git

component.mk

Lines changed: 0 additions & 2 deletions
This file was deleted.

idf_component.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: "0.0.1"
2+
description: C++ Interface to control hobby-grade servo motors compatible with Espressif's ESP32 SoC running esp-idf
3+
url: https://github.com/ShellAddicted/ESP32Servo.git
4+
dependencies:
5+
idf: ">=4.1"
File renamed without changes.

src/servoControl.cpp renamed to servoControl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ double servoControl::getDutyByPercentage(double percentage){
2828
if (percentage <= 0){
2929
return 0;
3030
}
31+
3132
if (percentage > 100){
3233
percentage = 100;
3334
}
@@ -49,7 +50,7 @@ void servoControl::attach(gpio_num_t pin, unsigned int minuS, unsigned int maxuS
4950
timer_conf.freq_hz = _freqHz;
5051
timer_conf.speed_mode = LEDC_HIGH_SPEED_MODE;
5152
timer_conf.timer_num = ledcTimer;
52-
timer_conf.clk_cfg = LEDC_AUTO_CLK;
53+
timer_conf.clk_cfg = LEDC_AUTO_CLK;
5354
ledc_timer_config(&timer_conf);
5455

5556
ledc_channel_config_t ledc_conf;

0 commit comments

Comments
 (0)