QP/C++  7.3.3
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qs_64bit.cpp
Go to the documentation of this file.
1//$file${src::qs::qs_64bit.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpcpp.qm
4// File: ${src::qs::qs_64bit.cpp}
5//
6// This code has been generated by QM 6.1.1 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// This code is covered by the following QP license:
10// License # : LicenseRef-QL-dual
11// Issued to : Any user of the QP/C++ real-time embedded framework
12// Framework(s) : qpcpp
13// Support ends : 2024-12-31
14// License scope:
15//
16// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17//
18// Q u a n t u m L e a P s
19// ------------------------
20// Modern Embedded Software
21//
22// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
23//
24// This software is dual-licensed under the terms of the open source GNU
25// General Public License version 3 (or any later version), or alternatively,
26// under the terms of one of the closed source Quantum Leaps commercial
27// licenses.
28//
29// The terms of the open source GNU General Public License version 3
30// can be found at: <www.gnu.org/licenses/gpl-3.0>
31//
32// The terms of the closed source Quantum Leaps commercial licenses
33// can be found at: <www.state-machine.com/licensing>
34//
35// Redistributions in source code must retain this top-level comment block.
36// Plagiarizing this software to sidestep the license obligations is illegal.
37//
38// Contact information:
39// <www.state-machine.com/licensing>
40// <info@state-machine.com>
41//
42//$endhead${src::qs::qs_64bit.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43#define QP_IMPL // this is QF/QK implementation
44#include "qs_port.hpp" // QS port
45#include "qs_pkg.hpp" // QS package-scope internal interface
46
47//============================================================================
48//! @cond INTERNAL
49
50namespace QP {
51namespace QS {
52
53//${QS::QS-tx-64bit::u64_raw_} ...............................................
54void u64_raw_(std::uint64_t d) noexcept {
55 std::uint8_t chksum = priv_.chksum;
56 std::uint8_t * const buf = priv_.buf;
57 QSCtr head = priv_.head;
58 QSCtr const end = priv_.end;
59
60 priv_.used = (priv_.used + 8U); // 8 bytes are about to be added
61 for (std::int_fast8_t i = 8U; i != 0U; --i) {
62 std::uint8_t const b = static_cast<std::uint8_t>(d);
63 QS_INSERT_ESC_BYTE_(b)
64 d >>= 8U;
65 }
66
67 priv_.head = head; // save the head
68 priv_.chksum = chksum; // save the checksum
69}
70
71//${QS::QS-tx-64bit::u64_fmt_} ...............................................
72void u64_fmt_(
73 std::uint8_t format,
74 std::uint64_t d) noexcept
75{
76 std::uint8_t chksum = priv_.chksum;
77 std::uint8_t * const buf = priv_.buf;
78 QSCtr head = priv_.head;
79 QSCtr const end = priv_.end;
80
81 priv_.used = (priv_.used + 9U); // 9 bytes are about to be added
82 QS_INSERT_ESC_BYTE_(format) // insert the format byte
83
84 for (std::int_fast8_t i = 8U; i != 0U; --i) {
85 format = static_cast<std::uint8_t>(d);
86 QS_INSERT_ESC_BYTE_(format)
87 d >>= 8U;
88 }
89
90 priv_.head = head; // save the head
91 priv_.chksum = chksum; // save the checksum
92}
93
94} // namespace QS
95} // namespace QP
96
97//! @endcond
QF::Attr priv_
Definition qf_act.cpp:78
QP/C++ framework.
Definition qequeue.hpp:50
QS/C++ package-scope interface.
QS/C++ port to a 32-bit CPU, generic C++ compiler.