réplica de
https://github.com/Arnau478/quark.git
synced 2024-05-20 04:46:30 +02:00
Arnau Camprubí
109b5b17a1
The debug_printf() function works just as any printf-like function. It prints to the serial port using ANSI coloring. Also, debug_vprintf() was implemented, which takes arguments as a va_list instead of as variadic arguments.
30 líneas
587 B
C
30 líneas
587 B
C
#include "shell.h"
|
|
#include "lib/stdio.h"
|
|
#include "lib/string.h"
|
|
#include "lib/memory.h"
|
|
|
|
int shell_run(char *cmd){
|
|
int ret = 0;
|
|
|
|
puts("\x1b[32m");
|
|
if(!strcmp(cmd, "hello")){
|
|
printf("Hello!\n");
|
|
}
|
|
else if(!strcmp(cmd, "version")){
|
|
printf("%s\n", OS_VERSION);
|
|
}
|
|
else if(!strcmp(cmd, "clear")){
|
|
clear_screen();
|
|
}
|
|
else if(!strcmp(cmd, "serial")){
|
|
serial_printf("Hello world!\n");
|
|
}
|
|
else{
|
|
printf("SHELL: Unknown command \"%s\"\n", cmd);
|
|
ret = 127;
|
|
}
|
|
puts("\x1b[0m");
|
|
|
|
return ret;
|
|
}
|