Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
sys_mon.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 Gautier Hattenberger
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, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 *
21 */
28#include "core/sys_mon.h"
30#include "mcu_periph/sys_time.h"
31
32#include "mcu_periph/uart.h"
33#include "pprzlink/messages.h"
35
38
39/* Local vars */
50
72
99
101{
106
107 /* only periodic cycle : periodic_cycle = periodic_usec - sum_time_event; */
110
111 /* remember min and max periodic times */
114 }
117 }
118
119 /* remember min and max periodic cycle times */
122 }
125 }
126
127 n_periodic++;
129 n_event = 0;
130 sum_time_event = 0;
131}
132
133void event_sysmon(void)
134{
136 if (n_event > 0) {
138 if (t < min_time_event) {
140 }
141 sum_time_event += t;
142 }
144 n_event++;
145}
146
uint16_t foo
Definition main_demo5.c:58
static uint32_t sum_cycle_periodic
in usec
Definition sys_mon.c:46
static uint32_t event_timer
Definition sys_mon.c:44
static uint16_t n_event
Definition sys_mon.c:41
static uint32_t sum_n_event
Definition sys_mon.c:49
static uint32_t sum_time_event
in usec
Definition sys_mon.c:47
static uint32_t sum_time_periodic
in usec
Definition sys_mon.c:45
void event_sysmon(void)
Analyse event calls.
Definition sys_mon.c:133
static uint32_t periodic_cycle
Definition sys_mon.c:43
static uint16_t n_periodic
Definition sys_mon.c:40
static uint32_t min_time_event
in usec
Definition sys_mon.c:48
void periodic_sysmon(void)
Analyse periodic calls Should be run at the highest frequency.
Definition sys_mon.c:100
struct SysMon sys_mon
Global system monitor data (averaged over 1 sec)
Definition sys_mon.c:37
void periodic_report_sysmon(void)
Report system status.
Definition sys_mon.c:73
void init_sysmon(void)
Init system monitoring.
Definition sys_mon.c:51
static uint32_t periodic_timer
Definition sys_mon.c:42
System monitoring common header return cpu load, average exec time, ...
uint8_t cpu_load
uint16_t periodic_time_max
in usec
uint16_t periodic_cycle
in usec
uint16_t periodic_cycle_max
in usec
uint16_t periodic_cycle_min
in usec
uint16_t periodic_time_min
in usec
uint16_t periodic_time
in usec
uint16_t event_number
Architecture independent timing functions.
#define SysTimeTimerStart(_t)
Definition sys_time.h:227
#define SysTimeTimer(_t)
Definition sys_time.h:228
static float get_sys_time_float(void)
Get the time in seconds since startup.
Definition sys_time.h:138
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.