diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl/qspy/dpp.tcl b/examples/arm-cm/dpp_ek-tm4c123gxl/qspy/dpp.tcl index 63582695..42d66449 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl/qspy/dpp.tcl +++ b/examples/arm-cm/dpp_ek-tm4c123gxl/qspy/dpp.tcl @@ -1,7 +1,7 @@ #----------------------------------------------------------------------------- # Product: QSpyView -- Customization example for DPP application -# Last updated for version 5.5.0 -# Last updated on 2015-08-21 +# Last updated for version 5.6.4 +# Last updated on 2016-04-25 # # Q u a n t u m L e a P s # --------------------------- @@ -65,11 +65,13 @@ proc onPause {} { # specific canvas for DPP ==================================================== -image create photo ::img::e -file img/eating.gif -image create photo ::img::h -file img/hungry.gif -image create photo ::img::t -file img/thinking.gif -image create photo ::img::BTN_UP -file img/BTN_UP.gif -image create photo ::img::BTN_DWN -file img/BTN_DWN.gif +set scriptFolder [file dirname [file normalize [info script]]] + +image create photo ::img::e -file $scriptFolder/img/eating.gif +image create photo ::img::h -file $scriptFolder/img/hungry.gif +image create photo ::img::t -file $scriptFolder/img/thinking.gif +image create photo ::img::BTN_UP -file $scriptFolder/img/BTN_UP.gif +image create photo ::img::BTN_DWN -file $scriptFolder/img/BTN_DWN.gif wm geometry .canv =400x260 .canv.c configure -width 400 diff --git a/include/qep.h b/include/qep.h index c8b31147..e5fc857c 100644 --- a/include/qep.h +++ b/include/qep.h @@ -3,8 +3,8 @@ /// @ingroup qep /// @cond ///*************************************************************************** -/// Last updated for version 5.6.3 -/// Last updated on 2016-04-12 +/// Last updated for version 5.6.4 +/// Last updated on 2016-04-25 /// /// Q u a n t u m L e a P s /// --------------------------- @@ -43,15 +43,16 @@ //! The current QP version as a decimal constant XYZ, where X is a 1-digit // major version number, Y is a 1-digit minor version number, and Z is // a 1-digit release number. -#define QP_VERSION 563 +#define QP_VERSION 564 //! The current QP version number string of the form X.Y.Z, where X is // a 1-digit major version number, Y is a 1-digit minor version number, // and Z is a 1-digit release number. -#define QP_VERSION_STR "5.6.3" +#define QP_VERSION_STR "5.6.4" + +//! Tamperproof current QP release (5.6.4) and date (16-04-25) +#define QP_RELEASE 0xA061143BU -//! Tamperproof current QP release (5.6.3) and date (16-04-12) -#define QP_RELEASE 0xA063100CU #ifndef Q_SIGNAL_SIZE //! The size (in bytes) of the signal of an event. Valid values: diff --git a/ports/posix/qf_port.cpp b/ports/posix/qf_port.cpp index ff8adbb9..78c3dd17 100644 --- a/ports/posix/qf_port.cpp +++ b/ports/posix/qf_port.cpp @@ -2,8 +2,8 @@ /// @brief QF/C++ port to POSIX/P-threads /// @cond ///*************************************************************************** -/// Last updated for version 5.6.2 -/// Last updated on 2016-01-22 +/// Last updated for version 5.6.4 +/// Last updated on 2016-04-25 /// /// Q u a n t u m L e a P s /// --------------------------- @@ -47,7 +47,6 @@ #include // for PTHREAD_STACK_MIN #include // for mlockall() -#include namespace QP { @@ -57,8 +56,9 @@ Q_DEFINE_THIS_MODULE("qf_port") pthread_mutex_t QF_pThreadMutex_ = PTHREAD_MUTEX_INITIALIZER; // Local-scope objects ------------------------------------------------------- -static long int l_tickUsec = 10000UL; // clock tick in usec (for tv_usec) static bool l_running; +static struct timespec l_tick; +enum { NANOSLEEP_NSEC_PER_SEC = 1000000000 }; // see NOTE05 static void *ao_thread(void *arg); // thread routine for all AOs @@ -75,6 +75,9 @@ void QF::init(void) { bzero(&QF::timeEvtHead_[0], static_cast(sizeof(QF::timeEvtHead_))); bzero(&active_[0], static_cast(sizeof(active_))); + + l_tick.tv_sec = 0; + l_tick.tv_nsec = NANOSLEEP_NSEC_PER_SEC/100L; // default clock tick } //............................................................................ int_t QF::run(void) { @@ -90,13 +93,11 @@ int_t QF::run(void) { // setting priority failed, probably due to insufficient privieges } - struct timeval timeout = { 0 }; // timeout for select() l_running = true; - while (l_running) { + while (l_running) { // the clock tick loop... QF_onClockTick(); // clock tick callback (must call QF_TICK_X()) - timeout.tv_usec = l_tickUsec; - select(0, 0, 0, 0, &timeout); // sleep for the full tick , NOTE05 + nanosleep(&l_tick, NULL); // sleep for the number of ticks, NOTE05 } onCleanup(); // invoke cleanup callback pthread_mutex_destroy(&QF_pThreadMutex_); @@ -104,7 +105,7 @@ int_t QF::run(void) { } //............................................................................ void QF_setTickRate(uint32_t ticksPerSec) { - l_tickUsec = 1000000UL / ticksPerSec; + l_tick.tv_nsec = NANOSLEEP_NSEC_PER_SEC / ticksPerSec; } //............................................................................ void QF::stop(void) { @@ -225,22 +226,7 @@ static void *ao_thread(void *arg) { // the expected POSIX signature // I/O), and the rest highest-priorities for the active objects. // // NOTE05: -// The select() system call seems to deliver the finest time granularity of -// 1 clock tick. The timeout value passed to select() is rounded up to the -// nearest tick (10 ms on desktop Linux). The timeout cannot be too short, -// because the system might choose to busy-wait for very short timeouts. -// An alternative, POSIX nanosleep() system call seems to deliver only 20ms -// granularity. -// -// Here the select() call is used not just as a fairly portable way to sleep -// with subsecond precision. The select() call is also used to detect any -// characters typed on the console. -// -// Also according to man pages, on Linux, the function select() modifies -// timeout to reflect the amount of time not slept; most other implementations -// do not do this. This causes problems both when Linux code which reads -// timeout is ported to other operating systems, and when code is ported to -// Linux that reuses a struct timeval for multiple selects in a loop without -// reinitializing it. Here the microsecond part of the structure is re- -// initialized before each select() call. +// In some (older) Linux kernels, the POSIX nanosleep() system call might +// deliver only 2*actual-system-tick granularity. To compensate for this, +// you would need to reduce (by 2) the constant NANOSLEEP_NSEC_PER_SEC. // diff --git a/ports/win32-qv/QSpy/qp.tlog/CL.read.1.tlog b/ports/win32-qv/QSpy/qp.tlog/CL.read.1.tlog new file mode 100644 index 00000000..4d3cb028 Binary files /dev/null and b/ports/win32-qv/QSpy/qp.tlog/CL.read.1.tlog differ diff --git a/ports/win32-qv/QSpy/qp.tlog/CL.write.1.tlog b/ports/win32-qv/QSpy/qp.tlog/CL.write.1.tlog new file mode 100644 index 00000000..aad68df5 Binary files /dev/null and b/ports/win32-qv/QSpy/qp.tlog/CL.write.1.tlog differ diff --git a/ports/win32-qv/QSpy/qp.tlog/Lib-link.read.1.tlog b/ports/win32-qv/QSpy/qp.tlog/Lib-link.read.1.tlog new file mode 100644 index 00000000..07a233a3 Binary files /dev/null and b/ports/win32-qv/QSpy/qp.tlog/Lib-link.read.1.tlog differ diff --git a/ports/win32-qv/QSpy/qp.tlog/Lib-link.write.1.tlog b/ports/win32-qv/QSpy/qp.tlog/Lib-link.write.1.tlog new file mode 100644 index 00000000..04491914 Binary files /dev/null and b/ports/win32-qv/QSpy/qp.tlog/Lib-link.write.1.tlog differ diff --git a/ports/win32-qv/QSpy/qp.tlog/cl.command.1.tlog b/ports/win32-qv/QSpy/qp.tlog/cl.command.1.tlog new file mode 100644 index 00000000..a706d4aa Binary files /dev/null and b/ports/win32-qv/QSpy/qp.tlog/cl.command.1.tlog differ diff --git a/ports/win32-qv/QSpy/qp.tlog/lib.command.1.tlog b/ports/win32-qv/QSpy/qp.tlog/lib.command.1.tlog new file mode 100644 index 00000000..622f6314 Binary files /dev/null and b/ports/win32-qv/QSpy/qp.tlog/lib.command.1.tlog differ diff --git a/ports/win32-qv/QSpy/qp.tlog/qp.lastbuildstate b/ports/win32-qv/QSpy/qp.tlog/qp.lastbuildstate new file mode 100644 index 00000000..4640ee87 --- /dev/null +++ b/ports/win32-qv/QSpy/qp.tlog/qp.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit +QSpy|Win32|C:\qp\qpcpp\ports\win32-qv\| diff --git a/ports/win32-qv/QSpy/vc120.pdb b/ports/win32-qv/QSpy/vc120.pdb index 5f13917e..51ebea11 100644 Binary files a/ports/win32-qv/QSpy/vc120.pdb and b/ports/win32-qv/QSpy/vc120.pdb differ diff --git a/ports/win32/QSpy/qp.tlog/CL.read.1.tlog b/ports/win32/QSpy/qp.tlog/CL.read.1.tlog new file mode 100644 index 00000000..d2e57546 Binary files /dev/null and b/ports/win32/QSpy/qp.tlog/CL.read.1.tlog differ diff --git a/ports/win32/QSpy/qp.tlog/CL.write.1.tlog b/ports/win32/QSpy/qp.tlog/CL.write.1.tlog new file mode 100644 index 00000000..24c99b43 Binary files /dev/null and b/ports/win32/QSpy/qp.tlog/CL.write.1.tlog differ diff --git a/ports/win32/QSpy/qp.tlog/Lib-link.read.1.tlog b/ports/win32/QSpy/qp.tlog/Lib-link.read.1.tlog new file mode 100644 index 00000000..79426b66 Binary files /dev/null and b/ports/win32/QSpy/qp.tlog/Lib-link.read.1.tlog differ diff --git a/ports/win32/QSpy/qp.tlog/Lib-link.write.1.tlog b/ports/win32/QSpy/qp.tlog/Lib-link.write.1.tlog new file mode 100644 index 00000000..b059bfa2 Binary files /dev/null and b/ports/win32/QSpy/qp.tlog/Lib-link.write.1.tlog differ diff --git a/ports/win32/QSpy/qp.tlog/cl.command.1.tlog b/ports/win32/QSpy/qp.tlog/cl.command.1.tlog new file mode 100644 index 00000000..48e71c10 Binary files /dev/null and b/ports/win32/QSpy/qp.tlog/cl.command.1.tlog differ diff --git a/ports/win32/QSpy/qp.tlog/lib.command.1.tlog b/ports/win32/QSpy/qp.tlog/lib.command.1.tlog new file mode 100644 index 00000000..22ff863e Binary files /dev/null and b/ports/win32/QSpy/qp.tlog/lib.command.1.tlog differ diff --git a/ports/win32/QSpy/qp.tlog/qp.lastbuildstate b/ports/win32/QSpy/qp.tlog/qp.lastbuildstate new file mode 100644 index 00000000..2239c35c --- /dev/null +++ b/ports/win32/QSpy/qp.tlog/qp.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit +QSpy|Win32|C:\qp\qpcpp\ports\win32\| diff --git a/ports/win32/QSpy/vc120.pdb b/ports/win32/QSpy/vc120.pdb index ec6b8538..8f8c8f4b 100644 Binary files a/ports/win32/QSpy/vc120.pdb and b/ports/win32/QSpy/vc120.pdb differ diff --git a/source/qk.cpp b/source/qk.cpp index 41a07cf3..65f9380c 100644 --- a/source/qk.cpp +++ b/source/qk.cpp @@ -4,8 +4,8 @@ /// @cond ///*************************************************************************** /// Product: QK/C++ -/// Last updated for version 5.6.3 -/// Last updated on 2016-04-12 +/// Last updated for version 5.6.4 +/// Last updated on 2016-04-25 /// /// Q u a n t u m L e a P s /// --------------------------- @@ -306,7 +306,7 @@ void QK_sched_(uint_fast8_t p) { // find new highest-prio AO ready to run... p = QK_readySet_.findMax(); - // is the new priority below the current preemption threshold? + // is the new priority below the initial preemption threshold? if (p <= pin) { p = static_cast(0); // active object not eligible }