Skip to content

Commit 41ea814

Browse files
author
camilo
committed
bump to 1.7.7
1 parent 6913f8c commit 41ea814

File tree

13 files changed

+120
-68
lines changed

13 files changed

+120
-68
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"maintainer": true
1717
}
1818
],
19-
"version": "1.7.6",
19+
"version": "1.7.7",
2020
"license": "MIT",
2121
"frameworks": "arduino",
2222
"platforms": "*"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=QuarkTS
2-
version=1.7.6
2+
version=1.7.7
33
license=MIT
44
author=J. Camilo Gomez C. <[email protected]>
55
maintainer=J. Camilo Gomez C. <[email protected]>

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required( VERSION 3.2 )
22
project( quarkts-cpp
3-
VERSION 1.7.6
3+
VERSION 1.7.7
44
DESCRIPTION "An open-source OS for small embedded applications"
55
LANGUAGES CXX )
66

src/QuarkTS.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* @file QuarkTS.h
33
* @author J. Camilo Gomez C.
4-
* @version 1.7.6
4+
* @version 1.7.7
55
* @note This file is part of the QuarkTS++ distribution.
66
* @brief Global inclusion header
77
**/
@@ -41,8 +41,8 @@ This file is part of the QuarkTS++ OS distribution.
4141
#ifndef QOS_CPP_H
4242
#define QOS_CPP_H
4343

44-
#define QUARKTS_CPP_VERSION "1.7.6"
45-
#define QUARKTS_CPP_VERNUM ( 176u )
44+
#define QUARKTS_CPP_VERSION "1.7.7"
45+
#define QUARKTS_CPP_VERNUM ( 177u )
4646
#define QUARKTS_CPP_CAPTION "QuarkTS++ OS " QUARKTS_CPP_VERSION
4747

4848
#include "config/config.h"
@@ -66,7 +66,7 @@ This file is part of the QuarkTS++ OS distribution.
6666

6767
namespace qOS {
6868
namespace build {
69-
constexpr const uint32_t number = 4149;
69+
constexpr const uint32_t number = 4181;
7070
constexpr const char* date = __DATE__;
7171
constexpr const char* time = __TIME__;
7272
constexpr const char* std = "c++11";
@@ -76,7 +76,7 @@ namespace qOS {
7676
constexpr const uint8_t number = QUARKTS_CPP_VERNUM;
7777
constexpr const uint8_t mayor = 1U;
7878
constexpr const uint8_t minor = 7U;
79-
constexpr const uint8_t rev = 6U;
79+
constexpr const uint8_t rev = 7U;
8080
}
8181
namespace product {
8282
constexpr const char* author = "J. Camilo Gomez C.";

src/include/cli.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace qOS {
7474
volatile bool ready{ false };
7575
void flush( void );
7676
void operator=( input const& ) = delete;
77-
input() {}
77+
input() noexcept {}
7878
};
7979
/*! @endcond */
8080

src/include/clock.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace qOS {
8181
/*! @cond */
8282
static volatile qOS::clock_t sysTick_Epochs; // skipcq: CXX-W2009
8383
static qOS::clock_t internalTick( void ) noexcept;
84-
clock();
84+
clock() = default;
8585
/*! @endcond */
8686
public:
8787
clock( clock &other ) = delete;

src/include/input.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace qOS {
117117
public:
118118
/*! @cond */
119119
virtual ~channel() {}
120-
channel( uint8_t channelNumber ) : number( channelNumber ) {}
120+
channel( uint8_t channelNumber ) noexcept : number( channelNumber ) {}
121121
/*! @endcond */
122122

123123
/**
@@ -257,7 +257,7 @@ namespace qOS {
257257
* @param[in] inputChannel The specified channel(pin) number to read.
258258
* @param[in] invert To invert/negate the raw-reading.
259259
*/
260-
explicit digitalChannel( const uint8_t inputChannel, bool invert = false ) : channel( inputChannel ), negate( invert) {}
260+
explicit digitalChannel( const uint8_t inputChannel, bool invert = false ) noexcept : channel( inputChannel ), negate( invert) {}
261261
/**
262262
* @brief Get the channel type.
263263
* @return The channel type.
@@ -373,7 +373,7 @@ namespace qOS {
373373
* @param[in] upperThreshold The upper threshold value.
374374
* @param[in] h Hysteresis for the in-band transition.
375375
*/
376-
analogChannel( const uint8_t inputChannel, const analogValue_t lowerThreshold, const analogValue_t upperThreshold, const analogValue_t h = 20 )
376+
analogChannel( const uint8_t inputChannel, const analogValue_t lowerThreshold, const analogValue_t upperThreshold, const analogValue_t h = 20 ) noexcept
377377
: channel( inputChannel ),
378378
high( upperThreshold ),
379379
low( lowerThreshold ),
@@ -453,7 +453,7 @@ namespace qOS {
453453
/**
454454
* @brief The digital input-channel watcher class.
455455
*/
456-
class watcher : protected node, private nonCopyable {
456+
class watcher : private nonCopyable {
457457
private:
458458
eventCallback_t exception{ nullptr };
459459
list digitalChannels;

src/include/kernel.hpp

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ namespace qOS {
9393
list coreLists[ Q_PRIORITY_LEVELS + 2 ]; // skipcq: CXX-W2066
9494
list& waitingList; // skipcq: CXX-W2012, CXX-W2010
9595
list& suspendedList; // skipcq: CXX-W2012, CXX-W2010
96-
list inputWatchers;
96+
//list inputWatchers;
97+
void(*cpuIdle)(void){ nullptr };
9798
static const priority_t MAX_PRIORITY_VALUE;
9899
static const uint32_t BIT_INIT;
99100
static const uint32_t BIT_FCALL_IDLE;
@@ -104,8 +105,7 @@ namespace qOS {
104105
void dispatchTaskFillEventInfo( task *Task ) noexcept;
105106
void dispatch( list * const xList ) noexcept;
106107
void dispatchIdle( void ) noexcept;
107-
void handleInputWatchers( void ) noexcept;
108-
core() : waitingList( coreLists[ Q_PRIORITY_LEVELS ] ), suspendedList( coreLists[ Q_PRIORITY_LEVELS + 1 ] ) {}
108+
core() noexcept : waitingList( coreLists[ Q_PRIORITY_LEVELS ] ), suspendedList( coreLists[ Q_PRIORITY_LEVELS + 1 ] ) {}
109109
core( core &other ) = delete;
110110
void operator=( const core & ) = delete;
111111
public:
@@ -131,6 +131,8 @@ namespace qOS {
131131
* @param[in] callbackIdle Callback function to the Idle Task. To
132132
* disable the Idle-Task activities, ignore this parameter of pass
133133
* @c nullptr as argument.
134+
* @param[in] coreIdleFcn The function that sets the CPU into
135+
* low-power or idle state
134136
* @return @c true on success. Otherwise return @c false.
135137
*
136138
* Example : When tick is already provided
@@ -165,7 +167,7 @@ namespace qOS {
165167
* }
166168
* @endcode
167169
*/
168-
bool init( const getTickFcn_t tFcn = nullptr, taskFcn_t callbackIdle = nullptr ) noexcept;
170+
bool init( const getTickFcn_t tFcn = nullptr, taskFcn_t callbackIdle = nullptr, void(*coreIdleFcn)(void) = nullptr ) noexcept;
169171
/**
170172
* @brief Add a task to the scheduling scheme. The task is scheduled to run
171173
* every @a t time units, @a n times and executing @a callback method on
@@ -262,6 +264,15 @@ namespace qOS {
262264
bool add( task &Task, commandLineInterface &cli, const priority_t p, void *arg = nullptr ) noexcept;
263265
/** @}*/
264266
#endif
267+
268+
/**
269+
* @brief Add an input-watcher so that its function is executed by
270+
* the kernel
271+
* @note The input-watcher is considered as an always-active task
272+
* @param[in] w The input watcher.
273+
* @return Returns @c true if success, otherwise returns @c false.
274+
*/
275+
bool add( task &Task, input::watcher &w, const priority_t p = HIGHEST_PRIORITY, const taskState s = taskState::ENABLED_STATE, void *arg = nullptr ) noexcept;
265276
/**
266277
* @brief Set/Change the callback for the Idle-task
267278
* @param[in] callback A pointer to a void callback method with a qOS::event_t
@@ -277,6 +288,13 @@ namespace qOS {
277288
*/
278289
bool setNameIdleTask( const char *tName ) noexcept;
279290
/**
291+
* @brief Set the function that puts the CPU into a low-power or
292+
* idle state until an interrupt occurs.
293+
* @param[in] pFcn The function to put the CPU into low-power or idle-state
294+
* @return @c true on success. Otherwise return @c false.
295+
*/
296+
bool setCoreIdleFcn( void(*pFcn)(void) ) noexcept;
297+
/**
280298
* @brief Disables the kernel scheduling. The main thread will continue
281299
* after the core::run() call.
282300
*/
@@ -438,21 +456,6 @@ namespace qOS {
438456
*/
439457
globalState getGlobalState( task &Task ) const noexcept;
440458
/**
441-
* @brief Add an input-watcher so that its function is executed by
442-
* the kernel
443-
* @note The input-watcher is considered as an always-active task
444-
* @param[in] w The input watcher.
445-
* @return Returns @c true if success, otherwise returns @c false.
446-
*/
447-
bool add( input::watcher &w ) noexcept;
448-
/**
449-
* @brief Remove an input-watcher so that the kernel stops executing
450-
* its function
451-
* @param[in] w The input-watcher.
452-
* @return Returns @c true if success, otherwise returns @c false.
453-
*/
454-
bool remove( input::watcher &w ) noexcept;
455-
/**
456459
* @brief Check if the OS instance has been initialized.
457460
* @return @c true if OS instance has been initialized
458461
*/

src/include/list.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace qOS {
7676
{
7777
return container;
7878
}
79-
node() : next(nullptr), prev(nullptr), container(nullptr) {}
79+
node() noexcept : next(nullptr), prev(nullptr), container(nullptr) {}
8080
/*! @cond */
8181
virtual ~node() {}
8282
/*! @endcond */

src/include/timer.hpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace qOS {
2828
qOS::clock_t tStart{ 0U };
2929
qOS::clock_t tv{ 0U };
3030
public:
31-
timer();
31+
timer() noexcept;
3232
/*! @cond */
3333
virtual ~timer() {}
3434
/*! @endcond */
@@ -85,7 +85,23 @@ namespace qOS {
8585
* @return Returns @c true on success, otherwise, returns @c false.
8686
* @note A disarmed timer also returns @c false.
8787
*/
88-
bool freeRun( const qOS::duration_t tTime ) noexcept;
88+
bool reloadIfExpired( const qOS::duration_t tTime ) noexcept;
89+
/**
90+
* @brief Non-Blocking timer check with automatic arming.
91+
*
92+
* Behavior:
93+
* If disarmed, it gets armed immediately with the previous
94+
* specified time.
95+
*
96+
* If armed, the API only checks for expiration. When the time
97+
* expires, the timer gets armed immediately using the previously
98+
* assigned time.
99+
* @note After the timer expiration, this method re-arms the timer
100+
* @note The OS must be running before using a timer.
101+
* @return Returns @c true on success, otherwise, returns @c false.
102+
* @note A disarmed timer also returns @c false.
103+
*/
104+
bool reloadIfExpired( void ) noexcept;
89105
/**
90106
* @brief Retrieve the remaining time in epochs
91107
* @return The remaining time specified in epochs.

0 commit comments

Comments
 (0)