APM:Libraries
libraries
AP_HAL_F4Light
handler.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
hal.h
>
4
5
template
<
typename
T>
void
ZeroIt
(T&
value
)
6
{
7
memset(&value,0,
sizeof
(value));
8
}
9
10
FUNCTOR_TYPEDEF
(MemberProcArg,
void
, uint32_t);
11
12
#pragma pack(push, 1)
13
union
Revo_handler
{
// blood, bowels, assembler :) transform functors into a unified view for calling from C
14
voidFuncPtr
vp
;
15
revo_isr_handler
isr
;
16
AP_HAL::Proc
hp
;
17
AP_HAL::Device::PeriodicCb
pcb
;
//\\ this is C not C ++, so we can not declare the support of functors explicitly, and are forced to pass
18
AP_HAL::MemberProc
mp
;
// support of functors explicitly, and are forced to pass
19
MemberProcArg
mpa
;
20
Handler
h
;
// treat as handle <-- as 64-bit integer
21
uint32_t
w
[2];
// words, to check. if this is a functor then the high is the address of the flash and the lower one is the address in RAM.
22
// if this is a function pointer then lower word is an address in flash and high is 0
23
};
24
#pragma pack(pop)
25
voidFuncPtr
void(* voidFuncPtr)(void)
Definition:
hal_types.h:16
Revo_handler::mp
AP_HAL::MemberProc mp
Definition:
handler.h:18
Revo_handler::h
Handler h
Definition:
handler.h:20
Revo_handler::isr
revo_isr_handler isr
Definition:
handler.h:15
hal.h
AP_HAL::Proc
void(* Proc)(void)
Definition:
AP_HAL_Namespace.h:47
revo_isr_handler
void(* revo_isr_handler)(uint32_t arg)
Definition:
hal_types.h:17
Revo_handler::w
uint32_t w[2]
Definition:
handler.h:21
ZeroIt
void ZeroIt(T &value)
Definition:
handler.h:5
Revo_handler
Definition:
handler.h:13
Revo_handler::mpa
MemberProcArg mpa
Definition:
handler.h:19
FUNCTOR_TYPEDEF
FUNCTOR_TYPEDEF(MemberProcArg, void, uint32_t)
Revo_handler::pcb
AP_HAL::Device::PeriodicCb pcb
Definition:
handler.h:17
value
float value
Definition:
SIM_FlightAxis.cpp:42
Revo_handler::vp
voidFuncPtr vp
Definition:
handler.h:14
Handler
uint64_t Handler
Definition:
hal_types.h:19
Revo_handler::hp
AP_HAL::Proc hp
Definition:
handler.h:16
Generated on Sun Jun 17 2018 14:18:49 for APM:Libraries by
1.8.13