#ifndef DEFINES_H #define DEFINES_H #define DEBUG 1 #define SKIP_BT_CHECK 1 // #define RTT_MR 0x400E1A30U #define MS(x) x * 1000 #define S(x) MS(x) * 1000 #define OBD2_SLOW_VALUES_QUERY_INTERVAL_MS 5000 #define SCREEN_WIDTH 480 #define SCREEN_HEIGHT 320 #define INIT_TEXT_WIDTH 15 #define INIT_PERCENTAGE_WIDTH 4 #define FLAG_INIT_UPDATE_TEXT_POS 0x01 #define FLAG_INIT_CLEAR_POS 0x02 #define FLAG_INIT_UPDATE_PERCENT_POS 0x03 #define FLAG_DEVICE_LABEL_UPDATE_POS 0x04 #define FLAG_DEVICE_LABEL_SHOULD_UPDATE_POS 0x05 /* 0 if label should be updated, 1 if valyue should be updated */ #define FLAG_DEVICE_LABEL_UPDATE_KB_POS 0x06 /* count KB up */ #define FLAG_INIT_ELM327_DONE_POS 0x07 /* elm327 done initializing */ #define LOGO_MIN_STEP 20 #define LOGO_MAX_POS_Y 124 #define FLAG_LOGO_UPDATE 0x00 #define LOGO_TEXT_WIDTH 16 #define RAM_AMOUNT_KB 96 #define RAM_AMOUNT_B 98304 #define RAM_TEXT_WIDTH 9 #define DEV_LABEL_LENGTH 10 #define COLOR_LIGHT_GRAY 217, 217, 217 /****************************************/ /* x and y positions for several gauges */ /****************************************/ /* box that holds temperature gauges */ #define TEMP_BOX_PADDING 5 #define TEMP_BOX_X_START 300 #define TEMP_BOX_Y_START TEMP_BOX_PADDING #define TEMP_BOX_CONTENT_WIDTH 180 // witdth of the box to calculate the content in it #define TEMP_BOX_WIDTH TEMP_BOX_CONTENT_WIDTH - TEMP_BOX_PADDING // width of the box to draw the outline #define TEMP_BOX_HEIGHT 197 - TEMP_BOX_PADDING #define TEMP_BOX_COLOR VGA_TEAL #define TEMP_BOX_BAR_AMOUNT 4 // amount of bars to display in the temperature box #define TEMP_BOX_BAR_PADDING 2 #define TEMP_BOX_BAR_HEIGHT 24 #define TEMP_BOX_BAR_WIDTH TEMP_BOX_CONTENT_WIDTH - (TEMP_BOX_BAR_PADDING * 4) #define TEMP_BOX_COOLANT_POS 0 #define TEMP_BOX_INTAKE_AIR_POS 1 #define TEMP_BOX_AMBIENT_AIR_POS 2 #define TEMP_BOX_OIL_POS 3 #define TEMP_BOX_CONTENT_X_START TEMP_BOX_X_START + TEMP_BOX_BAR_PADDING #define TEMP_BOX_COOLANT_TEXT_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + (2 * TEMP_BOX_COOLANT_POS * TEMP_BOX_BAR_HEIGHT) #define TEMP_BOX_COOLANT_BAR_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + ((2 * TEMP_BOX_COOLANT_POS * TEMP_BOX_BAR_HEIGHT) + TEMP_BOX_BAR_HEIGHT) #define TEMP_BOX_INTAKE_AIR_TEXT_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + (2 * TEMP_BOX_INTAKE_AIR_POS * TEMP_BOX_BAR_HEIGHT) + 2 #define TEMP_BOX_INTAKE_AIR_BAR_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + (2 * (TEMP_BOX_INTAKE_AIR_POS * TEMP_BOX_BAR_HEIGHT) + TEMP_BOX_BAR_HEIGHT) #define TEMP_BOX_AMBIENT_AIR_TEXT_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + (2 * TEMP_BOX_AMBIENT_AIR_POS * TEMP_BOX_BAR_HEIGHT) + 2 #define TEMP_BOX_AMBIENT_AIR_BAR_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + ((2 * TEMP_BOX_AMBIENT_AIR_POS * TEMP_BOX_BAR_HEIGHT) + TEMP_BOX_BAR_HEIGHT) #define TEMP_BOX_OIL_TEXT_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + (2 * TEMP_BOX_OIL_POS * TEMP_BOX_BAR_HEIGHT) + 2 #define TEMP_BOX_OIL_BAR_Y_START TEMP_BOX_Y_START + TEMP_BOX_BAR_PADDING + ((2 * TEMP_BOX_OIL_POS * TEMP_BOX_BAR_HEIGHT) + TEMP_BOX_BAR_HEIGHT) /* box that holds the engine load */ #define ENGINE_LOAD_BOX_X_START TEMP_BOX_X_START #define ENGINE_LOAD_BOX_Y_START TEMP_BOX_Y_START + TEMP_BOX_HEIGHT + TEMP_BOX_PADDING #define ENGINE_LOAD_BOX_WIDTH TEMP_BOX_WIDTH #define ENGINE_LOAD_BOX_HEIGHT (SCREEN_HEIGHT - TEMP_BOX_HEIGHT - TEMP_BOX_PADDING) #define ENGINE_LOAD_BOX_COLOR VGA_TEAL #endif // !DEFINES_H