X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=s88w%2Fs88w-t.c;h=a1ff6aa9f05d467aff9a473f1828a5c3568756d6;hb=49c7ae4a26f8dd7d09872b6b5e4c107ef33b4560;hp=692eac5f6f3e6310c4ba8f8d0fdddb34faf68083;hpb=9c37d18b9c70fdb70dfec453398c4649e9e57586;p=model-railway-devices.git diff --git a/s88w/s88w-t.c b/s88w/s88w-t.c index 692eac5..a1ff6aa 100644 --- a/s88w/s88w-t.c +++ b/s88w/s88w-t.c @@ -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('.');