Compare commits

...

2 Commits

Author SHA1 Message Date
89487aebb5 min max detection/ higher clokrate 2024-05-05 01:02:06 +02:00
3c0c81df2e isetpin.c 2024-05-04 20:00:58 +02:00
2 changed files with 23 additions and 11 deletions

View File

@ -156,8 +156,8 @@ static void handle_switches()
single_step=0;
return;
}
disp_nr--;
if (disp_nr>0)
disp_nr--;
}
}
@ -168,7 +168,9 @@ static void handle_switches()
single_step=0;
return;
}
disp_nr++;
if (disp_nr<99)
disp_nr++;
}
}
@ -205,7 +207,7 @@ static void update_display()
}
#define COU0 11
#define COU1 1000
#define COU1 10
static void cou0()
{
@ -224,19 +226,22 @@ static void pulser()
{
if(pulse>0){
P2_6 = 1;
P1_2 = 1;
P1_3 = 0;
pulse--;
return;
}
P2_6=0;
P1_2=0;
P1_3=1;
}
static void cou1()
{
static int ctr = 99;
static int ctr = 9900;
static int count=COU1;
@ -252,14 +257,10 @@ static void cou1()
ctr-=disp_nr;
if (ctr <=0){
ctr+=99;
ctr+=9900;
pulse=PULSE_LEN;
}
// if (disp_nr>99)
// disp_nr=0;
}

11
setpin.c Normal file
View File

@ -0,0 +1,11 @@
#include "mctools.h"
void setpin(uint8_t port, uint8_t pin, uint8_t val)
{
if (val)
setpin_hi(port,pin);
else
setpin_lo(port,pin);
}