Skip to content

Commit c8800f8

Browse files
author
camilo
committed
updated examples
1 parent 3c2ab96 commit c8800f8

18 files changed

+71
-12
lines changed

check/qlibs_cpp_test.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <include/mat.hpp>
55

66
using namespace std;
7+
using namespace qlibs;
78

89
void test_fis( void );
910
void test_fis2( void );

doc/qbitfield.dox

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
* #include <iostream>
4747
* #include <qlibs.h>
4848
*
49+
* using namespace qlibs;
50+
*
4951
* int main( int argc, char *argv[] )
5052
* {
5153
* bitfield vPort; // create the bitfield instance

doc/qfis.dox

+2
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@
348348
* #include "tipper_fis.h"
349349
* #include <qlibs.h>
350350
*
351+
* using namespace qlibs;
352+
*
351353
* // I/O Names
352354
* enum : fis::tag { service, food};
353355
* enum : fis::tag { tip};

doc/qltisys.dox

+8
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
* #include <thread>
4646
* #include <qlibs.h>
4747
*
48+
* using namespace qlibs;
49+
*
4850
* void xTaskSystemSimulate( void )
4951
* {
5052
* const real_t dt = 0.05f; // Time step
@@ -74,6 +76,8 @@
7476
* #include <thread>
7577
* #include <qlibs.h>
7678
*
79+
* using namespace qlibs;
80+
*
7781
* void xTaskSystemSimulate( void )
7882
* {
7983
* const real_t dt = 0.05f; // Time step
@@ -125,6 +129,8 @@
125129
* #include <thread>
126130
* #include <qlibs.h>
127131
*
132+
* using namespace qlibs;
133+
*
128134
* void xTaskSystemSimulate( void )
129135
* {
130136
* real_t num[] = { 0.1f 0.2f, 0.3f };
@@ -151,6 +157,8 @@
151157
* #include <thread>
152158
* #include <qlibs.h>
153159
*
160+
* using namespace qlibs;
161+
*
154162
* void xTaskSystemSimulate( void )
155163
* {
156164
* discreteTF<3,3> dtf= {

doc/qpid.dox

+5
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
* #include "bsp.h"
131131
* #include <qlibs.h>
132132
*
133+
* using namespace qlibs;
134+
*
133135
* const TickType_t dt = 50; //50mS time-step
134136
* void xTaskPIDspeedControl( void *arg );
135137
* real_t SetPoint = 300.0f; // desired motor speed 300rpm
@@ -215,6 +217,8 @@
215217
* #include "bsp.h"
216218
* #include <qlibs.h>
217219
*
220+
* using namespace qlibs;
221+
*
218222
* #define REF_MODEL_ORDER ( 1 )
219223
*
220224
* const TickType_t dt = 50; //50mS time-step
@@ -328,6 +332,7 @@
328332
* #include "bsp.h"
329333
* #include <qlibs.h>
330334
*
335+
* using namespace qlibs;
331336
*
332337
* const TickType_t dt = 50; //50mS time-step
333338
* void xTaskPIDspeedControl( void *arg );

doc/qrms.dox

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
* #include "hal_timer.h"
2626
* #include <qlibs.h>
2727
*
28-
*
28+
* using namespace qlibs;
29+
*
2930
* static rms rms_instance;
3031
* static volatile real_t rms_value = 0.0f;
3132
* static real_t window[ 8 ] = { 0.0f };
@@ -57,7 +58,7 @@
5758
*
5859
* #ifndef RMS_COMPUTE_H
5960
* #define RMS_COMPUTE_H
60-
*
61+
*
6162
* #ifdef __cplusplus
6263
* extern "C" {
6364
* #endif

doc/qssmoother.dox

+2
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@
399399
* #include "AppSignalProcessing.h"
400400
* #include <qlibs.h>
401401
*
402+
* using namespace qlibs;
403+
*
402404
* constexpr size_t SMOOTHER_WINDOW_SIZE = 10;
403405
* constexpr uint32_t SMOOTHER_SAMPLE_TIME = 100;
404406
* constexpr real_t GAUSS_SIGMA = 0.5f;

examples/continuous_system/continuous_system.ino

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <qlibs.h>
22

3+
using namespace qlibs;
4+
35
continuousTF<3> ctf= {
46
{ 0.0f, 2.0f, 3.0f, 6.0f },
57
{ 1.0f, 6.0f, 11.0f, 16.0f },

examples/discrete_system/discrete_system.ino

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <qlibs.h>
22

3+
using namespace qlibs;
4+
35
discreteTF<3,3> dtf= {
46
{ 0.1f, 0.2f, 0.3f },
57
{ 1.0f, -0.85f, 0.02f },

examples/gaussian_smoother/gaussian_smoother.ino

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <qlibs.h>
22

3+
using namespace qlibs;
4+
35
smootherGMWF filter;
46
constexpr real_t SMOOTHER_SAMPLE_TIME = 20; /*mS*/
57
int inputPin = A0; // select the input pin for the potentiometer that will drive the system

examples/mamdani_tipper/mamdani_tipper.ino

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <qlibs.h>
22

3+
using namespace qlibs;
4+
35
enum : fis::tag { service, food};
46
enum : fis::tag { tip};
57
// I/O Membership functions tags

examples/simple_pid_controller/simple_pid_controller.ino

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <qlibs.h>
22

3+
using namespace qlibs;
4+
35
continuousTF<1> processTransferFunction= {
46
{ 0.0f, 1.5f, },
57
{ 2.0f, 1.0f, },

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"maintainer": true
1717
}
1818
],
19-
"version": "1.3.1",
19+
"version": "1.3.2",
2020
"license": "MIT",
2121
"frameworks": "arduino",
2222
"platforms": "*"

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=qlibs
2-
version=1.3.1
2+
version=1.3.2
33
license=MIT
44
author=J. Camilo Gomez C. <[email protected]>
55
maintainer=J. Camilo Gomez C. <[email protected]>

src/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required( VERSION 3.2 )
22
project( qlibs-cpp
3-
VERSION 1.3.1
3+
VERSION 1.3.2
44
DESCRIPTION "A collection of useful C++ libraries for embedded systems"
55
LANGUAGES CXX )
66

src/ffmath.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ static float poly_laguerre_recursion( size_t n,
13031303
{
13041304
const float l0 = 1.0F;
13051305
float y;
1306-
1306+
/*cstat -MISRAC++2008-0-1-2_b*/
13071307
if ( 0U == n ) {
13081308
y = l0;
13091309
}
@@ -1328,7 +1328,7 @@ static float poly_laguerre_recursion( size_t n,
13281328
y = ln;
13291329
}
13301330
}
1331-
1331+
/*cstat +MISRAC++2008-0-1-2_b*/
13321332
return y;
13331333
}
13341334
/*============================================================================*/
@@ -1366,7 +1366,9 @@ static float poly_laguerre_hyperg( size_t n,
13661366
{
13671367
const float b = alpha + 1.0F;
13681368
const float mx = -x;
1369+
/*cstat -MISRAC++2008-0-1-2_b*/
13691370
const float tc_sgn = ( x < 0.0F ) ? 1.0F : ( ( 1 == ( n % 2 ) ) ? -1.0F : 1.0F );
1371+
/*cstat +MISRAC++2008-0-1-2_b*/
13701372
const float ax = absolute( x );
13711373
float tc = 1.0F;
13721374

@@ -2017,7 +2019,7 @@ static float expint_Ei_asymp( float x )
20172019
static float expint_E1( float x )
20182020
{
20192021
float y;
2020-
2022+
/*cstat -MISRAC++2008-0-1-2_b*/
20212023
if ( x < 0.0F ) {
20222024
y = -expint_Ei( -x );
20232025
}
@@ -2030,7 +2032,7 @@ static float expint_E1( float x )
20302032
else {
20312033
y = expint_E1_asymp( x );
20322034
}
2033-
2035+
/*cstat +MISRAC++2008-0-1-2_b*/
20342036
return y;
20352037
}
20362038
/*============================================================================*/

src/fp16.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ fp16Raw_t fp16::sqrt( fp16Raw_t x ) noexcept
306306
x <<= 16;
307307
retValue <<= 16;
308308
}
309+
/*cstat -ATH-shift-bounds -MISRAC++2008-5-8-1 -CERT-INT34-C_b*/
309310
bit = 1U << 14U;
311+
/*cstat +ATH-shift-bounds +MISRAC++2008-5-8-1 +CERT-INT34-C_b*/
310312
}
311313
}
312314
}

src/qlibs.h

+27-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ This file is part of the QuarkTS++ OS distribution.
4141
#ifndef QLIBS_CPP_H
4242
#define QLIBS_CPP_H
4343

44-
#define QLIBS_CPP_VERSION "1.3.1"
45-
#define QLIBS_CPP_VERNUM ( 131 )
44+
#define QLIBS_CPP_VERSION "1.3.2"
45+
#define QLIBS_CPP_VERNUM ( 132 )
4646
#define QLIBS_CPP_CAPTION "qLibs++" QLIBS_CPP_VERSION
4747

4848
#include <include/qlibs_types.hpp>
@@ -60,6 +60,30 @@ This file is part of the QuarkTS++ OS distribution.
6060
#include <include/interp1.hpp>
6161
#include <include/algorithm.hpp>
6262

63-
using namespace qlibs;
63+
namespace qlibs {
64+
namespace build {
65+
constexpr const uint32_t number = 2351;
66+
constexpr const char* date = __DATE__;
67+
constexpr const char* time = __TIME__;
68+
constexpr const char* std = "c++11";
69+
}
70+
namespace version {
71+
constexpr const char* str = QLIBS_CPP_VERSION;
72+
constexpr const uint8_t number = QLIBS_CPP_VERNUM;
73+
constexpr const uint8_t mayor = 1U;
74+
constexpr const uint8_t minor = 3U;
75+
constexpr const uint8_t rev = 2U;
76+
}
77+
namespace product {
78+
constexpr const char* author = "J. Camilo Gomez C.";
79+
constexpr const char* copyright = "Copyright (C) 2012 J. Camilo Gomez C. All Rights Reserved.";
80+
constexpr const char* name = "qLibs++";
81+
constexpr const char* category = "Library";
82+
constexpr const char* caption = QLIBS_CPP_CAPTION;
83+
constexpr const char* compliance = "MISRAC++2008,SEI-CERT";
84+
constexpr const char* license = "MIT";
85+
constexpr const char* source_model = "Open Source";
86+
}
87+
};
6488

6589
#endif /*QOS_CPP_H*/

0 commit comments

Comments
 (0)