modm API documentation for STM32F469ZIT6
modm::Fiber< StackSize > Class Template Reference

#include <modm/processing/fiber/fiber.hpp>

Inheritance diagram for modm::Fiber< StackSize >:
modm::fiber::Task

Public Types

enum  Start
 

Public Member Functions

template<class T >
 Fiber (T &&task, fiber::Start start=fiber::Start::Now)
 
bool isRunning () const
 
bool stack_overflow () const
 
size_t stack_usage () const
 
bool start ()
 
void watermark_stack ()
 

Static Public Attributes

static constexpr size_t StackAlignment = sizeof(uintptr_t) * 2
 Alignment requirements for the bottom and top of the stack.
 
static constexpr size_t StackSizeMinimum = 108
 Minimum stack size required to push one full fiber context.
 
static constexpr size_t StackSizeDefault = 512
 

Detailed Description

template<size_t StackSize = fiber::StackSizeDefault>
class modm::Fiber< StackSize >

This class is a convenience extension of a fiber task, which contains the modm::fiber::Stack as part of the class. The class is constructed at runtime only, therefore it is placed into the .bss section by default and does not count towards your .data section size. To speed up booting you may place the object into the modm_faststack section.

Member Function Documentation

bool modm::fiber::Task::isRunning ( ) const
inheritedinline
Returns
if the fiber is attached to a scheduler.
bool modm::fiber::Task::stack_overflow ( ) const
inheritedinline
Returns
if the bottom word on the stack has been overwritten.
See also
modm_context_stack_overflow().
size_t modm::fiber::Task::stack_usage ( ) const
inheritedinline
Returns
the stack usage as measured by a watermark level.
See also
modm_context_stack_usage().
bool modm::fiber::Task::start ( )
inherited

Adds the task to the currently active scheduler, if not already running.

Returns
if the fiber has been scheduled.
void modm::fiber::Task::watermark_stack ( )
inheritedinline

Watermarks the stack to measure stack_usage() later.

See also
modm_context_watermark().

The documentation for this class was generated from the following files: