Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Jun 1, 2021
2 parents 936f905 + 89d7081 commit 2801bb3
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 40 deletions.
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

## v1.0.3

- CMSIS-OS improvements for Kernel aware debuggers

## v1.0.2

- Fixed `float` output when engineering mode is disabled

## v1.0.1

- Fixed compiler error when engineering mode disabled but float enabled
- Properly handled `zero` float inputs

## v1.0.0

- First stable release
- Embedded systems optimized library
- Apply all modifiers except `%a`
- Extensive docs available
- Operating system ready with CMSIS-OS template
2 changes: 1 addition & 1 deletion dev/VisualStudio/lwprintf_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#ifndef LWPRINTF_HDR_OPTS_H
#define LWPRINTF_HDR_OPTS_H
Expand Down
27 changes: 16 additions & 11 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 = 'v1.0.2'

# 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
47 changes: 32 additions & 15 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/lwprintf>`_.

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

* Downloading latest release from `releases area <https://github.com/MaJerle/lwprintf/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,47 +46,56 @@ 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::
This is preferred option to use when you want to evaluate library and run prepared examples.
Repository consists of multiple submodules which can be automatically downloaded when cloning and pulling changes from root repository.
This is preferred option to use when you want to evaluate library and run prepared examples.
Repository consists of multiple submodules which can be automatically downloaded when cloning and pulling changes from root repository.

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 ``lwprintf`` folder to your project
* Add ``lwprintf/src/include`` folder to `include path` of your toolchain
* Add source files from ``lwprintf/src/`` folder to toolchain build
* Copy ``lwprintf`` folder to your project, it contains library files
* Add ``lwprintf/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 ``lwprintf/src/`` folder to toolchain build. These files are built by `C/C++` compiler
* Copy ``lwprintf/src/include/lwprintf/lwprintf_opts_template.h`` to project folder and rename it to ``lwprintf_opts.h``
* Build the project

Configuration file
^^^^^^^^^^^^^^^^^^

Configuration file is used to overwrite default settings defined for the essential use case.
Library comes with template config file, which can be modified according to needs.
This file shall be named ``lwprintf_opts.h`` and its default template looks like the one below.
and it should be copied (or simply renamed in-place) and named ``lwprintf_opts.h``

.. note::
Default configuration template file location: ``lwprintf/src/include/lwprintf/lwprintf_opts_template.h``.
File must be renamed to ``lwprintf_opts.h`` first and then copied to the project directory (or simply renamed in-place) where compiler
File must be renamed to ``lwprintf_opts.h`` first and then copied to the project directory where compiler
include paths have access to it by using ``#include "lwprintf_opts.h"``.

.. tip::
Check :ref:`api_lwprintf_opt` section for possible configuration settings
List of configuration options are available in the :ref:`api_lwprintf_opt` section.
If any option is about to be modified, it should be done in configuration file

.. literalinclude:: ../../lwprintf/src/include/lwprintf/lwprintf_opts_template.h
:language: c
:linenos:
:caption: Template options file
:caption: Template configuration file

.. note::
If you prefer to avoid using configuration file, application must define
a global symbol ``LWPRINTF_IGNORE_USER_OPTS``, visible across entire application.
This can be achieved with ``-D`` compiler option.

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#ifndef LWPRINTF_HDR_OPTS_H
#define LWPRINTF_HDR_OPTS_H
Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/include/lwprintf/lwprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#ifndef LWPRINTF_HDR_H
#define LWPRINTF_HDR_H
Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/include/lwprintf/lwprintf_opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#ifndef LWPRINTF_HDR_OPT_H
#define LWPRINTF_HDR_OPT_H
Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/include/lwprintf/lwprintf_opts_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#ifndef LWPRINTF_HDR_OPTS_H
#define LWPRINTF_HDR_OPTS_H
Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/include/system/lwprintf_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#ifndef LWPRINTF_HDR_SYS_H
#define LWPRINTF_HDR_SYS_H
Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/lwprintf/lwprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#include <limits.h>
#include <float.h>
Expand Down
8 changes: 5 additions & 3 deletions lwprintf/src/system/lwprintf_sys_cmsis_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#include "system/lwprintf_sys.h"

Expand All @@ -39,8 +39,10 @@

uint8_t
lwprintf_sys_mutex_create(LWPRINTF_CFG_OS_MUTEX_HANDLE* m) {
*m = osMutexNew(NULL);
return lwprintf_sys_mutex_isvalid(m);
const osMutexAttr_t attr = {
.name = "lwprintf_mutex",
};
return (*m = osMutexNew(&attr)) != NULL;
}

uint8_t
Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/system/lwprintf_sys_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#include "system/lwprintf_sys.h"

Expand Down
2 changes: 1 addition & 1 deletion lwprintf/src/system/lwprintf_sys_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LwPRINTF - Lightweight stdio manager library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.0.2
* Version: v1.0.3
*/
#include "system/lwprintf_sys.h"

Expand Down

0 comments on commit 2801bb3

Please sign in to comment.