libs
platform_specific_components
kinetis
libuavcan
driver
src
kinetis/libuavcan/driver/src/internal.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2014, 2018 Pavel Kirienko <pavel.kirienko@gmail.com>
3
* Kinetis Port Author David Sidrane <david_s5@nscdg.com>
4
*/
5
6
#pragma once
7
8
#include <
uavcan_kinetis/build_config.hpp
>
9
10
#if UAVCAN_KINETIS_NUTTX
11
# include <nuttx/arch.h>
12
# include "up_arch.h"
13
# include <arch/board/board.h>
14
# include <chip/kinetis_pit.h>
15
# include <chip/kinetis_sim.h>
16
# include <syslog.h>
17
#else
18
# error "Unknown OS"
19
#endif
20
24
#ifndef UAVCAN_KINETIS_LOG
25
# if 1
26
# define UAVCAN_KINETIS_LOG(fmt, ...) syslog(LOG_INFO, "uavcan_kinetis: " fmt "\n", ## __VA_ARGS__)
27
# else
28
# define UAVCAN_KINETIS_LOG(...) ((void)0)
29
# endif
30
#endif
31
35
#define UAVCAN_KINETIS_IRQ_HANDLER(id) int id(int irq, FAR void* context, FAR void *arg)
36
37
41
#define UAVCAN_KINETIS_GLUE2_(A, B) A ## B
42
#define UAVCAN_KINETIS_GLUE2(A, B) UAVCAN_KINETIS_GLUE2_(A, B)
43
44
#define UAVCAN_KINETIS_GLUE3_(A, B, C) A ## B ## C
45
#define UAVCAN_KINETIS_GLUE3(A, B, C) UAVCAN_KINETIS_GLUE3_(A, B, C)
46
47
namespace
uavcan_kinetis
48
{
49
#if UAVCAN_KINETIS_NUTTX
50
51
struct
CriticalSectionLocker
52
{
53
const
irqstate_t flags_;
54
55
CriticalSectionLocker()
56
: flags_(enter_critical_section())
57
{
58
}
59
60
~CriticalSectionLocker()
61
{
62
leave_critical_section(flags_);
63
}
64
};
65
66
#endif
67
68
namespace
clock
69
{
70
uavcan::uint64_t
getUtcUSecFromCanInterrupt
();
71
}
72
}
uavcan::uint64_t
std::uint64_t uint64_t
Definition:
std.hpp:27
build_config.hpp
uavcan_kinetis
Definition:
platform_specific_components/kinetis/libuavcan/driver/include/uavcan_kinetis/can.hpp:13
uavcan_kinetis::clock::getUtcUSecFromCanInterrupt
uavcan::uint64_t getUtcUSecFromCanInterrupt()
Definition:
clock.cpp:78
uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:02