*duh* one extra zero

master
leitner 21 years ago
parent 29cfd8df4e
commit 0a38894c43

@ -27,12 +27,18 @@ path = $(subst :, ,$(PATH))
diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet)) diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet))
ifeq ($(strip $(diet_path)),) ifeq ($(strip $(diet_path)),)
ifneq ($(wildcard /opt/diet/bin/diet),) ifneq ($(wildcard /opt/diet/bin/diet),)
DIET=/opt/diet/bin/diet -Os DIET=/opt/diet/bin/diet
else else
DIET= DIET=
endif endif
else else
DIET:=$(strip $(diet_path)) -Os DIET:=$(strip $(diet_path))
endif
ifneq ($(DIET),)
ifneq ($(DEBUG),1)
DIET+=-Os
endif
endif endif
# to build without diet libc support, use $ make DIET= # to build without diet libc support, use $ make DIET=
# see http://www.fefe.de/dietlibc/ for details about the diet libc # see http://www.fefe.de/dietlibc/ for details about the diet libc

@ -5,9 +5,13 @@ void io_waituntil(tai6464 t) {
uint64 x,y; uint64 x,y;
tai6464 now,diff; tai6464 now,diff;
taia_now(&now); taia_now(&now);
taia_sub(&diff,&t,&now); if (taia_less(&t,&now))
if (!umult64(diff.sec.x,1000,&x) || (y=x+diff.nano/10000000)<x) y=0;
y=-1; /* overflow; wait indefinitely */ else {
if (!y && diff.nano) y=1; taia_sub(&diff,&t,&now);
if (!umult64(diff.sec.x,1000,&x) || (y=x+diff.nano/1000000)<x)
y=-1; /* overflow; wait indefinitely */
if (!y && diff.nano) y=1;
}
io_waituntil2(y); io_waituntil2(y);
} }

@ -15,13 +15,13 @@ extern HANDLE io_comport;
#endif #endif
typedef struct { typedef struct {
tai6464 timeout;
unsigned int wantread:1; unsigned int wantread:1;
unsigned int wantwrite:1; unsigned int wantwrite:1;
unsigned int canread:1; unsigned int canread:1;
unsigned int canwrite:1; unsigned int canwrite:1;
unsigned int nonblock:1; unsigned int nonblock:1;
unsigned int inuse:1; unsigned int inuse:1;
tai6464 timeout;
long next_read; long next_read;
long next_write; long next_write;
void* cookie; void* cookie;

Loading…
Cancel
Save