Skip to content

Commit 3205198

Browse files
committed
Merge branch 'develop'
2 parents 601bc87 + c21ba2d commit 3205198

File tree

26 files changed

+553
-130
lines changed

26 files changed

+553
-130
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
custom: ['paypal.me/tilz0R']

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
7+
name: Create Release
8+
9+
jobs:
10+
build:
11+
name: Create Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
- name: Create Release
17+
id: create_release
18+
uses: actions/create-release@v1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
21+
with:
22+
tag_name: ${{ github.ref }}
23+
release_name: Release ${{ github.ref }}
24+
body: |
25+
See the CHANGELOG.md
26+
draft: false
27+
prerelease: false

.gitignore

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,27 @@
2222
*.uvoptx
2323
*.__i
2424
*.i
25-
*.txt
2625
!docs/*.txt
2726
RTE/
2827

29-
# IAR Settings
30-
**/settings/*.crun
31-
**/settings/*.dbgdt
32-
**/settings/*.cspy
33-
**/settings/*.cspy.*
34-
**/settings/*.xcl
35-
**/settings/*.dni
36-
**/settings/*.wsdt
37-
**/settings/*.wspos
38-
39-
# IAR Debug Exe
40-
**/Exe/*.sim
41-
42-
# IAR Debug Obj
43-
**/Obj/*.pbd
44-
**/Obj/*.pbd.*
45-
**/Obj/*.pbi
46-
**/Obj/*.pbi.*
28+
# IAR Settings
29+
**/settings/*.crun
30+
**/settings/*.dbgdt
31+
**/settings/*.cspy
32+
**/settings/*.cspy.*
33+
**/settings/*.xcl
34+
**/settings/*.dni
35+
**/settings/*.wsdt
36+
**/settings/*.wspos
37+
38+
# IAR Debug Exe
39+
**/Exe/*.sim
40+
41+
# IAR Debug Obj
42+
**/Obj/*.pbd
43+
**/Obj/*.pbd.*
44+
**/Obj/*.pbi
45+
**/Obj/*.pbi.*
4746

4847
*.TMP
4948
/docs_src/x_Doxyfile.doxy
@@ -274,7 +273,7 @@ ClientBin/
274273
*.publishsettings
275274
orleans.codegen.cs
276275

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

@@ -370,7 +369,7 @@ __pycache__/
370369
# OpenCover UI analysis results
371370
OpenCover/
372371

373-
# Azure Stream Analytics local run output
372+
# Azure Stream Analytics local run output
374373
ASALocalRun/
375374

376375
# MSBuild Binary and Structured Log

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "third_party/Unity"]
2+
path = third_party/Unity
3+
url = https://github.com/ThrowTheSwitch/Unity.git
4+
[submodule "third_party/sanitizers-cmake"]
5+
path = third_party/sanitizers-cmake
6+
url = https://github.com/arsenm/sanitizers-cmake.git
7+
[submodule "third_party/cmake-modules"]
8+
path = third_party/cmake-modules
9+
url = https://github.com/bilke/cmake-modules.git

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Changelog
2+
3+
## Develop
4+
5+
## v2.0.2
6+
7+
- Add `volatile` keyword to all local variables to ensure thread safety in highest optimization
8+
- Add local variables for all read and write pointer accesses
9+
- Remove generic `volatile` keyword from func parameter and replace to struct member
10+
11+
## v2.0.1
12+
13+
- Fix wrong check for valid RB instance
14+
- Apply code style settings with Artistic style options
15+
- Add thread safety docs
16+
17+
## v2.0.0
18+
19+
- Break compatibility with previous versions
20+
- Rename function prefixes to `lwrb` instead of `ringbuff`
21+
- Add astyle code syntax correction
22+
23+
## v1.3.1
24+
25+
- Fixed missing `RINGBUFF_VOLATILE` for event callback causes compiler warnings or errors
26+
27+
## v1.3.0
28+
29+
- Added support for events on read/write or reset operation
30+
- Added optional volatile parameter for buffer structure
31+
- Fix bug in skip and advance operation to return actual amount of bytes processed
32+
- Remove `BUF_PREF` parameter and rename with fixed `ringbuff_` prefix for all functions
33+
34+
## v1.2.0
35+
36+
- Added first sphinx documentation
37+
38+
## v1.1.0
39+
40+
- Code optimizations, use pre-increment instead of post
41+
- Another code-style fixes
42+
43+
## v1.0.0
44+
45+
- First stable release

dev/VisualStudio/lwrb_dev.vcxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@
139139
<OptimizeReferences>true</OptimizeReferences>
140140
</Link>
141141
</ItemDefinitionGroup>
142-
<ItemGroup>
143-
<Text Include="ReadMe.txt" />
144-
</ItemGroup>
145142
<ItemGroup>
146143
<ClCompile Include="..\..\lwrb\src\lwrb\lwrb.c" />
147144
<ClCompile Include="main.c" />

dev/VisualStudio/lwrb_dev.vcxproj.filters

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
1515
</Filter>
1616
</ItemGroup>
17-
<ItemGroup>
18-
<Text Include="ReadMe.txt" />
19-
</ItemGroup>
2017
<ItemGroup>
2118
<ClCompile Include="main.c">
2219
<Filter>Source Files</Filter>

docs/conf.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,32 @@
2626
copyright = '2020, Tilen MAJERLE'
2727
author = 'Tilen MAJERLE'
2828

29-
# The full version, including alpha/beta/rc tags
30-
version = '2.0.1'
31-
3229
# Try to get branch at which this is running
3330
# and try to determine which version to display in sphinx
31+
# Version is using git tag if on master or "latest-develop" if on develop branch
32+
version = ''
3433
git_branch = ''
34+
35+
# Get current branch
3536
res = os.popen('git branch').read().strip()
3637
for line in res.split("\n"):
3738
if line[0] == '*':
3839
git_branch = line[1:].strip()
3940

4041
# Decision for display version
41-
try:
42-
if git_branch.index('develop') >= 0:
43-
version = "latest-develop"
44-
except Exception:
45-
print("Exception for index check")
46-
47-
# For debugging purpose
42+
git_branch = git_branch.replace('(HEAD detached at ', '').replace(')', '')
43+
if git_branch.find('master') >= 0 or git_branch.find('main') >= 0:
44+
version = os.popen('git describe --tags --abbrev=0').read().strip()
45+
if version == '':
46+
version = 'v0.0.0'
47+
elif git_branch.find('develop') != -1 and not (git_branch.find('develop-') >= 0 or git_branch.find('develop/') >= 0):
48+
version = 'latest-develop'
49+
else:
50+
version = 'branch-' + git_branch
51+
52+
# For debugging purpose only
4853
print("GIT BRANCH: " + git_branch)
49-
print("VERSION: " + version)
54+
print("GIT VERSION: " + version)
5055

5156
# -- General configuration ---------------------------------------------------
5257

@@ -112,7 +117,7 @@
112117
'css/custom.css',
113118
]
114119
html_js_files = [
115-
'https://kit.fontawesome.com/3102794088.js'
120+
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css'
116121
]
117122

118123
master_doc = 'index'

docs/examples_src/example_advance_1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ if ((len = lwrb_get_linear_block_write_length(&buff)) > 0) {
4343
/* Get length of linear memory at write pointer */
4444
/* Function returns 3 as we can write 3 bytes to buffer in sequence */
4545
/* When function returns 0, there is no memory available in the buffer for write anymore */
46-
if ((len = lwrb_get_linear_block_read_length(&buff)) > 0) {
46+
if ((len = lwrb_get_linear_block_write_length(&buff)) > 0) {
4747
/* Get pointer to first element in linear block at write address */
4848
/* Function returns &buff_data[0] */
49-
data = lwrb_get_linear_block_read_address(&buff);
49+
data = lwrb_get_linear_block_write_address(&buff);
5050

5151
/* Receive data via DMA and wait to finish (for sake of example) */
5252
/* Any other hardware may directly write to data array */

docs/get-started/index.rst

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@
33
Getting started
44
===============
55

6+
Getting started may be the most challenging part of every new library.
7+
This guide is describing how to start with the library quickly and effectively
8+
69
.. _download_library:
710

811
Download library
912
^^^^^^^^^^^^^^^^
1013

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

13-
* Download latest release from `releases area <https://github.com/MaJerle/lwrb/releases>`_ on Github
14-
* Clone `develop` branch for latest development
16+
You can get it with:
17+
18+
* Downloading latest release from `releases area <https://github.com/MaJerle/lwrb/releases>`_ on Github
19+
* Cloning ``master`` branch for latest stable version
20+
* Cloning ``develop`` branch for latest development
1521

1622
Download from releases
1723
**********************
@@ -24,7 +30,9 @@ Clone from Github
2430
First-time clone
2531
""""""""""""""""
2632

27-
* Download and install ``git`` if not already
33+
This is used when you do not have yet local copy on your machine.
34+
35+
* Make sure ``git`` is installed.
2836
* Open console and navigate to path in the system to clone repository to. Use command ``cd your_path``
2937
* Clone repository with one of available ``3`` options
3038

@@ -38,7 +46,8 @@ Update cloned to latest version
3846
"""""""""""""""""""""""""""""""
3947

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

4453
.. note::
@@ -49,18 +58,21 @@ Add library to project
4958
^^^^^^^^^^^^^^^^^^^^^^
5059

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

53-
* Copy ``lwrb`` folder to your project
54-
* Add ``lwrb/src/include`` folder to `include path` of your toolchain
55-
* Add source files from ``lwrb/src/`` folder to toolchain build
63+
* Copy ``lwrb`` folder to your project, it contains library files
64+
* 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
65+
* Add source files from ``lwrb/src/`` folder to toolchain build. These files are built by `C/C++` compilery
5666
* Build the project
5767

68+
5869
Minimal example code
5970
^^^^^^^^^^^^^^^^^^^^
6071

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

6375
.. literalinclude:: ../examples_src/example_minimal.c
6476
:language: c
6577
:linenos:
66-
:caption: Minimal example code
78+
:caption: Absolute minimum example

0 commit comments

Comments
 (0)