#include #include "init.h" #include "t6963c/t6963c.h" #include "t6963c/terminal.h" static Terminal* term; //unsigned char* string = "me@pic:~$ ls //me@pic:~$ mkdir docs //me@pic:~$ cd docs/ //me@pic:~/docs$ ls //me@pic:~/docs$ touch doc.txt //me@pic:~/docs$ ls //doc.txt //me@pic:~/docs$ cat doc.txt //me@pic:~/docs$ echo hello > doc.txt //me@pic:~/docs$ cat doc.txt //hello //me@pic:~/docs$ cd .. //me@pic:~$ tree -fFi //. //./docs/ //./docs/doc.txt // //1 directory, 1 file //me@pic:~$ rm -r docs/ //"; const static char* string = "[me@pic ~] ls\n" "[me@pic ~] mkdir docs\n" "[me@pic ~] cd docs/\n" "[me@pic docs] ls\n" "[me@pic docs] touch doc.txt\n" "[me@pic docs] ls\n" "doc.txt\n" "[me@pic docs] cat doc.txt\n" "[me@pic docs] echo hello > doc.txt\n" "[me@pic docs] cat doc.txt\n" "hello\n" "[me@pic docs] cd ..\n" "[me@pic ~] tree -fFi\n" ".\n" "./docs/\n" "./docs/doc.txt\n" "\n" "1 directory, 1 file\n" "[me@pic ~] rm -r docs/\n"; void init_terminal(void) { term = terminal.construct(t6963c_rows * t6963c_columns); term->update = t6963c_update_terminal; } void loop_string(void) { unsigned short i, j; unsigned char state = 0; // 0 = quick, 1 = slow for (i = 0; string[i]; i++) { if (!terminal.appendChar(term, string[i])) { terminal.free(term); t6963c_clear(); t6963c_set_address(5,5); t6963c_writeString("ERROR"); while (1); } if (string[i] == ']') { state = 1; terminal.appendChar(term, string[++i]); __delay_ms(800); } else if (string[i] == '\n') { state = 0; } if (state) { __delay_ms(80); } } } int main(void) { init(); init_terminal(); while (1) { loop_string(); } return 0; }