Exemplo n.º 1
0
void do_menu_item(uint8_t menuitem, int8_t *values, uint8_t mult, menu_range_t range, int8_t offset, uint8_t text_link, bool servo_enable, int16_t servo_number)
{
	mugui_size16_t size;
	int16_t temp16;
	int8_t i;
	int16_t value = (int8_t)*values;
	uint8_t display_update = 0;
	uint8_t servo_update = 0;
	uint8_t button_update = 0;
	uint8_t button_inc = 0;
	bool	button_lock = false;
	bool	first_time = true;

	// Multiply value for display only if style is 2
	if (range.style == 2)
	{
		value = value * mult;
	}
	else mult = 1;

	button = NONE;

	// Reset servo to neutral unless it is for the throttle channel in CPPM mode
	if (servo_enable && !((Config.Channel[servo_number].source_a == THROTTLE) && (Config.RxMode == CPPM_MODE)))
	{
		temp16 = Config.Limits[servo_number].trim;
		temp16 = ((temp16 << 2) / 10); 		// Span back to what the output wants

		// Give servos time to settle
		for (i = 0; i < 25; i++)
		{
			cli();
			output_servo_ppm_asm3(servo_number, temp16);
			sei();

			_delay_ms(10);
		}
	}

	// This is a loop that cycles until Button 4 is pressed (Save)
	// The GLCD updating slows servo updates down too much so only update the GLCD periodically
	// When not updating the GLCD the servo should be updated at 50Hz (20ms)
	while (button != ENTER)
	{
		// Increment loopcount so that we can time various things
		display_update++;
		servo_update++;

		// Vary the button increment delay depending on the function
		if (servo_enable)
		{
			button_inc = 20; // For servos

		}
		else
		{
			button_inc = 1;	// For everything else
		}

		// Increment button timer when pressed
		if (button != NONE)
		{
			button_update++;

			// Release button lock after button_inc loops
			if (button_update > button_inc)
			{
				button_lock = false;
				button_update = 0;
			} 
		}
		// Remove lock when not pressed
		else 
		{
			button_update = 0;
			button_lock = false;
		}

		// Display update
		if 	(!servo_enable || 									// Non-servo value or
			((display_update >= 32) && (button != NONE)) || 	// Servo value and 32 cycles passed but only with a button pressed or...
			 (first_time))										// First time into routine
		{
			display_update = 0;
			first_time = false;

			clear_buffer(buffer);

			// Print title
			gLCDprint_Menu_P((char*)pgm_read_word(&text_menu[menuitem]), (prog_uchar*)Verdana14, 0, 0);

			// Print value
			if ((range.style == 0) || (range.style == 2)) // numeric and numeric * 4
			{
				// Write numeric value, centered on screen
				mugui_text_sizestring(itoa(value,pBuffer,10), (prog_uchar*)Verdana14, &size);
				mugui_lcd_puts(itoa(value,pBuffer,10),(prog_uchar*)Verdana14,((128-size.x)/2)+offset,25);
			}
			else // text
			{
				// Write text, centered on screen
				pgm_mugui_scopy((char*)pgm_read_word(&text_menu[text_link + value])); // Copy string to pBuffer

				mugui_text_sizestring((char*)pBuffer, (prog_uchar*)Verdana14, &size);
				LCD_Display_Text(text_link + value, (prog_uchar*)Verdana14,((128-size.x)/2),25);
			}

			// Print bottom markers
			print_menu_frame(1);

			// Write from buffer
			write_buffer(buffer,1);
		}

		// Poll buttons when idle
		// Don't use button acceleration when moving servos
		// And don't block the code with poll_buttons()
		if (servo_enable)
		{
			button = (PINB & 0xf0);	
			button_multiplier = 1;
		}
		else
		{
			poll_buttons(true);
		}

		// Handle cursor Up/Down limits
		if (button == DOWN)
		{
			if (button_lock == false)
			{
				button_lock = true;
				value = value - (range.increment * button_multiplier);
				button_update = 0;
			}
		}

		if (button == UP)
		{
			if (button_lock == false)
			{
				button_lock = true;
				value = value + (range.increment * button_multiplier);
				button_update = 0;
			}
		}

		if (button == BACK)	
		{
			value = (range.default_value * mult);
		}

		// Limit values to set ranges
		if (value < (range.lower * mult)) 
		{
			value = range.lower * mult;
		}
		
		if (value > (range.upper * mult)) 
		{
			value = range.upper * mult;
		}

		// Update contrast setting
		if (menuitem == CONTRAST)
		{
			st7565_set_brightness(value); // debug
		}

		// Set servo position if required and update every 4 * 5ms = 20ms
		if ((servo_enable) && (servo_update >= 4))
		{
			servo_update = 0;

			temp16 = scale_percent(value);	// Convert to servo position (from %)
			temp16 = (((temp16 << 2) + (int16_t)5) / (int16_t)10); 	// Span back to what the output wants

			cli();
			output_servo_ppm_asm3(servo_number, temp16);
			sei();
		}

		// Loop rate = 5ms (200Hz)
		_delay_ms(5);

	} // while (button != ENTER)


	// Exit
	button = ENTER;

	// Divide value from that displayed if style = 2
	if (range.style == 2)
	{
		value = value / mult;
	}

	*values = (int8_t)value;
}
Exemplo n.º 2
0
void Display_status(void)
{
	int16_t temp, range, scale;
	uint16_t vbat_temp;
	int8_t	pos1, pos2, pos3;
	mugui_size16_t size;

	clear_buffer(buffer);

	// Display text
	LCD_Display_Text(4,(const unsigned char*)Verdana8,0,0); 	// Preset
	LCD_Display_Text(3,(const unsigned char*)Verdana8,0,11); 	// Version text
	LCD_Display_Text(138,(const unsigned char*)Verdana8,0,22); 	// RX sync
	LCD_Display_Text(139,(const unsigned char*)Verdana8,0,33); 	// RX sync
	LCD_Display_Text(6,(const unsigned char*)Verdana8,0,44); 	// Profile

	// Display menu and markers
	LCD_Display_Text(9, (const unsigned char*)Wingdings, 0, 59);// Down
	LCD_Display_Text(14,(const unsigned char*)Verdana8,10,55);	// Menu

	// Display values
	print_menu_text(0, 1, (22 + Config.MixMode), 45, 0);
	print_menu_text(0, 1, (48 + Config.RxModeIn), 45, 22);
	print_menu_text(0, 1, (48 + Config.RxModeOut), 45, 33);
	mugui_lcd_puts(itoa((Config.Flight + 1),pBuffer,10),(const unsigned char*)Verdana8,45,44);
	
	// Draw battery
	drawrect(buffer, 100,4, 28, 50, 1);					// Battery body
	drawrect(buffer, 110,0, 8, 5, 1);					// Battery terminal

	vbat_temp = GetVbat();

	// Calculate battery voltage limits
	range = SystemVoltage - Config.PowerTriggerActual;
	scale = range / 50;

	// Look out for that divide-by-zero... :)
	if ((vbat_temp >= Config.PowerTriggerActual) && (scale > 0))
	{
		temp = (vbat_temp - Config.PowerTriggerActual) / scale;
	}
	else
	{
		temp = 0;
	}

	if (temp > 50) temp = 50;

	fillrect(buffer, 100,54-temp, 28, temp, 1);				// Battery filler (max is 60)

	// Display voltage
	uint8_t x_loc = 102;	// X location of voltage display
	uint8_t y_loc = 55;		// Y location of voltage display

	temp = vbat_temp/100;	// Display whole decimal part first
	mugui_text_sizestring(itoa(temp,pBuffer,10), (const unsigned char*)Verdana8, &size);
	mugui_lcd_puts(itoa(temp,pBuffer,10),(const unsigned char*)Verdana8,x_loc,y_loc);
	pos1 = size.x;

	vbat_temp = vbat_temp - (temp * 100); // Now display the parts to the right of the decimal point

	LCD_Display_Text(7,(const unsigned char*)Verdana8,(x_loc + pos1),y_loc);
	mugui_text_sizestring(".", (const unsigned char*)Verdana8, &size);
	pos3 = size.x;
	mugui_text_sizestring("0", (const unsigned char*)Verdana8, &size);
	pos2 = size.x;

	if (vbat_temp >= 10)
	{
		mugui_lcd_puts(itoa(vbat_temp,pBuffer,10),(const unsigned char*)Verdana8,(x_loc + pos1 + pos3),y_loc);
	}
	else
	{
		LCD_Display_Text(8,(const unsigned char*)Verdana8,(x_loc + pos1 + pos3),y_loc);
		mugui_lcd_puts(itoa(vbat_temp,pBuffer,10),(const unsigned char*)Verdana8,(x_loc + pos1 + pos2 + pos3),y_loc);
	}

	// Draw error messages, if any
	if ((General_error != 0) || (Flight_flags & (1 << FailsafeFlag)))
	{
		// Create message box
		fillrect(buffer, 14,8, 96, 48, 0);	// White box
		drawrect(buffer, 14,8, 96, 48, 1); 	// Outline

		// Prioritise error from top to bottom
		if (General_error & (1 << LVA_ALARM))
		{
			LCD_Display_Text(134,(const unsigned char*)Verdana14,33,14); // Battery
			LCD_Display_Text(119,(const unsigned char*)Verdana14,46,34); // Low
		}
		else if (Flight_flags & (1 << FailsafeFlag))
		{
			LCD_Display_Text(75,(const unsigned char*)Verdana14,51,13); // No
			LCD_Display_Text(76,(const unsigned char*)Verdana14,39,33); // Signal
		}
		else if (General_error & (1 << THROTTLE_HIGH))
		{
			LCD_Display_Text(105,(const unsigned char*)Verdana14,28,14); // Throttle
			LCD_Display_Text(121,(const unsigned char*)Verdana14,46,34); // High
		}
	}

	// Write buffer to complete
	write_buffer(buffer);
	clear_buffer(buffer);
}
Exemplo n.º 3
0
void Display_status(void)
{
	int16_t temp, min, max, range, scale;
	int8_t	pos1, pos2, pos3;
	mugui_size16_t size;

	clear_buffer(buffer);

	// Display text
	LCD_Display_Text(4,(prog_uchar*)Verdana8,0,0); 		// Mode
	LCD_Display_Text(3,(prog_uchar*)Verdana8,0,11); 	// Version text
	LCD_Display_Text(5,(prog_uchar*)Verdana8,0,22); 	// Input
	LCD_Display_Text(46,(prog_uchar*)Verdana8,0,33); 	// Stability
	LCD_Display_Text(47,(prog_uchar*)Verdana8,0,44); 	// Autolevel

	// Display menu and markers
	LCD_Display_Text(9, (prog_uchar*)Wingdings, 0, 59);	// Down
	LCD_Display_Text(14,(prog_uchar*)Verdana8,10,55);	// Menu

	// Display values
	print_menu_text(0, 1, (18 + Config.RxMode), 50, 22);
	LCD_Display_Text(0,(prog_uchar*)Verdana8,50,11); 
	print_menu_text(0, 1, (22 + Config.MixMode), 33, 0);
	print_menu_text(0, 1, (101 + Stability), 50, 44);
	print_menu_text(0, 1, (101 + AutoLevel), 50, 33);

	// Draw battery
	drawrect(buffer, 100,4, 28, 50, 1);					// Battery body
	drawrect(buffer, 110,0, 8, 4, 1);					// Battery terminal

	GetVbat();

	min = Config.MinVoltage * Config.BatteryCells;		// Calculate battery voltage limits
	max = Config.MaxVoltage * Config.BatteryCells;
	range = max - min;
	scale = range / 50;

	if (vBat >= min) 
	{
		temp =(vBat - min) / scale;
	}
	else
	{
		temp = 0;
	}
	if (temp <= 0) temp = 0;
	if (temp > 50) temp = 50;

	fillrect(buffer, 100,54-temp, 28, temp, 1);				// Battery filler (max is 60)

	// Display voltage
	uint8_t x_loc = 102;	// X location of voltage display
	uint8_t y_loc = 55;		// Y location of voltage display

	temp = vBat/100;		// Display whole decimal part first
	mugui_text_sizestring(itoa(temp,pBuffer,10), (prog_uchar*)Verdana8, &size);
	mugui_lcd_puts(itoa(temp,pBuffer,10),(prog_uchar*)Verdana8,x_loc,y_loc);
	pos1 = size.x;

	vBat = vBat - (temp * 100); // Now display the parts to the right of the decimal point

	LCD_Display_Text(7,(prog_uchar*)Verdana8,(x_loc + pos1),y_loc);
	mugui_text_sizestring(".", (prog_uchar*)Verdana8, &size);
	pos3 = size.x;
	mugui_text_sizestring("0", (prog_uchar*)Verdana8, &size);
	pos2 = size.x;

	if (vBat >= 10)
	{
		mugui_lcd_puts(itoa(vBat,pBuffer,10),(prog_uchar*)Verdana8,(x_loc + pos1 + pos3),y_loc);
	}
	else
	{
		LCD_Display_Text(8,(prog_uchar*)Verdana8,(x_loc + pos1 + pos3),y_loc);
		mugui_lcd_puts(itoa(vBat,pBuffer,10),(prog_uchar*)Verdana8,(x_loc + pos1 + pos2 + pos3),y_loc);
	}

	// Draw error messages, if any
	if (General_error != 0)
	{
		// Create message box
		fillrect(buffer, 14,8, 96, 48, 0);	// White box
		drawrect(buffer, 14,8, 96, 48, 1); 	// Outline

		// Prioritise error from top to bottom
		if((General_error & (1 << SENSOR_ERROR)) != 0)
		{
			LCD_Display_Text(72,(prog_uchar*)Verdana14,35,14); // Sensor
			LCD_Display_Text(98,(prog_uchar*)Verdana14,43,34); // Error
			menu_beep(9);
		}
		else if((General_error & (1 << LOW_BATT)) != 0)
		{
			LCD_Display_Text(82,(prog_uchar*)Verdana14,33,14); 	// Battery
			LCD_Display_Text(119,(prog_uchar*)Verdana14,46,34); // Low
		}
		else if((General_error & (1 << NO_SIGNAL)) != 0)
		{
			LCD_Display_Text(75,(prog_uchar*)Verdana14,51,13); 	// No
			LCD_Display_Text(76,(prog_uchar*)Verdana14,39,33);  // Signal
			menu_beep(3);
		}
		else if((General_error & (1 << LOST_MODEL)) != 0)
		{
			LCD_Display_Text(99,(prog_uchar*)Verdana14,45,14); // Lost
			LCD_Display_Text(100,(prog_uchar*)Verdana14,40,34);// Model
		}
		else if((General_error & (1 << THROTTLE_HIGH)) != 0)
		{
			LCD_Display_Text(105,(prog_uchar*)Verdana14,28,14); // Throttle
			LCD_Display_Text(120,(prog_uchar*)Verdana14,46,34);	// High
			menu_beep(6);
		}
	}

	// Write buffer to complete
	write_buffer(buffer,1);
	clear_buffer(buffer);
}
Exemplo n.º 4
0
void Display_status(void)
{
    int16_t temp;
    uint16_t vbat_temp;
    int8_t	pos1, pos2, pos3;
    mugui_size16_t size;

    clear_buffer(buffer);

    // Display text
    LCD_Display_Text(3,(const unsigned char*)Verdana8,0,0); 		// Version text
    LCD_Display_Text(5,(const unsigned char*)Verdana8,0,16); 	// RX sync
    LCD_Display_Text(6,(const unsigned char*)Verdana8,0,27); 	// Profile
    LCD_Display_Text(23,(const unsigned char*)Verdana8,88,27); 	// Pos
    LCD_Display_Text(133,(const unsigned char*)Verdana8,0,38); 	// Battery

    // Display menu and markers
    LCD_Display_Text(9, (const unsigned char*)Wingdings, 0, 59);	// Down
    LCD_Display_Text(14,(const unsigned char*)Verdana8,10,55);	// Menu

    // Display values
    print_menu_text(0, 1, (62 + Config.RxMode), 45, 16); // Rx mode
    mugui_lcd_puts(itoa(transition,pBuffer,10),(const unsigned char*)Verdana8,110,27); // Raw transition value

    if (Config.RxMode == PWM)
    {
        LCD_Display_Text(24,(const unsigned char*)Verdana8,77,38); // Interrupt counter text
        mugui_lcd_puts(itoa(InterruptCount,pBuffer,10),(const unsigned char*)Verdana8,110,38); // Interrupt counter
    }

    // Display transition point
    if (transition <= 0)
    {
        LCD_Display_Text(48,(const unsigned char*)Verdana8,45,27);
    }
    else if (transition >= 100)
    {
        LCD_Display_Text(50,(const unsigned char*)Verdana8,45,27);
    }
    else if (transition == Config.Transition_P1n)
    {
        LCD_Display_Text(49,(const unsigned char*)Verdana8,45,27);
    }
    else if (transition < Config.Transition_P1n)
    {
        LCD_Display_Text(51,(const unsigned char*)Verdana8,45,27);
    }
    else if (transition > Config.Transition_P1n)
    {
        LCD_Display_Text(52,(const unsigned char*)Verdana8,45,27);
    }

    // Display voltage
    uint8_t x_loc = 45;		// X location of voltage display
    uint8_t y_loc = 38;		// Y location of voltage display

    vbat_temp = GetVbat();
    temp = vbat_temp/100;	// Display whole decimal part first
    mugui_text_sizestring(itoa(temp,pBuffer,10), (const unsigned char*)Verdana8, &size);
    mugui_lcd_puts(itoa(temp,pBuffer,10),(const unsigned char*)Verdana8,x_loc,y_loc);
    pos1 = size.x;

    vbat_temp = vbat_temp - (temp * 100); // Now display the parts to the right of the decimal point

    LCD_Display_Text(7,(const unsigned char*)Verdana8,(x_loc + pos1),y_loc);
    mugui_text_sizestring(".", (const unsigned char*)Verdana8, &size);
    pos3 = size.x;
    mugui_text_sizestring("0", (const unsigned char*)Verdana8, &size);
    pos2 = size.x;

    if (vbat_temp >= 10)
    {
        mugui_lcd_puts(itoa(vbat_temp,pBuffer,10),(const unsigned char*)Verdana8,(x_loc + pos1 + pos3),y_loc);
    }
    else
    {
        LCD_Display_Text(8,(const unsigned char*)Verdana8,(x_loc + pos1 + pos3),y_loc);
        mugui_lcd_puts(itoa(vbat_temp,pBuffer,10),(const unsigned char*)Verdana8,(x_loc + pos1 + pos2 + pos3),y_loc);
    }

    // Display error messages
    if (General_error != 0)
    {
        // Create message box
        fillrect(buffer, 14,8, 96, 48, 0);	// White box
        drawrect(buffer, 14,8, 96, 48, 1); 	// Outline

        // Prioritise error from top to bottom
        if((General_error & (1 << LVA_ALARM)) != 0)
        {
            LCD_Display_Text(134,(const unsigned char*)Verdana14,33,14); // Battery
            LCD_Display_Text(73,(const unsigned char*)Verdana14,46,34); 	// Low
        }
        else if((General_error & (1 << NO_SIGNAL)) != 0)
        {
            LCD_Display_Text(75,(const unsigned char*)Verdana14,51,13); 	// No
            LCD_Display_Text(76,(const unsigned char*)Verdana14,39,33);  // Signal
        }
        else if((General_error & (1 << THROTTLE_HIGH)) != 0)
        {
            LCD_Display_Text(105,(const unsigned char*)Verdana14,28,14); // Throttle
            LCD_Display_Text(55,(const unsigned char*)Verdana14,46,34);	// High
        }
        else if((General_error & (1 << DISARMED)) != 0)
        {
            LCD_Display_Text(18,(const unsigned char*)Verdana14,25,24); 	// Disarmed
        }
    }

    // Write buffer to complete
    write_buffer(buffer,1);
    clear_buffer(buffer);
}
Exemplo n.º 5
0
void Display_status(void)
{
	int16_t temp;
	uint16_t vbat_temp; 
	int8_t	pos1, pos2, pos3;
	mugui_size16_t size;

	clear_buffer(buffer);

	// Display text
	LCD_Display_Text(264,(const unsigned char*)Verdana8,0,0); 	// Version text
	LCD_Display_Text(266,(const unsigned char*)Verdana8,0,12); 	// RX sync
	LCD_Display_Text(267,(const unsigned char*)Verdana8,0,24); 	// Profile
	LCD_Display_Text(23,(const unsigned char*)Verdana8,88,24); 	// Pos
		
	// Display menu and markers
	LCD_Display_Text(9, (const unsigned char*)Wingdings, 0, 59);// Down
	LCD_Display_Text(14,(const unsigned char*)Verdana8,10,55);	// Menu

	// Display values
	print_menu_text(0, 1, (62 + Config.RxMode), 45, 12); // Rx mode
	mugui_lcd_puts(itoa(transition,pBuffer,10),(const unsigned char*)Verdana8,110,24); // Raw transition value

	if (Config.RxMode == PWM)
	{
		LCD_Display_Text(24,(const unsigned char*)Verdana8,77,12); // Interrupt counter text 
		mugui_lcd_puts(itoa(InterruptCount,pBuffer,10),(const unsigned char*)Verdana8,110,12); // Interrupt counter
	}

	// Display transition point
	if (transition <= 0)
	{
		LCD_Display_Text(48,(const unsigned char*)Verdana8,45,24);
	}
	else if (transition >= 100)
	{
		LCD_Display_Text(50,(const unsigned char*)Verdana8,45,24);
	}
	else if (transition == Config.Transition_P1n)
	{
		LCD_Display_Text(49,(const unsigned char*)Verdana8,45,24);
	}
	else if (transition < Config.Transition_P1n)
	{
		LCD_Display_Text(51,(const unsigned char*)Verdana8,45,24);
	}
	else
	{
		LCD_Display_Text(52,(const unsigned char*)Verdana8,45,24);
	}

	// Don't display battery text if there are error messages
	if (General_error == 0)
	{
		// Display voltage
		uint8_t x_loc = 45;		// X location of voltage display
		uint8_t y_loc = 36;		// Y location of voltage display

		LCD_Display_Text(289,(const unsigned char*)Verdana8,0,36); 	// Battery

		vbat_temp = GetVbat();
		temp = vbat_temp/100;	// Display whole decimal part first
		mugui_text_sizestring(itoa(temp,pBuffer,10), (const unsigned char*)Verdana8, &size);
		mugui_lcd_puts(itoa(temp,pBuffer,10),(const unsigned char*)Verdana8,x_loc,y_loc);
		pos1 = size.x;

		vbat_temp = vbat_temp - (temp * 100); // Now display the parts to the right of the decimal point

		LCD_Display_Text(268,(const unsigned char*)Verdana8,(x_loc + pos1),y_loc);
		mugui_text_sizestring(".", (const unsigned char*)Verdana8, &size);
		pos3 = size.x;
		mugui_text_sizestring("0", (const unsigned char*)Verdana8, &size);
		pos2 = size.x;

		if (vbat_temp >= 10)
		{
			mugui_lcd_puts(itoa(vbat_temp,pBuffer,10),(const unsigned char*)Verdana8,(x_loc + pos1 + pos3),y_loc);
		}
		else
		{
			LCD_Display_Text(269,(const unsigned char*)Verdana8,(x_loc + pos1 + pos3),y_loc);
			mugui_lcd_puts(itoa(vbat_temp,pBuffer,10),(const unsigned char*)Verdana8,(x_loc + pos1 + pos2 + pos3),y_loc);
		}
	
		// Display vibration info is set to "ON"
		if (Config.Vibration == ON)
		{
			// Create message box
			fillrect(buffer, 29,11, 70, 42, 0);		// White box
			drawrect(buffer, 29,11, 70, 42, 1); 	// Outline

			// Display vibration data
			temp = (int16_t)GyroAvgNoise;
			
			// Work out pixel size of number to display
			mugui_text_sizestring(itoa(temp,pBuffer,10), (const unsigned char*)Verdana22, &size);
			
			// Center the number in the box automatically
			mugui_lcd_puts(itoa(temp,pBuffer,10),(const unsigned char*)Verdana22,64 - (size.x / 2),20);
			
		} // if (Config.Vibration == ON)	
	}
	
	// Display error messages
	else
	{
		// Prioritise error from top to bottom
		if(General_error & (1 << LVA_ALARM))
		{
			LCD_Display_Text(134,(const unsigned char*)Verdana14,15,37);	// Battery
			LCD_Display_Text(271,(const unsigned char*)Verdana14,79,37);	// low
		}
		else if(General_error & (1 << NO_SIGNAL))
		{
			LCD_Display_Text(75,(const unsigned char*)Verdana14,30,37); 	// No
			LCD_Display_Text(272,(const unsigned char*)Verdana14,55,37);	// signal
		}
		else if(General_error & (1 << THROTTLE_HIGH))
		{
			LCD_Display_Text(105,(const unsigned char*)Verdana14,11,37);	// Throttle
			LCD_Display_Text(270,(const unsigned char*)Verdana14,82,37);	// high
		}
		else if(General_error & (1 << DISARMED))
		{
			LCD_Display_Text(18,(const unsigned char*)Verdana14,25,37); 	// Disarmed
		}
	}

	// Write buffer to complete
	write_buffer(buffer);
	clear_buffer(buffer);
}