Browse Source

Added halt command

Stephen Downward 1 year ago
parent
commit
0a98d7aefc
1 changed files with 8 additions and 2 deletions
  1. 8 2
      util/commands.c

+ 8 - 2
util/commands.c

@ -18,7 +18,13 @@ void clear(char *args) {
18 18
}
19 19
20 20
void change_bg (char *args) {
21
    set_background((args[0] - '0' )* 28, (args[1] - '0') * 28, (args[2] - '0') * 28);
21
    set_background((args[0] - '0' ) * 28, (args[1] - '0') * 28, (args[2] - '0') * 28);
22
}
23
24
void halt_cpu(char *args) {
25
    UNUSED(args);
26
    println("Shutting down the CPU. Goodbye.");
27
    __asm__ __volatile__("hlt");
22 28
}
23 29
24 30
void register_commands() {
@ -26,5 +32,5 @@ void register_commands() {
26 32
    register_command("echo", echo);
27 33
    register_command("clear", clear);
28 34
    register_command("bgc", change_bg);
29
    
35
    register_command("halt", halt_cpu);
30 36
}