Giter VIP home page Giter VIP logo

coco's Introduction

CoCo

(Micro)Controller Coroutines

This is the base component of CoCo, a library that enables cooperative multitasking on bare metal microcontrollers using C++20 coroutines. It removes the need for an operating system for many use cases.

Import

Add coco/<version> to your conanfile where version corresponds to the git tags

Features

  • Central event loop
  • Time with millisecond resolution
  • Suspending of a coroutine for a given duration or until a given time with co_await sleep(...)
  • Separate libraries for "drivers" such as SPI, USB etc.
  • Also runs on Windows/MacOS/Linux using poll()

Supported Platforms

  • Native
    • Windows
    • Todo: macOS
    • Todo: Linux
  • nRF52
    • nrf52805
    • nrf52810
    • nrf52811
    • nrf52820
    • nrf52833
    • nrf52840
  • STM32F0
    • stm32f030x6
    • stm32f038xx
    • stm32f058xx
    • stm32f072xb
    • stm32f030x8
    • stm32f042x6
    • stm32f070x6
    • stm32f078xx
    • stm32f030xc
    • stm32f048xx
    • stm32f070xb
    • stm32f091xc
    • stm32f031x6
    • stm32f051x8
    • stm32f071xb
    • stm32f098xx
  • STM32G4
    • stm32g431xx
    • stm32g471xx
    • stm32g474xx
    • stm32g484xx
    • stm32g4a1xx
    • stm32g441xx
    • stm32g473xx
    • stm32g483xx
    • stm32g491xx

Pass -o platform=<platform> to conan to set the platform. When no platform is given, the platform dependent code is omitted in the resulting conan package.

Development

Visual Studio Code

Install these extensions

  • C/C++
  • C/C++ Extension Pack
  • conan (disroop)

Add to settings.json

"cmake.useCMakePresets": "always",
"cmake.debugConfig": {
    "cwd": "${workspaceFolder}"
}

Install the arm gcc toolchain

Open coco* projects for the first time

  • Copy the conan profiles from coco/support/conan/ to your ~/.conan/profiles (make sure CC and CXX point to the arm toolchain)
  • Copy conan-settings.json from coco/support/vscode to .vscode/ in each project
  • Copy presets.py from coco/support/vscode to top level directory of each project
  • Open Visual Studio Code
  • Install conan dependencies by clicking on "Install" on the blue bar (cloud download icon)
  • Run presets.py by right-clicking and selecting "Run Python File in Terminal" to generate CMakeUserPresets.json

Configure and run

  • If "requires" in conanfile.py have changed (e.g. new version), click on "Install" again
  • Select CMake configure and build presets on the blue bar (tools icon)
  • Build (gear icon)
  • Now debug (bug icon) or run (play icon) the application

coco's People

Contributors

jochen0x90h avatar

Watchers

 avatar

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.