本文整理汇总了C++中FLAG_SET函数的典型用法代码示例。如果您正苦于以下问题:C++ FLAG_SET函数的具体用法?C++ FLAG_SET怎么用?C++ FLAG_SET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FLAG_SET函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: g_free
/**
* 更新好友信息数据.
* @param pal 好友数据
*/
void UdpData::UpdatePalInfo(PalInfo *pal)
{
g_free(pal->segdes);
pal->segdes = progdt.FindNetSegDescription(ipv4);
g_free(pal->version);
if (!(pal->version = iptux_get_section_string(buf, ':', 0)))
pal->version = g_strdup("?");
g_free(pal->user);
if (!(pal->user = iptux_get_section_string(buf, ':', 2)))
pal->user = g_strdup("???");
g_free(pal->host);
if (!(pal->host = iptux_get_section_string(buf, ':', 3)))
pal->host = g_strdup("???");
if (!FLAG_ISSET(pal->flags, 2)) {
g_free(pal->name);
if (!(pal->name = ipmsg_get_attach(buf, ':', 5)))
pal->name = g_strdup(_("mysterious"));
g_free(pal->group);
pal->group = GetPalGroup();
g_free(pal->iconfile);
if (!(pal->iconfile = GetPalIcon()))
pal->iconfile = g_strdup(progdt.palicon);
FLAG_CLR(pal->flags, 0);
g_free(pal->encode);
if ( (pal->encode = GetPalEncode()))
FLAG_SET(pal->flags, 0);
else
pal->encode = g_strdup(encode ? encode : "utf-8");
}
FLAG_SET(pal->flags, 1);
pal->packetn = 0;
pal->rpacketn = 0;
}
开发者ID:Chingpo-Lai,项目名称:iptux,代码行数:37,代码来源:UdpData.cpp
示例2: g_strdup
/**
* 创建好友信息数据.
* @return 好友数据
*/
PalInfo *UdpData::CreatePalInfo()
{
PalInfo *pal;
pal = new PalInfo;
pal->ipv4 = ipv4;
pal->segdes = progdt.FindNetSegDescription(ipv4);
if (!(pal->version = iptux_get_section_string(buf, ':', 0)))
pal->version = g_strdup("?");
if (!(pal->user = iptux_get_section_string(buf, ':', 2)))
pal->user = g_strdup("???");
if (!(pal->host = iptux_get_section_string(buf, ':', 3)))
pal->host = g_strdup("???");
if (!(pal->name = ipmsg_get_attach(buf, ':', 5)))
pal->name = g_strdup(_("mysterious"));
pal->group = GetPalGroup();
pal->photo = NULL;
pal->sign = NULL;
if (!(pal->iconfile = GetPalIcon()))
pal->iconfile = g_strdup(progdt.palicon);
if ( (pal->encode = GetPalEncode()))
FLAG_SET(pal->flags, 0);
else
pal->encode = g_strdup(encode ? encode : "utf-8");
FLAG_SET(pal->flags, 1);
pal->packetn = 0;
pal->rpacketn = 0;
return pal;
}
开发者ID:Chingpo-Lai,项目名称:iptux,代码行数:34,代码来源:UdpData.cpp
示例3: clientAutoMaximize
static void
clientAutoMaximize (Client * c, int full_w, int full_h)
{
if (FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN) ||
!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_BORDER))
{
/*
* Fullscreen or undecorated windows should not be
* automatically maximized...
*/
return;
}
if (!FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ) &&
(frameWidth (c) > full_w))
{
TRACE ("The application \"%s\" has requested a window width "
"(%u) larger than the actual width available in the workspace (%u), "
"the window will be maximized horizontally.", c->name, frameWidth (c), full_w);
FLAG_SET (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ);
}
if (!FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_VERT) &&
(frameHeight (c) > full_h))
{
TRACE ("The application \"%s\" has requested a window height "
"(%u) larger than the actual height available in the workspace (%u), "
"the window will be maximized vertically.", c->name, frameHeight (c), full_h);
FLAG_SET (c->flags, CLIENT_FLAG_MAXIMIZED_VERT);
}
}
开发者ID:jjk-jacky,项目名称:xfwm4-jjk,代码行数:31,代码来源:placement.c
示例4: tail_recursion_elimination
tail_recursion_elimination ()
{
int alt;
int tre = 0;
if (no_recursion_elm_flag)
return false;
for (alt = SON (ulhs); alt != nil; alt = BROTHER (alt))
{
int mem = SON (alt);
if (mem == nil)
continue;
if (FLAG_MARKED (alt, no_tail_recursion_opt_f))
continue;
mem = get_last_but_cut_mem (mem);
if (DEF (mem) == ulhs)
{
FLAG_SET (alt, tail_recursion_opt_f);
FLAG_SET (mem, tail_recursion_opt_f);
tre = 1;
}
}
return tre;
}
开发者ID:glammar,项目名称:glammar,代码行数:25,代码来源:gg11.c
示例5: nvmed_handle_feature_set
/*
* Set Handle Features
*/
int nvmed_handle_feature_set(NVMED_HANDLE* nvmed_handle, int feature, int value) {
switch(feature) {
case HANDLE_DIRECT_IO:
if(value)
FLAG_SET(nvmed_handle, HANDLE_DIRECT_IO);
else
FLAG_UNSET(nvmed_handle, HANDLE_DIRECT_IO);
break;
case HANDLE_SYNC_IO:
if(value)
FLAG_SET(nvmed_handle, HANDLE_SYNC_IO);
else
FLAG_UNSET(nvmed_handle, HANDLE_SYNC_IO);
break;
case HANDLE_HINT_DMEM:
if(value)
FLAG_SET(nvmed_handle, HANDLE_HINT_DMEM);
else
FLAG_UNSET(nvmed_handle, HANDLE_HINT_DMEM);
break;
}
return value;
}
开发者ID:nvmedirect,项目名称:nvmedirect,代码行数:29,代码来源:lib_nvmed.c
示例6: USB_Init
void USB_Init(void)
{
extern uint32 __VECTOR_RAM[];
/* Software Configuration */
Setup_Pkt=(tUSB_Setup*)BufferPointer[bEP0OUT_ODD];
gu8USB_State=uPOWER;
/* MPU Configuration */
MPU_CESR=0; // MPU is disable. All accesses from all bus masters are allowed
/* SIM Configuration */
#ifdef USB_CLOCK_CLKIN
FLAG_SET(SIM_SCGC5_PORTE_SHIFT,SIM_SCGC5);
PORTE_PCR26=(0|PORT_PCR_MUX(7)); // Enabling PTE26 as CLK input
#endif
#ifdef USB_CLOCK_PLL
FLAG_SET(SIM_SOPT2_PLLFLLSEL_SHIFT,SIM_SOPT2); // Select PLL output
#endif
#ifndef USB_CLOCK_CLKIN
FLAG_SET(SIM_SOPT2_USBSRC_SHIFT,SIM_SOPT2); // PLL/FLL selected as CLK source
#endif
SIM_CLKDIV2|=USB_FARCTIONAL_VALUE; // USB Freq Divider
SIM_SCGC4|=(SIM_SCGC4_USBOTG_MASK); // USB Clock Gating
/* NVIC Configuration */
__VECTOR_RAM[89]=(UINT32)USB_ISR; //replace ISR
//NVICICER2|=(1<<9); //Clear any pending interrupts on USB
NVICISER2|=(1<<9); //Enable interrupts from USB module
/* USB Module Configuration */
// Reset USB Module
USB0_USBTRC0|=USB_USBTRC0_USBRESET_MASK;
while(FLAG_CHK(USB_USBTRC0_USBRESET_SHIFT,USB0_USBTRC0)){};
// Set BDT Base Register
USB0_BDTPAGE1=(UINT8)((UINT32)tBDTtable>>8);
USB0_BDTPAGE2=(UINT8)((UINT32)tBDTtable>>16);
USB0_BDTPAGE3=(UINT8)((UINT32)tBDTtable>>24);
// Clear USB Reset flag
FLAG_SET(USB_ISTAT_USBRST_MASK,USB0_ISTAT);
// Enable USB Reset Interrupt
FLAG_SET(USB_INTEN_USBRSTEN_SHIFT,USB0_INTEN);
// Enable weak pull downs
USB0_USBCTRL=0x40;
USB0_USBTRC0|=0x40;
USB0_CTL|=0x01;
}
开发者ID:LouisMo,项目名称:New-Balance-Program-Structure,代码行数:59,代码来源:USB.c
示例7: USB_Reset_Handler
void USB_Reset_Handler(void)
{
//PMC_VLPR_Exit();
/* Software Flags */
u8CDCState=0;
gu8USBClearFlags=0xFF;
gu8USB_Toogle_flags=0;
gu8USB_PingPong_flags=0x00;
/* Disable all data EP registers */
USB0_ENDPT1=0x00;
USB0_ENDPT2=0x00;
USB0_ENDPT3=0x00;
USB0_ENDPT4=0x00;
USB0_ENDPT5=0x00;
USB0_ENDPT6=0x00;
/* EP0 BDT Setup */
// EP0 OUT BDT Settings
tBDTtable[bEP0OUT_ODD].Cnt = EP0_SIZE;
tBDTtable[bEP0OUT_ODD].Addr =(UINT32)gu8EP0_OUT_ODD_Buffer;
tBDTtable[bEP0OUT_ODD].Stat._byte = kUDATA1;
// EP0 OUT BDT Settings
tBDTtable[bEP0OUT_EVEN].Cnt = EP0_SIZE;
tBDTtable[bEP0OUT_EVEN].Addr =(UINT32)gu8EP0_OUT_EVEN_Buffer;
tBDTtable[bEP0OUT_EVEN].Stat._byte = kUDATA1;
// EP0 IN BDT Settings
tBDTtable[bEP0IN_ODD].Cnt = EP0_SIZE;
tBDTtable[bEP0IN_ODD].Addr =(UINT32)gu8EP0_IN_ODD_Buffer;
tBDTtable[bEP0IN_ODD].Stat._byte = kUDATA0;
// EP0 IN BDT Settings
tBDTtable[bEP0IN_EVEN].Cnt = (EP0_SIZE);
tBDTtable[bEP0IN_EVEN].Addr =(UINT32)gu8EP0_IN_EVEN_Buffer;
tBDTtable[bEP0IN_EVEN].Stat._byte = kUDATA0;
// Enable EP0
USB0_ENDPT0=0x0D;
// Clear all Error flags
USB0_ERRSTAT=0xFF;
// CLear all USB ISR flags
USB0_ISTAT=0xFF;
// Set default Address
USB0_ADDR=0x00;
// Enable all error sources
USB0_ERREN=0xFF;
// USB Interrupt Enablers
FLAG_SET(USB_INTEN_TOKDNEEN_SHIFT,USB0_INTEN);
FLAG_SET(USB_INTEN_SOFTOKEN_SHIFT,USB0_INTEN);
FLAG_SET(USB_INTEN_ERROREN_SHIFT,USB0_INTEN);
FLAG_SET(USB_INTEN_USBRSTEN_SHIFT,USB0_INTEN);
}
开发者ID:LouisMo,项目名称:New-Balance-Program-Structure,代码行数:57,代码来源:USB.c
示例8: nvmed_cache_alloc
/*
* Allocation cache slot and memory
*/
int nvmed_cache_alloc(NVMED* nvmed, unsigned int size, bool lazy_init) {
int i;
unsigned int req_size;
NVMED_CACHE_SLOT *slot;
NVMED_CACHE *info;
u64 *paList;
pthread_spin_lock(&nvmed->mngt_lock);
if(size == 0) return -NVMED_FAULT;
if(size == nvmed->num_cache_size) return 0;
if(size < nvmed->num_cache_size) {
nvmed_printf("%s: Cache shrinking is not supported\n", nvmed->ns_path);
return -NVMED_FAULT;
}
req_size = size - nvmed->num_cache_size;
slot = malloc(sizeof(NVMED_CACHE_SLOT));
slot->cache_info = malloc(sizeof(NVMED_CACHE) * req_size);
slot->cache_ptr = mmap(NULL, PAGE_SIZE * req_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_LOCKED | MAP_SHARED, -1, 0);
slot->size = req_size;
LIST_INSERT_HEAD(&nvmed->slot_head, slot, slot_list);
/* Initialize memory and translate virt to phys addr */
if(!lazy_init) {
paList = malloc(sizeof(u64) * req_size);
virt_to_phys(nvmed, slot->cache_ptr, paList, PAGE_SIZE * req_size);
}
/* fill cache info and add to free list */
for(i=0; i<req_size; i++) {
info = slot->cache_info + i;
info->lpaddr = 0;
info->ref = 0;
if(lazy_init == false) {
info->paddr = paList[i];
FLAG_SET(info, CACHE_FREE);
}
else {
info->paddr = 0;
FLAG_SET(info, CACHE_UNINIT | CACHE_FREE);
}
info->ptr = slot->cache_ptr + (i*PAGE_SIZE);
TAILQ_INSERT_HEAD(&nvmed->free_head, info, cache_list);
}
nvmed->num_cache_size = size;
pthread_spin_unlock(&nvmed->mngt_lock);
return req_size;
}
开发者ID:nvmedirect,项目名称:nvmedirect,代码行数:58,代码来源:lib_nvmed.c
示例9: hw_usb_reset_handler
//=========================================================================
//函数名: hw_usb_reset_handler
//功 能: 处理复位中断
//参 数: 无
//返 回: 无
//=========================================================================
void hw_usb_reset_handler(void)
{
//清标志
gu8USBClearFlags=0xFF;
gu8USB_Toogle_flags=0;
//禁止所有端点
USB0_ENDPT1=0x00;
USB0_ENDPT2=0x00;
USB0_ENDPT3=0x00;
USB0_ENDPT4=0x00;
USB0_ENDPT5=0x00;
USB0_ENDPT6=0x00;
// EP0 BDT Setup
// EP0 OUT BDT 设置
tBDTtable[bEP0OUT_ODD].Cnt = EP0_SIZE;
tBDTtable[bEP0OUT_ODD].Addr =(uint_32)gu8EP0_OUT_ODD_Buffer;
tBDTtable[bEP0OUT_ODD].Stat._byte = kUDATA1;
// EP0 OUT BDT 设置
tBDTtable[bEP0OUT_EVEN].Cnt = EP0_SIZE;
tBDTtable[bEP0OUT_EVEN].Addr =(uint_32)gu8EP0_OUT_EVEN_Buffer;
tBDTtable[bEP0OUT_EVEN].Stat._byte = kUDATA1;
// EP0 IN BDT 设置
tBDTtable[bEP0IN_ODD].Cnt = EP0_SIZE;
tBDTtable[bEP0IN_ODD].Addr =(uint_32)gu8EP0_IN_ODD_Buffer;
tBDTtable[bEP0IN_ODD].Stat._byte = kUDATA0;
// EP0 IN BDT 设置
tBDTtable[bEP0IN_EVEN].Cnt = (EP0_SIZE);
tBDTtable[bEP0IN_EVEN].Addr =(uint_32)gu8EP0_IN_EVEN_Buffer;
tBDTtable[bEP0IN_EVEN].Stat._byte = kUDATA0;
// 使能 EP0
USB0_ENDPT0=0x0D;
// 清除所有的错误
USB0_ERRSTAT=0xFF;
// 清除所有的中断标志
USB0_ISTAT=0xFF;
// USB设备地址
USB0_ADDR=0x00;
// 使能所有的错误中断
USB0_ERREN=0xFF;
// USB模块中断使能
FLAG_SET(USB_INTEN_TOKDNEEN_SHIFT,USB0_INTEN);
FLAG_SET(USB_INTEN_SOFTOKEN_SHIFT,USB0_INTEN);
FLAG_SET(USB_INTEN_ERROREN_SHIFT,USB0_INTEN);
FLAG_SET(USB_INTEN_USBRSTEN_SHIFT,USB0_INTEN);
}
开发者ID:forbelief,项目名称:KL25EM,代码行数:59,代码来源:usb.c
示例10: _bsp_platform_init
void _bsp_platform_init(void)
{
/* MPU Configuration */
MPU_CESR=0; // MPU is disable. All accesses from all bus masters are allowed
/* SIM Configuration */
FLAG_SET(SIM_SOPT2_USBSRC_SHIFT,SIM_SOPT2); // PLL/FLL selected as CLK source
FLAG_SET(SIM_SOPT2_PLLFLLSEL_SHIFT,SIM_SOPT2); // Select PLL output
SIM_CLKDIV2=0x02; // USB Freq Divider
SIM_SCGC4|=(SIM_SCGC4_USBOTG_MASK); // USB Clock Gating
// weak pulldowns
USB0_USBCTRL=0x40;
}
开发者ID:LouisMo,项目名称:New-Balance-Program-Structure,代码行数:15,代码来源:P2.c
示例11: hw_usb_endpoint_setup_handler
//=========================================================================
//函数名: hw_usb_endpoint_setup_handler
//功 能: 当主机请求接口配置请求时,执行该函数
//参 数: 无
//返 回: 无
//=========================================================================
void hw_usb_endpoint_setup_handler(void)
{
uint_16 u16Status;
switch(Setup_Pkt->bRequest)
{
case GET_STATUS:
if(FLAG_CHK(Setup_Pkt->wIndex_h,gu8HALT_EP))
u16Status=0x0100;
else
u16Status=0x0000;
hw_usb_ep_in_transfer(EP0,(uint_8*)&u16Status,2);
break;
case CLEAR_FEATURE:
FLAG_CLR(Setup_Pkt->wIndex_h,gu8HALT_EP);
hw_usb_ep_in_transfer(EP0,0,0);
break;
case SET_FEATURE:
FLAG_SET(Setup_Pkt->wIndex_h,gu8HALT_EP);
hw_usb_ep_in_transfer(EP0,0,0);
break;
default:
break;
}
}
开发者ID:forbelief,项目名称:KL25EM,代码行数:36,代码来源:usb.c
示例12: vfnInitUSBClock
void vfnInitUSBClock (uint8_t u8ClkOption)
{
switch (u8ClkOption)
{
case MCGPLL0:
{
SIM_SOPT2 |= SIM_SOPT2_PLLFLLSEL_MASK /** PLL reference */
| SIM_SOPT2_USBSRC_MASK; /** USB clock source MCGPLLCLK/2 or MCGFLLCLK */
break;
}
case MCGFLL:
{
/** Configure FLL to generate a 48MHz core clock */
fll_init();
SIM_SOPT2 &= ~SIM_SOPT2_PLLFLLSEL_MASK; /** FLL reference */
SIM_SOPT2 |= SIM_SOPT2_USBSRC_MASK; /** USB clock source MCGPLLCLK/2 or MCGFLLCLK */
break;
}
case CLKIN:
{
SIM_SOPT2 &= (uint32_t)(~SIM_SOPT2_USBSRC_MASK); /** PTA5 selected as USBFS CLK source */
FLAG_SET(SIM_SCGC5_PORTA_SHIFT,SIM_SCGC5);
PORTA_PCR5=(0|PORT_PCR_MUX(2)); /** Enable PTA5 as CLK input */
}
}
SIM_SCGC4|=(SIM_SCGC4_USBOTG_MASK); // USB Clock Gating
}
开发者ID:noahp,项目名称:lightBar,代码行数:34,代码来源:bsp_KL25.c
示例13: block_store_link
void block_store_link(block_store_t *const bs, const char *const filename) {
if (bs && filename) {
if (! FLAG_CHECK(bs, FILE_LINKED)) {
// Ok, I can make a giant complicated hunk of logic to:
// Create if it doesn't exist
// Increase size if smaller
// Decrease size if larger
// and It'll be a giant headache for various reasons (error checking, portability)
// OR, I can just do it in two commands and call it a day.
bs->fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP);
if (bs->fd != -1) {
if (utility_write_file(bs->fd, bs->data_blocks, BLOCK_COUNT * BLOCK_SIZE) == BLOCK_COUNT * BLOCK_SIZE) {
// Kill the DBM and dirty flag, set link state
bitmap_format(bs->dbm, 0x00);
FLAG_CLEAR(bs, DIRTY);
FLAG_SET(bs, FILE_LINKED);
bs_errno = BS_OK;
return;
}
bs_errno = BS_FILE_IO;
return;
}
bs_errno = BS_FILE_ACCESS;
return;
}
bs_errno = BS_LINK_EXISTS;
return;
}
bs_errno = BS_PARAM;
}
开发者ID:cjc455,项目名称:OSF15_Library,代码行数:30,代码来源:block_store.c
示例14: FLAG_SET
void I8254Pit::writePeriodicIo(void)
{
state.lock.acquire();
io::write8(
i8254_CHAN0_IO_CONTROL,
i8254_CHAN0_CONTROL_SELECT_COUNTER
| i8254_CHAN0_CONTROL_MODE2_RATEGEN
| i8254_CHAN0_CONTROL_COUNTER_WRITE_LOWHIGH);
atomicAsm::memoryBarrier();
// Write out the currently set periodic rate.
io::write8(
i8254_CHAN0_IO_COUNTER,
i8254State.currentIntervalClks & 0xFF);
io::write8(
i8254_CHAN0_IO_COUNTER,
i8254State.currentIntervalClks >> 8);
FLAG_SET(
state.rsrc.flags,
ZKCM_TIMERDEV_STATE_FLAGS_ENABLED
| ZKCM_TIMERDEV_STATE_FLAGS_SOFT_ENABLED);
state.lock.release();
}
开发者ID:latentPrion,项目名称:zambesii,代码行数:28,代码来源:i8254.cpp
示例15: esys_isolate
int esys_isolate(struct esys* esys, ocn_entity_token_t token, entity_t** entity)
{
if(token >= OCN_MAX_ENTITIES)
return OCN_ENTITY_ERR_RANGE;
*entity = NULL;
pthread_spin_lock(&esys->lock);
struct entityslot* slot = &esys->slots[token];
if(!FLAG_GET(slot->flags, ENTITYSLOT_FLAG_USED))
{
pthread_spin_unlock(&esys->lock);
return OCN_ENTITY_ERR_NONEXIST;
}
if(FLAG_GET(slot->flags, ENTITYSLOT_FLAG_ISOLATED))
{
pthread_spin_unlock(&esys->lock);
return OCN_ENTITY_ERR_ISOLATED;
}
/* --- */
FLAG_SET(slot->flags, ENTITYSLOT_FLAG_ISOLATED);
*entity = &slot->entity;
/* --- */
pthread_spin_unlock(&esys->lock);
return OCN_OK;
}
开发者ID:onixion,项目名称:pandarus,代码行数:34,代码来源:esys.c
示例16: sudoku_get
static int sudoku_get(const char *filename)
{
int fd;
int i, j;
char buf[10];
fd = open(filename, O_RDONLY);
if (fd == -1) {
printf("open %s error!\n", filename);
getch();
exit(-1);
}
for (i = 0; i < 9; i++) {
read(fd, buf, 10);
for (j = 0; j < 9; j++) {
if ((buf[j] >= '0') && (buf[j] <= '9')) {
sudoku[i][j].data = buf[j] - '0';
sudoku[i][j].flag = FLAG_SET(buf[j] - '0');
} else {
printf("ERROR - Please check origin data\n");
getch();
exit(-1);
}
}
}
if (fd)
close(fd);
return 0;
}
开发者ID:zenglg,项目名称:learning,代码行数:32,代码来源:sudoku.c
示例17: esys_add
int esys_add(struct esys* esys, ocn_entity_token_t* token, ocn_entity_type_t type)
{
if(token == NULL)
return OCN_FAIL;
/* generate token */
if(esys_token(esys, token) != OCN_OK)
return OCN_ENTITY_ERR_MAX;
/* we do not need to lock here,
because nobody can possibly
know this token by now. */
if(entity_init(&esys->slots[*token].entity, type) != OCN_OK)
return OCN_ENTITY_ERR_INIT;
pthread_spin_lock(&esys->lock);
/* --- */
FLAG_SET(esys->slots[*token].flags, ENTITYSLOT_FLAG_USED);
/* --- */
pthread_spin_unlock(&esys->lock);
return OCN_OK;
}
开发者ID:onixion,项目名称:pandarus,代码行数:27,代码来源:esys.c
示例18: CDC_InterfaceReq_Handler
/*!
* @brief 当前接口请求为CDC类请求 的 中断复位函数
* @note 在 USB_Setup_Handler 中断里调用
* @since v5.0
*/
uint8 CDC_InterfaceReq_Handler(void)
{
uint8 u8State = uSETUP;
switch(Setup_Pkt->bRequest)
{
case GET_INTERFACE:
EP_IN_Transfer(EP0, &gu8Interface, 1);
break;
case GET_LINE_CODING:
EP_IN_Transfer(EP0, (uint8 *)&com_cfg, 7);
break;
case SET_LINE_CODING:
u8CDCState = SET_LINE_CODING;
u8State = uDATA;
break;
case SET_CONTROL_LINE_STATE:
u8CDCState = SET_CONTROL_LINE_STATE;
u8State = uSETUP;
break;
case LOADER_MODE:
FLAG_SET(LOADER, gu8USB_Flags);
CDC_OUT_Data[0] = 0xFF;
break;
default:
break;
}
return(u8State);
}
开发者ID:github188,项目名称:Freescale-Smartcar,代码行数:38,代码来源:USB_CDC.c
示例19: rsys_worker_req_add
int rsys_worker_req_add(struct rsys* rsys, ocn_entity_token_t token, entity_t* entity)
{
rsys_req_t* req = ocn_malloc(sizeof(rsys_req_t));
req->flags = 0;
FLAG_SET(req->flags, RSYS_REQ_RENDERER);
req->type = RSYS_REQ_TYPE_ADD;
req->token = token;
switch(entity->type)
{
case ENTITY_TYPE_NONE:
break;
case ENTITY_TYPE_CAMERA:
break;
case ENTITY_TYPE_POINTLIGHT:
break;
case ENTITY_TYPE_STATIC_MESH:
break;
default:
break;
}
return rsys_worker_req(rsys, req);
}
开发者ID:onixion,项目名称:pandarus,代码行数:29,代码来源:rsys.c
示例20: clientInitFocusFlag
void
clientInitFocusFlag (Client * c)
{
ScreenInfo *screen_info;
Client *c2;
GList *list;
guint workspace;
g_return_if_fail (c != NULL);
TRACE ("client \"%s\" (0x%lx)", c->name, c->window);
if (!clientAcceptFocus (c) || (c->type & WINDOW_TYPE_DONT_FOCUS))
{
return;
}
screen_info = c->screen_info;
workspace = c->win_workspace;
for (list = screen_info->windows_stack; list; list = g_list_next (list))
{
c2 = (Client *) list->data;
if ((c2->win_workspace == workspace) && FLAG_TEST (c2->xfwm_flags, XFWM_FLAG_FOCUS))
{
FLAG_UNSET (c2->xfwm_flags, XFWM_FLAG_FOCUS);
}
}
FLAG_SET (c->xfwm_flags, XFWM_FLAG_FOCUS);
}
开发者ID:iglosiggio,项目名称:xfwm4,代码行数:28,代码来源:focus.c
注:本文中的FLAG_SET函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论