 #include "Adafruit_SSD1306.h"
 
 #define	SERIAL_STATUS_OUTPUT
+#define MEASURE_PREFORMANCE
 
 // #define BUTTON_A		0		// huzzah oled 
 #define BUTTON_B		16		// huzzah oled 

	display.println(display_struct.displaybuffer[3]);
}


//void long_button_press_cb(void *arg) {
//	// TODO
//}
//
//void long_button_press_timer() {
//	os_timer_disarm(&timer_long_button_press);
//	os_timer_setfn(&timer_long_button_press, (os_timer_func_t *)long_button_press_cb, (void *)0);
//	os_timer_arm(&timer_long_button_press, DELAY_MS_TWOSEC, true);
//}


void setup() {
#if !defined(ESP8266)
	while (!Serial) delay(1);

}

void loop() {
#ifdef MEASURE_PREFORMANCE
	int32_t perfStopWatch_getvalues;
	int32_t perfStopWatch_output;
	perfStopWatch_getvalues = micros();
#endif

	check_sensor_updates();
	check_sensor_calc();
	
#ifdef MEASURE_PREFORMANCE
	perfStopWatch_getvalues -= micros();
	perfStopWatch_output = micros();
	perfStopWatch_output -= micros();
#endif

	if (display_struct.update_display) {
		display_struct.update_display = false;
		update_display();
	}
#ifdef MEASURE_PREFORMANCE
	Serial.print("performance us: ");
	Serial.print(-perfStopWatch_getvalues);
	Serial.print(" ");
	Serial.println(-perfStopWatch_output);
#endif
	
	yield();
	display.display();
	yield();

	//// display tab-separated accel/gyro x/y/z values
	//Serial.print("a/g:\t");
