Premier commit
Cette révision appartient à :
révision
aee5ad5442
118 fichiers modifiés
+16226
Aucun fichier ne correspond à votre recherche
@@ -0,0 +1,38 @@
|
||||
/* ============================================================================
|
||||
* baro_stub.c -- barometre simule.
|
||||
*
|
||||
* Valeurs plausibles pour un boitier en montagne : environ 1500 m d'altitude.
|
||||
* ==========================================================================*/
|
||||
|
||||
#include "vc_baro.h"
|
||||
#include "vc_radio.h" /* codes VC_HAL_* */
|
||||
|
||||
static uint32_t s_pressure_pa = 84500; /* ~1500 m */
|
||||
static int32_t s_temp_centi_c = 420; /* 4,20 degres C */
|
||||
|
||||
void vc_baro_init(void)
|
||||
{
|
||||
s_pressure_pa = 84500;
|
||||
s_temp_centi_c = 420;
|
||||
}
|
||||
|
||||
int vc_baro_read_pressure(uint32_t *out_pa)
|
||||
{
|
||||
if (out_pa == 0) return VC_HAL_EIO;
|
||||
*out_pa = s_pressure_pa;
|
||||
return VC_HAL_OK;
|
||||
}
|
||||
|
||||
int vc_baro_read_temp(int32_t *out_centi_c)
|
||||
{
|
||||
if (out_centi_c == 0) return VC_HAL_EIO;
|
||||
*out_centi_c = s_temp_centi_c;
|
||||
return VC_HAL_OK;
|
||||
}
|
||||
|
||||
/* --- point de controle reserve au harnais de test ---------------------- */
|
||||
void vc_baro_stub_set(uint32_t pa, int32_t centi_c)
|
||||
{
|
||||
s_pressure_pa = pa;
|
||||
s_temp_centi_c = centi_c;
|
||||
}
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur