GithubHelp home page GithubHelp logo

kmilo17pet / quarkts Goto Github PK

View Code? Open in Web Editor NEW
195.0 19.0 31.0 46.48 MB

An open-source OS for embedded applications that supports prioritized cooperative scheduling, time control, inter-task communications primitives, hierarchical state machines and CoRoutines.

License: MIT License

Makefile 0.71% C 98.09% Batchfile 0.61% PowerShell 0.59%
multitasking cooperative os microcontrollers state-machine embedded-systems coroutines rtos arm avr

quarkts's Introduction

Hi, I’m Camilo 👋

Typing SVG

  • 👀 I’m also interested in RTOSes, automation, advanced control loops, robotics and soft-computing
  • 🌱 I’m currently learning Rust
  • 💞️ I’am looking to collaborate on projects based on C/C++, Rust as well as hardware design projects with Altium Designer.
  • 📫 How to reach me.. Email me at [email protected]

Skills

My Skills

Top Langs

quarkts's People

Contributors

b4yuan avatar codacy-badger avatar gitter-badger avatar kmilo17pet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quarkts's Issues

Interfacing with C++

Hey QuarkTS Team,

Issue:
QuarkTS ist currently not compatible to C++ as keywords - private - are used in the QuarkTS code.

Plattform/Compilers:
C++11 compilers: MSVC, CLANG and Compilers for ARM as well as Aurix Tricore.
OS: Windows and MacOS
Microcontrollers: Aurix TRICORE

Suggested Solution:
If C++ Support - e.g. to implement a small Operating System-Abstraction Layer to a C++ application - is planned for the future, refactor code to not use keywords, e.g. private_qts

I found your really interesting OS and I am currently testing QuarkTS to be used in an ongoing project. As I do have a C++11 compiler available for my Microcontroller, I am working on a small Operating-Abstraction-Layer to offer a C++ Interface for QuarkTS C Code.

Today I spend some time rewriting parts of the code as for "private variables inside structures", the C++ keyword private is actually used - causing at least my compiler to fail.

Also, there seems to be an issue with the definition of "unsigned int" somewhere in the code (did not found that issue till now).

If it is planned in the future to be compatible to C++, which I think is a really good idea as QuarkTS and its simplicity to port it (non-preemptive of course) is outstanding, I would suggest to refactor the code to not use C++ keywords like private - maybe renaming it to private_qts or something similar.

If you like, I could also do a Pull-Request to share my changes to QuarkTS to be C++ compatible.

Kind regards

ScXML - automatic code generation

Consider creating tool that consumes ScXML file as input and generates *.c and *.h files with application structure using QuarkTS as base. ScXML files would be generated by external (already existing) tools.
Creating HSMs in visual tools is easier and faster then writing them by hand. These kind of tools also provide possibility to test designs before compiling and programming destination devices.

Very good (and free) tool is ScxmlEditor created by Alex Zhornyak - https://github.com/alexzhornyak/SCXML-tutorial

#define Q_SETUP_TIME_CANONICAL ( 1 ) // Error

Hi!
If I write Q_SETUP_TIME_CANONICAL (1) in config.h, then I get an error:

Severity Code Description Project File Line
Error undefined reference to `qClock_InternalTick' Blink_QuarkTS Blink_QuarkTS\os\qclock.c 47

Thanks!

#define Q_QUEUES ( 0 ) // Does not compile

Hi!
If I write Q_QUEUES (0) in config.h, then I get an error:

Severity Code Description Project File Line
Error 'qQUEUE_COUNT' undeclared (first use in this function) Blink_QuarkTS os\qkernel.c 490

MPLAB X IDE v6.05, XC8 2.40 Compiler, PIC16F1xxx

IDE: MPLAB X 6.05
COMPILER: XC8 2.40
MCU: PIC16F1779

Create empty project
#include "mcc_generated_files/mcc.h"
#include "quarkts/QuarkTS.h"

void main(void)
{
while (1)
{
}
}

Include (SET and etc) all path and directory of QuarkTS

include "quarkts/QuarkTS.h"

try to compile

MAIN ISSUE

quarkts/qatcli.c:554:21: error: initializer element is not a compile-time constant
                    const qINT32_t errorCode = qATCLI_ERRORCODE( (qINT32_t)retval );
                    ^
1 error generated.
(908) exit status = 1
"/Applications/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=16F1779 -c   -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8"  -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto     -o build/default/production/quarkts/qedgecheck.p1 quarkts/qedgecheck.c 
make[2]: *** [nbproject/Makefile-default.mk:288: build/default/production/quarkts/qatcli.p1] Error 1
make[2]: *** Waiting for unfinished jobs....
quarkts/qcritical.c:24:9: error: initializer element is not a compile-time constant
        const qInt_Disabler_t xDisabler = critical.disable;
        ^
quarkts/qcritical.c:33:9: error: initializer element is not a compile-time constant
        const qInt_Restorer_t xRestorer = critical.restore;

FULL LOG

CLEAN SUCCESSFUL (total time: 56ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory '/Users/RadaR_1/MPLABXProjects/demo.X'
make -f nbproject/Makefile-default.mk dist/default/production/demo.X.production.hex
make[2]: Entering directory '/Users/RadaR_1/MPLABXProjects/demo.X'
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/quarkts/qclock.p1 quarkts/qclock.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/main.p1 main.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/quarkts/qatcli.p1 quarkts/qatcli.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/quarkts/qbsbuffers.p1 quarkts/qbsbuffers.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/mcc_generated_files/mcc.p1 mcc_generated_files/mcc.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/quarkts/qcoroutine.p1 quarkts/qcoroutine.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/mcc_generated_files/pin_manager.p1 mcc_generated_files/pin_manager.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/mcc_generated_files/device_config.p1 mcc_generated_files/device_config.c
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/quarkts/qcritical.p1 quarkts/qcritical.c
quarkts/qatcli.c:554:21: error: initializer element is not a compile-time constant
const qINT32_t errorCode = qATCLI_ERRORCODE( (qINT32_t)retval );
^
1 error generated.
(908) exit status = 1
"/Applications/microchip/xc8/v2.40/bin/xc8-cc" -mcpu=16F1779 -c -mdfp="/Applications/microchip/mplabx/v6.05/packs/Microchip/PIC12-16F1xxx_DFP/1.3.90/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/quarkts/qedgecheck.p1 quarkts/qedgecheck.c
make[2]: *** [nbproject/Makefile-default.mk:288: build/default/production/quarkts/qatcli.p1] Error 1
make[2]: *** Waiting for unfinished jobs....
quarkts/qcritical.c:24:9: error: initializer element is not a compile-time constant
const qInt_Disabler_t xDisabler = critical.disable;
^
quarkts/qcritical.c:33:9: error: initializer element is not a compile-time constant
const qInt_Restorer_t xRestorer = critical.restore;
^
2 errors generated.
(908) exit status = 1
default: Empty
make[2]: *** [nbproject/Makefile-default.mk:320: build/default/production/quarkts/qcritical.p1] Error 1
default: Empty
make[2]: *** [nbproject/Makefile-default.mk:328: build/default/production/quarkts/qedgecheck.p1] Error 1
default: Empty
quarkts/qedgecheck.c:66:9: error: initializer element is not a compile-time constant
const qCoreRegSize_t pinReader = ec->qPrivate.reader;
^
quarkts/qedgecheck.c:91:5: error: initializer element is not a compile-time constant
const qCoreRegSize_t pinReader = ec->qPrivate.reader;
^
2 errors generated.
(908) exit status = 1
make[2]: Leaving directory '/Users/RadaR_1/MPLABXProjects/demo.X'
make[1]: Leaving directory '/Users/RadaR_1/MPLABXProjects/demo.X'
make[1]: *** [nbproject/Makefile-default.mk:85: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2

BUILD FAILED (exit value 2, total time: 2s)

Specific Embedded Compilers complain about missing newline at end of file

Hey,

Just a very minor enhancement: There are a lot of embedded/safety etc. compilers complaining about missing newlines at the end of a file when you are compiling with all warnings enabled (e.g. Tasking AURIX).

I would suggest to ensure that newlines are added (missing for a lot of header-files) - this would allow me to keep up with all commits without modifying any files.

Kind regards

ask for a help

dear friend:
Can you tell me this rtos will consume how much resources, when it runs on the stm8, or pic, or avr? I am looking for a minirtos, which can work well on this environment! osa is a good choice, but nonone mend it!

Timing tasks in the range of Microseconds, using QuarkTs with Omnetpp

Hi,
Recently I came across a scenario where I may need to time tasks below 1 Millisecond - mainly within a simulation framework like Omnetpp. I somehow like the idea of using QuarkTS with Omnet as it would allow me to reuse a lot of code I will write for the simulation than in the actual firmware.

The plan is to use Omnetpp Self-Messages to simulate the ticks for QuarkTs. As I won't use a custom IDLE function, I thought about executing the QuarkTs Run Function after every Tick call and/or events. This should then execute all timed and event-driven tasks when I remember the kernel code correctly.

Coming to my questions:

  • What is your opinion on using a non-preemptive OS for timing below a millisecond?
  • Do you think the simulation would work with the proposed solution?
  • Without deep-diving into the code: is scheduling below a millisecond even possible with the current implementation? I normally use Q_SETUP_TIME_CANONICAL

Thanks for your effort!

Consider adding examples for different platforms.

Consider adding examples which one could easily compile and run with one or two command lines.

Currently only source of example is manual. User has to copy-paste snippets of code and prepare ones own project.
Basic project structure would be an encouraging example to start working with QuarkTS.
Further on more sophisticated examples (and different platforms) would be added.

Draft: MichalRostekRostkowski#3

Bug in qIOUtil_XtoU32 function

File: src/quarkts/qioutils.c
Function: qIOUtil_XtoU32()
Currently: when procedure is parsing A-F characters in the string value 75u is subtracted from xByte value.
eg.
string: "A"
result: "A" = 65u (dec), 65u - 75u = -10u

Should be: subtract value 55u instead of 75u
eg.
string: "A"
result: "A" = 65 (dec), 65 - 55 = 10

Move qconfig.h away from standard-sources

Hey,

Again just a minor suggestion:
The qconfig.h file might me specific for each user - as in my case, I have deactivated a lot of features. So every time I want to stay up to date with the latest commits, I have to remove/change the qconfig.h file.

I think I would be a good idea to move it from src/os/include to maybe just src/ and let the build system ensure that the qconfig.h file is present on the include paths.

So the users can directly pull the src/os/ foulder having their specific qconfig.h on another path where all their global configs may life.

Hopefully my suggestions is clear.

Kind regards

_qTrace_Kernel

I just updated and got compile error (for STM32 using cubeIDE)

"undefined reference to _qTrace_Kernel"

I added this

#define Q_TRACE_KERNEL_AND_MODULES ( 0 ) /**< Experimental*/

to qconfig.h

Got round it by commenting out all the _qTrace_Kernel lines mainly in qkernel.c

Have I missed something?

Thanks for your work, it is great for me and easy to add to projects, I've used it on AVR and PiPico.

feature : workflow static analisys

Currently static analisys are performed by external tools. To have more control over the this, a workflow on github actions should be required by using the cppcheck tool to enhance the devops practice. All checks including MISRA-C and CERT guidelines should be performed.
attached misra rules text file. Please update the path on json file.

cppcheck_misra_rules.tar.gz

cppcheck --addon=/path/to/misra.json --addon=cert.py --enable=all --inconclusive --std=c99 . --output-file=sa_results.txt --suppress=missingIncludeSystem

qATCLI minor optimization

if ( strstr( cmd, Command->Text ) == cmd ) { /*check if the input match the subscribed command starting from the beginning*/ /*TODO : potentially unsafe, find a better way*/

Replace
if ( strstr( cmd, Command->Text ) == cmd )

with

if ( 0 == strncmp( cmd, Command->Text, Command->qPrivate.CmdLen ) )

This will improve speed and it will also be safe.

need to be tested on real scenarios

Redundant Semicolon

Hi,

Compiler: MSVC

I think I found a quick-fix bug... At least MSVC (with standard checks) fails to compile.

The semicolon in line 85 and 86 when calling the Macro _qSM_HANDLER_FIELDS to define const/non-const is redundant

typedef struct _qSM_uPublicData_s{ _qSM_HANDLER_FIELDS(/*none*/); }_qSM_UnprotectedPublicData_t;

as the Macro itself defines the semicolon at the end of struct-definition:

QuarkTS/include/qfsm.h

Lines 68 to 75 in b15628d

#define _qSM_HANDLER_FIELDS( pAttrib ) struct{\
void *StartState;\
void *NextState;\
pAttrib void *machine;\
pAttrib void *Data;\
pAttrib qSM_Signal_t Signal;\
pAttrib qSM_Status_t Status;\
};\

So I suggest to either remove the semicolon after calling the macro or in the macro itself.
I think I won't open a PR for this one as its just one symbol to remove...

Timing may not be correct when using floating-point timing-base

Issue:
When initialising the OS in the standard-mode using floating points (eg. 0.001s as base-time, 1s as periodic-task time) the task becomes alive every 0.999s instead of exactly one second.

Problem:
I tracked down the issue to be in the function qClock_t qClock_Convert2Clock(const qTime_t t) - where following conversion from floating point qTime_t to qClock_t is done in the return statement:

qTime_t epochs;
epochs = (t / TimmingBase) + QFLT_TIME_FIX_VALUE;
return (qClock_t)epochs;

so, epochs might become something like 999.99999998 when diving for example 1over 0.001 in the given example. The correct rounding to unsigned int for qClock_t type should be 1000 mS - but instead the conversion ends up with 999 mS - causing the task-offset from 1 mS.

Solution:
To correctly get back 1000 mS, one could add a round in the conversion - with adding a hint in the manual what is going to happen on fractional numbers of a periodic task and the Timing-Base:

qTime_t epochs;
epochs = (t / TimmingBase) + QFLT_TIME_FIX_VALUE;
return (qClock_t)round(epochs);

What do you think?
Kind regards.

timing

Hello J. Camilo Gómez C.

Firstly thank you very much for this work, I am playing around with it now and find it very useful.

I was creating a pulse generator on the current version on a STM32F103 (blue pill) using a timer task set at every 10ms. The system tick is 1ms and is accurate.

If I use my 10ms task to increment a counter and set an o/p if odd or clear if even the pulse length is 9ms not 10ms!

Can give you more details if you want, but here is a little:
In main.c

qSchedulerAdd_Task(&tmsTask, tms_cb, qLowest_Priority, 0.01, qPeriodic, qEnabled, "tms");

In qotasks.c

void tms_cb(qEvent_t event)
{
   static int cntr = 0;
.
.
. 
    cntr++;
    if(cntr & 1)
        GPIOA->BSRR = X_EN;
    else
        GPIOA->BSRR = X_EN << 16;
}

It toggles at 9ms

Thanks

Billy

cmake list file for kernel

a cmake file should be added to the kernel branch in order to support kernel inclusion as module to a bigger cmake-based project.

Crash while using Priority-Queue

Hey QuarkTS-Team,

COMPILER: MSVC, CLANG, Aurix-Tasking/Infineon Free-Toolchain
ISSUE: Crash in Kernel when using Priority-Queue (qTaskQueueNotification)

Solution:
https://github.com/TECREA/QuarkTS/blob/ca9a3116e75ead6c0e0fb691aadcc765fef49f3c/src/os/qkernel.c#L208

Tail is equal NULL, isn't it? Hence the statement should be:
if( NULL == kernel.QueueStack[i].Task )

I am still not through the complete Quark-TS Magic, but changing the Line to equals-NULL check fixes the issue for me.

Thanks in advance!

Arduino compile error

In file included from qtasks.h:18:0,
from qkernel.h:7,
from QuarkTS.h:43,
qatcli.h:99:16: warning: '_qATCLI_ControlBlock_s::_qATCLI_Private_s' has a field '_qATCLI_ControlBlock_s::_qATCLI_Private_s::Input' whose type has no linkage [-Wsubobject-linkage]
struct _qATCLI_Private_s{
^~~~~~~~~~~~~~~~~

Can you help?

something uncertain

Dear friend:
Thank you for the last help, what about the RAM, today i will have a test on my stc15f2k60s2 mcu -_-!

Best wishes to you and your family!

Bug in atcli

Bug in ATCLI when sending any command with CR that is not in the list of subscribed commands. this error occurs before a valid command is sent for the first time, after sending the valid command it does not occur.

example:

Error:

  1. Running firmware for the first time

  2. send "at\r"

  3. segmentation fault

  4. Running firmware for the first time

  5. send "anything\r"

  6. segmentation fault

No error:

  1. Running firmware for the first time
  2. send "at+help\r" , this a command is part of the subscribed command list
  3. OK

minor kernel refactor for kernel-objects as tasks

normalize attached kernel-objects handling by using a single pointer and task-activities as a single callback.
for reference, the fsm as task should be handled similar as the CLI as task. Using this, the dummy task for FSM as task can be removed

qTask_Notification_Send and EventData - do not work once?

Hi!

Example code:
producer:

typedef enum {NO_FLAG = 0, FLAG_ENLARGE, FLAG_REDUCE, FLAG_POWER_ON, FLAG_POWER_OFF} Flags_enum;


qSM_Status_t State_Button_Release (qSM_Handler_t m)
{
	static qSTimer_t timeout;

     Flags_enum     flag[1];

	switch (m->Signal)
	{
		case QSM_SIGNAL_ENTRY:
			qSTimer_Set(&timeout, TIME_BUTTON_RELEASE);
			break;

          default:
               break;

		case QSM_SIGNAL_NONE:
			if (qSTimer_Expired(&timeout))
			{
			     m->NextState = State_Button_Wait;
               
                    switch (Button.Count)
                    {
                         case 1:
                              flag[0] = FLAG_ENLARGE;
                                                      
                              break;

                         default:
                         case 2:
                              flag[0] = FLAG_REDUCE;
                                        
                              break; 
                    }

                    qTask_Notification_Send(&Task_Set_Light, flag);
               
			}

			if (BUTTON_PRESS)
			{
	               m->NextState = State_Button_Push;
			}
			break;
	}

	return qSM_EXIT_SUCCESS;
}

consumer:

typedef struct
{
     Flags_enum     flag;
}User_Data_t;

void Set_Light_Callback (qEvent_t e)
{

     User_Data_t*   Data = (User_Data_t*)e->EventData;

     switch (Data->flag)
     {
          case FLAG_ENLARGE:
               if (PWM.PWM_Phase == 100)
               {

               }
               else
                    {
                         PWM.PWM_Phase++;
                    }
               break;

          case FLAG_REDUCE:
               if (PWM.PWM_Phase == 0)
               {

               }
               else
                    {
                         PWM.PWM_Phase--;
                         
                    }
               break;

          case FLAG_POWER_ON:
               PWM.PWM_Phase++;

               if (PWM.PWM_Phase == PWM.Save)
               {

               }
               break;

          default:
               break;
     }

}

In the function Set_Light_Callback() I get NO_FLAG (sendings FLAG_ENLARGE or FLAG_REDUCE).

If the code is changed like this:

qSM_Status_t State_Button_Release (qSM_Handler_t m)
{
	static qSTimer_t timeout;

     Flags_enum     flag[1];

	switch (m->Signal)
	{
		case QSM_SIGNAL_ENTRY:
			qSTimer_Set(&timeout, TIME_BUTTON_RELEASE);
			break;

          default:
               //break;    <- comment

		case QSM_SIGNAL_NONE:
              <....>

         }

}

In this case, everything is fine, but the Set_Light_Callback() function is called 2 times. Is this a bug?

//Sorry for the english language

_QTRACE_KERNEL not defined when trace variables are not used

Hi QuarkTS Team,
first of all I would like you to thank you very much for this work, I'm just playing around with it and I found it very interesting!

I'm using a PSoC4M series microcontroller from Infineon (ex Cypress), I configured the qconfig.h and built a simple project.
However, I got some implicit declaration warnings and undefined reference errors related to the _QTRACE_KERNEL definition.

I configured the qconfig.h to not use the trace variables:

#define Q_TRACE_VARIABLES           ( 0 )

Looking at the code, in this way the _QTRACE_KERNEL is never defined, but the code actually calls this function.
I solved the problem by adding the following statement into the qtrace.h file within the proper conditional directive:

#define _QTRACE_KERNEL( msg, id, obj )  do {} while (0)

Is this a bug or I'm missing something?

Thank you very much!
Simone

restructure: Change qSM_Signal_t from qUINT32_t to struct with Type and Data attributes

The suggestion here is to replace current qSM_Signal_t implementation as qUINT32_t with structure with two attributes:

typedef struct {
  qUINT32_t Type;
  qUINT32_t *Data;
} qSM_Signal_t;

The idea behind this is to allow HSMs to send signals with data. Certainly it's not just a modification but it would rather require restructure of the whole FSM module. Anyway it is worth discussion.

feature: Add Pub/Sub interface for qSM_Signal_t (qSM_t)

Currently signals can only be sent to particualar qSM_t HSMs. That forces some level of coupling.
HSM that sends signals has to know which HSM is interested in receiving it.

Adding Pub/Sub interafce would allow HSMs to declare which signals it wants to receive without mentioning
any other HSM. That would completly decouple HSMs.

Draft of such an interface can be find here: MichalRostekRostkowski#2

Issues in qstimers.c

  1. The documentation and code do not match

retValue = qSTimer_Disarm( t );

qSTimer_FreeRun() when the time expires, the STimer gets armed immediately taking the specified time. This implies it should call qSTimer_Reload() if STimer expires not qSTimer_Disarm( t )

  1. qSTimer_Remaining() does not check if elapsed time is greater than t->tv before subtracting. It should return 0 if qSTimer_Elapsed( t ) is greater than t->tv

retValue = t->tv - qSTimer_Elapsed( t );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.