Coder Social home page Coder Social logo

kmilo17pet / quarkts-cpp Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 2.0 8.32 MB

The QuarkTS port for C++. 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

CMake 0.61% C 0.97% C++ 97.71% Batchfile 0.36% PowerShell 0.35%
cooperative embedded event-driven firmware iot microcontrollers multitasking os rtos state-machine

quarkts-cpp's People

Contributors

fermuch avatar kmilo17pet avatar

Stargazers

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

Watchers

 avatar  avatar

quarkts-cpp's Issues

How to access param from a callback?

Given the following signature when adding a new command:

bool commandLineInterface::add( cli::command &cmd, char *textCommand, cli::commandCallback_t cFcn, cli::options_t cmdOpt, void *param )

param seems to be stored inside in the cmd itself.

As far as I understood, there is no way to access that variable. It is private and there is no getter.

Am I missing something?

reinterpret_cast<unsigned_t> or reinterpret_cast<std::uintptr_t> in logger.cpp

BTW no criticism with your code, loving qlibs and QuarkTS

Compiling on GCC 5.10 on a W10 PC to setup some unit tests and ran into an issue with logger.cpp

Line 203 Example in logger.cpp
(void)util::unsignedToString( reinterpret_cast<unsigned_t>( p ), buffer, 16U ); // skipcq: CXX-C1000

Compiled with an error for 5 lines all related reinterpret_cast<unsigned_t>

E:\CSandbox\QuarkTS-cpp\src\logger.cpp|121|error: cast from 'const void*' to 'qOS::unsigned_t' {aka 'long unsigned int'} loses precision [-fpermissive]|

Tried different CPP standards just in case, but no solution.

Changing reinterpret_cast<unsigned_t> to reinterpret_cast<std::uintptr_t> fixes the compiler issue but wondering if this is a valid solution or a more project centric solution might be better.

(void)util::unsignedToString( reinterpret_caststd::uintptr_t( &sm.getTop() ), buffer, 16 ); // skipcq: CXX-C1000

Everything else compiles fine.

task.setName() doesn't work

The task name of the two examples is never displayed in the log.
The task is searched based on its name and, if found, set. This doesn't actually make any sense since the task is already the correct object.
I have now made the following correction in task.cpp:

/*============================================================================*/
bool task::setName(const char *tName) noexcept {
    bool retValue = false;
    const size_t nl = util::strlen(tName, sizeof(name));
    /*cstat -MISRAC++2008-5-14-1*/
    // if ( ( nullptr != getContainer() ) && ( nl > 0U ) && ( nl < sizeof(name) ) ) {
    //     if ( nullptr == os.getTaskByName( tName ) ) {
    if (nl > 0U && nl < sizeof(name)) {
        (void)util::strcpy(name, tName, sizeof(name));  // skipcq: CXX-C1000
        retValue = true;
    }
    //     }
    // }
    // /*cstat +MISRAC++2008-5-14-1*/
    return retValue;
}

Example LED_Blink_Flat_State_Machine problems

I am very interested in the FSM extension. The concept seems to me to be a very interesting variant. Unfortunately the example doesn't compile. After my corrections it is not working correctly. I tried to follow the example based on the documentation "https://kmilo17pet.github.io/QuarkTS-cpp/q_fsm.html" but failed. After the fixes it doesn't work. I don't yet fully understand how the timeout should be handled so that the "State_LEDBlink" works.
I would be happy if you could correct the example. I am not yet able to do this myself. Thank you for the excellent product.

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.