First commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user