Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed May 28, 2023
2 parents b3ad58e + c079fb8 commit b78c1bf
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ AlignConsecutiveBitFields:
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
SortIncludes: false
SortIncludes: true
InsertBraces: true # Control statements must have curly brackets
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Develop

## v1.1.1

- Fix wrong time check

## v1.1.0

- Print error message only on one trial
- Print erro0 message only on one trial
- Add print option to list all expired watchdogs

## v1.0.0
Expand All @@ -15,3 +19,4 @@
## v0.0.1

- First version
****
2 changes: 1 addition & 1 deletion dev/lwwdg_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LWWDG - Lightweight watchdog for RTOS in embedded systems.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.0
* Version: v1.1.1
*/
#ifndef LWWDG_HDR_OPTS_H
#define LWWDG_HDR_OPTS_H
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LwWDG",
"version": "v1.1.0",
"version": "v1.1.1",
"description": "Lightweight watchdog for operating systems and embedded systems",
"keywords": "lwwdg, watchdog, lightweight, independent, watchdog, rtos, os, system",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion lwwdg/src/include/lwwdg/lwwdg.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LWWDG - Lightweight watchdog for RTOS in embedded systems.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.0
* Version: v1.1.1
*/
#ifndef LWWDG_HDR_H
#define LWWDG_HDR_H
Expand Down
2 changes: 1 addition & 1 deletion lwwdg/src/include/lwwdg/lwwdg_opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LWWDG - Lightweight watchdog for RTOS in embedded systems.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.0
* Version: v1.1.1
*/
#ifndef LWWDG_OPT_HDR_H
#define LWWDG_OPT_HDR_H
Expand Down
2 changes: 1 addition & 1 deletion lwwdg/src/include/lwwdg/lwwdg_opts_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LWWDG - Lightweight watchdog for RTOS in embedded systems.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.0
* Version: v1.1.1
*/
#ifndef LWWDG_OPTS_HDR_H
#define LWWDG_OPTS_HDR_H
Expand Down
12 changes: 7 additions & 5 deletions lwwdg/src/lwwdg/lwwdg.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* This file is part of LWWDG - Lightweight watchdog for RTOS in embedded systems.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.0
* Version: v1.1.1
*/
#include <stdint.h>
#include <string.h>
Expand Down Expand Up @@ -106,10 +106,11 @@ lwwdg_set_name(lwwdg_wdg_t* wdg, const char* name) {
void
lwwdg_print_expired(void) {
LWWDG_CRITICAL_SECTION_DEFINE;
LWWDG_CRITICAL_SECTION_LOCK();
uint32_t t = LWWDG_GET_TIME();

LWWDG_CRITICAL_SECTION_LOCK();
for (lwwdg_wdg_t* wdg = wdgs; wdg != NULL; wdg = wdg->next) {
if (WDG_IS_EXPIRED(wdg, time)) {
if (WDG_IS_EXPIRED(wdg, t)) {
LWWDG_CFG_WDG_NAME_ERR_DEBUG(wdg->name);
}
}
Expand Down Expand Up @@ -164,10 +165,11 @@ uint8_t
lwwdg_reload(lwwdg_wdg_t* wdg) {
LWWDG_CRITICAL_SECTION_DEFINE;
uint8_t ret = 0;
uint32_t t = LWWDG_GET_TIME();

LWWDG_CRITICAL_SECTION_LOCK();
if (!WDG_IS_EXPIRED(wdg, LWWDG_GET_TIME())) {
wdg->last_reload_time = time;
if (!WDG_IS_EXPIRED(wdg, t)) {
wdg->last_reload_time = t;
ret = 1;
}
LWWDG_CRITICAL_SECTION_UNLOCK();
Expand Down

0 comments on commit b78c1bf

Please sign in to comment.