当前位置: 首页>>代码示例>>C++>>正文


C++ display_chars函数代码示例

本文整理汇总了C++中display_chars函数的典型用法代码示例。如果您正苦于以下问题:C++ display_chars函数的具体用法?C++ display_chars怎么用?C++ display_chars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了display_chars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: edit_consumption_sel

void edit_consumption_sel(uint8_t pos)
{	
	display_chars(0, LCD_SEG_L1_3_0, consumption_str[consumption-1], SEG_SET);
	display_symbol(0, LCD_UNIT_L1_PER_S, consumption == 4 ? SEG_ON : SEG_OFF);
	display_chars(0, LCD_SEG_L1_3_0, NULL, BLINK_ON);
	display_chars(0, LCD_SEG_L2_3_0, "POLL", SEG_SET);
}
开发者ID:KarolTx,项目名称:openchronos-ng,代码行数:7,代码来源:altitude.c

示例2: update_schedule

u8 update_schedule()
{
	update_schedule_time();
	clear_line(LINE2);
	if(sSchedule.state == SCHEDULE_ENABLED)
	{
		if(sSchedule.currentlyShown == PERIOD)
		{
			display_chars(LCD_SEG_L2_4_0, sSchedule.period, SEG_ON);
		}
		else if(sSchedule.currentlyShown == TIME)
		{
			display_chars(LCD_SEG_L2_3_0, itoa(sSchedule.end, 4, 0), SEG_ON);
			display_symbol(LCD_SEG_L2_COL0, SEG_ON);
		}
	}
	else if (sSchedule.state == SCHEDULE_DISABLED)
	{
		display_chars(LCD_SEG_L2_4_0, sSchedule.period, SEG_ON);
	}
	/*else if (sSchedule.state == SCHEDULE_NONE)
	{
		if (is_schedule())
		{
			menu_skip_next(LINE2);
		}
	}*/
	return 1;
}
开发者ID:lieb005,项目名称:My_Stuff,代码行数:29,代码来源:schedule.c

示例3: edit_threshold_sel

void edit_threshold_sel(uint8_t pos)
{   
    
    _printf(0, LCD_SEG_L1_1_0, "%1u", sAlt.accu_threshold);
    display_chars(0, LCD_SEG_L1_1_0, NULL, BLINK_ON);
    display_chars(0, LCD_SEG_L2_4_0, "THRES", SEG_SET);
}
开发者ID:KarolTx,项目名称:openchronos-ng,代码行数:7,代码来源:altitude.c

示例4: display_heartrate

// *************************************************************************************************
// @fn          display_heartrate
// @brief       Heart rate display routine. 
// @param       u8 line	LINE1
//				u8 update	DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL, DISPLAY_LINE_CLEAR
// @return      none
// *************************************************************************************************
void display_heartrate(u8 line, u8 update)
{
	u8 * str;
	
	if (update != DISPLAY_LINE_CLEAR)
	{
		if (is_bluerobin())
		{
			str = itoa(sBlueRobin.heartrate, 3, 2);
			display_chars(LCD_SEG_L1_2_0, str, SEG_ON);
		}
		else
		{
			display_chars(LCD_SEG_L1_2_0, (u8 *)"---", SEG_ON);
		}
	}
	
	// Redraw whole screen
	if (!is_bluerobin())
	{
		if (update == DISPLAY_LINE_UPDATE_FULL)	
		{
			 display_symbol(LCD_ICON_HEART, SEG_ON);
		}
		else if (update == DISPLAY_LINE_CLEAR)
		{
			// Clear heart when not connected
			display_symbol(LCD_ICON_HEART, SEG_OFF);
		}
	}
}
开发者ID:CaptFrank,项目名称:Black-Box-Mouse-Interface,代码行数:38,代码来源:bluerobin.c

示例5: sx_rfbsl

// *************************************************************************************************
// @fn          sx_rfbsl
// @brief       This functions starts the RFBSL
// @param       line            LINE1, LINE2
// @return      none
// *************************************************************************************************
void sx_rfbsl(u8 line)
{
    // Exit if battery voltage is too low for radio operation
    if (sys.flag.low_battery)
        return;

    // Exit if BlueRobin stack is active
    if (is_bluerobin())
        return;

    // Exit if SimpliciTI stack is active
    if (is_rf())
        return;

    rfBSL_button_confirmation++;

    if (rfBSL_button_confirmation == 2)
    {
        // Before entering RFBSL clear the LINE1 Symbols
        display_symbol(LCD_SYMB_AM, SEG_OFF);

        clear_line(LINE1);

        // Write RAM to indicate we will be downloading the RAM Updater first
        display_chars(LCD_SEG_L2_5_0, (u8 *) " RFBSL", SEG_ON);
        display_chars(LCD_SEG_L1_3_0, (u8 *) " RAM", SEG_ON);

        // Call RFBSL
        CALL_RFSBL();
    }
}
开发者ID:guipoletto,项目名称:MyChronos,代码行数:37,代码来源:rfbsl.c

示例6: display_time

// *************************************************************************************************
// @fn          display_time
// @brief       Clock display routine. Supports 24H and 12H time format,
//              through the helper display_hours_with_12_24.
// @param       u8 line			LINE1
//				u8 update		DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL
// @return      none
// *************************************************************************************************
void display_time(u8 line, u8 update)
{
	// Partial and full update
	if (update == DISPLAY_LINE_UPDATE_PARTIAL || update == DISPLAY_LINE_UPDATE_FULL)
	{
	  if ( ( line == LINE1 && sTime.line1ViewStyle == DISPLAY_DEFAULT_VIEW ) || ( line == LINE2 && sTime.line2ViewStyle == DISPLAY_DEFAULT_VIEW ) )
	  {
	    // Display hours
#ifndef LZH
	        display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sTime.hour, 2, 1, SEG_ON);
#else
	        display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sTime.hour, 2, 0, SEG_ON);
#endif	        
	    // Display minute
	    display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sTime.minute, 2, 0), SEG_ON);
	    display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON_BLINK_ON);
	  }
	  else
	  {
	    // Display seconds
	    display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sTime.second, 2, 0), SEG_ON);
	    display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_ON);
	  }
	}
	else if (update == DISPLAY_LINE_CLEAR)
	{
	  display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_OFF_BLINK_OFF);
	  // Change display style to default (HH:MM)
	  sTime.line1ViewStyle = DISPLAY_DEFAULT_VIEW;
	  // Clean up AM/PM icon
	  display_symbol(LCD_SYMB_AM, SEG_OFF);
	}
}
开发者ID:Rossano,项目名称:ez430_ChibiOS,代码行数:41,代码来源:clock.c

示例7: putchar_to_display

void putchar_to_display(int c)
{
    if (c == '\n') {
        display_buf[4] = 1;
        return;
    }

    if (display_buf[4]) {
        memset(display_buf, '\0', 11);
    }
    else {
        display_buf[0] = display_buf[1];
        display_buf[1] = display_buf[2];
        display_buf[2] = display_buf[3];
        display_buf[3] = display_buf[5];
        display_buf[5] = display_buf[6];
        display_buf[6] = display_buf[7];
        display_buf[7] = display_buf[8];
        display_buf[8] = display_buf[9];
    }

    display_buf[9] = toupper(c);

    clear_display_all();

    display_chars(LCD_SEG_L1_3_0, display_buf, SEG_ON);
    display_chars(LCD_SEG_L2_5_0, display_buf + 4, SEG_ON);
}
开发者ID:4120976,项目名称:RIOT,代码行数:28,代码来源:display_putchar.c

示例8: menumode_handler

static void menumode_handler(void)
{
	if (ports_button_pressed(PORTS_BTN_STAR, 0)) {
		/* exit mode mode */
		menumode.enabled = 0;

		/* clear both lines but keep symbols! */
		display_clear(0, 1);
		display_clear(0, 2);

		/* turn off up/down symbols */
		display_symbol(0, LCD_SYMB_ARROW_UP, SEG_OFF);
		display_symbol(0, LCD_SYMB_ARROW_DOWN, SEG_OFF);

		/* stop blinking name of current selected module */
		display_chars(0, LCD_SEG_L2_4_0, NULL, BLINK_OFF);

		/* activate item */
		if (menumode.item->activate_fn)
			menumode.item->activate_fn();

	} else if (ports_button_pressed(PORTS_BTN_UP, 0)) {
		menumode.item = menumode.item->next;
		display_chars(0, LCD_SEG_L2_4_0, menumode.item->name, SEG_SET);

	} else if (ports_button_pressed(PORTS_BTN_DOWN, 0)) {
		menumode.item = menumode.item->prev;
		display_chars(0, LCD_SEG_L2_4_0, menumode.item->name, SEG_SET);
	}
}
开发者ID:rafaelfini,项目名称:openchronos-ng-elf,代码行数:30,代码来源:openchronos.c

示例9: edit_metric_sel

//* ************************************************************************************************
/// @fn			edit_metric_sel(void)
/// @brief		Start routine of the metric menu item.
/// @return		none
//* ************************************************************************************************
static void edit_metric_sel(void)
{
    // Display "MTRC" as title
    display_chars(1, LCD_SEG_L2_3_0, "MTRC", SEG_SET);

    // Display the current metric system used
    display_chars(1, LCD_SEG_L1_3_0, (temp_display_metric == 0 ? "CELS " : "FARH"), SEG_SET);
}
开发者ID:freespace,项目名称:openchronos-ng,代码行数:13,代码来源:temperature.c

示例10: edit_offset_sel

//* ************************************************************************************************
/// @fn			edit_offset_sel(void)
/// @brief		Start routine of the offset menu item.
/// @return		none
//* ************************************************************************************************
static void edit_offset_sel(void)
{
    // Display "OFST" as title
    display_chars(1, LCD_SEG_L2_3_0, "OFST", SEG_SET);

    // Display the current offset
    display_chars(1, LCD_SEG_L1_3_0, _sprintf("%2s", temperature.offset / 10), SEG_SET);
}
开发者ID:freespace,项目名称:openchronos-ng,代码行数:13,代码来源:temperature.c

示例11: edit_dd_dsel

static void edit_dd_dsel(void)
{
#ifdef CONFIG_MOD_CLOCK_MONTH_FIRST
	display_chars(0, LCD_SEG_L2_1_0, NULL, BLINK_OFF);
#else
	display_chars(0, LCD_SEG_L2_4_3, NULL, BLINK_OFF);
#endif
}
开发者ID:KarolTx,项目名称:openchronos-rfsw,代码行数:8,代码来源:clock.c

示例12: display_alarm

// *************************************************************************************************
// @fn          display_alarm
// @brief       Display alarm time. 24H / 12H time format.
// @param       u8 line	LINE1, LINE2
//		u8 update	DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_CLEAR
// @return      none
// *************************************************************************************************
void display_alarm(u8 line, u8 update)
{
#ifndef CONFIG_METRIC_ONLY 
	u8 hour12;
#endif
	
	if (update == DISPLAY_LINE_UPDATE_FULL)			
	{
#ifdef CONFIG_METRIC_ONLY
		display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), itoa(sAlarm.hour, 2, 0), SEG_ON); 
#else
		if (sys.flag.use_metric_units)
		{
			// Display 24H alarm time "HH:MM"
			display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), itoa(sAlarm.hour, 2, 0), SEG_ON); 
		}
		else
		{
			// Display 12H alarm time "HH:MM" + AM/PM
			hour12 = convert_hour_to_12H_format(sAlarm.hour);
			display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), itoa(hour12, 2, 0), SEG_ON); 	
			
			// Display AM/PM symbol
			display_am_pm_symbol(sAlarm.hour);		
		}
#endif
		display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), itoa(sAlarm.minute, 2, 0), SEG_ON); 
		display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON);

		// Show blinking alarm icon
		display_symbol(LCD_ICON_ALARM, SEG_ON_BLINK_ON);

//		// If alarm is enabled, show icon
// 		if (sAlarm.state == ALARM_ENABLED)
// 		{
// 			display_symbol(LCD_ICON_ALARM, SEG_ON_BLINK_OFF);
// 		}
//		// When alarm is disabled, blink icon to indicate that this is not current time!
// 		else if (sAlarm.state == ALARM_DISABLED) 
// 		{
// 		}
	}
	else if (update == DISPLAY_LINE_CLEAR)			
	{
		// Clean up function-specific segments before leaving function
		display_symbol(LCD_SYMB_AM, SEG_OFF);
		
		// Clear / set alarm icon
		if (sAlarm.state == ALARM_DISABLED) 
		{
			display_symbol(LCD_ICON_ALARM, SEG_OFF_BLINK_OFF);
		}
		else
		{
			display_symbol(LCD_ICON_ALARM, SEG_ON_BLINK_OFF);
		}
	}
}
开发者ID:epall,项目名称:OpenChronos,代码行数:65,代码来源:alarm.c

示例13: display_sidereal

// *************************************************************************************************
// @fn          display_sidereal
// @brief       Sidereal Clock display routine. Supports 24H and 12H time format,
//              through the helper display_hours_with_12_24.
// @param       u8 line			LINE1
//				u8 update		DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL
// @return      none
// *************************************************************************************************
void display_sidereal(u8 line, u8 update)
{
	// Partial update
	if (update == DISPLAY_LINE_UPDATE_PARTIAL)
	{
		if(sSidereal_time.drawFlag != 0)
		{
			if (sSidereal_time.line1ViewStyle == DISPLAY_DEFAULT_VIEW)
			{
				switch(sSidereal_time.drawFlag)
				{
					case 3:
						display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sSidereal_time.hour, 2, 1, SEG_ON);
					case 2:
						display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.minute, 2, 0), SEG_ON);
				}
			}
			else
			{
				// Seconds are always updated
				display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.second, 2, 0), SEG_ON);
			}
		}
	}
	else if (update == DISPLAY_LINE_UPDATE_FULL)
	{
		if (line == LINE1)
		{
			// display "i" (like in sIdereal) to distinguish sidereal time clock from normal clock
			display_symbol(LCD_UNIT_L1_I, SEG_ON);
		}
		// Full update
		if ( ( line == LINE1 && sSidereal_time.line1ViewStyle == DISPLAY_DEFAULT_VIEW ) || ( line == LINE2 && sSidereal_time.line2ViewStyle == DISPLAY_DEFAULT_VIEW ) )
		{
			// Display hours
			display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sSidereal_time.hour, 2, 1, SEG_ON);
			// Display minute
			display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.minute, 2, 0), SEG_ON);
			display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON_BLINK_ON);
		}
		else
		{
			// Display seconds
			display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.second, 2, 0), SEG_ON);
			display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_ON);
		}
	}
	else if (update == DISPLAY_LINE_CLEAR)
	{
		display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_OFF_BLINK_OFF);
// 		// Change display style to default (HH:MM)
// 		sSidereal_time.line1ViewStyle = DISPLAY_DEFAULT_VIEW;
		// Clean up AM/PM icon
		display_symbol(LCD_SYMB_AM, SEG_OFF);
		// cleanup "i" icon
		display_symbol(LCD_UNIT_L1_I, SEG_OFF);
	}
}
开发者ID:anilgulecha,项目名称:OpenChronos,代码行数:66,代码来源:sidereal.c

示例14: edit_mo_sel

static void edit_mo_sel(void)
{
	lcd_screen_activate(0);
#ifdef CONFIG_MOD_CLOCK_MONTH_FIRST
	display_chars(0, LCD_SEG_L2_4_3, NULL, BLINK_ON);
#else
	display_chars(0, LCD_SEG_L2_1_0, NULL, BLINK_ON);
#endif
}
开发者ID:KarolTx,项目名称:openchronos-rfsw,代码行数:9,代码来源:clock.c

示例15: edit_filter_sel

void edit_filter_sel(uint8_t pos)
{	
	if(useFilter){
		display_chars(0, LCD_SEG_L1_2_1, "ON", SEG_SET);
	}else{
		display_chars(0, LCD_SEG_L1_2_0, "OFF", SEG_SET);
	}
	display_chars(0, LCD_SEG_L1_2_0, NULL, BLINK_ON);
	display_chars(0, LCD_SEG_L2_2_0, "FLT", SEG_SET);
}
开发者ID:KarolTx,项目名称:openchronos-ng,代码行数:10,代码来源:altitude.c


注:本文中的display_chars函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。