Dolda2000 GitWeb
/
kokare.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1eabd7a
)
Set SEGPs immediately.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 5 Jul 2007 00:08:57 +0000
(
00:08
+0000)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 5 Jul 2007 00:08:57 +0000
(
00:08
+0000)
kokare.c
patch
|
blob
|
blame
|
history
diff --git
a/kokare.c
b/kokare.c
index
f3c65b6
..
b81842e
100644
(file)
--- a/
kokare.c
+++ b/
kokare.c
@@
-135,10
+135,10
@@
unsigned char bindisp(unsigned char num)
return(ret);
}
return(ret);
}
-void display(char num)
+void display(char num
, char d0, char d1
)
{
{
- dsp[0] = font[(num / 10) % 10];
- dsp[1] = font[num % 10];
+ dsp[0] = font[(num / 10) % 10]
| (d0?SEGP:0)
;
+ dsp[1] = font[num % 10]
| (d1?SEGP:0)
;
}
void disphex(unsigned char num)
}
void disphex(unsigned char num)
@@
-272,7
+272,7
@@
int main(void)
rstate = 0;
init();
sei();
rstate = 0;
init();
sei();
- display(0);
+ display(0
, 0, 0
);
while(1) {
mnow = getticks();
while(1) {
mnow = getticks();
@@
-289,9
+289,10
@@
int main(void)
if(ktok) {
ktok = 0;
if((tempk >= 273) && (tempk <= 372)) {
if(ktok) {
ktok = 0;
if((tempk >= 273) && (tempk <= 372)) {
- display(tempk - 273);
+ display(tempk - 273
, 0, run
);
} else {
} else {
- dsp[0] = dsp[1] = SEGG;
+ dsp[0] = SEGG;
+ dsp[1] = SEGG | (run?SEGP:0);
}
}
if(pval != 0)
}
}
if(pval != 0)
@@
-303,10
+304,6
@@
int main(void)
else
run = !run;
}
else
run = !run;
}
- if(run)
- dsp[1] |= SEGP;
- else
- dsp[1] &= ~SEGP;
} else if(state == 1) {
/* Temp setting */
if(pval != 0) {
} else if(state == 1) {
/* Temp setting */
if(pval != 0) {
@@
-316,10
+313,12
@@
int main(void)
cur = 0;
if(cur > 100)
cur = 100;
cur = 0;
if(cur > 100)
cur = 100;
- if(cur < 100)
- display(cur);
- else
- dsp[0] = dsp[1] = SEGG;
+ if(cur < 100) {
+ display(cur, 0, run);
+ } else {
+ dsp[0] = SEGG;
+ dsp[1] = SEGG | (run?SEGP:0);
+ }
utime = mnow;
}
if(mnow - utime > 1000000)
utime = mnow;
}
if(mnow - utime > 1000000)
@@
-331,12
+330,9
@@
int main(void)
} else if(state == 2) {
/* Display raw temp time reading */
if(ttimea < 20000) {
} else if(state == 2) {
/* Display raw temp time reading */
if(ttimea < 20000) {
- display((ttimea / 100) % 100);
- dsp[0] |= SEGP;
- if(ttimea >= 10000)
- dsp[1] |= SEGP;
+ display((ttimea / 100) % 100, 1, ttimea >= 10000);
} else {
} else {
- display(ttimea / 1000);
+ display(ttimea / 1000
, 0, 0
);
}
if(sstate == 2) {
state = 0;
}
if(sstate == 2) {
state = 0;