本文整理汇总了C++中DC函数的典型用法代码示例。如果您正苦于以下问题:C++ DC函数的具体用法?C++ DC怎么用?C++ DC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateCompatibleBitmap
void SimpleCanvas::setBitmapSize(int sizeX, int sizeY)
{
HBITMAP newBM = CreateCompatibleBitmap(DC(), sizeX, sizeY);
SetBitmapDimensionEx(newBM, sizeX, sizeY, 0);
if (mOffScreenBM) {
// Copy as much of the old contents as possible into the new bitmap
HDC tempDC = CreateCompatibleDC(DC());
HGDIOBJ defaultBM = SelectObject(tempDC, newBM);
// Perform the copy from old to new
SIZE oldBMSize;
GetBitmapDimensionEx(mOffScreenBM, &oldBMSize);
BitBlt(tempDC, 0, 0, oldBMSize.cx, oldBMSize.cy,
offScreenDC(), 0, 0, SRCCOPY);
// Select clean up and select new bitmap
SelectObject(tempDC, defaultBM);
DeleteDC(tempDC);
HGDIOBJ oldBM = SelectObject(offScreenDC(), newBM);
assert(oldBM == mOffScreenBM);
DeleteObject(mOffScreenBM);
} else {
SelectObject(offScreenDC(), newBM);
}
mOffScreenBM = newBM;
}
示例2: analyze_ttydata
void
analyze_ttydata()
{
static char cmdbuf[33];
static uint8_t cmdlen;
uint8_t idx, ucCommand;
while(USB_Rx_Buffer->nbytes) {
ucCommand = rb_get(USB_Rx_Buffer);
//DC(ucCommand); // echo
if(ucCommand == '\n' || ucCommand == '\r') {
if(!cmdlen) // empty return
continue;
cmdbuf[cmdlen] = 0;
if(!callfn(cmdbuf)) {
DC('?');
for(idx = 0; fntab[idx].name; idx++) {
DC(' ');
DC(fntab[idx].name);
}
DNL();
}
cmdlen = 0;
} else {
if(cmdlen < sizeof(cmdbuf)-1)
cmdbuf[cmdlen++] = ucCommand;
}
}
}
示例3: fht_display_buf
void
fht_display_buf(uint8_t ptr[])
{
#ifdef FHTDEBUG
#warning FHT USB DEBUGGING IS ACTIVE
uint8_t odc = display_channel;
display_channel = DISPLAY_USB;
uint16_t *p = (uint16_t *)&ticks;
DU(*p, 5);
DC(' ');
DH2(fht80b_state);
DC(' ');
#else
if(!(tx_report & REP_FHTPROTO))
return;
#endif
DC('T');
for(uint8_t i = 0; i < 5; i++)
DH2(ptr[i]);
if(tx_report & REP_RSSI)
DH2(250);
DNL();
#ifdef FHTDEBUG
display_channel = odc;
#endif
}
示例4: return
ObjToLexEntry *ObjToLexEntryGet1A(Obj *obj, Obj *value_prop, char *features,
char *not_usagefeat, int subcat, int paruniv,
int *theta_filled, Discourse *dc)
{
int save_style;
char *p;
ObjToLexEntry *ole;
if ((ole = ObjToLexEntryGet1B(obj, value_prop, features, not_usagefeat,
subcat, paruniv, theta_filled, dc))) {
return(ole);
}
/* Try other styles. */
save_style = DC(dc).style;
for (p = FT_STYLE FS_NULL; *p; p++) {
if (*p == save_style) continue;
DC(dc).style = *p;
if ((ole = ObjToLexEntryGet1B(obj, value_prop, features, not_usagefeat,
subcat, paruniv, theta_filled,
dc))) {
return(ole);
}
}
DC(dc).style = save_style;
return(NULL);
}
示例5: RfAnalyze_Task
void
RfAnalyze_Task(void)
{
uint8_t datatype = 0;
bucket_t *b;
uint8_t oby = 0;
if(lowtime) {
if(tx_report & REP_LCDMON) {
#ifdef HAS_LCD
lcd_txmon(hightime, lowtime);
#else
uint8_t rssi = cc1100_readReg(CC1100_RSSI); // 0..256
rssi = (rssi >= 128 ? rssi-128 : rssi+128); // Swap
if(rssi < 64) // Drop low and high 25%
rssi = 0;
else if(rssi >= 192)
rssi = 15;
else
rssi = (rssi-80)>>3;
DC('a'+rssi);
#endif
}
if(tx_report & REP_MONITOR) {
DC('r'); if(tx_report & REP_BINTIME) DC(hightime);
DC('f'); if(tx_report & REP_BINTIME) DC(lowtime);
}
lowtime = 0;
}
示例6: rf_moritz_task
void
rf_moritz_task(void)
{
uint8_t enc[MAX_MORITZ_MSG];
uint8_t rssi;
if(!moritz_on)
return;
// see if a CRC OK pkt has been arrived
if(bit_is_set( CC1100_IN_PORT, CC1100_IN_PIN )) {
//errata #1 does not affect us, because we wait until packet is completely received
enc[0] = CC1100_READREG( CC1100_RXFIFO ) & 0x7f; // read len
if (enc[0]>=MAX_MORITZ_MSG)
enc[0] = MAX_MORITZ_MSG-1;
CC1100_ASSERT;
cc1100_sendbyte( CC1100_READ_BURST | CC1100_RXFIFO );
for (uint8_t i=0; i<enc[0]; i++) {
enc[i+1] = cc1100_sendbyte( 0 );
}
// RSSI is appended to RXFIFO
rssi = cc1100_sendbyte( 0 );
// And Link quality indicator, too
/* LQI = */ cc1100_sendbyte( 0 );
CC1100_DEASSERT;
moritz_handleAutoAck(enc);
if (tx_report & REP_BINTIME) {
DC('z');
for (uint8_t i=0; i<=enc[0]; i++)
DC( enc[i] );
} else {
DC('Z');
for (uint8_t i=0; i<=enc[0]; i++)
DH2( enc[i] );
if (tx_report & REP_RSSI)
DH2(rssi);
DNL();
}
return;
}
if(CC1100_READREG( CC1100_MARCSTATE ) == 17) {
CCSTROBE( CC1100_SFRX );
CCSTROBE( CC1100_SIDLE );
CCSTROBE( CC1100_SRX );
}
}
示例7: DC
VOID CHalWaveDevice::DebugPrintStatus( VOID )
/////////////////////////////////////////////////////////////////////////////
{
ULONG ulStreamStatus = m_RegStreamStatus.Read();
ULONG ulStreamControl = m_RegStreamControl.Read();
(void) ulStreamStatus; (void)ulStreamControl;
DC('[');
DX16( (USHORT)(ulStreamStatus & REG_STREAMSTAT_L2PTR_MASK), COLOR_NORMAL );
DC(',');
DX16( (USHORT)(ulStreamControl & REG_STREAMCTL_PCPTR_MASK), COLOR_NORMAL );
DC(']');
}
示例8: shoes_slot_scroll_to
void shoes_slot_scroll_to(shoes_canvas *canvas, int dy, int rel) {
if (rel)
canvas->slot->scrolly += dy;
else
canvas->slot->scrolly = dy;
if (canvas->slot->scrolly > canvas->endy - canvas->height)
canvas->slot->scrolly = canvas->endy - canvas->height;
if (canvas->slot->scrolly < 0)
canvas->slot->scrolly = 0;
if (DC(canvas->app->slot) == DC(canvas->slot)) canvas->app->slot->scrolly = canvas->slot->scrolly;
shoes_native_slot_scroll_top(canvas->slot);
shoes_slot_repaint(canvas->slot);
}
示例9: lcd_contrast
void
lcd_contrast(uint8_t hb)
{
uint8_t contrast = erb((uint8_t*)EE_CONTRAST);
if(hb == 0xFE) {
contrast--;
} else if (hb == 0xFD) {
contrast++;
} else if (hb == 0xFC) {
//keep the eeprom value
} else {
contrast = hb;
}
if(contrast < 40) contrast = 40;
if(contrast > 80) contrast = 80;
ewb((uint8_t*)EE_CONTRAST, contrast);
lcd_sendcmd (LCD_CMD_SETCON);
lcd_senddata (contrast);
DS_P( PSTR("Contrast:") );
DU(100-(contrast-40)*100/40, 3);
DC('%');
DNL();
}
示例10: ccreg
//--------------------------------------------------------------------
void
ccreg(char *in)
{
uint8_t hb, out, addr;
if(in[1] == 'w' && fromhex(in+2, &addr, 1) && fromhex(in+4, &hb, 1)) {
cc1100_writeReg(addr, hb);
ccStrobe( CC1100_SCAL );
ccRX();
DH2(addr); DH2(hb); DNL();
} else if(fromhex(in+1, &hb, 1)) {
if(hb == 0x99) {
for(uint8_t i = 0; i < 0x30; i++) {
DH2(cc1100_readReg(i));
if((i&7) == 7)
DNL();
}
} else {
out = cc1100_readReg(hb);
DC('C'); // prefix
DH2(hb); // register number
DS_P( PSTR(" = ") );
DH2(out); // result, hex
DS_P( PSTR(" / ") );
DU(out,2); // result, decimal
DNL();
}
}
}
示例11: ObjToLexEntryGet1
ObjToLexEntry *ObjToLexEntryTransGet2(Obj *obj, Obj *value, char *feat,
int paruniv, int *theta_filled,
Discourse *dc)
{
int save_style;
ObjToLexEntry *ole;
ole = ObjToLexEntryGet1(obj, value, feat, F_NULL, paruniv, theta_filled, dc);
if (ole == NULL && DC(dc).style != F_NULL) {
save_style = DC(dc).style;
DC(dc).style = F_NULL;
ole = ObjToLexEntryGet1(obj, value, feat, F_NULL, paruniv, theta_filled,
dc);
DC(dc).style = save_style;
}
return(ole);
}
示例12: RptAddConcept
void RptAddConcept(Rpt *rpt, Obj *obj, Discourse *dc)
{
char buf[PHRASELEN];
GenConceptString(obj, N("empty-article"), F_NOUN, F_NULL, DC(dc).lang,
F_NULL, F_NULL, F_NULL, PHRASELEN, 0, 1, dc, buf);
RptAdd(rpt, buf, RPT_JUST_LEFT);
}
示例13: ntp_digestpacket
void
ntp_digestpacket()
{
if(uip_len < sizeof(ntp_packet_t))
return;
ntp_packet_t *p = (ntp_packet_t*)uip_appdata;
uint8_t *f = (uint8_t *)&ntp_sec;
f[0] = p->tx_ts.u8[3];
f[1] = p->tx_ts.u8[2];
f[2] = p->tx_ts.u8[1];
f[3] = p->tx_ts.u8[0];
ntp_hsec = (uint16_t)(p->tx_ts.u8[4]*125)/256;
if(eth_debug) {
DC('n'); DC('r'); ntp_func(0);
}
}
示例14: lcd_brightness
void
lcd_brightness(uint8_t hb)
{
int16_t brightness = erb((uint8_t*)EE_BRIGHTNESS);
if(hb == 0xFE) {
brightness += 0x20;
} else if (hb == 0xFD) {
brightness -= 0x20;
} else if (hb == 0xFC) {
//keep the eeprom value
} else {
brightness = hb;
}
if(brightness < 0) brightness = 0;
if(brightness > 255) brightness = 255;
ewb((uint8_t*)EE_BRIGHTNESS, brightness);
LCD_BL_PWM = brightness;
DS_P( PSTR("Brightns:") );
DU(brightness*100/255, 3);
DC('%');
DNL();
}
示例15: moritz_sendAck
void
moritz_sendAck(uint8_t* enc)
{
uint8_t ackPacket[12];
ackPacket[0] = 11; /* len*/
ackPacket[1] = enc[1]; /* msgcnt */
ackPacket[2] = 0; /* flag */
ackPacket[3] = 2; /* type = Ack */
for(int i=0;i<3;++i) /* src = enc_dst*/
ackPacket[4+i] = enc[7+i];
for(int i=0;i<3;++i) /* dst = enc_src */
ackPacket[7+i] = enc[4+i];
ackPacket[10] = 0; /* groupid */
ackPacket[11] = 0; /* payload */
my_delay_ms(20); /* by experiments */
moritz_sendraw(ackPacket, 0);
//Inform FHEM that we send an autoack
DC('Z');
for (uint8_t i=0; i < ackPacket[0]+1; i++)
DH2( ackPacket[i] );
if (tx_report & REP_RSSI)
DH2( 0 ); //fake some rssi
DNL();
}