[LinuxBIOS] Convert hex to dec

Indrek Kruusa indrek.kruusa at artecdesign.ee
Mon Jul 9 08:43:49 CEST 2007


Ühel kenal päeval (laupäev 07 juuli 2007 1:59 am) kirjutas Joseph Smith:
> Quoting Stefan Reinauer <stepan at coresystems.de>:
> > * Joseph Smith <joe at smittys.pointclark.net> [070706 17:41]:
> >> #define PRINT_DEBUG_DEC(d)
> >>
> >> value=0xff; /* hexadecimal */
> >>
> >> print_debug("value in decimal is now ");
> >> PRINT_DEBUG_DEC(value);
> >> print_debug(" Is this working?\r\n");
> >
> > Since it seems to be for debug only, you can also use
> > print_debug_hex8
> > print_debug_hex16
> > print_debug_hex32
> >
> > Stefan
>
> But that is the whole problem. I already says "print_debug_hex8". I
> want it to display decimal not hex.....

/* Print CPU clock */

        p3 = cpu_clk / 100;
        p2 = (cpu_clk - p3 * 100)/10;
        p1 = cpu_clk - p3 * 100 - p2*10;

        print_info("CPU ");
        print_info_char(48+p3);
        print_info_char(48+p2);
        print_info_char(48+p1);
        print_info(" MHz\r\n");

:)

cheers,
Indrek




More information about the coreboot mailing list