for schleife
-
for (i=0;i<ULM;i++) { if (i & 0x0001) { Upload[i] = Upload[i] | 0x0001; Upload[i] = Upload & ~(0x0002); } else { Upload[i] =Upload[i] & ~(0x0001); Upload[i] = Upload[i] | 0x0002; } }
Hallo..Hat jemand eine Idee, was es bedeuten kann??
-
Bei jedem geraden Index werden in
Upload[i]
die niederwertigsten Bits auf 10 gesetzt, bei jedem ungeraden Index auf 01. Wenn man den Fehler beseitigt, es fehlt einmal das[i]
.
-
for (i=0;i<ULM;i++) { if (i & 0x0001) //bei ungeraden Indizes... { Upload[i] = Upload[i] | 0x0001; //setze LSB... Upload[i] = Upload[i] & ~(0x0002); //...und loesche LSB + 1 } else //bei geraden Indizes { Upload[i] =Upload[i] & ~(0x0001); //loesche LSB Upload[i] = Upload[i] | 0x0002; //und setze LSB + 1 } }
Der Sinn ist abhängig vom Kontext. Den sieht man hier aber nicht.
-
Das wäre einfacher zu haben als
for (i=0;i<ULM;i++) { Upload[i] = Upload[i] & ~3 | (2 - i % 2); }