]> git.gag.com Git - fw/sdcc/commitdiff
updated examples for integer promotion in vararg funcs (printf)
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 6 Feb 2001 10:49:40 +0000 (10:49 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 6 Feb 2001 10:49:40 +0000 (10:49 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@589 4a8a32a2-be11-0410-ad9d-d568d2c75423

device/examples/ds390/i2c390/i2c390.c
device/examples/ds390/readmac/readmac.c
device/examples/ds390/rtc390/rtc390.c

index 7bd00d377d57939c9939ea358337a2b9e6d516ea..ecdbf8931a368a12d3a6422e6fc0d24a01c7a5fa 100644 (file)
@@ -7,7 +7,7 @@
 void main (void) {
 
   while(1) {
-    printf ("% 5.2f %03bu %03bu %03bu %03bu\n\r", 
+    printf ("% 5.2f %03u %03u %03u %03u\n\r", 
            ReadDS1621(2),
            ReadPCF8591(0,0), 
            ReadPCF8591(0,1), 
index becf2294c446903ac29e776cedc604c86f467382..be3b207c20b7552d4d0583f72c14240833fcc325 100644 (file)
@@ -40,7 +40,7 @@ void main(void)
                    owSerialNum(serial, 1);
        
            #ifdef NOISY
-                   printf("found 1-wire device: %02bx%02bx%02bx%02bx%02bx%02bx%02bx%02bx\n",
+                   printf("found 1-wire device: %02x%02x%02x%02x%02x%02x%02x%02x\n",
                           serial[0], serial[1], serial[2], serial[3],
                           serial[4], serial[5], serial[6], serial[7]);
            #endif
@@ -57,7 +57,7 @@ void main(void)
     
    if (!rc)
    {
-               printf("DS2502 located (ID %02bx%02bx%02bx%02bx%02bx%02bx%02bx%02bx).\n",
+               printf("DS2502 located (ID %02x%02x%02x%02x%02x%02x%02x%02x).\n",
                           serial[0], serial[1], serial[2], serial[3],
                           serial[4], serial[5], serial[6], serial[7]);       
         /* Build command packet. */
@@ -74,7 +74,7 @@ void main(void)
         myCRC = docrc8(myCRC, serial[3]);
        if (myCRC != serial[4])
        {
-           printf("read failed: bogus CRC: %bx != %bx\n", myCRC, serial[4]);
+           printf("read failed: bogus CRC: %x != %x\n", myCRC, serial[4]);
            rc = 1;
        }
     }
@@ -91,7 +91,7 @@ void main(void)
        printf("DS2502 memory: ");
        for (i = 0; i < 32; i++)
         {
-           printf("%02bx ", serial[i]);
+           printf("%02x ", serial[i]);
         }       
         printf("\n");
        #endif
@@ -105,7 +105,7 @@ void main(void)
            }
        }
        
-       printf("MAC address: %02bx%02bx%02bx%02bx%02bx%02bx\n",
+       printf("MAC address: %02x%02x%02x%02x%02x%02x\n",
                mac[0], mac[1], mac[2],
                mac[3], mac[4], mac[5]);
        owTouchReset();
index 11e6be36fd46d5c2d78c7269c2f5c0c31912a3a9..da5b866fece152267a9ddb2b808d94bd907ea287 100755 (executable)
@@ -58,7 +58,7 @@ char GetTime(struct RTCDate *rtcDate) {
 }
 
 void PrintTime(struct RTCDate *rtcDate) {
-  printf ("%04d-%02bd-%02bd %02bd:%02bd:%02bd.%02bd\n", 
+  printf ("%04d-%02d-%02d %02d:%02d:%02d.%02d\n", 
          rtcDate->year, rtcDate->month, rtcDate->day,
          rtcDate->hour, rtcDate->minute, rtcDate->second,
          rtcDate->hundredth);
@@ -84,9 +84,9 @@ void main (void) {
 #endif    
 
 #ifdef USE_LCD
-    LcdLPrintf (2,"%04d-%02bd-%02bd",
+    LcdLPrintf (2,"%04d-%02d-%02d",
                rtcDate.year, rtcDate.month, rtcDate.day);
-    LcdLPrintf (3, "%02bd:%02bd:%02bd.%02bd", 
+    LcdLPrintf (3, "%02d:%02d:%02d.%02d", 
                rtcDate.hour, rtcDate.minute, rtcDate.second,
                rtcDate.hundredth);
 #endif