Skip to content

Commit c51d20b

Browse files
committed
6.9.2rc2
1 parent 5f7d98a commit c51d20b

File tree

10 files changed

+93
-150
lines changed

10 files changed

+93
-150
lines changed

include/qep.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
// and Z is a 1-digit release number.
5151
#define QP_VERSION_STR "6.9.2"
5252

53-
//! Encrypted current QP release (6.9.2) and date (2020-12-22)
54-
#define QP_RELEASE 0x880FF2EBU
53+
//! Encrypted current QP release (6.9.2) and date (2021-01-18)
54+
#define QP_RELEASE 0x82C286EBU
5555

5656

5757
//****************************************************************************

include/qs.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// @cond
55
///***************************************************************************
66
/// Last updated for version 6.9.2
7-
/// Last updated on 2021-01-12
7+
/// Last updated on 2021-01-14
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
@@ -587,12 +587,9 @@ enum QSpyRxRecords : std::uint8_t {
587587

588588
//! put one byte into the QS RX lock-free buffer
589589
inline bool QS::rxPut(std::uint8_t const b) noexcept {
590-
QSCtr head = rxPriv_.head;
591-
if (head != 0U) {
592-
--head;
593-
}
594-
else {
595-
head = rxPriv_.end;
590+
QSCtr head = rxPriv_.head + 1U;
591+
if (head == rxPriv_.end) {
592+
head = 0U;
596593
}
597594
if (head != rxPriv_.tail) { // buffer NOT full?
598595
rxPriv_.buf[rxPriv_.head] = b;

ports/posix-qutest/qutest_port.cpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
/// @ingroup ports
44
/// @cond
55
///***************************************************************************
6-
/// Last updated for version 6.8.0
7-
/// Last updated on 2020-03-31
6+
/// Last updated for version 6.9.2
7+
/// Last updated on 2021-01-14
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
1111
/// Modern Embedded Software
1212
///
13-
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
13+
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
1414
///
1515
/// This program is open source software: you can redistribute it and/or
1616
/// modify it under the terms of the GNU General Public License as published
@@ -261,29 +261,21 @@ void QS::onTestLoop() {
261261
struct timeval timeout = {
262262
(long)0, (long)(QS_TIMEOUT_MS * 1000)
263263
};
264-
int nrec = select(l_sock + 1, &readSet,
264+
int status = select(l_sock + 1, &readSet,
265265
(fd_set *)0, (fd_set *)0, &timeout);
266-
if (nrec < 0) {
266+
if (status < 0) {
267267
FPRINTF_S(stderr, "<TARGET> ERROR socket select,errno=%d\n",
268268
errno);
269269
onCleanup();
270270
exit(-2);
271271
}
272-
else if ((nrec > 0) && FD_ISSET(l_sock, &readSet)) { // socket ready?
273-
uint8_t buf[QS_RX_SIZE];
274-
int status = recv(l_sock, (char *)buf, (int)sizeof(buf), 0);
275-
while (status > 0) { // any data received?
276-
uint8_t *pb;
277-
int i = (int)rxGetNfree();
278-
if (i > status) {
279-
i = status;
280-
}
281-
status -= i;
282-
// reorder the received bytes into QS-RX buffer
283-
for (pb = &buf[0]; i > 0; --i, ++pb) {
284-
rxPut(*pb);
285-
}
286-
rxParse(); // parse all n-bytes of data
272+
else if ((status > 0) && FD_ISSET(l_sock, &readSet)) { //socket ready?
273+
status = recv(l_sock,
274+
(char *)QS::rxPriv_.buf, (int)QS::rxPriv_.end, 0);
275+
if (status > 0) { // any data received?
276+
QS::rxPriv_.tail = 0U;
277+
QS::rxPriv_.head = status; // # bytes received
278+
QS::rxParse(); // parse all received bytes
287279
}
288280
}
289281

ports/posix-qv/qs_port.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
/// @brief QS/C++ port to POSIX API
33
/// @cond
44
///***************************************************************************
5-
/// Last updated for version 6.8.0
6-
/// Last updated on 2020-03-31
5+
/// Last updated for version 6.9.2
6+
/// Last updated on 2021-01-14
77
///
88
/// Q u a n t u m L e a P s
99
/// ------------------------
1010
/// Modern Embedded Software
1111
///
12-
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
12+
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
1313
///
1414
/// This program is open source software: you can redistribute it and/or
1515
/// modify it under the terms of the GNU General Public License as published
@@ -303,20 +303,12 @@ void QS_output(void) {
303303
}
304304
//............................................................................
305305
void QS_rx_input(void) {
306-
uint8_t buf[QS_RX_SIZE];
307-
int status = recv(l_sock, (char *)buf, (int)sizeof(buf), 0);
308-
if (status != SOCKET_ERROR) { // any data received?
309-
uint8_t *pb;
310-
int i = (int)QS::rxGetNfree();
311-
if (i > status) {
312-
i = status;
313-
}
314-
status -= i;
315-
// reorder the received bytes into QS-RX buffer
316-
for (pb = &buf[0]; i > 0; --i, ++pb) {
317-
QS::rxPut(*pb);
318-
}
319-
QS::rxParse(); // parse all n-bytes of data
306+
int status = recv(l_sock,
307+
(char *)QS::rxPriv_.buf, (int)QS::rxPriv_.end, 0);
308+
if (status > 0) { // any data received?
309+
QS::rxPriv_.tail = 0U;
310+
QS::rxPriv_.head = status; // # bytes received
311+
QS::rxParse(); // parse all received bytes
320312
}
321313
}
322314

ports/posix/qs_port.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
/// @brief QS/C++ port to POSIX API
33
/// @cond
44
///***************************************************************************
5-
/// Last updated for version 6.8.0
6-
/// Last updated on 2020-03-31
5+
/// Last updated for version 6.9.2
6+
/// Last updated on 2021-01-14
77
///
88
/// Q u a n t u m L e a P s
99
/// ------------------------
1010
/// Modern Embedded Software
1111
///
12-
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
12+
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
1313
///
1414
/// This program is open source software: you can redistribute it and/or
1515
/// modify it under the terms of the GNU General Public License as published
@@ -303,20 +303,12 @@ void QS_output(void) {
303303
}
304304
//............................................................................
305305
void QS_rx_input(void) {
306-
uint8_t buf[QS_RX_SIZE];
307-
int status = recv(l_sock, (char *)buf, (int)sizeof(buf), 0);
308-
if (status != SOCKET_ERROR) { // any data received?
309-
uint8_t *pb;
310-
int i = (int)QS::rxGetNfree();
311-
if (i > status) {
312-
i = status;
313-
}
314-
status -= i;
315-
// reorder the received bytes into QS-RX buffer
316-
for (pb = &buf[0]; i > 0; --i, ++pb) {
317-
QS::rxPut(*pb);
318-
}
319-
QS::rxParse(); // parse all n-bytes of data
306+
int status = recv(l_sock,
307+
(char *)QS::rxPriv_.buf, (int)QS::rxPriv_.end, 0);
308+
if (status > 0) { // any data received?
309+
QS::rxPriv_.tail = 0U;
310+
QS::rxPriv_.head = status; // # bytes received
311+
QS::rxParse(); // parse all received bytes
320312
}
321313
}
322314

ports/win32-qutest/qutest_port.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
/// @ingroup ports
44
/// @cond
55
///***************************************************************************
6-
/// Last updated for version 6.9.1
7-
/// Last updated on 2020-09-12
6+
/// Last updated for version 6.9.2
7+
/// Last updated on 2021-01-14
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
1111
/// Modern Embedded Software
1212
///
13-
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
13+
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
1414
///
1515
/// This program is open source software: you can redistribute it and/or
1616
/// modify it under the terms of the GNU General Public License as published
@@ -263,20 +263,12 @@ void QS::onTestLoop() {
263263
exit(-2);
264264
}
265265
else if (FD_ISSET(l_sock, &readSet)) { // socket ready?
266-
uint8_t buf[QS_RX_SIZE];
267-
status = recv(l_sock, (char *)buf, (int)sizeof(buf), 0);
268-
while (status > 0) { // any data received?
269-
uint8_t *pb;
270-
int i = (int)rxGetNfree();
271-
if (i > status) {
272-
i = status;
273-
}
274-
status -= i;
275-
// reorder the received bytes into QS-RX buffer
276-
for (pb = &buf[0]; i > 0; --i, ++pb) {
277-
rxPut(*pb);
278-
}
279-
rxParse(); // parse all n-bytes of data
266+
status = recv(l_sock,
267+
(char *)QS::rxPriv_.buf, (int)QS::rxPriv_.end, 0);
268+
if (status > 0) { // any data received?
269+
QS::rxPriv_.tail = 0U;
270+
QS::rxPriv_.head = status; // # bytes received
271+
QS::rxParse(); // parse all received bytes
280272
}
281273
}
282274

ports/win32-qv/qs_port.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
/// @ingroup ports
44
/// @cond
55
///***************************************************************************
6-
/// Last updated for version 6.8.0
7-
/// Last updated on 2020-03-31
6+
/// Last updated for version 6.9.2
7+
/// Last updated on 2021-01-14
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
1111
/// Modern Embedded Software
1212
///
13-
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
13+
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
1414
///
1515
/// This program is open source software: you can redistribute it and/or
1616
/// modify it under the terms of the GNU General Public License as published
@@ -303,20 +303,12 @@ void QS_output(void) {
303303
}
304304
//............................................................................
305305
void QS_rx_input(void) {
306-
uint8_t buf[QS_RX_SIZE];
307-
int status = recv(l_sock, (char *)buf, (int)sizeof(buf), 0);
308-
if (status != SOCKET_ERROR) { // any data received?
309-
uint8_t *pb;
310-
int i = (int)QS::rxGetNfree();
311-
if (i > status) {
312-
i = status;
313-
}
314-
status -= i;
315-
// reorder the received bytes into QS-RX buffer
316-
for (pb = &buf[0]; i > 0; --i, ++pb) {
317-
QS::rxPut(*pb);
318-
}
319-
QS::rxParse(); // parse all n-bytes of data
306+
int status = recv(l_sock,
307+
(char *)QS::rxPriv_.buf, (int)QS::rxPriv_.end, 0);
308+
if (status > 0) { // any data received?
309+
QS::rxPriv_.tail = 0U;
310+
QS::rxPriv_.head = status; // # bytes received
311+
QS::rxParse(); // parse all received bytes
320312
}
321313
}
322314

ports/win32/qs_port.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
/// @ingroup ports
44
/// @cond
55
///***************************************************************************
6-
/// Last updated for version 6.8.0
7-
/// Last updated on 2020-03-31
6+
/// Last updated for version 6.9.2
7+
/// Last updated on 2021-01-14
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
1111
/// Modern Embedded Software
1212
///
13-
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
13+
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
1414
///
1515
/// This program is open source software: you can redistribute it and/or
1616
/// modify it under the terms of the GNU General Public License as published
@@ -303,20 +303,12 @@ void QS_output(void) {
303303
}
304304
//............................................................................
305305
void QS_rx_input(void) {
306-
uint8_t buf[QS_RX_SIZE];
307-
int status = recv(l_sock, (char *)buf, (int)sizeof(buf), 0);
308-
if (status != SOCKET_ERROR) { // any data received?
309-
uint8_t *pb;
310-
int i = (int)QS::rxGetNfree();
311-
if (i > status) {
312-
i = status;
313-
}
314-
status -= i;
315-
// reorder the received bytes into QS-RX buffer
316-
for (pb = &buf[0]; i > 0; --i, ++pb) {
317-
QS::rxPut(*pb);
318-
}
319-
QS::rxParse(); // parse all n-bytes of data
306+
int status = recv(l_sock,
307+
(char *)QS::rxPriv_.buf, (int)QS::rxPriv_.end, 0);
308+
if (status > 0) { // any data received?
309+
QS::rxPriv_.tail = 0U;
310+
QS::rxPriv_.head = status; // # bytes received
311+
QS::rxParse(); // parse all received bytes
320312
}
321313
}
322314

0 commit comments

Comments
 (0)