YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
task_idle.h
1// ---------------------------------------------
2// This file is part of
3// _ _ __ _ _ __ __
4// ( \/ ) /__\ ( )_( ) /__\ ( )
5// \ / /(__)\ ) _ ( /(__)\ )(__
6// (__)(__)(__)(_) (_)(__)(__)(____)
7//
8// Yet Another HW Abstraction Library
9// Copyright (C) Andreas Terstegge
10// BSD Licensed (see file LICENSE)
11//
12// ---------------------------------------------
13//
14// The idle task. It does nothing but sleep.
15//
16#ifndef _TASK_IDLE_H_
17#define _TASK_IDLE_H_
18
19#include "task.h"
20
21class task_idle : public task
22{
23 public:
24 task_idle() : task("IDLE", 200) { }
25 ~task_idle() override = default;
26
27 // No copy, no assignment
28 task_idle (const task_idle &) = delete;
29 task_idle & operator= (const task_idle &) = delete;
30
31 [[noreturn]] inline void run() override {
32 // Do nothing but sleep ...
34 while(true) cpu_sleep();
35 }
36};
37
38#endif // _TASK_IDLE_H_
39
Definition task.h:39