Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yhzhang0128 committed Apr 3, 2022
1 parent 57b1f56 commit 7891201
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/system/sys_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main() {
int home = dir_lookup(0, "home");
grass->work_dir_ino = dir_lookup(home, "yunhao");
INFO("sys_shell: %s has ino=%d", work_dir, grass->work_dir_ino);
HIGHLIGHT("Welcome to egos-riscv!");
CRITICAL("Welcome to egos-riscv!");

/* Wait for shell commands */
while (1) {
Expand Down
2 changes: 1 addition & 1 deletion earth/dev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int disk_write(int block_no, int nblocks, char* src) {
}

void disk_init() {
HIGHLIGHT("Choose a disk:");
CRITICAL("Choose a disk:");
printf(" Enter 0: use the microSD card\r\n");
printf(" Enter 1: use the on-board flash ROM @0x20800000\r\n");

Expand Down
4 changes: 2 additions & 2 deletions earth/dev_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ int tty_success(const char *format, ...)
printf("%s\r\n", "\x1B[1;0m");
}

int tty_highlight(const char *format, ...)
int tty_critical(const char *format, ...)
{
printf("%s[HIGHLIGHT] ", "\x1B[1;33m");
printf("%s[CRITICAL] ", "\x1B[1;33m");
VPRINTF
printf("%s\r\n", "\x1B[1;0m");
}
2 changes: 1 addition & 1 deletion earth/earth.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void earth_init() {
earth->tty_info = tty_info;
earth->tty_fatal = tty_fatal;
earth->tty_success = tty_success;
earth->tty_highlight = tty_highlight;
earth->tty_critical = tty_critical;

INFO("-----------------------------------");
INFO("Start to initialize the earth layer");
Expand Down
2 changes: 1 addition & 1 deletion earth/earth.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ int tty_printf(const char *format, ...);
int tty_info(const char *format, ...);
int tty_fatal(const char *format, ...);
int tty_success(const char *format, ...);
int tty_highlight(const char *format, ...);
int tty_critical(const char *format, ...);
6 changes: 3 additions & 3 deletions library/egos.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct earth {
int (*tty_info)(const char *format, ...);
int (*tty_fatal)(const char *format, ...);
int (*tty_success)(const char *format, ...);
int (*tty_highlight)(const char *format, ...);
int (*tty_critical)(const char *format, ...);
};

struct grass {
Expand All @@ -36,8 +36,8 @@ struct grass {

extern struct earth *earth;

#define printf earth->tty_printf
#define INFO earth->tty_info
#define FATAL earth->tty_fatal
#define SUCCESS earth->tty_success
#define HIGHLIGHT earth->tty_highlight
#define printf earth->tty_printf
#define CRITICAL earth->tty_critical

0 comments on commit 7891201

Please sign in to comment.