Skip to content

Commit 03bdad2

Browse files
author
Yuma Arakawa
committed
timer: global_counterを10ミリ秒単位から1ミリ秒単位のカウントへ変更
1 parent 094d5fe commit 03bdad2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/uptime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void uptime_start(void)
99
unsigned int cursor_pos_y;
1010

1111
while (1) {
12-
uptime = syscall(SYSCALL_TIMER_GET_GLOBAL_COUNTER, 0, 0, 0) / 100;
12+
uptime = syscall(SYSCALL_TIMER_GET_GLOBAL_COUNTER, 0, 0, 0) / 1000;
1313
cursor_pos_y = syscall(SYSCALL_CON_GET_CURSOR_POS_Y, 0, 0, 0);
1414
if (cursor_pos_y < ROWS) {
1515
syscall(SYSCALL_CON_PUT_STR_POS, (unsigned int)"uptime:", COLUMNS - (7 + 4), 0);

kernel/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ unsigned int global_counter = 0;
77

88
void do_ir_timer(void)
99
{
10-
global_counter++;
10+
global_counter += TIMER_TICK_MS;
1111
sched_update_wakeupq();
1212
schedule();
1313
}

0 commit comments

Comments
 (0)