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


C++ PutChar函数代码示例

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


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

示例1: Transmit_Delta

/*! \brief Transmits the channel delta values to QTouch Studio.
 */
void Transmit_Delta(void)
{
	int16_t delta;
	UNUSED(delta);  /* Dummy. To avoid warning. */

#if ((DEF_TOUCH_QDEBUG_ENABLE_QM == 1)      ||\
	(DEF_TOUCH_QDEBUG_ENABLE_QTA == 1) ||\
	(DEF_TOUCH_QDEBUG_ENABLE_QTB == 1))

	uint8_t c;
	PutChar(QT_DELTAS);
	for (c = 0; c < QDEBUG_NUM_SENSORS; c++) {
		QDEBUG_GET_DELTA_FUNC(c, &delta);

		PutChar((uint8_t)((delta >> 8) & 0xFFu));
		PutChar((uint8_t)(delta & 0xFFu));
	}
#endif

#if DEF_TOUCH_QDEBUG_ENABLE_AT == 1
	uint16_t reference = *(QDEBUG_REFERENCES_PTR);
	uint16_t signal = *(QDEBUG_SIGNALS_PTR);
	uint16_t unsigned_delta = (uint16_t)(reference - signal);
	delta = (int16_t)unsigned_delta;

	PutChar(QT_DELTAS);
	PutChar((uint8_t)((delta >> 8) & 0xFFu));
	PutChar((uint8_t)(delta & 0xFFu));
#endif

	Send_Message();
}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:34,代码来源:QDebug_at32uc3l.c

示例2: SUMP_sendmeta_uint32

/* \brief Send 32bit unsigned integer as SUMP meta data */
static void SUMP_sendmeta_uint32(char type, unsigned int i) {
  PutChar(type);
  PutChar((i >> 24) & 0xff);
  PutChar((i >> 16) & 0xff);
  PutChar((i >> 8) & 0xff);
  PutChar(i & 0xff);
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:8,代码来源:Logic.c

示例3: main

int
main() {
    char c1 = 'a';
    char c2 = 'b';
    char c3 = 'c';
    char c4 = 'd';
    int j;
    int tid1;
    int tid2;
    int tid3;
    int tid4;

    tid1 = UserThreadCreate(SimpleThread, (void*) &c1);
    tid2 = UserThreadCreate(SimpleThread, (void*) &c2);
    tid3 = UserThreadCreate(SimpleThread, (void*) &c3);
    tid4 = UserThreadCreate(SimpleThread, (void*) &c4);

    for (j = 0; j < 10; j++) {
        PutChar('m');
        PutInt(j);
        PutChar('\n');
    }

    UserThreadJoin(tid1);
    UserThreadJoin(tid2);
    UserThreadJoin(tid3);
    UserThreadJoin(tid4);

    /* not reached */
    return 0;
}
开发者ID:mcdooda,项目名称:ignacio,代码行数:31,代码来源:thread_test1.c

示例4: ListAliases

void ListAliases( void )
/**********************/
{
    int i;
    char far *alias;
    char        prompt[ 80 ];

    SaveLine();
    SavePrompt( prompt );
    PutNL();
    i = 0;
    alias = AliasList;
    while( *alias != '\0' ) {
        if( *alias == '\n' ) {
            if( ++i == 23 ) {
                PutChar( '\n' );
                if( !PutMore() ) break;
                ++alias;
                i = 0;
                continue;
            }
        }
        PutChar( *alias );
        ++alias;
    }
    RestorePrompt( prompt );
    RestoreLine();
    Draw = TRUE;
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:29,代码来源:cmdalias.c

示例5: memset

void UDA_Driver::PutFloat(float val, uint8_t nbDecimal)
{
   char tab[4];
   unsigned char i;
   
   for ( i = 0 ; i < nbDecimal ; i++ )
   {
      val = val * 10.0;
   }
   
   unsigned short val10 = (unsigned short)(val);
   memset(tab,0,sizeof(tab));
   sprintf(tab,"%02d",val10);
   unsigned char offset = 0;
   for ( i = 0 ; i < 3 ; i++ )
   {
      if ( i >= ( 3 - strlen(tab)))
      {         
         if ( (i == (2-nbDecimal)) && (nbDecimal != 0) )
            PutChar(i,tab[offset] | 0x80 );
         else
            PutChar(i,tab[offset] );
         offset++;
      }
      else
      {
         PutChar(i,' ');
      }
   }
   
}
开发者ID:PaintX,项目名称:Universal_Display_Automotive,代码行数:31,代码来源:UDA_Driver.cpp

示例6: main

void main(int argc, char *argv[]) // shared memory ID passed from server
{
   int shmid;
   info_t *my_info;
   sem_t *sem_video;
   char *p, str[30];

   shmid = atoi( argv[0] ); // get shared memory ID server requested/opened

   if( ( p = shmat( shmid, 0, 0 ) ) == (char *) -1 ) // attach to p
   {
      perror( "alphabet shmat: " );
      return;
   }
   my_info = (info_t *)p; // got to go around via p (char *)

   sprintf( str, "%d", getppid() ); // use server PID as key str
   sem_video = sem_open( str, O_CREAT, S_IRWXU, 1 );
   if( sem_video == SEM_FAILED ) { perror("alphabet sem_open: "); return; }

   srand( getpid() * (unsigned int)time(NULL) );   // seed rand()

   for( my_info->col=1; my_info->col<=MAX_COL; my_info->col++ ) // race loop
   {
      PutChar( my_info->row, my_info->col, my_info->symbol, sem_video ); // show my symbol

      usleep( USEC * ( 1+ rand()%4 ) ); // random sleep 1 ~ 4 portions of USEC

      if( my_info->col == MAX_COL ) break; // if reached finish, no need to erase last

      PutChar( my_info->row, my_info->col, ' ', sem_video ); // erase my symbol
   }
}
开发者ID:trusktr,项目名称:csc60,代码行数:33,代码来源:alphabet.c

示例7: WriteString

/**
 * Изменение атрибутов.
 */
void CConsole::SetTextAttributes( EnAttributes Attributes ) {

    WriteString( ESC );
    PutChar( ( Attributes & 0x0F ) + '0' );
    PutChar( 'm' );

}
开发者ID:NNNorth,项目名称:avr,代码行数:10,代码来源:Console.cpp

示例8: AddModRecord

bool    AddModRecord(event  ev)
{
  if (IsRecordDisabled(ev)) return true;

  uint i = OpenRecord(MOD_RECORD, cdwModRecord);

  reCurr.ti = *GetCurrTimeDate();
  reCurr.cdwRecord = cdwModRecord++; SaveCache(&chModRecord);
  reCurr.ev = ev;

  PutChar(0, ibDig);

  switch (ev)
  {
    case EVE_MODEM_PROFILEOPEN:
    case EVE_MODEM_SPECIALOPEN:  Put(1, (uchar *) &mpdiDigital[ibDig], sizeof(digital)); break;

    case EVE_MODEM_PROFILE:      PutInt(1, mpcwStopCan[ibDig]); break;

    case EVE_MODEM_PROFILEOK:    PutInt(1, cwHouRead);
                                 PutInt(3, mpcwStopCan[ibDig]); break;

    case EVE_MODEM_PROFILEERROR2:PutInt(1, GetCurr());
                                 PutChar(3, mpSerial[ibPort]); break;
  }

  CloseRecord(MOD_RECORD, i);

  return CloseOut();
}
开发者ID:feilongfl,项目名称:tm4c1294ncpdt,代码行数:30,代码来源:records.c

示例9: Transmit_Sensor_Config

/**
 * @brief Transmits the channel config struct to QTouch Studio
 * @ingroup  QDebug-Remote
 */
void Transmit_Sensor_Config(void)
{
    uint8_t c;
    PutChar(QT_SENSOR_CONFIG);
    
#ifdef _ROTOR_SLIDER_
    PutChar(1);		// 1 = KRS
    
    /* Value of c is used according the maximum channel number to be measured
       to avoid the over the air data transmission.
    */
    for(c = 0; c <= CHANNEL_19; c++) 
    {
        PutChar(sensors[c].threshold);
        PutChar(sensors[c].type_aks_pos_hyst);
        PutChar(sensors[c].from_channel);
        PutChar(sensors[c].to_channel);
    }
#else
    PutChar(0);		// 0 = K
    for(c=0; c<QT_NUM_CHANNELS; c++)
    {
        PutChar(sensors[c].threshold);
        PutChar(sensors[c].type_aks_pos_hyst);
        PutChar(sensors[c].from_channel);
    }
#endif
    
    Send_Message();
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:34,代码来源:qdebug.c

示例10: AddImpRecord

bool    AddImpRecord(event  ev)
{
  if (IsRecordDisabled(ev)) return true;

  uint i = OpenRecord(IMP_RECORD, cdwImpRecord);

  reCurr.ti = *GetCurrTimeDate();
  reCurr.cdwRecord = cdwImpRecord++; SaveCache(&chImpRecord);
  reCurr.ev = ev;

  PutChar(0, ibDig);

  switch (ev)
  {
    case EVE_EVENTS_BADLINK:  PutChar(1, mpSerial[ibPort]);
                              PutChar(2, bEventCode);
                              break;

    case EVE_EVENTS_OMISSION: PutChar(1, bEventCode);
                              break;

    case EVE_EVENTS_A:
    case EVE_EVENTS_B:        Put(1, (uchar *) &tiRecordTime, sizeof(time));
                              PutChar(7, bEventCode);
                              break;
  }

  CloseRecord(IMP_RECORD, i);

  return CloseOut();
}
开发者ID:feilongfl,项目名称:tm4c1294ncpdt,代码行数:31,代码来源:records.c

示例11: Transmit_Delta

/*============================================================================
Name    :   Transmit_Delta
------------------------------------------------------------------------------
Purpose :   Transmits the channel delta values to QTouch Studio
Input   :   n/a
Output  :   n/a
Notes   :   The value is equal to signal-reference
============================================================================*/
void Transmit_Delta(void)
{
      int16_t delta;
      /* avoid Cppcheck Warning */
      UNUSED(delta);

#if ((DEF_TOUCH_QMATRIX == 1)      || \
     (DEF_TOUCH_QTOUCH_GRP_A == 1) || \
     (DEF_TOUCH_QTOUCH_GRP_B == 1))

      uint8_t c;
      PutChar(QT_DELTAS);
      for (c=0; c < QDEBUG_NUM_SENSORS; c++)
      {
              QDEBUG_GET_DELTA_FUNC( c, &delta);

              PutChar((uint8_t)((delta >>8) & 0xFFu));
              PutChar((uint8_t)(delta & 0xFFu));
      }
#endif

#if DEF_TOUCH_AUTONOMOUS_QTOUCH == 1
      uint16_t reference = *(QDEBUG_REFERENCES_PTR);
      uint16_t signal    = *(QDEBUG_SIGNALS_PTR);
      uint16_t unsigned_delta = (uint16_t)( reference - signal );
      delta = (int16_t) unsigned_delta;

      PutChar(QT_DELTAS);
      PutChar((uint8_t)((delta >>8) & 0xFFu));
      PutChar((uint8_t)(delta & 0xFFu));
#endif

      Send_Message();
}
开发者ID:kerichsen,项目名称:asf,代码行数:42,代码来源:qdebug.c

示例12: print

void print(char c, int n) {
    int i;
    for (i = 0; i < n; i++) {
        PutChar(c + i);
    }
    PutChar('\n');
}
开发者ID:Dwaaap,项目名称:ignacio,代码行数:7,代码来源:putchar.c

示例13: main

int main(){
 

  int c = GetChar();
  PutChar(c);
  PutChar('\n');

}
开发者ID:zlatan-ibrahimovic,项目名称:SE,代码行数:8,代码来源:getChar.c

示例14: main

int
main()
{
	char s = SynchGetChar();
	PutChar(s);
	PutChar('\n');
	return 0;
}
开发者ID:RodolpheFreby,项目名称:nachOS,代码行数:8,代码来源:getChar.c

示例15: main

int main()
{
  PutInt(ForkExec("step4_ForkExec_helloworld"));
  PutChar('\n');
  PutInt(ForkExec("step4_ForkExec_helloworld"));
  PutChar('\n');
  return 0;
}
开发者ID:HugoGuiroux,项目名称:project-system,代码行数:8,代码来源:step4_ForkExec_pid.c


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