Xyris  0.5
spinner.cpp
Go to the documentation of this file.
1 /**
2  * @file spinner.cpp
3  * @author Keeton Feavel ([email protected])
4  * @brief Kernel spinner task
5  * @version 0.1
6  * @date 2021-06-05
7  *
8  * @copyright Copyright the Xyris Contributors (c) 2021
9  *
10  */
11 #include <Applications/spinner.hpp>
13 
14 namespace Apps {
15 
16 void spinner(void) {
17  Console::printf("\n");
18  int i = 0;
19  const char spinnay[] = { '|', '/', '-', '\\' };
20  while (true) {
21  // Display a spinner to know that we're still running.
22  Console::printf("\e[s\e[24;0f%c\e[u", spinnay[i]);
23  i = (i + 1) % sizeof(spinnay);
24  asm volatile("hlt");
25  }
26 }
27 
28 }
Apps
Definition: animation.cpp:14
console.hpp
Framebuffer console.
Apps::spinner
void spinner(void)
Starts a spinner in an infinite loop.
Definition: spinner.cpp:16
spinner.hpp
Kernel spinner task.
Console::printf
int printf(const char *fmt,...)
Definition: console.cpp:273