Skip to content

Commit

Permalink
fix step/diff events. bump to 1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
camilo committed Jun 14, 2024
1 parent 9bef25f commit adf2218
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion doc/Doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "OS"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v1.7.1
PROJECT_NUMBER = v1.7.3

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"maintainer": true
}
],
"version": "1.7.2",
"version": "1.7.3",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=QuarkTS
version=1.7.2
version=1.7.3
license=MIT
author=J. Camilo Gomez C. <kmilo17pet@gmail.com>
maintainer=J. Camilo Gomez C. <kmilo17pet@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required( VERSION 3.2 )
project( quarkts-cpp
VERSION 1.7.2
VERSION 1.7.3
DESCRIPTION "An open-source OS for small embedded applications"
LANGUAGES CXX )

Expand Down
21 changes: 10 additions & 11 deletions src/QuarkTS.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @file QuarkTS.h
* @author J. Camilo Gomez C.
* @version 1.7.1
* @version 1.7.3
* @note This file is part of the QuarkTS++ distribution.
* @brief Global inclusion header
**/
Expand Down Expand Up @@ -41,8 +41,8 @@ This file is part of the QuarkTS++ OS distribution.
#ifndef QOS_CPP_H
#define QOS_CPP_H

#define QUARKTS_CPP_VERSION "1.7.2"
#define QUARKTS_CPP_VERNUM ( 172u )
#define QUARKTS_CPP_VERSION "1.7.3"
#define QUARKTS_CPP_VERNUM ( 173u )
#define QUARKTS_CPP_CAPTION "QuarkTS++ OS " QUARKTS_CPP_VERSION

#include "config/config.h"
Expand All @@ -65,12 +65,18 @@ This file is part of the QuarkTS++ OS distribution.
#include "include/logger.hpp"

namespace qOS {
namespace build {
constexpr const uint32_t number = 4140;
constexpr const char* date = __DATE__;
constexpr const char* time = __TIME__;
constexpr const char* std = "c++11";
}
namespace version {
constexpr const char* str = QUARKTS_CPP_VERSION;
constexpr const uint8_t number = QUARKTS_CPP_VERNUM;
constexpr const uint8_t mayor = 1U;
constexpr const uint8_t minor = 7U;
constexpr const uint8_t rev = 2U;
constexpr const uint8_t rev = 3U;
}
namespace product {
constexpr const char* author = "J. Camilo Gomez C.";
Expand All @@ -82,13 +88,6 @@ namespace qOS {
constexpr const char* compliance = "MISRAC++2008,SEI-CERT";
constexpr const char* license = "MIT";
}

namespace build {
constexpr const uint32_t number = 4139;
constexpr const char* date = __DATE__;
constexpr const char* time = __TIME__;
constexpr const char* std = "c++11";
}
}

#endif /*QOS_CPP_H*/
Expand Down
8 changes: 5 additions & 3 deletions src/include/input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,17 @@ namespace qOS {
* @param[in] timeDebounce The specified time to bypass the
* bounce of the digital input channels
*/
watcher( const qOS::duration_t timeDebounce = 100_ms ) : debounceTime( timeDebounce ) {}
watcher( const qOS::duration_t dt = 100_ms ) : debounceTime( dt ) {}
/**
* @brief Constructor for the input-watcher instance
* @param[in] rDigital A pointer to a function that reads the specific
* digital input channel
* @param[in] rAnalog A pointer to a function that reads the specific
* analog input channel
* @param[in] timeDebounce The specified time to bypass the
* bounce of the digital input channels
* @param[in] dt The specified time to bypass the bounce of the
* digital input channels. Is also used as sample time
* on analog input channels to trigger input::event::STEP and
* input::event::DELTA events.
*/
watcher( const digitalReaderFcn_t& rDigital, const analogReaderFcn_t& rAnalog, const qOS::duration_t timeDebounce = 100_ms ) :
debounceTime( timeDebounce ), digitalReader( rDigital ), analogReader( rAnalog ) {}
Expand Down
10 changes: 6 additions & 4 deletions src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ void input::analogChannel::updateReading( bool act ) noexcept
{
value = ( isShared() ) ? ptrValue[ 0 ] : reader( number );
if ( act ) {
const analogValue_t diff = value - last;
analogValue_t diff = value - last;
diff = ( diff < 0.0F ) ? -diff : diff;

if ( diff >= delta ) {
dispatchEvent( input::event::DELTA );
Expand Down Expand Up @@ -303,6 +304,7 @@ void input::analogChannel::setInitalState( void ) noexcept
else {
channelState = &input::analogChannel::inBandState;
}
last = val;
}
/*============================================================================*/
bool input::watcher::add( input::channel& c ) noexcept
Expand Down Expand Up @@ -436,13 +438,13 @@ bool input::analogChannel::setParameter( const input::event e, const analogValue
low = p;
break;
case input::event::IN_BAND:
hysteresis = p;
hysteresis = ( p < 0.0F ) ? -p : p;
break;
case input::event::DELTA:
delta = p;
delta = ( p < 0.0F ) ? -p : p;
break;
case input::event::STEP:
step = p;
step = ( p < 0.0F ) ? -p : p;
break;
default:
retValue = false;
Expand Down

0 comments on commit adf2218

Please sign in to comment.