added a temperary buffer when running

This commit is contained in:
2025-10-30 18:05:35 -07:00
parent 0abe4974df
commit 3d755bd9a7
4 changed files with 40 additions and 0 deletions

View File

@@ -1,11 +1,14 @@
#include "term.h"
#include <stdio.h>
unsigned char haveread = 0;
unsigned char __state__ = 0;
char __term_input_buffer__[8] = {' ',' ',' ',' ',' ',' ',' ',' '};
void set_char_push_back(char t) {
char tmp1;
char hold1;
char hold2;
__state__ = __state__ + 1;
hold1 = __term_input_buffer__[0];
for(int i = 0; i < 8 - 1; i++) {
hold2 = __term_input_buffer__[i+1];
@@ -140,6 +143,7 @@ void* input_threaded_func(void* vargp) {
int myid = getpid();
while(1) {
set_char_push_back(term_getch());
usleep(1000);
}
return NULL;
}
@@ -156,6 +160,28 @@ int term_threaded_input_init() {
return 1;
}
unsigned char term_key_pressed() {
if( __state__ > 0 ) {
return 1;
}
return 0;
}
void term_handled_key() {
if( __state__ > 0 ) {
__state__ = 0;
}
}
void term_end_of_key() {
if(__state__ > 0 && haveread > 200) {
//__state__ = 0;
}
}
void term_start_read() {
haveread += 1;
}
#endif