Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
logger_utils.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2026 Gautier Hattenberger <gautier.hattenberger@enac.fr>
3
*
4
* This file is part of paparazzi.
5
*
6
* paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with paparazzi; see the file COPYING. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*
20
*/
21
26
#ifndef LOGGER_UTILS_H
27
#define LOGGER_UTILS_H
28
29
#if USE_CHIBIOS_RTOS
30
31
#include "
modules/loggers/sdlog_chibios.h
"
32
#define LogWrite sdLogWriteLog
33
#define LogFileIsOpen(_file) (_file != -1)
34
#define LogOpen(_file, _path, _name) {}
35
#define LogClose(_file) {}
36
typedef
FileDes
LogFile_t
;
37
38
#else
// assume Linux based OS
39
40
#include <stdio.h>
41
#include <unistd.h>
42
#define LogWrite fprintf
43
#define LogFileIsOpen(_file) (_file != NULL)
44
#define LogOpen(_file, _path, _name) { _file = open_log(_path, _name); }
45
#define LogClose(_file) { \
46
fclose(_file); \
47
_file = NULL; \
48
}
49
typedef
FILE
*
LogFile_t
;
50
57
extern
FILE
*
open_log
(
char
* path,
char
* name);
58
59
#endif
60
61
#endif
/* LOGGER_UTILS_H */
62
open_log
FILE * open_log(char *path, char *name)
Open a log file.
Definition
logger_utils.c:34
LogFile_t
FILE * LogFile_t
Definition
logger_utils.h:49
foo
uint16_t foo
Definition
main_demo5.c:58
FileDes
int8_t FileDes
Definition
sdLog.h:128
sdlog_chibios.h
sw
airborne
modules
loggers
logger_utils.h
Generated on Wed Apr 8 2026 08:31:57 for Paparazzi UAS by
1.9.8