Skip to content
Browse files

BUG FIX: clock didn't show zeros front of <10 values.

  • Loading branch information...
1 parent f88d7de commit a4ec4cb12283479034ad3f4c8d9c37c7011017be @Asido committed Feb 29, 2012
Showing with 19 additions and 4 deletions.
  1. BIN FLOPPY.IMG
  2. +19 −4 kernel32/shell.c
View
BIN FLOPPY.IMG
Binary file not shown.
View
23 kernel32/shell.c
@@ -58,6 +58,23 @@ static void prompt_draw()
color_load();
}
+static void clock_redraw()
+{
+ cursor_save();
+ set_color(SHELL_HEAD_CLR_BG, SHELL_HEAD_CLR_FG);
+ goto_xy(71, 0);
+ if (hw_time.hour < 10)
+ putchar('0');
+ printf("%d:", hw_time.hour);
+ if (hw_time.min < 10)
+ putchar('0');
+ printf("%d:", hw_time.min);
+ if (hw_time.sec < 10)
+ putchar('0');
+ printf("%d", hw_time.sec);
+ cursor_load();
+}
+
/*
* Redraws the header.
*/
@@ -75,9 +92,7 @@ static void header_redraw()
goto_xy(1, 0);
printf("Welcome to AxidOS");
- goto_xy(63, 0);
- printf("day: %d | %d:%d:%d",
- hw_time.day, hw_time.hour, hw_time.min, hw_time.sec);
+ clock_redraw();
cursor_load();
}
@@ -189,7 +204,7 @@ void shell_kbrd_cb(char c)
*/
static void update_time_cb(void *data)
{
- header_redraw();
+ clock_redraw();
}
/*

0 comments on commit a4ec4cb

Please sign in to comment.
Something went wrong with that request. Please try again.