Tab.c 717 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Tab.c
  3. *
  4. * Created on: 15 janv. 2019
  5. * Author: e_rcluze
  6. */
  7. #include "Tab.h"
  8. extern Sortie tabSortie[NBLIGNEACTIVE];
  9. extern uint8_t gl_Stop;
  10. extern uint8_t gl_Essai;
  11. void initTab(Sortie *S) {
  12. S[0].OUT = 0b0000000000000100;
  13. S[1].OUT = 0b0000000000001000;
  14. S[2].OUT = 0b0000000000000011;
  15. S[3].OUT = 0b0000000000010000;
  16. //S[1].OUT = 0b0000000000000010;
  17. //S[2].OUT = 0b0000000000000100;
  18. //S[3].OUT = 0b0000000000001000;
  19. }
  20. uint8_t newStatus(Sortie *s, uint16_t heure) {
  21. if (heure >= s->Demmarage & heure < s->Extinxtion) {
  22. if (heure < s->Demmarage + s->Pente)
  23. return ENALLUME;
  24. else if(heure > s->Extinxtion - s->Pente)
  25. return ENETEIN;
  26. else
  27. return ALLUME;
  28. } else
  29. return ETEIN;
  30. }