-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathmain.h
More file actions
52 lines (43 loc) · 2.03 KB
/
main.h
File metadata and controls
52 lines (43 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/****************************************************************************
----------------------------------------------------------------------
Copyright (C) Alexander Hoffman, 2019
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------
****************************************************************************/
/**
* @file main.h
* @author Alex Hoffman
* @email alex.hoffman@tum.de
* @website http://alexhoffman.info
* @copyright GNU GPL v3
* @mainpage
* This basic implementation of a state machine using function pointers and
* POSIX thread aims to show a simplified method for implementing a flexible
* state machine with minimal code recycling required.
*
* The states.c and states.h files also demonstrates how mini API interfaces can
* be implemented in a C project to segment your project into modules which only
* expose clean API interfaces. This allows for the interfacing of multiple
* components within a project to be done cleanly as well as allowing for easier
* debugging through the black boxing of each module, which can be easily tested
* separately.
* */
#ifndef __MAIN_H__
#define __MAIN_H__
#define FIRST_STATE_NAME "Count up once"
#define SECOND_STATE_NAME "Count up twice"
#define THIRD_STATE_NAME "Count down once"
#define NANOS_IN_SEC 1000000000
#define NANOS_IN_MSEC 10000000
#define MSEC_IN_NANO(MSEC) MSEC *NANOS_IN_MSEC
#define DEFAULT_TICK 100
#endif