Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Sep 12, 2021
2 parents 601bc87 + c21ba2d commit 3205198
Show file tree
Hide file tree
Showing 26 changed files with 553 additions and 130 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

custom: ['paypal.me/tilz0R']
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
See the CHANGELOG.md
draft: false
prerelease: false
41 changes: 20 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,27 @@
*.uvoptx
*.__i
*.i
*.txt
!docs/*.txt
RTE/

# IAR Settings
**/settings/*.crun
**/settings/*.dbgdt
**/settings/*.cspy
**/settings/*.cspy.*
**/settings/*.xcl
**/settings/*.dni
**/settings/*.wsdt
**/settings/*.wspos

# IAR Debug Exe
**/Exe/*.sim

# IAR Debug Obj
**/Obj/*.pbd
**/Obj/*.pbd.*
**/Obj/*.pbi
**/Obj/*.pbi.*
# IAR Settings
**/settings/*.crun
**/settings/*.dbgdt
**/settings/*.cspy
**/settings/*.cspy.*
**/settings/*.xcl
**/settings/*.dni
**/settings/*.wsdt
**/settings/*.wspos

# IAR Debug Exe
**/Exe/*.sim

# IAR Debug Obj
**/Obj/*.pbd
**/Obj/*.pbd.*
**/Obj/*.pbi
**/Obj/*.pbi.*

*.TMP
/docs_src/x_Doxyfile.doxy
Expand Down Expand Up @@ -274,7 +273,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

Expand Down Expand Up @@ -370,7 +369,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "third_party/Unity"]
path = third_party/Unity
url = https://github.com/ThrowTheSwitch/Unity.git
[submodule "third_party/sanitizers-cmake"]
path = third_party/sanitizers-cmake
url = https://github.com/arsenm/sanitizers-cmake.git
[submodule "third_party/cmake-modules"]
path = third_party/cmake-modules
url = https://github.com/bilke/cmake-modules.git
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Changelog

## Develop

## v2.0.2

- Add `volatile` keyword to all local variables to ensure thread safety in highest optimization
- Add local variables for all read and write pointer accesses
- Remove generic `volatile` keyword from func parameter and replace to struct member

## v2.0.1

- Fix wrong check for valid RB instance
- Apply code style settings with Artistic style options
- Add thread safety docs

## v2.0.0

- Break compatibility with previous versions
- Rename function prefixes to `lwrb` instead of `ringbuff`
- Add astyle code syntax correction

## v1.3.1

- Fixed missing `RINGBUFF_VOLATILE` for event callback causes compiler warnings or errors

## v1.3.0

- Added support for events on read/write or reset operation
- Added optional volatile parameter for buffer structure
- Fix bug in skip and advance operation to return actual amount of bytes processed
- Remove `BUF_PREF` parameter and rename with fixed `ringbuff_` prefix for all functions

## v1.2.0

- Added first sphinx documentation

## v1.1.0

- Code optimizations, use pre-increment instead of post
- Another code-style fixes

## v1.0.0

- First stable release
3 changes: 0 additions & 3 deletions dev/VisualStudio/lwrb_dev.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\lwrb\src\lwrb\lwrb.c" />
<ClCompile Include="main.c" />
Expand Down
3 changes: 0 additions & 3 deletions dev/VisualStudio/lwrb_dev.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
Expand Down
29 changes: 17 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,32 @@
copyright = '2020, Tilen MAJERLE'
author = 'Tilen MAJERLE'

# The full version, including alpha/beta/rc tags
version = '2.0.1'

# Try to get branch at which this is running
# and try to determine which version to display in sphinx
# Version is using git tag if on master or "latest-develop" if on develop branch
version = ''
git_branch = ''

# Get current branch
res = os.popen('git branch').read().strip()
for line in res.split("\n"):
if line[0] == '*':
git_branch = line[1:].strip()

# Decision for display version
try:
if git_branch.index('develop') >= 0:
version = "latest-develop"
except Exception:
print("Exception for index check")

# For debugging purpose
git_branch = git_branch.replace('(HEAD detached at ', '').replace(')', '')
if git_branch.find('master') >= 0 or git_branch.find('main') >= 0:
version = os.popen('git describe --tags --abbrev=0').read().strip()
if version == '':
version = 'v0.0.0'
elif git_branch.find('develop') != -1 and not (git_branch.find('develop-') >= 0 or git_branch.find('develop/') >= 0):
version = 'latest-develop'
else:
version = 'branch-' + git_branch

# For debugging purpose only
print("GIT BRANCH: " + git_branch)
print("VERSION: " + version)
print("GIT VERSION: " + version)

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -112,7 +117,7 @@
'css/custom.css',
]
html_js_files = [
'https://kit.fontawesome.com/3102794088.js'
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css'
]

master_doc = 'index'
Expand Down
4 changes: 2 additions & 2 deletions docs/examples_src/example_advance_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ if ((len = lwrb_get_linear_block_write_length(&buff)) > 0) {
/* Get length of linear memory at write pointer */
/* Function returns 3 as we can write 3 bytes to buffer in sequence */
/* When function returns 0, there is no memory available in the buffer for write anymore */
if ((len = lwrb_get_linear_block_read_length(&buff)) > 0) {
if ((len = lwrb_get_linear_block_write_length(&buff)) > 0) {
/* Get pointer to first element in linear block at write address */
/* Function returns &buff_data[0] */
data = lwrb_get_linear_block_read_address(&buff);
data = lwrb_get_linear_block_write_address(&buff);

/* Receive data via DMA and wait to finish (for sake of example) */
/* Any other hardware may directly write to data array */
Expand Down
30 changes: 21 additions & 9 deletions docs/get-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
Getting started
===============

Getting started may be the most challenging part of every new library.
This guide is describing how to start with the library quickly and effectively

.. _download_library:

Download library
^^^^^^^^^^^^^^^^

Library is primarly hosted on `Github <https://github.com/MaJerle/lwrb>`_.

* Download latest release from `releases area <https://github.com/MaJerle/lwrb/releases>`_ on Github
* Clone `develop` branch for latest development
You can get it with:

* Downloading latest release from `releases area <https://github.com/MaJerle/lwrb/releases>`_ on Github
* Cloning ``master`` branch for latest stable version
* Cloning ``develop`` branch for latest development

Download from releases
**********************
Expand All @@ -24,7 +30,9 @@ Clone from Github
First-time clone
""""""""""""""""

* Download and install ``git`` if not already
This is used when you do not have yet local copy on your machine.

* Make sure ``git`` is installed.
* Open console and navigate to path in the system to clone repository to. Use command ``cd your_path``
* Clone repository with one of available ``3`` options

Expand All @@ -38,7 +46,8 @@ Update cloned to latest version
"""""""""""""""""""""""""""""""

* Open console and navigate to path in the system where your resources repository is. Use command ``cd your_path``
* Run ``git pull origin master --recurse-submodules`` command to pull latest changes and to fetch latest changes from submodules
* Run ``git pull origin master --recurse-submodules`` command to pull latest changes and to fetch latest changes from submodules on ``master`` branch
* Run ``git pull origin develop --recurse-submodules`` command to pull latest changes and to fetch latest changes from submodules on ``develop`` branch
* Run ``git submodule foreach git pull origin master`` to update & merge all submodules

.. note::
Expand All @@ -49,18 +58,21 @@ Add library to project
^^^^^^^^^^^^^^^^^^^^^^

At this point it is assumed that you have successfully download library, either cloned it or from releases page.
Next step is to add the library to the project, by means of source files to compiler inputs and header files in search path

* Copy ``lwrb`` folder to your project
* Add ``lwrb/src/include`` folder to `include path` of your toolchain
* Add source files from ``lwrb/src/`` folder to toolchain build
* Copy ``lwrb`` folder to your project, it contains library files
* Add ``lwrb/src/include`` folder to `include path` of your toolchain. This is where `C/C++` compiler can find the files during compilation process. Usually using ``-I`` flag
* Add source files from ``lwrb/src/`` folder to toolchain build. These files are built by `C/C++` compilery
* Build the project


Minimal example code
^^^^^^^^^^^^^^^^^^^^

Run below example to test and verify library
To verify proper library setup, minimal example has been prepared.
Run it in your main application file to verify its proper execution

.. literalinclude:: ../examples_src/example_minimal.c
:language: c
:linenos:
:caption: Minimal example code
:caption: Absolute minimum example
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LwRB is a generic *FIFO* (First In; First Out) buffer library optimized for embe
.. rst-class:: center
.. rst-class:: index_links

:ref:`download_library` :ref:`getting_started` `Open Github <https://github.com/MaJerle/lwrb>`_
:ref:`download_library` :ref:`getting_started` `Open Github <https://github.com/MaJerle/lwrb>`_ `Donate <https://paypal.me/tilz0R>`_

Features
^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
breathe>=4.9.1
colorama
docutils>=0.14
sphinx>=2.0.1
docutils==0.16
sphinx>=3.5.1
sphinx_rtd_theme
sphinx-tabs
sphinxcontrib-svg2pdfconverter
Expand Down
2 changes: 1 addition & 1 deletion docs/static/images/logo.drawio
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile modified="2019-12-01T16:48:18.227Z" host="" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/11.2.5 Chrome/76.0.3809.139 Electron/6.0.7 Safari/537.36" etag="g-lV9veBl4p9DRM_DQmf" pages="1" version="11.2.5" type="device"><diagram id="I-N_G4gh3ujyhIfbbh0O" name="Page-1">7Ztdb+I4FIZ/DZcT+TOOL1vo7FzsaitVq53Zu0BciCbgKqQF5tevQ2ywHVoMGSgSZKQRPnFO6vM+do5PoIf70+UfZfoy+UtmoughkC17eNBDKCGJ+r82rBoDSWBjGJd51pgsw1P+SzRGqo2veSbmTr9KyqLKX1zjSM5mYlQ5trQs5cLt9iwL96Yv6Vi0DE+jtGhb/82zaqJHRcHW/k3k44m5MwT6zDQ1nbVhPkkzubC84oce7pdSVs2n6bIvijp0JizNdV/fObv5w0oxq0IueC7/q379vRp8m/74p+intH+XD75g1Lh5S4tXPWL911YrEwLlRkVbNe4Xk7wSTy/pqD6zUHIr26SaFqoF1cd5VcqfmzCpAd4/50XRl4UsVXsmZ7WPLC+VTrmcKdNcvtZd79tD0aN7E2Ulln7MFGpCTkVVrlQXfRZzDYzGDHIaactiqxvEWoyJrZkxppqV8cb7Npzqg47oAdGFdH906yHmirc/06EoHuU817EZyqqSUxUc0+GuyMf1iUr6YZ+kL7Wz6XJcz8BomM7zUZSWo7UkaVndzcbru4FIBQnfi1m2tQDaEk6Fw1Wuh/Dz+th0tc7E66O+Qs4qy94cpxOcQOAIjiDYJTjYJTg4leAoYDqdVXDQEhx2FZwM6n/XJiy+MGFhS1jUVdgEDfF6Jl+VsOTChEUtYXFXYTPGhwBcm7CX9uzFLWFJZ2HjYUyvbsbGFyYsaQlLuwo7TCihVzdj2YUJS1vCxl2F5THD6Xln7KfLmlyYrHFLVtZVVjRg8foJ622CNldc1TzmFyY4awmedBUcgPjh7utN8KaIBC5M8KQlOO8qeJ9hepvhRnC4X/Ajq4bwrFVDgtyqIUK7qoZsR3DZyWIbsCGt0a5r29v4WPFU0ShX39fUY0KM4UczDRJkDIM6BGDTWtmtR1HmajSiNMZlXhmPsW5rh0w3t+7qxspq+M7elU3pWo5EAHZqso9F9VFHHTKROcX9NgaWyHSHyMZWiiKt8jf3lcAu5fUdHmWuxralDLtzGJPNHDZOmrHr65BVxPdc4cRzxVuumui0XK1h3Ay9A58B++pQPmPKfD5hNz6b7bDNJ7kBuh9QyiMjowEL4IiA7eH5DOWVEB4xyLeHexOMI0its+y8KAdUEkJR5iBxUWY87oYyBy7KjMMbyvtRTlTkbODiFtYxs04fuQ4Tte4S0CbXAhvg88IcUD0JgxlGQL822sBM96GsqYUOsfRjXnfhf4XA8iQi7wOLFGiJtyyGQkqRopB4/CfqIXteMAPqP+GrrJcwIIAD0awvRg6eCByeG9yg1assj7h9uMwen99StK7P7fF2amIDCljhKW7sEgsgDybWz2YBim/EHr/MQuKBpXLTxMpxvQd2OLNIpRyuawyjhJ8VWhJQhAuvG3jPf4D21g2sEgH1oL0ts6dJZhFmEUYWwB2SWfOWxrgGLOLxp+3MSEiBMRBmwFHPyxnIPpg/3pkB7hJ+TCJxhTBTHkHv0a4Ahl42ekhlIfHcqeTW7OnPBSrqCqqm6ovCqsllD9k+fbcb4Vu13wgjCoURXhSMmHu5AD06ZSUYtLiOz52ykoDvJ4YvmF7Kynj4JgtwtwbA9r0heG+pvTFKAIliL69kICL2voscyyxx9m+UHnSbU8Mc8ArMvA1+LsRSU31vAT4q0vk8H/mMZ+Y1I40QZCozIBQQiig03+HSvz/BapuGFfYQYEISxOoJsdhcaqw0iRGIea/1GnmYjpIM93Z+b6A+PsL5QuDDnEV7F7Vg3NQO6dNXyIBi/w2qE69ovxMqelKoVHP706ym+/bnbfjhfw==</diagram></mxfile>
<mxfile modified="2020-12-05T00:16:42.437Z" host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.3.2 Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36" etag="U11Z96L21UU_GpCirp-U" version="12.3.2" type="device" pages="1"><diagram id="I-N_G4gh3ujyhIfbbh0O" name="Page-1">jZJNb4MwDIZ/DcdJQNSKXcu6Tto6TTCp54i4JFogKLgD9usXhgNFVaWdEj/+iPPaAUur/mB5I49GgA7iUPQBewriOAqTxB0jGSbyuCVQWiUoaAG5+oEJbghelIB2FYfGaFTNGhamrqHAFePWmm4ddjZ6/WjDS7gBecH1LT0pgXKiySZc+AuoUvqXo5A8FffBBFrJhemuqrJ9wFJrDE63qk9Bj9p5Waa85zveuTELNf4noeVMvOeDyrg6vn6cs1NSfj7EU5Vvri/04bcu21HDOHgVrLnUAsZCUcB2nVQIecOL0du5sTsmsdLkbtGar1mtrSNnUyNNlo32LEXoDOoALEJ/92uLYG7RwFSAdnAhlMD8OGjHYm93y8iiLTF5NS4fx2lLyrn0IqS7kJbeXGb257tafLb/BQ==</diagram></mxfile>
Loading

0 comments on commit 3205198

Please sign in to comment.