Aaah, jetzt dämmert's mir. Danke @markusj. Die Farbigkeit des Codes habe ich immer als Feature der Forumsoftware angesehen. Ist aber nicht so! Sondern lag daran, dass ich den Code direkt aus Eclipse cut&paste! Dadurch kommt das syntaxcoloring von Eclipse mit ins Forum. Wenn ich das nicht tue (siehe Test unten) bleibt es schwarz/weiß. Und ... siehe da, mein indent Problem ist auch weg.
Code:typedef uint16_t Frame_t[9]; typedef struct { uint16_t NumberOfFrames; // Anzahl der Frames Frame_t * PointerToAnimation; // Pointer zum FrameArray } Animationen_t; PROGMEM Frame_t animation1[] ={{0,2,3,4,5,6,7,8,9}, {1,2,3,4,5,6,7,8,9}}; PROGMEM Frame_t animation2[]={{3,2,3,4,5,6,7,8,9}}; PROGMEM Animationen_t animations[] = {{2, animation1}, {1, animation2}}; int main(void) { int i, j, k; for (i = 0; i < sizeof(animations)/sizeof(Animationen_t); i++) { for (j = 0; j < pgm_read_word(&animations[i].NumberOfFrames); j++) { Frame_t * frame = pgm_read_word(&animations[i].PointerToAnimation); for (k = 0; k < 9; k++) { uint16_t frameWord = pgm_read_word(&frame[j][k]); //printf("%d, ", frameWord); } } } }







Zitieren

Lesezeichen