Examples of RTC


Examples of org.jnode.driver.system.cmos.def.RTC

    public static void main(String[] args)
        throws ResourceNotFreeException, NamingException {

        CMOSService cmos = InitialNaming.lookup(CMOSService.NAME);
        RTC rtc = new RTC(cmos);

        for (int i = 0; i < 10; i++) {
            System.out.println("CMOS" + i + "=" + BCDUtils.bcd2bin(cmos.getRegister(i)));
        }

        System.out.println("time=" + rtc.getHours() + ":" + rtc.getMinutes() + ":" + rtc.getSeconds());
        System.out.println("date=" + rtc.getDay() + "-" + rtc.getMonth() + "-" + rtc.getYear());

        int fp = cmos.getRegister(0x10);
        System.out.println("floppy A: " + ((fp >> 4) & 0x0f));
        System.out.println("floppy B: " + (fp & 0x0f));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.