Open FFBoard
Open source force feedback firmware
cppmain.h
Go to the documentation of this file.
1
/*
2
* cppmain.h
3
*
4
* Created on: Jan 4, 2020
5
* Author: Yannick
6
*/
7
8
#ifndef CPPMAIN_H_
9
#define CPPMAIN_H_
10
11
#include "
constants.h
"
12
13
#ifndef DEFAULTMAIN
14
#define DEFAULTMAIN 0
15
#endif
16
17
#pragma once
18
#ifdef __cplusplus
19
20
#include "
FFBoardMain.h
"
21
#include "
ledEffects.h
"
22
#include "
ClassChooser.h
"
23
24
25
26
extern
"C"
{
27
#endif
28
29
#include "
eeprom_addresses.h
"
30
#include "main.h"
31
#include "cmsis_compiler.h"
32
33
34
void
cppmain
();
35
void
usb_init
();
36
void
tudThread
(
void
*argument);
37
38
#ifdef __cplusplus
39
}
40
41
static
inline
bool
inIsr
(){
42
return
(__get_PRIMASK() != 0U) || (__get_IPSR() != 0U);
43
}
44
45
template
<
class
T,
class
C>
46
int8_t
cliptest
(T v,
C
l,
C
h)
47
{
48
if
(v > h){
49
return
1;
50
}
else
if
(v < l){
51
return
-1;
52
}
else
{
53
return
0;
54
}
55
}
56
57
template
<
class
T,
class
C>
58
T
clip
(T v,
C
l,
C
h)
59
{
60
return
{ v > h ? h : v < l ? l : v };
61
}
62
63
uint32_t
micros
();
// Returns microsecond scaled time
64
unsigned
long
getRunTimeCounterValue
(
void
);
// RTOS
65
66
void
refreshWatchdog
();
// Refreshes the watchdog
67
68
#endif
69
70
71
#endif
/* CPPMAIN_H_ */
ClassChooser.h
FFBoardMain.h
C
C
constants.h
clip
T clip(T v, C l, C h)
Definition:
cppmain.h:58
cppmain
void cppmain()
Definition:
cppmain.cpp:30
micros
uint32_t micros()
Definition:
cppmain.cpp:116
refreshWatchdog
void refreshWatchdog()
Definition:
cppmain.cpp:103
getRunTimeCounterValue
unsigned long getRunTimeCounterValue(void)
Definition:
cppmain.cpp:144
usb_init
void usb_init()
cliptest
int8_t cliptest(T v, C l, C h)
Definition:
cppmain.h:46
inIsr
static bool inIsr()
Definition:
cppmain.h:41
tudThread
void tudThread(void *argument)
eeprom_addresses.h
ledEffects.h
Firmware
FFBoard
Inc
cppmain.h
Generated by
1.9.2