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


C++ EVT_KEY_FIRST函数代码示例

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


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

示例1: menuProcArduPilot5

void menuProcArduPilot5(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot4);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot6);
        break;
    case EVT_KEY_FIRST(KEY_MENU):
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
    break;
    }
    initval (0, PACK_POS, WPN);
    initval (1, PACK_POS, DST);
    title ('5'); 
    lcd_puts_P  (1*FW, 1*FH, PSTR(" Way Point # "));    
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" Distance "));
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:25,代码来源:ardupilot.cpp

示例2: menuProcArduPilot7

void menuProcArduPilot7(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot6);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot8);
        break;
    case EVT_KEY_FIRST(KEY_MENU):
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
    break;
    }
    initval (0, PACK_ATT, RLL);
    initval (1, PACK_ATT, PCH);
    title ('7'); 
    lcd_puts_P  (1*FW, 1*FH, PSTR(" Roll Angle"));   
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" Pitch Angle"));
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:25,代码来源:ardupilot.cpp

示例3: menuProcArduPilot6

void menuProcArduPilot6(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot5);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot7);
        break;
    case EVT_KEY_FIRST(KEY_MENU):
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
        break;
    }
    initval (0, PACK_ATT, ASP);
    initval (1, PACK_ATT, THH);
    title ('6'); 
    lcd_puts_P  (1*FW, 1*FH, PSTR(" Air Speed "));    
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" Climb Rate "));
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:25,代码来源:ardupilot.cpp

示例4: menuStatisticsView

void menuStatisticsView(uint8_t event)
{
  TITLE(STR_MENUSTAT);

  switch(event)
  {
    case EVT_KEY_FIRST(KEY_UP):
      chainMenu(menuStatisticsDebug);
      break;

    case EVT_KEY_LONG(KEY_MENU):
      g_eeGeneral.globalTimer = 0;
      eeDirty(EE_GENERAL);
      sessionTimer = 0;
      break;

    case EVT_KEY_FIRST(KEY_EXIT):
      chainMenu(menuMainView);
      break;
  }

  // Session and Total timers
  lcd_putsAtt(STATS_1ST_COLUMN, FH*1+1, "SES", BOLD);
  putsTimer(STATS_1ST_COLUMN + STATS_LABEL_WIDTH, FH*1+1, sessionTimer, 0, 0);
  lcd_putsAtt(STATS_1ST_COLUMN, FH*2+1, "TOT", BOLD);
  putsTimer(STATS_1ST_COLUMN + STATS_LABEL_WIDTH, FH*2+1, g_eeGeneral.globalTimer + sessionTimer, TIMEHOUR, 0);

  // Throttle special timers
  lcd_putsAtt(STATS_2ND_COLUMN, FH*0+1, "THR", BOLD);
  putsTimer(STATS_2ND_COLUMN + STATS_LABEL_WIDTH, FH*0+1, s_timeCumThr, 0, 0);
  lcd_putsAtt(STATS_2ND_COLUMN, FH*1+1, "TH%", BOLD);
  putsTimer(STATS_2ND_COLUMN + STATS_LABEL_WIDTH, FH*1+1, s_timeCum16ThrP/16, 0, 0);

  // Timers
  for (int i=0; i<TIMERS; i++) {
    putsStrIdx(STATS_3RD_COLUMN, FH*i+1, "TM", i+1, BOLD);
    if (timersStates[i].val > 3600)
      putsTimer(STATS_3RD_COLUMN + STATS_LABEL_WIDTH, FH*i+1, timersStates[i].val, TIMEHOUR, 0);
    else
      putsTimer(STATS_3RD_COLUMN + STATS_LABEL_WIDTH, FH*i+1, timersStates[i].val, 0, 0);
  }

#if defined(THRTRACE)
  coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
  const coord_t x = 5;
  const coord_t y = 60;
  lcd_hline(x-3, y, MAXTRACE+3+3);
  lcd_vline(x, y-32, 32+3);

  for (coord_t i=0; i<MAXTRACE; i+=6) {
    lcd_vline(x+i+6, y-1, 3);
  }
  for (coord_t i=1; i<=MAXTRACE; i++) {
    lcd_vline(x+i, y-s_traceBuf[traceRd], s_traceBuf[traceRd]);
    traceRd++;
    if (traceRd>=MAXTRACE) traceRd = 0;
    if (traceRd==s_traceWr) break;
  }
#endif
}
开发者ID:BenZoFly,项目名称:opentx,代码行数:60,代码来源:view_statistics.cpp

示例5: menuProcArduPilot8

void menuProcArduPilot8(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot7);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot1);
        break;
    case EVT_KEY_FIRST(KEY_MENU):
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
        break;
    }
    initval (0, PACK_MOD, MOD);
    initval (1, PACK_WPC, WPC);
    title ('8');
    lcd_puts_P  (1*FW, 1*FH, PSTR(" ArduPilot Mode"));
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" RTL Distance"));
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:25,代码来源:ardupilot.cpp

示例6: interrupt10ms

void interrupt10ms(void)
{
  Tenms |= 1;			// 10 mS has passed

  uint8_t enuk = KEY_MENU;
  uint8_t in = readKeys();
  for (uint8_t i = 1; i != uint8_t(1 << TRM_BASE); i <<= 1) {
    uint8_t value = (in & i);
    keys[enuk].input(value);
    ++enuk;
  }

#if defined(REV9E)
  checkRotaryEncoder();
  static rotenc_t rePreviousValue;
  rotenc_t reNewValue = (x9de_rotenc / 2);
  int8_t scrollRE = reNewValue - rePreviousValue;
  if (scrollRE) {
    rePreviousValue = reNewValue;
    if (scrollRE < 0) {
      putEvent(EVT_KEY_FIRST(KEY_MINUS));
    }
    else {
      putEvent(EVT_KEY_FIRST(KEY_PLUS)); 
    }
  }
#endif
}
开发者ID:BenZoFly,项目名称:opentx,代码行数:28,代码来源:boot.cpp

示例7: menuTelemetryMavlink

/*!	\brief Top Mavlink Menu definition
 *	\details Registers button events and handles that info. Buttons select menus,
 *	these are launched from the MAVLINK_menu switch statement. Setup menu is
 *	lanuched by the menu button. On exit (with exit button) the mavlink
 *	extension is reinitialized.
 */
void menuTelemetryMavlink(uint8_t event) {
	
	switch (event) // new event received, branch accordingly
	{
	case EVT_ENTRY:
		MAVLINK_menu = MENU_INFO;
		break;

	case EVT_KEY_FIRST(KEY_UP):
		if (MAVLINK_menu > 0)
		{
			MAVLINK_menu--;
			break;
		}
		else
		{
			chainMenu(menuMainView);
			return;
		}
	case EVT_KEY_FIRST(KEY_DOWN):
		if (MAVLINK_menu < MAX_MAVLINK_MENU - 1)
			MAVLINK_menu++;
		break;
	case EVT_KEY_FIRST(KEY_MENU):
		return;
	case EVT_KEY_FIRST(KEY_EXIT):
		chainMenu(menuMainView);
		return;
	}

	switch (MAVLINK_menu) {
	case MENU_INFO:
		menuTelemetryMavlinkInfos();
		break;
	case MENU_MODE:
		menuTelemetryMavlinkFlightMode();
		break;
	case MENU_BATT:
		menuTelemetryMavlinkBattery();
		break;
	case MENU_NAV:
		menuTelemetryMavlinkNavigation();
		break;
	case MENU_GPS:
		menuTelemetryMavlinkGPS();
		break;
#ifdef DUMP_RX_TX
	case MENU_DUMP_TX:
	case MENU_DUMP_RX:
		menuTelemetryMavlinkDump(event);
		break;
#endif
	default:
		break;
	}

}
开发者ID:4408,项目名称:opentx,代码行数:63,代码来源:view_mavlink.cpp

示例8: menuTelemetryFrsky

void menuTelemetryFrsky(uint8_t event)
{
  enum NavigationDirection direction = none;

  switch (event) {
    case EVT_KEY_FIRST(KEY_EXIT):
    case EVT_KEY_LONG(KEY_EXIT):
      killEvents(event);
      chainMenu(menuMainView);
      break;

    case EVT_KEY_LONG(KEY_PAGE):
      killEvents(event);
      // no break;

    case EVT_KEY_FIRST(KEY_UP):
      decrTelemetryScreen();
      break;

    case EVT_KEY_BREAK(KEY_PAGE):
    case EVT_KEY_FIRST(KEY_DOWN):
      incrTelemetryScreen();
      break;

    case EVT_KEY_LONG(KEY_ENTER):
      killEvents(event);
      POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
      POPUP_MENU_ADD_ITEM(STR_RESET_FLIGHT);
      popupMenuHandler = onMainViewMenu;
      break;
  }

  for (int i=0; i<=TELEMETRY_SCREEN_TYPE_MAX; i++) {
    if (direction == up) {
      if (s_frsky_view-- == 0)
        s_frsky_view = TELEMETRY_VIEW_MAX;
    }
    else if (direction == down) {
      if (s_frsky_view++ == TELEMETRY_VIEW_MAX)
        s_frsky_view = 0;
    }
    else {
      direction = down;
    }
    if (displayTelemetryScreen()) {
      return;
    }
  }

  lcdDrawTelemetryTopBar();
  lcd_puts(8*FW, 3*FH, "No Telemetry Screens");
  displayRssiLine();
}
开发者ID:cody82,项目名称:opentx,代码行数:53,代码来源:view_telemetry.cpp

示例9: menuStatisticsView

void menuStatisticsView(uint8_t event)
{
  TITLE(STR_MENUSTAT);

  switch(event)
  {
    case EVT_KEY_FIRST(KEY_UP):
      chainMenu(menuStatisticsDebug);
      return;

#if defined(CPUARM)
    case EVT_KEY_LONG(KEY_MENU):
      g_eeGeneral.globalTimer = 0;
      eeDirty(EE_GENERAL);
      sessionTimer = 0;
      break;
#endif
    case EVT_KEY_FIRST(KEY_EXIT):
      chainMenu(menuMainView);
      return;
  }

  lcd_puts(  1*FW, FH*0, STR_TOTTM1TM2THRTHP);
  putsTimer(    5*FW+5*FWNUM+1, FH*1, timersStates[0].val, 0, 0);
  putsTimer(   12*FW+5*FWNUM+1, FH*1, timersStates[1].val, 0, 0);

  putsTimer(    5*FW+5*FWNUM+1, FH*2, s_timeCumThr, 0, 0);
  putsTimer(   12*FW+5*FWNUM+1, FH*2, s_timeCum16ThrP/16, 0, 0);

  putsTimer(   12*FW+5*FWNUM+1, FH*0, sessionTimer, 0, 0);
  
#if defined(CPUARM)
  putsTimer(21*FW+5*FWNUM+1, 0*FH, g_eeGeneral.globalTimer + sessionTimer, TIMEHOUR, 0);
#endif

#if defined(THRTRACE)
  uint8_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
  const uint8_t x=5;
  const uint8_t y=60;
  lcd_hline(x-3,y,MAXTRACE+3+3);
  lcd_vline(x,y-32,32+3);

  for (uint8_t i=0; i<MAXTRACE; i+=6) {
    lcd_vline(x+i+6,y-1,3);
  }
  for (uint8_t i=1; i<=MAXTRACE; i++) {
    lcd_vline(x+i, y-s_traceBuf[traceRd], s_traceBuf[traceRd]);
    traceRd++;
    if (traceRd>=MAXTRACE) traceRd = 0;
    if (traceRd==s_traceWr) break;
  }
#endif
}
开发者ID:geofrancis,项目名称:opentx,代码行数:53,代码来源:view_statistics.cpp

示例10: menuProcStatistic

void menuProcStatistic(uint8_t event)
{
  TITLE("STAT");
  switch(event)
  {
    case EVT_KEY_FIRST(KEY_UP):
      chainMenu(menuProcStatistic2);
      break;
    case EVT_KEY_FIRST(KEY_DOWN):
    case EVT_KEY_FIRST(KEY_EXIT):
      chainMenu(menuMainView);
      break;
  }

  lcd_puts_P(  1*FW, FH*1, PSTR("TME"));
  putsTime(    5*FW, FH*1, s_timeCumAbs, 0, 0);
  lcd_puts_P( 17*FW, FH*1, PSTR("TSW"));
  putsTime(   11*FW, FH*1, s_timeCumSw,      0, 0);

  lcd_puts_P(  1*FW, FH*2, PSTR("STK"));
  putsTime(    5*FW, FH*2, s_timeCumThr, 0, 0);
  lcd_puts_P( 17*FW, FH*2, PSTR("ST%"));
  putsTime(   11*FW, FH*2, s_timeCum16ThrP/16, 0, 0);

  lcd_puts_P( 17*FW, FH*0, PSTR("TOT"));
  putsTime(   11*FW, FH*0, s_timeCumTot, 0, 0);

  uint16_t traceRd = s_traceCnt>MAXTRACE ? s_traceWr : 0;
  uint8_t x=5;
  uint8_t y=60;
  lcd_hline(x-3,y,120+3+3);
  lcd_vline(x,y-32,32+3);

  for(uint8_t i=0; i<120; i+=6)
  {
    lcd_vline(x+i+6,y-1,3);
  }
  for(uint8_t i=1; i<=120; i++)
  {
    lcd_vline(x+i,y-s_traceBuf[traceRd],s_traceBuf[traceRd]);
    traceRd++;
    if(traceRd>=MAXTRACE) traceRd=0;
    if(traceRd==s_traceWr) break;
  }
}
开发者ID:banditniu,项目名称:gruvin9x,代码行数:45,代码来源:statistics_views.cpp

示例11: menuProcArduPilot3

void menuProcArduPilot3(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot2);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot4);
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
        break;
    }
    initval (0, PACK_POS, ALT);
    initval (1, PACK_POS, ALH);
    title ('3');  
    lcd_puts_P  (1*FW, 1*FH, PSTR(" Altitude"));    
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" Altitude Hold") );
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:23,代码来源:ardupilot.cpp

示例12: menuProcArduPilot4

void menuProcArduPilot4(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot3);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot5);
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
    break;
    }
    initval (0, PACK_POS, CRS);
    initval (1, PACK_POS, BER);
    title ('4'); 
    lcd_puts_P  (1*FW, 1*FH, PSTR(" Course"));    
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" Bearing"));
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:23,代码来源:ardupilot.cpp

示例13: menuProcArduPilot2

void menuProcArduPilot2(uint8_t event)
{
    switch(event)
    {
    case EVT_KEY_FIRST(KEY_UP):
        chainMenu(menuProcArduPilot1);
        break;
    case EVT_KEY_FIRST(KEY_DOWN):
        chainMenu(menuProcArduPilot3);
        break;
    case EVT_KEY_FIRST(KEY_EXIT):
        ARDUPILOT_DisableRXD();
        chainMenu(menuProc0);
        break;
    }
    initval (0, PACK_POS, SPD);
    initval (1, PACK_POS, CRT);
    title ('2');  
    lcd_puts_P  (1*FW, 1*FH, PSTR(" Ground speed"));    
    lcd_putsAtt (2*FW, 2*FH, VALSTR(0), APSIZE);
    lcd_puts_P  (1*FW, 4*FH, PSTR(" Climb rate") );
    lcd_putsAtt (2*FW, 5*FH, VALSTR(1), APSIZE);
}
开发者ID:RasmusKS,项目名称:er9x,代码行数:23,代码来源:ardupilot.cpp

示例14: menuProcStatistic2

void menuProcStatistic2(uint8_t event)
{
  TITLE("STAT2");
  switch(event)
  {
    case EVT_KEY_FIRST(KEY_MENU):
      g_tmr1Latency_min = 0xff;
      g_tmr1Latency_max = 0;
      g_timeMain    = 0;
//      g_time_per10 = 0;
      beepKey();
      break;
    case EVT_KEY_FIRST(KEY_DOWN):
      chainMenu(menuProcStatistic);
      break;
    case EVT_KEY_FIRST(KEY_UP):
    case EVT_KEY_FIRST(KEY_EXIT):
      chainMenu(menuMainView);
      break;
  }
  lcd_puts_P( 0*FW,  1*FH, PSTR("tmr1Lat max    us"));
  lcd_outdez8(15*FW , 1*FH, g_tmr1Latency_max/2 );
  lcd_puts_P( 0*FW,  2*FH, PSTR("tmr1Lat min    us"));
  lcd_outdez8(15*FW , 2*FH, g_tmr1Latency_min/2 );
  lcd_puts_P( 0*FW,  3*FH, PSTR("tmr1 Jitter    us"));
  lcd_outdez8(15*FW , 3*FH, (g_tmr1Latency_max - g_tmr1Latency_min) /2 );
  lcd_puts_P( 0*FW,  4*FH, PSTR("tmain max      ms"));
  lcd_outdezAtt(15*FW, 4*FH, (g_timeMain*100)/16, PREC2);
  lcd_puts_P( 0*FW,  5*FH, PSTR("t10ms          us"));
  lcd_outdez8(15*FW , 5*FH, g_time_per10/2 );
#ifndef SIMU
  lcd_puts_P( 0*FW,  6*FH, PSTR("Free Stack min    b"));
  lcd_outdezAtt(18*FW-1,  6*FH, stack_free() ) ;
#endif
  lcd_puts_P( 3*FW,  7*FH, PSTR("[MENU] to reset"));
}
开发者ID:banditniu,项目名称:gruvin9x,代码行数:36,代码来源:statistics_views.cpp

示例15: menuTelemetryJeti

void menuTelemetryJeti(uint8_t event)
{
  lcdDrawTelemetryTopBar();

  for (uint8_t i=0; i<16; i++) {
    lcd_putcAtt((i+2)*FW, 3*FH, jetiRxBuffer[i], BSS);
    lcd_putcAtt((i+2)*FW, 4*FH, jetiRxBuffer[i+16], BSS);
  }

  if (event == EVT_KEY_FIRST(KEY_EXIT)) {
    JETI_DisableRXD();
    jetiReady = 0;
    chainMenu(menuMainView);
  }
}
开发者ID:4408,项目名称:opentx,代码行数:15,代码来源:jeti.cpp


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