Skip to content

Commit

Permalink
Merge branch 'develop' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
slav-at-attachix committed May 31, 2022
2 parents 9a9e850 + 2c0afe6 commit bce3637
Show file tree
Hide file tree
Showing 376 changed files with 8,064 additions and 8,478 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Continuous Integration (CI)

on:
push:

pull_request:
branches: [ develop ]

jobs:
build:
strategy:
fail-fast: false
matrix:
arch: [Esp8266, Host, Esp32, Rp2040]
variant: [""]
os: [ubuntu-latest, windows-latest]
include:
- arch: Esp32
variant: esp32s2
os: ubuntu-latest
- arch: Esp32
variant: esp32s2
os: windows-latest
- arch: Esp32
variant: esp32c3
os: ubuntu-latest
- arch: Esp32
variant: esp32c3
os: windows-latest
exclude:
- os: windows-latest
arch: Host

continue-on-error: ${{ matrix.arch == 'Host' && matrix.os == 'windows-latest' }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ toJson(matrix) }}
cancel-in-progress: true

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SMING_HOME for Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "CI_BUILD_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "SMING_HOME=$GITHUB_WORKSPACE/Sming" >> $GITHUB_ENV
- name: Setup SMING_HOME for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo ("CI_BUILD_DIR=" + $env:GITHUB_WORKSPACE) >> $env:GITHUB_ENV
$env:SMING_HOME = Join-Path $env:GITHUB_WORKSPACE "Sming"
echo ("SMING_HOME=" + $env:SMING_HOME) >> $env:GITHUB_ENV
- name: Install Sming Framework on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
SMING_ARCH: ${{matrix.arch}}
SMING_SOC: ${{matrix.variant}}
run: |
./Tools/install.sh $(echo "$SMING_ARCH" | tr '[:upper:]' '[:lower:]')
- name: Install Sming Framework on Windows
if: ${{ matrix.os == 'windows-latest' }}
env:
SMING_ARCH: ${{matrix.arch}}
SMING_SOC: ${{matrix.variant}}
run: |
Tools/ci/setenv.ps1
Tools/install.cmd "$env:SMING_ARCH".ToLower()
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Build and Test for ${{matrix.arch}} on Ubuntu
env:
SMING_ARCH: ${{matrix.arch}}
SMING_SOC: ${{matrix.variant}}
CLANG_FORMAT: clang-format-8
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
source $SMING_HOME/../Tools/export.sh
$CLANG_FORMAT --version
./Tools/ci/build.sh
- name: Build and Test for ${{matrix.arch}} on Windows
env:
SMING_ARCH: ${{matrix.arch}}
SMING_SOC: ${{matrix.variant}}
if: ${{ matrix.os == 'windows-latest' }}
run: |
$env:PYTHON_PATH=$(python -c "import sys, os.path; print(os.path.dirname(sys.executable))")
Tools/ci/setenv.ps1
Tools/ci/build.cmd
73 changes: 73 additions & 0 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Coverity Scan

on:
# Push to master MUST be evaluated
# Pushing to develop only on condition
push:
branches: [ master, develop ]
# Pull requests to master MUST be evaluated
pull_request:
branches: [ master ]
# Run the workflow once a month
schedule:
- cron: '30 1 1 * *'

jobs:
scan:
# concurrency:
# group: ${{ github.head_ref || github.run_id }}
# cancel-in-progress: true

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check if we are allowed to scan
env:
BRANCH: ${{github.ref_name}}
run: |
CHECK_SCA=0
if [[ "$BRANCH" == "master" ]]; then
CHECK_SCA=1;
elif [[ $BRANCH == "develop" ]]; then
if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
CHECK_SCA=1;
elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
COMMIT_MSG=$(git log --format=%B -n 1)
if [[ "$COMMIT_MSG" == *"[scan:coverity]"* ]]; then
CHECK_SCA=1;
fi
fi
fi
echo "CHECK_SCA=$CHECK_SCA" >> $GITHUB_ENV
- name: Setup SMING_HOME for Ubuntu
if: ${{ env.CHECK_SCA == 1 }}
run: |
echo "CI_BUILD_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "SMING_HOME=$GITHUB_WORKSPACE/Sming" >> $GITHUB_ENV
echo "SMING_ARCH=Host" >> $GITHUB_ENV
- name: Install Sming Framework on Ubuntu
if: ${{ env.CHECK_SCA == 1 }}
run: |
./Tools/install.sh $(echo "$SMING_ARCH" | tr '[:upper:]' '[:lower:]')
- name: Install Ninja
if: ${{ env.CHECK_SCA == 1 }}
uses: seanmiddleditch/gha-setup-ninja@master
- name: Run Coverity Scan
if: ${{ env.CHECK_SCA == 1 }}
env:
COVERITY_SCAN_TOKEN: ${{secrets.COVERITY_SCAN_TOKEN}}
run: |
source $SMING_HOME/../Tools/export.sh
export MAKE_PARALLEL="make -j$(nproc)"
export COVERITY_SCAN_BUILD_COMMAND_PREPEND="cd $SMING_HOME"
cat > /tmp/secrets.sh
$SMING_HOME/Arch/Host/Tools/ci/coverity-scan.sh
- name: Archive scan log
if: ${{ env.CHECK_SCA == 1 }}
uses: actions/upload-artifact@v3
with:
name: coverity-scan-report
path: Sming/cov-int/scm_log.txt
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

# TODO: check if the tag is pointing to the tip of the master branch

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: trstringer/manual-approval@v1
if: ${{ github.ref_type == 'tag' }}
with:
secret: ${{ github.TOKEN }}
approvers: slaff
- name: Install xmlstarlet
if: ${{ github.ref_type == 'tag' }}
run: sudo apt-get install -y xmlstarlet
- name: Build docs
if: ${{ github.ref_type == 'tag' }}
run: |
Tools/install.sh doc
make -C docs html
zip -r sming-docs.zip docs/build/html
- name: Release New Version
if: ${{ github.ref_type == 'tag' }}
env:
SMING_ARCH: Host
RELEASE_TOKEN: ${{secrets.RELEASE_TOKEN}}
CI_REPO_NAME: ${{github.repository}}
CHOCO_TOKEN: ${{secrets.CHOKO_TOKEN}}
run: |
export CI_BUILD_DIR="$GITHUB_WORKSPACE"
export SMING_HOME="$GITHUB_WORKSPACE/Sming"
make -C $SMING_HOME submodules
cat > /tmp/secrets.sh
Tools/ci/deploy.sh ${{github.ref_name}}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Run whenever a PR is generated or updated.

name: Pull Request Checks
name: Spelling Check

on:
pull_request:

branches: [ develop ]

jobs:

code-spell:
Expand Down
32 changes: 28 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
path = Sming/Components/libyuarel
url = https://github.com/jacketizer/libyuarel.git
ignore = dirty
[submodule "lwip"]
path = Sming/Components/lwip/lwip
url = https://github.com/lwip-tcpip/lwip
ignore = dirty
[submodule "mqtt-codec"]
path = Sming/Components/mqtt-codec
url = https://github.com/slaff/mqtt-codec.git
Expand Down Expand Up @@ -126,10 +130,6 @@
# `Host` Components
#

[submodule "Host.lwip"]
path = Sming/Arch/Host/Components/lwip/lwip
url = https://github.com/lwip-tcpip/lwip
ignore = dirty
[submodule "seriallib"]
path = Sming/Arch/Host/Components/SerialLib/seriallib
url = https://github.com/imabot2/serialib.git
Expand Down Expand Up @@ -157,6 +157,22 @@
path = Sming/Libraries/Adafruit_BusIO
url = https://github.com/adafruit/Adafruit_BusIO
ignore = dirty
[submodule "Libraries.Adafruit_GFX"]
path = Sming/Libraries/Adafruit_GFX
url = https://github.com/adafruit/Adafruit-GFX-Library
ignore = dirty
[submodule "Libraries.Adafruit_ILI9341"]
path = Sming/Libraries/Adafruit_ILI9341
url = https://github.com/adafruit/Adafruit_ILI9341
ignore = dirty
[submodule "Libraries.Adafruit_NeoPixel"]
path = Sming/Libraries/Adafruit_NeoPixel
url = https://github.com/adafruit/Adafruit_NeoPixel
ignore = dirty
[submodule "Libraries.Adafruit_PCD8544"]
path = Sming/Libraries/Adafruit_PCD8544
url = https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library
ignore = dirty
[submodule "Libraries.Adafruit_Sensor"]
path = Sming/Libraries/Adafruit_Sensor
url = https://github.com/adafruit/Adafruit_Sensor
Expand All @@ -173,6 +189,10 @@
path = Sming/Libraries/Adafruit_VL53L0X
url = https://github.com/adafruit/Adafruit_VL53L0X.git
ignore = dirty
[submodule "Libraries.AnimatedGIF"]
path = Sming/Libraries/AnimatedGIF/AnimatedGIF
url = https://github.com/bitbank2/AnimatedGIF.git
ignore = dirty
[submodule "Libraries.ArduinoFFT"]
path = Sming/Libraries/ArduinoFFT
url = https://github.com/kosme/arduinoFFT.git
Expand Down Expand Up @@ -229,6 +249,10 @@
path = Sming/Libraries/jerryscript
url = https://github.com/slaff/Sming-jerryscript.git
ignore = dirty
[submodule "Libraries.IOControl"]
path = Sming/Libraries/IOControl
url = https://github.com/mikee47/IOControl
ignore = dirty
[submodule "Libraries.IR"]
path = Sming/Libraries/IR
url = https://github.com/markszabo/IRremoteESP8266.git
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sming is [open source](LICENSE), modular and supports [multiple architectures](h
[![Backers](https://opencollective.com/Sming/backers/badge.svg)](#financial-contributions)
[![Sponsors](https://opencollective.com/Sming/sponsors/badge.svg)](#financial-contributions)
[![Download](https://img.shields.io/badge/download-~1.7M-orange.svg)](https://github.com/SmingHub/Sming/releases/latest)
[![Build](https://travis-ci.org/SmingHub/Sming.svg?branch=develop)](https://travis-ci.org/SmingHub/Sming)
[![Build](https://github.com/SmingHub/Sming/actions/workflows/ci.yml/badge.svg)](https://github.com/SmingHub/Sming/actions/workflows/ci.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/23ff16f8d550440787125b0d25ba7ada)](https://www.codacy.com/gh/SmingHub/Sming/dashboard?utm_source=github.com&utm_medium=referral&utm_content=SmingHub/Sming&utm_campaign=Badge_Grade)
[![Coverity Badge](https://img.shields.io/coverity/scan/12007.svg)](https://scan.coverity.com/projects/sminghub-sming)

Expand All @@ -29,15 +29,15 @@ You can also try Sming without installing anything locally. We have an [interact

The purpose of Sming is to simplify the creation of embedded applications. The documentation will help you get started in no time.

- [**Documentation for version 4.5.0**](https://sming.readthedocs.io/en/stable) - current stable version.
- [**Documentation for version 4.6.0**](https://sming.readthedocs.io/en/stable) - current stable version.
- [Documentation for version 4.2.x](https://sming.readthedocs.io/en/4.2.2) - Long Term Support (LTS) version.
- [Documentation for latest](https://sming.readthedocs.io/en/latest) - development version.

## Releases

### Stable

- [Sming V4.5.0](https://github.com/SmingHub/Sming/releases/tag/4.5.0) - great new features, performance and stability improvements.
- [Sming V4.6.0](https://github.com/SmingHub/Sming/releases/tag/4.6.0) - great new features, performance and stability improvements.


### Long Term Support (LTS)
Expand Down
43 changes: 37 additions & 6 deletions Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@

#include <esp_attr.h>
#include <sming_attr.h>
#include <cstdint>
#include <stdint.h>

#ifdef CONFIG_ESP_TIMER_IMPL_TG0_LAC
#include <soc/timer_group_reg.h>
#else
#include <hal/systimer_ll.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define HW_TIMER_BASE_CLK APB_CLK_FREQ

Expand Down Expand Up @@ -117,17 +127,34 @@ uint32_t hw_timer1_read(void);
*
*************************************/

constexpr uint32_t HW_TIMER2_CLK = 1000000;

extern "C" int64_t esp_timer_get_time(void);
#if CONFIG_ESP_TIMER_IMPL_TG0_LAC
#define HW_TIMER2_CLK 2000000U
#define HW_TIMER2_INDEX 0
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#define HW_TIMER2_CLK 80000000U
#define HW_TIMER2_INDEX
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#define HW_TIMER2_CLK 16000000U
#define HW_TIMER2_INDEX 0
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
#define HW_TIMER2_CLK 16000000U
#define HW_TIMER2_INDEX 0
#else
_Static_assert(false, "ESP32 Unsupported timer");
#endif

/**
* @brief Read current timer2 value
* @retval uint32_t
*/
__forceinline uint32_t hw_timer2_read(void)
__forceinline static uint32_t hw_timer2_read(void)
{
return esp_timer_get_time();
#if CONFIG_ESP_TIMER_IMPL_TG0_LAC
return REG_READ(TIMG_LACTLO_REG(HW_TIMER2_INDEX));
#else
systimer_ll_counter_snapshot(HW_TIMER2_INDEX);
return systimer_ll_get_counter_value_low(HW_TIMER2_INDEX);
#endif
}

#define NOW() hw_timer2_read()
Expand All @@ -139,3 +166,7 @@ __forceinline uint32_t hw_timer2_read(void)
void hw_timer_init(void);

/** @} */

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit bce3637

Please sign in to comment.