Ajout de la position mi-fermé pour la porte de la chambre de dépression
This commit is contained in:
		
							parent
							
								
									0b8b32a494
								
							
						
					
					
						commit
						651212632e
					
				
							
								
								
									
										7
									
								
								Test.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								Test.c
									
									
									
									
									
								
							| @ -543,6 +543,7 @@ int test_i2c_ecriture_pico_annex_nb_2(){ | ||||
| 
 | ||||
| 
 | ||||
|     printf("F - Ferme porte\n"); | ||||
|     printf("G - Mi-Ferme porte\n"); | ||||
|     printf("O - Ouvre porte\n"); | ||||
|     printf("T - Turbine On\n"); | ||||
|     printf("U - Turbine Off\n"); | ||||
| @ -572,6 +573,12 @@ int test_i2c_ecriture_pico_annex_nb_2(){ | ||||
|                     printf("=> Ferme porte\n"); | ||||
|                     break; | ||||
| 
 | ||||
|                 case 'G': | ||||
|                 case 'g': | ||||
|                     i2c_annexe_mi_ferme_porte(); | ||||
|                     printf("=> Ferme porte\n"); | ||||
|                     break; | ||||
| 
 | ||||
|                 case 'O': | ||||
|                 case 'o': | ||||
|                     i2c_annexe_ouvre_porte(); | ||||
|  | ||||
							
								
								
									
										17
									
								
								i2c_annexe.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								i2c_annexe.c
									
									
									
									
									
								
							| @ -82,20 +82,23 @@ void i2c_annexe_desactive_turbine(void){ | ||||
| } | ||||
| 
 | ||||
| void i2c_annexe_ouvre_porte(void){ | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xFD; | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xF9; | ||||
|     donnees_a_envoyer=1; | ||||
| } | ||||
| void i2c_annexe_ferme_porte(void){ | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= 0x02; | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xF9; | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= (1 << 1); | ||||
|     donnees_a_envoyer=1; | ||||
| } | ||||
| void i2c_annexe_mi_ferme_porte(void){ | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xF9; | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= (2 << 1); | ||||
|     donnees_a_envoyer=1; | ||||
| } | ||||
| 
 | ||||
| void i2c_annexe_active_propulseur(void){ | ||||
|     if(!(donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] & 0x04)){ | ||||
|         printf("active propulseur\n"); | ||||
|         donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= 0x04; | ||||
|         donnees_a_envoyer=1; | ||||
|     } | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= 0x08; | ||||
|     donnees_a_envoyer=1; | ||||
| } | ||||
| void i2c_annexe_desactive_propulseur(void){ | ||||
|     donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xFB; | ||||
|  | ||||
| @ -9,6 +9,7 @@ void i2c_annexe_desactive_turbine(void); | ||||
| 
 | ||||
| void i2c_annexe_ouvre_porte(void); | ||||
| void i2c_annexe_ferme_porte(void); | ||||
| void i2c_annexe_mi_ferme_porte(void); | ||||
| 
 | ||||
| void i2c_annexe_active_propulseur(void); | ||||
| void i2c_annexe_desactive_propulseur(void); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user