 		if (row_i > 6) {
 			row_i = 0;
 			pwm_i++;
-			if (pwm_i >= ARRAY_SIZE(pwm_planes)) {
+			if (pwm_i >= ARRAY_SIZE(pwm_lengths)) {
 				pwm_i = 0;
 				if (may_flip) {
 					buf_swap();
 				}
 			}
 			// Switch to next PWM cycle
-			buf_pwm = buf_front[pwm_planes[pwm_i]];
+			buf_pwm = buf_front[pwm_i];
 		}
 	}
 


void driveDisplay() {
	static int cur_pin = pin_col[0];
	
	// Main screen turn off.
	digitalWrite(cur_pin, HIGH);


	// initialize SPI
	SPI.begin();
	Timer1.initialize(pwm_lengths[0]);
	Timer1.attachInterrupt(driveDisplay);
}

