mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
101d0fee7c
commit
12c5982e2b
@ -5,37 +5,43 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015 Genode Labs GmbH
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/component.h>
|
||||
#include <base/env.h>
|
||||
#include <base/log.h>
|
||||
#include <base/printf.h>
|
||||
#include <rtc_session/connection.h>
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
struct Main
|
||||
{
|
||||
Genode::printf("--- RTC test started ---\n");
|
||||
Main(Genode::Env &env)
|
||||
{
|
||||
Genode::log("--- RTC test started ---");
|
||||
|
||||
/* open sessions */
|
||||
static Rtc::Connection rtc;
|
||||
static Timer::Connection timer;
|
||||
/* open sessions */
|
||||
Rtc::Connection rtc(env);
|
||||
Timer::Connection timer(env);
|
||||
|
||||
for (unsigned i = 0; i < 4; ++i) {
|
||||
Rtc::Timestamp now = rtc.current_time();
|
||||
for (unsigned i = 0; i < 4; ++i) {
|
||||
Rtc::Timestamp now = rtc.current_time();
|
||||
|
||||
Genode::printf("RTC: %u-%02u-%02u %02u:%02u:%02u\n",
|
||||
now.year, now.month, now.day,
|
||||
now.hour, now.minute, now.second);
|
||||
Genode::printf("RTC: %u-%02u-%02u %02u:%02u:%02u\n",
|
||||
now.year, now.month, now.day,
|
||||
now.hour, now.minute, now.second);
|
||||
|
||||
timer.msleep(1000);
|
||||
timer.msleep(1000);
|
||||
}
|
||||
|
||||
Genode::log("--- RTC test finished ---");
|
||||
|
||||
env.parent().exit(0);
|
||||
}
|
||||
};
|
||||
|
||||
Genode::printf("--- RTC test finished ---\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
void Component::construct(Genode::Env &env) { static Main main(env); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user