CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/ArduCopter/UserCode.cpp
Views: 1798
1
#include "Copter.h"
2
3
#ifdef USERHOOK_INIT
4
void Copter::userhook_init()
5
{
6
// put your initialisation code here
7
// this will be called once at start-up
8
}
9
#endif
10
11
#ifdef USERHOOK_FASTLOOP
12
void Copter::userhook_FastLoop()
13
{
14
// put your 100Hz code here
15
}
16
#endif
17
18
#ifdef USERHOOK_50HZLOOP
19
void Copter::userhook_50Hz()
20
{
21
// put your 50Hz code here
22
}
23
#endif
24
25
#ifdef USERHOOK_MEDIUMLOOP
26
void Copter::userhook_MediumLoop()
27
{
28
// put your 10Hz code here
29
}
30
#endif
31
32
#ifdef USERHOOK_SLOWLOOP
33
void Copter::userhook_SlowLoop()
34
{
35
// put your 3.3Hz code here
36
}
37
#endif
38
39
#ifdef USERHOOK_SUPERSLOWLOOP
40
void Copter::userhook_SuperSlowLoop()
41
{
42
// put your 1Hz code here
43
}
44
#endif
45
46
#ifdef USERHOOK_AUXSWITCH
47
void Copter::userhook_auxSwitch1(const RC_Channel::AuxSwitchPos ch_flag)
48
{
49
// put your aux switch #1 handler here (CHx_OPT = 47)
50
}
51
52
void Copter::userhook_auxSwitch2(const RC_Channel::AuxSwitchPos ch_flag)
53
{
54
// put your aux switch #2 handler here (CHx_OPT = 48)
55
}
56
57
void Copter::userhook_auxSwitch3(const RC_Channel::AuxSwitchPos ch_flag)
58
{
59
// put your aux switch #3 handler here (CHx_OPT = 49)
60
}
61
#endif
62
63