本文整理汇总了C++中PutChar函数的典型用法代码示例。如果您正苦于以下问题:C++ PutChar函数的具体用法?C++ PutChar怎么用?C++ PutChar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PutChar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: PutASMCode
void PutASMCode(int code, Symbol opds[])
{
char *fmt = ASMTemplate[code];
char *prefix = NULL;
int i;
PutChar('\t');
while (*fmt)
{
switch (*fmt)
{
case ';':
PutString("\n\t");
break;
case '%':
fmt++;
if (*fmt == 'b')
{
prefix = "BYTE PTR ";
fmt++;
}
else if (*fmt == 'w')
{
prefix = "WORD PTR ";
fmt++;
}
else if (*fmt == 'd')
{
prefix = "DWORD PTR ";
fmt++;
}
else
prefix = NULL;
i = *fmt - '0';
if (opds[i]->reg != NULL)
{
PutString(opds[i]->reg->name);
}
else
{
if (prefix && opds[i]->kind != SK_Constant && opds[i]->kind != SK_Function)
{
PutString(prefix);
}
PutString(GetAccessName(opds[i]));
}
break;
default:
PutChar(*fmt);
break;
}
fmt++;
}
PutChar('\n');
}
开发者ID:descent,项目名称:ucc-code,代码行数:58,代码来源:x86win32.c
示例17: VT102Attribute
void VT102Attribute (INT8U fgcolor, INT8U bgcolor)
{
PutChar(0x1b);
PutChar('[');
PutDec(30 + fgcolor);
PutChar(';');
PutDec(40 + bgcolor);
PutChar('m');
}
开发者ID:SSexpress,项目名称:ele542-2011,代码行数:9,代码来源:test.c
示例18: WriteOneEntry
void WriteOneEntry(CalEntry *c)
{
int ch, i;
char const *s = c->entry;
printf(" [");
/* Chew up leading spaces */
while(isspace((unsigned char) *s)) s++;
/* Skip three decimal numbers for COLOR special */
if (c->special == SPECIAL_COLOR) {
for (i=0; i<3; i++) {
while(*s && !isspace(*s)) s++;
while(*s && isspace(*s)) s++;
}
}
PutChar('(');
while(*s) {
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
/* which treated some latin1 characters as white space. */
ch = (unsigned char) *s++;
if (ch == '\\' || ch == '(' || ch == ')') PutChar('\\');
if (!isspace(ch)) PutChar(ch);
else {
PutChar(')');
while(isspace((unsigned char)*s)) s++;
if (!*s) {
goto finish;
}
PutChar('(');
}
}
printf(")\n");
finish:
if (c->special == SPECIAL_COLOR) {
int r, g, b;
if (sscanf(c->entry, "%d %d %d", &r, &g, &b) == 3) {
if (r < 0) r = 0;
else if (r > 255) r = 255;
if (g < 0) g = 0;
else if (g > 255) g = 255;
if (b < 0) b = 0;
else if (b > 255) b = 255;
printf("(gsave %f %f %f setrgbcolor)(grestore)",
r / 255.0, g / 255.0, b / 255.0);
} else {
/* Punt... unrecognized color is black */
printf("()()");
}
} else {
printf("()()");
}
printf("]\n");
}
开发者ID:unixsuperhero,项目名称:remind,代码行数:56,代码来源:rem2ps.c
示例19: AddSysRecord
bool AddSysRecord(event ev)
{
if (IsRecordDisabled(ev)) return true;
uint i = OpenRecord(SYS_RECORD, cdwSysRecord);
reCurr.ti = *GetCurrTimeDate();
reCurr.cdwRecord = cdwSysRecord++; SaveCache(&chSysRecord);
reCurr.ev = ev;
switch (ev)
{
// case EVE_CONTACTS3_START:
// case EVE_CONTACTS3_COUNTER: memcpy(&reCurr.mpbBuff+0, &cbContact, sizeof(uchar));
// memcpy(&reCurr.mpbBuff+1, &cbContactMax, sizeof(uchar)); break;
//
// case EVE_VALUE3_DOWN: memcpy(&reCurr.mpbBuff+0, &reContactDown, sizeof(float)); break;
// case EVE_VALUE3_UP: memcpy(&reCurr.mpbBuff+0, &reContactUp, sizeof(float)); break;
// case EVE_VALUE3_COUNTER: memcpy(&reCurr.mpbBuff+0, &cbContactMax, sizeof(uchar)); break;
//
// case EVE_CONTACTS3_0_ON: memcpy(&reCurr.mpbBuff+0, &reContactRec, sizeof(float));
// memcpy(&reCurr.mpbBuff+4, &reContactUp, sizeof(float)); break;
//
// case EVE_CONTACTS3_0_OFF: memcpy(&reCurr.mpbBuff+0, &reContactRec, sizeof(float));
// memcpy(&reCurr.mpbBuff+4, &reContactDown, sizeof(float)); break;
//
// case EVE_CONTACTSMODE:
// case EVE_CONTACTS1:
// case EVE_CONTACTS2: memcpy(&reCurr.mpbBuff+0, &bContactRec, sizeof(uchar)); break;
case EVE_PREVNEXTTIME2: Put(0, (uchar *) &tiCurr, sizeof(time)); break;
case EVE_EDIT_DIGITAL1:
case EVE_EDIT_DIGITAL2: PutChar(0, ibRecordCan);
Put(1, (uchar *) &mpdiDigital[ibRecordCan], sizeof(digital)); break;
case EVE_EDIT_KEY10:
case EVE_EDIT_KEY20: PutChar(0, ibRecordCan);
Put(1, (uchar *) &mpphKeys[ibRecordCan].szLine+0, 7); break;
case EVE_EDIT_KEY11:
case EVE_EDIT_KEY21: Put(0, (uchar *) &mpphKeys[ibRecordCan].szLine+7, 6); break;
case EVE_EDIT_ADDRESS10:
case EVE_EDIT_ADDRESS11: PutChar(0, ibRecordCan);
Put(1, (uchar *) &mpdwAddress1[ibRecordCan], sizeof(ulong)); break;
case EVE_EDIT_ADDRESS20:
case EVE_EDIT_ADDRESS21: PutChar(0, ibRecordCan);
Put(1, (uchar *) &mpdwAddress2[ibRecordCan], sizeof(ulong)); break;
}
CloseRecord(SYS_RECORD, i);
return CloseOut();
}
开发者ID:feilongfl,项目名称:tm4c1294ncpdt,代码行数:56,代码来源:records.c
示例20: f
void f(void* arg)
{
PutChar('5');
Arg *param = (Arg*) arg;
PutChar(param->a);
PutChar('6');
param->wait = 0;
PutChar('7');
UserThreadExit(0);
}
开发者ID:starfox644,项目名称:jjcgm2014B2,代码行数:10,代码来源:testGetCharMultiThread.c
注:本文中的PutChar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论