-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
93 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Tilen Majerle <[email protected]> | ||
Tilen Majerle <[email protected]> | ||
Brian <[email protected]> | ||
Peter Maxwell Warasila <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#ifndef LWPRINTF_HDR_OPTS_H | ||
#define LWPRINTF_HDR_OPTS_H | ||
|
@@ -42,10 +42,10 @@ | |
* Open "include/lwprintf/lwprintf_opt.h" and | ||
* copy & replace here settings you want to change values | ||
*/ | ||
#define LWPRINTF_CFG_OS 1 | ||
#define LWPRINTF_CFG_OS_MUTEX_HANDLE HANDLE | ||
#define LWPRINTF_CFG_OS 1 | ||
#define LWPRINTF_CFG_OS_MUTEX_HANDLE HANDLE | ||
|
||
#define LWPRINTF_CFG_SUPPORT_LONG_LONG 1 | ||
#define LWPRINTF_CFG_OS_MANUAL_PROTECT 1 | ||
#define LWPRINTF_CFG_SUPPORT_LONG_LONG 1 | ||
#define LWPRINTF_CFG_OS_MANUAL_PROTECT 1 | ||
|
||
#endif /* OW_HDR_OPTS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _authors: | ||
|
||
Authors | ||
======= | ||
|
||
List of authors and contributors to the library | ||
|
||
.. literalinclude:: ../../AUTHORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#ifndef LWPRINTF_HDR_OPTS_H | ||
#define LWPRINTF_HDR_OPTS_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
# Register core library | ||
add_library(lwprintf INTERFACE) | ||
target_sources(lwprintf PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/lwprintf/lwprintf.c) | ||
target_include_directories(lwprintf INTERFACE ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
|
||
if (DEFINED LWPRINTF_SYS_PORT) | ||
target_sources(lwprintf PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/src/system/lwprintf_sys_${LWPRINTF_SYS_PORT}.c) | ||
endif() | ||
include(${CMAKE_CURRENT_LIST_DIR}/library.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# This file provides set of variables for end user | ||
# and also generates one (or more) libraries, that can be added to the project using target_link_libraries(...) | ||
# | ||
# Before this file is included to the root CMakeLists file (using include() function), user can set some variables: | ||
# | ||
# LWPRINTF_SYS_PORT: If defined, it will include port source file from the library. | ||
# LWPRINTF_OPTS_DIR: If defined, it should set the folder path where options file shall be generated. | ||
# LWPRINTF_COMPILE_OPTIONS: If defined, it provide compiler options for generated library. | ||
# LWPRINTF_COMPILE_DEFINITIONS: If defined, it provides "-D" definitions to the library build | ||
# | ||
|
||
# Library core sources | ||
set(lwprintf_core_SRCS | ||
${CMAKE_CURRENT_LIST_DIR}/src/lwprintf/lwprintf.c | ||
) | ||
|
||
# Add system port | ||
if(DEFINED LWPRINTF_SYS_PORT) | ||
set(lwprintf_core_SRCS | ||
${lwprintf_core_SRCS} | ||
${CMAKE_CURRENT_LIST_DIR}/src/system/lwprintf_sys_${LWPRINTF_SYS_PORT}.c | ||
) | ||
endif() | ||
|
||
# Setup include directories | ||
set(lwprintf_include_DIRS | ||
${CMAKE_CURRENT_LIST_DIR}/src/include | ||
) | ||
|
||
# Register library to the system | ||
add_library(lwprintf INTERFACE) | ||
target_sources(lwprintf INTERFACE ${lwprintf_core_SRCS}) | ||
target_include_directories(lwprintf INTERFACE ${lwprintf_include_DIRS}) | ||
target_compile_options(lwprintf PRIVATE ${LWPRINTF_COMPILE_OPTIONS}) | ||
target_compile_definitions(lwprintf PRIVATE ${LWPRINTF_COMPILE_DEFINITIONS}) | ||
|
||
# Create config file | ||
if(DEFINED LWPRINTF_OPTS_DIR AND NOT EXISTS ${LWPRINTF_OPTS_DIR}/lwprintf_opts.h) | ||
configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/lwprintf/lwprintf_opts_template.h ${LWPRINTF_OPTS_DIR}/lwprintf_opts.h COPYONLY) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#ifndef LWPRINTF_HDR_H | ||
#define LWPRINTF_HDR_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#ifndef LWPRINTF_OPT_HDR_H | ||
#define LWPRINTF_OPT_HDR_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#ifndef LWPRINTF_OPTS_HDR_H | ||
#define LWPRINTF_OPTS_HDR_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#ifndef LWPRINTF_SYS_HDR_H | ||
#define LWPRINTF_SYS_HDR_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#include "lwprintf/lwprintf.h" | ||
#include <float.h> | ||
|
@@ -838,7 +838,7 @@ prv_format(lwprintf_int_t* lwi, va_list arg) { | |
const char* fmt = lwi->fmt; | ||
|
||
#if LWPRINTF_CFG_OS && !LWPRINTF_CFG_OS_MANUAL_PROTECT | ||
if (IS_PRINT_MODE(p) && /* OS protection only for print */ | ||
if (IS_PRINT_MODE(lwi) && /* OS protection only for print */ | ||
(!lwprintf_sys_mutex_isvalid(&lwi->lwobj->mutex) /* Invalid mutex handle */ | ||
|| !lwprintf_sys_mutex_wait(&lwi->lwobj->mutex))) { /* Cannot acquire mutex */ | ||
return 0; | ||
|
@@ -1112,7 +1112,7 @@ prv_format(lwprintf_int_t* lwi, va_list arg) { | |
} | ||
lwi->out_fn(lwi, '\0'); /* Output last zero number */ | ||
#if LWPRINTF_CFG_OS && !LWPRINTF_CFG_OS_MANUAL_PROTECT | ||
if (IS_PRINT_MODE(p)) { /* Mutex only for print operation */ | ||
if (IS_PRINT_MODE(lwi)) { /* Mutex only for print operation */ | ||
lwprintf_sys_mutex_release(&lwi->lwobj->mutex); | ||
} | ||
#endif /* LWPRINTF_CFG_OS && !LWPRINTF_CFG_OS_MANUAL_PROTECT */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#include "system/lwprintf_sys.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#include "system/lwprintf_sys.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* This file is part of LwPRINTF - Lightweight stdio manager library. | ||
* | ||
* Author: Tilen MAJERLE <[email protected]> | ||
* Version: v1.0.4 | ||
* Version: v1.0.5 | ||
*/ | ||
#include "system/lwprintf_sys.h" | ||
|
||
|