Homogénéisation des indices, certains comptaient de 1 à12, d'autres de 0 à 11. Alignement sur 0 à 11.
This commit is contained in:
parent
312a82ab24
commit
c3580f9525
@ -22,10 +22,9 @@ void Selection_capteur_init(void){
|
||||
}
|
||||
|
||||
/// @brief Désactive le capteur en question
|
||||
/// @param capteur capteur, numéroté de 1 à 12
|
||||
/// @param capteur capteur, numéroté de 0 à 11
|
||||
void Selection_capteur_select(uint32_t capteur){
|
||||
uint32_t io_value;
|
||||
capteur = capteur - 1;
|
||||
|
||||
io_value = 0;
|
||||
io_value |= ((capteur & 0x08) >> 3) << 2;
|
||||
@ -43,5 +42,5 @@ void Selection_capteur_init_pin_low(uint pin){
|
||||
}
|
||||
|
||||
void Selection_capteur_deselect(){
|
||||
Selection_capteur_select(16);
|
||||
Selection_capteur_select(15);
|
||||
}
|
@ -46,7 +46,7 @@ void initialise_adresses(void){
|
||||
// Pour chaque capteur
|
||||
for(uint capteur=0; capteur<NB_CAPTEURS; capteur++){
|
||||
// reset du capteur
|
||||
Selection_capteur_select(capteur+1);
|
||||
Selection_capteur_select(capteur);
|
||||
sleep_ms(1);
|
||||
Selection_capteur_deselect();
|
||||
sleep_ms(1);
|
||||
|
Loading…
Reference in New Issue
Block a user