]> git.tdb.fi Git - model-railway-devices.git/blobdiff - s88w/s88w-t.c
Drop the pretense of C89, put declarations where they make sense
[model-railway-devices.git] / s88w / s88w-t.c
index 692eac5f6f3e6310c4ba8f8d0fdddb34faf68083..a1ff6aa9f05d467aff9a473f1828a5c3568756d6 100644 (file)
@@ -70,14 +70,13 @@ int main()
 
        while(1)
        {
-               uint8_t i, j;
                uint16_t input = 0;
                uint16_t valid = 0xFFF;
 
-               for(i=0; i<100; ++i)
+               for(uint8_t i=0; i<100; ++i)
                {
                        uint16_t pins = 0;
-                       for(j=0; j<100; ++j)
+                       for(uint8_t j=0; j<100; ++j)
                                pins |= ~((PIND>>2) | ((PINB&0x3F)<<6));
 
                        if(i==0)
@@ -135,13 +134,11 @@ SERIAL_SET_CALLBACK(receive)
 
 void send_state(void)
 {
-       uint8_t i;
-
        serial_write(':');
        serial_write(hexdigit(offset>>8));
        serial_write(hexdigit(offset>>4));
        serial_write(hexdigit(offset|(nibbles-1)));
-       for(i=nibbles; i--;)
+       for(uint8_t i=nibbles; i--;)
                serial_write(hexdigit(state>>(i*4)));
        serial_write('.');