Le-Guily
Firmware du robot auto-équilibré (Zephyr, STM32WB55)
Chargement...
Recherche...
Aucune correspondance
Référence du fichier safety.c

Thread SAFETY. Plus de détails...

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include "priorities.h"
#include "include.h"

Aller au code source de ce fichier.

Fonctions

static float moving_average (float new_value)
static void thread_safety (void *p1, void *p2, void *p3)
 K_THREAD_DEFINE (thread_safety_id, STACK_SIZE, thread_safety, NULL, NULL, NULL, PRIORITY_SAFETY, 0, 0)

Variables

static float buffer [10]
static int index = 0
static int count = 0
static float sum = 0.0f
static float moyenne

Description détaillée

Thread SAFETY.

lit la tension de la batterie toutes les 500 ms et en calcule une moyenne glissante sur 10 mesures.

Auteur
Axel Guilly, Lucas Olivet, Julien Ung, Joseph Griois

Le-Guily - Robot auto-équilibré à deux roues - CESI A4, projet SPI

Définition dans le fichier safety.c.

Documentation des fonctions

◆ K_THREAD_DEFINE()

K_THREAD_DEFINE ( thread_safety_id ,
STACK_SIZE ,
thread_safety ,
NULL ,
NULL ,
NULL ,
PRIORITY_SAFETY ,
0 ,
0  )

◆ moving_average()

float moving_average ( float new_value)
static

Définition à la ligne 23 du fichier safety.c.

◆ thread_safety()

void thread_safety ( void * p1,
void * p2,
void * p3 )
static

Définition à la ligne 44 du fichier safety.c.

Documentation des variables

◆ buffer

float buffer[10]
static

Définition à la ligne 17 du fichier safety.c.

◆ count

int count = 0
static

Définition à la ligne 19 du fichier safety.c.

◆ index

int index = 0
static

Définition à la ligne 18 du fichier safety.c.

◆ moyenne

float moyenne
static

Définition à la ligne 21 du fichier safety.c.

◆ sum

float sum = 0.0f
static

Définition à la ligne 20 du fichier safety.c.