29 lines
632 B
C
29 lines
632 B
C
#include "derivative.h"
|
|
#include "defines.h"
|
|
#include "tempo.h"
|
|
|
|
void interrupt 7 depassement_compteur(void)
|
|
{
|
|
if (SW1) {
|
|
if (PTBD == 0xFF && retard_cycle_droite == 0) {
|
|
retard_cycle_droite = 1;
|
|
} else if (retard_cycle_droite == 1 || PTBD == 0) {
|
|
retard_cycle_droite = 0;
|
|
PTBD = 1;
|
|
} else {
|
|
PTBD |= (PTBD << 1); // Allumage
|
|
}
|
|
|
|
} else if (SW2) {
|
|
if (PTBD == 0xFF && retard_cycle_gauche == 0) {
|
|
retard_cycle_gauche = 1;
|
|
} else if (retard_cycle_gauche == 1 || PTBD == 0) {
|
|
retard_cycle_gauche = 0;
|
|
PTBD = 0x80;
|
|
} else {
|
|
PTBD |= (PTBD >> 1); // Allumage
|
|
}
|
|
}
|
|
|
|
TPMSC = TPMSC & 0b01111111;
|
|
} |