Skip to content

Commit

Permalink
fix cast on logger. Other minor fixes. bump to 1.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
camilo committed Jun 5, 2024
1 parent c21f443 commit 129d7a4
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 20 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.5.8
PROJECT_NUMBER = v1.5.9

# 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.5.8",
"version": "1.5.9",
"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.5.8
version=1.5.9
license=MIT
author=J. Camilo Gomez C. <[email protected]>
maintainer=J. Camilo Gomez C. <[email protected]>
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.5.8
VERSION 1.5.9
DESCRIPTION "An open-source OS for small embedded applications"
LANGUAGES CXX )

Expand Down
10 changes: 5 additions & 5 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.5.8
* @version 1.5.9
* @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.5.8"
#define QUARKTS_CPP_VERNUM ( 158u )
#define QUARKTS_CPP_VERSION "1.5.9"
#define QUARKTS_CPP_VERNUM ( 159u )
#define QUARKTS_CPP_CAPTION "QuarkTS++ OS " QUARKTS_CPP_VERSION

#include "config/config.h"
Expand Down Expand Up @@ -70,7 +70,7 @@ namespace qOS {
constexpr const uint8_t number = QUARKTS_CPP_VERNUM;
constexpr const uint8_t mayor = 1U;
constexpr const uint8_t minor = 5U;
constexpr const uint8_t rev = 8U;
constexpr const uint8_t rev = 9U;
}
namespace product {
constexpr const char* author = "J. Camilo Gomez C.";
Expand All @@ -84,7 +84,7 @@ namespace qOS {
}

namespace build {
constexpr const uint32_t number = 4122;
constexpr const uint32_t number = 4123;
constexpr const char* date = __DATE__;
constexpr const char* time = __TIME__;
constexpr const char* std = "c++11";
Expand Down
11 changes: 6 additions & 5 deletions src/include/input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace qOS {
/*! @endcond */

/**
* @brief An digital input-channel object.
* @brief An input-channel object, could be either analog or digital.
*/
class channel : protected node {
private:
Expand Down Expand Up @@ -207,17 +207,18 @@ namespace qOS {
return ( &value != ptrValue );
}
/**
* @brief Set/Change the interval duration between multiple press
* for a digital input
* @brief Set/Change the interval duration between multiple
* pulsations for a digital input
* @param[in] interval The specified interval
* @return @c true on success. Otherwise @c false.
*/
inline bool setMultiPressInterval( qOS::duration_t interval )
inline bool setPulsationInterval( qOS::duration_t interval )
{
bool retValue = false;

if ( ( input::type::DIGITAL == channelType ) && ( interval > 50 ) ) {
pulsationInterval = interval;
retValue = true;
}

return retValue;
Expand All @@ -228,7 +229,7 @@ namespace qOS {
* the input event-callback.
* @return The pulsation count.
*/
inline uint8_t getMultiPressCount( void ) const {
inline uint8_t getPulsationCount( void ) const {
return pulsationCount;
}
friend class watcher;
Expand Down
1 change: 1 addition & 0 deletions src/include/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ namespace qOS {
_logger& operator<<( const qOS::timer& t );
_logger& operator<<( const qOS::stateMachine& sm );
_logger& operator<<( const qOS::sm::state& s );
_logger& operator<<( const qOS::trigger& t );
_logger& operator<<( const qOS::input::channel& in );
_logger& operator<<( const qOS::input::event& e );

Expand Down
2 changes: 1 addition & 1 deletion src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ bool input::watcher::add( channel& c ) noexcept
bool input::watcher::remove( channel& c ) noexcept
{
list *channelContainer = c.getContainer();
bool retValue = channelContainer->remove( &c );
const bool retValue = channelContainer->remove( &c );
c.ptrValue = &c.value;

if ( ( input::type::ANALOG == c.channelType ) && !c.isShared() ) {
Expand Down
21 changes: 16 additions & 5 deletions src/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace qOS {
_logger& _logger::operator<<( const void * const p )
{
/*cstat -CERT-INT36-C*/
(void)util::unsignedToString( reinterpret_cast<unsigned_t>( p ), buffer, 16U ); // skipcq: CXX-C1000
(void)util::unsignedToString( reinterpret_cast<uintptr_t>( p ), buffer, 16U ); // skipcq: CXX-C1000
/*cstat +CERT-INT36-C*/
(void)util::outputString( writeChar, "p@0x" );
(void)util::outputString( writeChar, buffer ); // skipcq: CXX-C1000
Expand Down Expand Up @@ -200,10 +200,10 @@ namespace qOS {
_logger& _logger::operator<<( const qOS::stateMachine& sm )
{
(void)util::outputString( writeChar , "SM{ T: 0x" );
(void)util::unsignedToString( reinterpret_cast<unsigned_t>( &sm.getTop() ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::unsignedToString( reinterpret_cast<uintptr_t>( &sm.getTop() ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , buffer ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , ", C: 0x" );
(void)util::unsignedToString( reinterpret_cast<unsigned_t>( sm.getCurrent() ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::unsignedToString( reinterpret_cast<uintptr_t>( sm.getCurrent() ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , buffer ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , " } " );
return *this;
Expand All @@ -212,16 +212,27 @@ namespace qOS {
_logger& _logger::operator<<( const qOS::sm::state& s )
{
(void)util::outputString( writeChar , "s{ 0x" );
(void)util::unsignedToString( reinterpret_cast<unsigned_t>( &s ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::unsignedToString( reinterpret_cast<uintptr_t>( &s ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , buffer ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , " } " );
return *this;
}

_logger& _logger::operator<<( const qOS::trigger& t )
{
static const char *str[ static_cast<int>( qOS::input::event::MAX_EVENTS ) + 1 ] = { // skipcq: CXX-W2066
"None ", "byTimeElapsed ", "byNotificationQueued ", "byNotificationSimple ",
"byQueueReceiver ", "byQueueFull ", "byQueueCount ", "byQueueEmpty ",
"byEventFlags ", "bySchedulingRelease ", "byNoReadyTasks "
};
(void)util::outputString( writeChar , str[ static_cast<int>( t ) ] ); // skipcq: CXX-C1000
return *this;
}

_logger& _logger::operator<<( const qOS::input::channel& in )
{
(void)util::outputString( writeChar , "in{ 0x" );
(void)util::unsignedToString( reinterpret_cast<unsigned_t>( &in ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::unsignedToString( reinterpret_cast<uintptr_t>( &in ), buffer, 16 ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , buffer ); // skipcq: CXX-C1000
(void)util::outputString( writeChar , ( qOS::input::type::ANALOG == in.getChannelType() ) ? ", ANALOG, C: " : ", DIGITAL, C: " );
(void)util::unsignedToString( static_cast<unsigned_t>( in.getChannel() ), buffer, 10 ); // skipcq: CXX-C1000
Expand Down

0 comments on commit 129d7a4

Please sign in to comment.