|
Le-Guily
Firmware du robot auto-équilibré (Zephyr, STM32WB55)
|
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 |
Thread SAFETY.
lit la tension de la batterie toutes les 500 ms et en calcule une moyenne glissante sur 10 mesures.
Le-Guily - Robot auto-équilibré à deux roues - CESI A4, projet SPI
Définition dans le fichier safety.c.
| K_THREAD_DEFINE | ( | thread_safety_id | , |
| STACK_SIZE | , | ||
| thread_safety | , | ||
| NULL | , | ||
| NULL | , | ||
| NULL | , | ||
| PRIORITY_SAFETY | , | ||
| 0 | , | ||
| 0 | ) |
|
static |