From b06f1c631a8ef4bc60564bc034330c9440195647 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 1 May 2023 21:02:08 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20d=C3=A9clenchement=20du=20d=C3=A9g?= =?UTF-8?q?uisement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test.c | 15 +++++++++++++++ i2c_annexe.c | 9 +++++++++ i2c_annexe.h | 5 ++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Test.c b/Test.c index 762ba85..48274e9 100644 --- a/Test.c +++ b/Test.c @@ -543,6 +543,9 @@ int test_i2c_ecriture_pico_annex_nb_2(){ enum i2c_resultat_t retour_i2c = I2C_EN_COURS; + + printf("D - Deguisement On\n"); + printf("E - Deguisement Off\n"); printf("F - Ferme porte\n"); printf("G - Mi-Ferme porte\n"); printf("O - Ouvre porte\n"); @@ -568,6 +571,18 @@ int test_i2c_ecriture_pico_annex_nb_2(){ if(lettre != PICO_ERROR_TIMEOUT && lettre != '\0'){ printf("lettre !\n"); switch(lettre){ + case 'd': + case 'D': + i2c_annexe_active_deguisement(); + printf("=> Active déguisement\n"); + break; + + case 'E': + case 'e': + i2c_annexe_desactive_deguisement(); + printf("=> Desactive déguisement\n"); + break; + case 'F': case 'f': i2c_annexe_ferme_porte(); diff --git a/i2c_annexe.c b/i2c_annexe.c index 095f1e6..5ccf066 100644 --- a/i2c_annexe.c +++ b/i2c_annexe.c @@ -107,6 +107,15 @@ void i2c_annexe_desactive_propulseur(void){ donnees_a_envoyer=1; } +void i2c_annexe_active_deguisement(void){ + donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= 0x10; + donnees_a_envoyer=1; +} +void i2c_annexe_desactive_deguisement(void){ + donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xEF; + donnees_a_envoyer=1; +} + void i2c_annexe_envoie_score(uint8_t score){ donnees_emission[ADRESSE_SCORE - ADRESSE_DEBUT_W] = score; donnees_a_envoyer=1; diff --git a/i2c_annexe.h b/i2c_annexe.h index 492aa27..759d3c1 100644 --- a/i2c_annexe.h +++ b/i2c_annexe.h @@ -23,4 +23,7 @@ uint8_t i2c_annexe_get_contacteur_longer_A(void); uint8_t i2c_annexe_get_contacteur_longer_C(void); void i2c_annexe_get_distances(uint8_t *distance_capteur_cm); -void i2c_annexe_couleur_balise(uint8_t couleur, uint16_t masque_led); \ No newline at end of file +void i2c_annexe_couleur_balise(uint8_t couleur, uint16_t masque_led); + +void i2c_annexe_active_deguisement(void); +void i2c_annexe_desactive_deguisement(void); \ No newline at end of file