 uint8_t col_i = 0;
 uint8_t row_i = 0;
 volatile uint8_t may_flip = 0;
-int pwm_lengths[] = { 0x30, 0x10, 0x06 }; // PWM cycle lengths
-volatile int pwm_i = 0; // Current PWM cycle
+volatile uint16_t pwm_lengths[] = { 0x30, 0x10, 0x06 }; // PWM cycle lengths
+uint8_t pwm_i = 0; // Current PWM cycle
 
 // Hardware configuration
 #define PIN_COL_BIT0 A2

	pinMode(9, OUTPUT); // OC1A main screen turn on
	pinMode(PIN_ROW_LATCH, OUTPUT);
	pinMode(PIN_COL_LATCH, OUTPUT);

	// Initialize serial and SPI
	Serial.begin(19200);
	SPI.begin();

	// Timer magic
	cli();
	TCCR1A = 0;


inline static void frame_store(uint8_t intensity);
inline static void set_pixel(uint8_t *plane);
static void screen_on(void);
inline static void pick_column(void);

void buf_swap(void) {
	uint8_t (*tmp)[56] = buf_front;
