update_status();
print_freq(1);
_HOME();
- do {
- n = pollkeys(pollkeybuf, 19, 1);
- } while(n == 0);
- c = pollkeybuf[0];
+ c = pollkey_single_timeout(44, 1); // About 1s
switch(c) {
case charcode_8: // UP CH
setup.memorynum++;
default:
break;
}
-// _HOME();
- _HOME();
+// _HOME();
} while(1);
_l0:
_CLS();
#
-#Fri Aug 23 00:59:05 JST 2013
+#Fri Aug 23 01:38:06 JST 2013
default.languagetoolchain.dir=/opt/microchip/xc8/v1.20/bin
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=1c49f19f6a43b876c317e0d8d41c0854
default.languagetoolchain.version=1.20
cold = c;
return c;
}
+ penalty = 0;
+ } else {
+ penalty++;
+ if(penalty > 4) {
+ penalty = 0;
+ cold = charcode_null; // About 100ms
+ }
}
- penalty++;
- if(penalty > 65) cold = charcode_null; // About 1500ms
} while(1);
}
{
unsigned char c;
unsigned int ticks = 0;
+ unsigned char penalty = 0;
+ unsigned char count = 0;
-// cold = charcode_null;
+ cold = charcode_null;
+ pollkeybuf[0] = charcode_null;
do {
+ if(limit != 0) {
+ ticks++;
+ if(ticks > limit) {
+ break;
+ }
+ }
idle_time_ms(5); // 5ms.
c = readkey(); // 2 * 9 = 18ms
ClrWdt();
ticks++;
- if(c != charcode_null) {
- if(repeat != 0){
+ if(c != charcode_null){
+ if(cold != c) {
+ pollkeybuf[count++] = c;
cold = c;
- break;
- } else {
- if(cold != c) {
- cold = c;
- break;
+ count++;
+ if(repeat == 0) {
+ break;
}
+ penalty = 0;
}
- }
- if(limit != 0) {
- ticks++;
- if(ticks > limit) {
+ } else {
+ penalty++;
+ if(penalty > 4){
+ penalty = 0;
cold = charcode_null;
- return charcode_null;
}
}
- } while(1);
+ } while(count < 32);
/*
* Set Deadzone.
*/
if(limit == 0) {
-// if(ticks >= (limit >> 1)) cold = charcode_null;
while(ticks <= limit) {
idle_time_ms(5 + 18);
ticks++;
}
}
+ c = pollkeybuf[0];
return c;
}
/*