本文整理汇总了C++中diag_printf函数的典型用法代码示例。如果您正苦于以下问题:C++ diag_printf函数的具体用法?C++ diag_printf怎么用?C++ diag_printf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了diag_printf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: fb_close
/* close framebuffer*/
static void
fb_close(PSD psd)
{
diag_printf("%s - NOT IMPLEMENTED\n", __FUNCTION__);
#if 0
int tty;
/* if not opened, return*/
if(status != 2)
return;
status = 1;
/* reset hw palette*/
ioctl_setpalette(0, 256, saved_red, saved_green, saved_blue);
/* unmap framebuffer*/
// munmap(psd->addr, psd->size);
/* close framebuffer*/
close(fb);
#endif
}
开发者ID:ghaerr,项目名称:microwindows,代码行数:23,代码来源:scr_ecos.c
示例2: do_swab
static void
do_swab(int argc, char *argv[])
{
// Fill a region of memory with a pattern
struct option_info opts[4];
unsigned long base;
long len;
bool base_set, len_set;
bool set_32bit, set_16bit;
init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM,
(void *)&base, (bool *)&base_set, "base address");
init_opts(&opts[1], 'l', true, OPTION_ARG_TYPE_NUM,
(void *)&len, (bool *)&len_set, "length");
init_opts(&opts[2], '4', false, OPTION_ARG_TYPE_FLG,
(void *)&set_32bit, (bool *)0, "fill 32 bit units");
init_opts(&opts[3], '2', false, OPTION_ARG_TYPE_FLG,
(void *)&set_16bit, (bool *)0, "fill 16 bit units");
if (!scan_opts(argc, argv, 1, opts, 4, 0, 0, "")) {
return;
}
if (!base_set || !len_set) {
diag_printf("usage: swab -b <addr> -l <length> [-2|-4]\n");
return;
}
if (set_16bit) {
// 16 bits at a time
while ((len -= sizeof(cyg_uint16)) >= 0) {
*(cyg_uint16 *)base = CYG_SWAP16(*(cyg_uint16 *)base);
base += sizeof(cyg_uint16);
}
} else {
// Default - 32 bits
while ((len -= sizeof(cyg_uint32)) >= 0) {
*(cyg_uint32 *)base = CYG_SWAP32(*(cyg_uint32 *)base);
base += sizeof(cyg_uint32);
}
}
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:39,代码来源:swab.c
示例3: dhcp_mgt_entry
// ------------------------------------------------------------------------
// The management thread function
void dhcp_mgt_entry( cyg_addrword_t loop_on_failure )
{
int j;
while ( 1 ) {
while ( 1 ) {
cyg_semaphore_wait( &dhcp_needs_attention );
diag_printf("dhcp wakeup01\n");
if ( ! dhcp_bind() ) // a lease expired
break; // If we need to re-bind
}
dhcp_halt(); // tear everything down
if ( !loop_on_failure )
return; // exit the thread/return
init_all_network_interfaces(); // re-initialize
for ( j = 0; j < CYGPKG_NET_NLOOP; j++ )
init_loopback_interface( j );
OnSetIP();
#ifdef CYGPKG_SNMPAGENT
SnmpdShutDown(0); // Cycle the snmpd state
#endif
}
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:24,代码来源:dhcp_support.c
示例4: lcd_test
static void
lcd_test(int depth)
{
int i, j;
diag_printf("Set depth %d\n", depth);
lcd_on(depth);
lcd_clear();
for (j = 0; j < 5; j++) {
for (i = 0; i < width; i++) {
lcd_putc('A');
}
}
lcd_putc('\n');
lcd_putc('\n');
cyg_thread_delay(5*100);
for (j = 0; j < 5; j++) {
for (i = FIRST_CHAR; i <= LAST_CHAR; i++) {
lcd_putc(i);
}
}
cyg_thread_delay(5*100);
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:22,代码来源:lcd_test.c
示例5: ccp_open
/*
* ccp_open - CCP is allowed to come up.
*/
void
ccp_open(PPP_IF_VAR_T *pPppIf)
{
diag_printf("\n<ccp_open>\n");
fsm *f = &pPppIf->ccp_fsm;
if (f->state != OPENED)
ccp_flags_set(&pPppIf->pSc->sc_flags,1, 0);
/*
* Find out which compressors the kernel supports before
* deciding whether to open in silent mode.
*/
ccp_resetci(f);
if (!ANY_COMPRESS(f->pPppIf->ccp_gotoptions))
f->flags |= OPT_SILENT;
{ //Added by Eddy
int ipmode = 0;
CFG_get(CFG_WAN_IP_MODE, &ipmode);
if (ipmode == PPPOEMODE)
f->flags |= OPT_SILENT;
#ifdef CONFIG_PPTP_PPPOE
//Added by Haitao
int pptp_wanif = 0;
CFG_get(CFG_PTP_WANIF, &pptp_wanif);
if(ipmode == PPTPMODE && pptp_wanif == 2 && !strcmp(pPppIf->pppname,"ppp0"))//for pptp over pppoe use ppp
f->flags |= OPT_SILENT;
#endif
#ifdef CONFIG_L2TP_OVER_PPPOE
int l2tp_wanif = 0;
CFG_get(CFG_L2T_WANIF, &l2tp_wanif);
if((ipmode == L2TPMODE) && (l2tp_wanif == 2) && (!strcmp(pPppIf->pppname,"ppp0")))//for l2tp over pppoe use ppp
f->flags |= OPT_SILENT;
#endif
}
fsm_open(f);
}
开发者ID:houzhenggang,项目名称:mt7688_mips_ecos,代码行数:42,代码来源:ccp.c
示例6: battery_test_menu
void
battery_test_menu (MENU_ARG arg)
{
// Test Menu Table
static MENU_ITEM batteryMenu[] = {
{"Write data to SDRAM", battery_test_write, NULL},
{"Check data from SDRAM", battery_test_read, NULL},
};
unsigned int num_menu_items = (sizeof (batteryMenu) / sizeof (batteryMenu[0]));
char *menu_title = "\n Battery Backup SDRAM memory test.";
diag_printf ("\n*************************************************************************\n");
diag_printf ("* This test will enable you to perform a battery test in 4 steps: *\n");
diag_printf ("* 1/ Select option 1 to write test pattern, *\n");
diag_printf ("* 2/ Power the board off and wait 60 seconds, *\n");
diag_printf ("* 3/ Power the board back on, *\n");
diag_printf ("* 4/ Select option 2 to read back and compare test pattern *\n");
diag_printf ("*************************************************************************");
menu (batteryMenu, num_menu_items, menu_title, MENU_OPT_NONE);
diag_printf ("\n");
}
开发者ID:lijinlei,项目名称:Kernel_BOOX60,代码行数:24,代码来源:battery.c
示例7: expand_history
// Check input line to see if it needs history expansion. If so,
// try to find matching command and replace buffer as appropriate.
static void
expand_history(char *buf)
{
int ncmds = _cl_max_index + 1;
int i, index, len;
if (buf[0] != '!' || buf[1] == '\0')
return;
if (ncmds > 0) {
if (!strcmp(buf, "!!")) {
strcpy(buf, _cl_lines[_cl_index]);
return;
}
if ((index = parse_history_index(buf + 1)) >= 0) {
if (index <= _cl_real_index) {
while (index >= _CL_NUM_LINES) {
index -= _CL_NUM_LINES;
}
strcpy(buf, _cl_lines[index]);
return;
}
} else {
len = strlen(buf + 1);
for (i = 0, index = _cl_index; i < ncmds; i++) {
if (!strncmp(_cl_lines[index], buf+1, len)) {
strcpy(buf, _cl_lines[index]);
return;
}
if (--index < 0)
index = _cl_max_index;
}
}
}
diag_printf("%s: event not found\n", buf);
*buf = '\0';
}
开发者ID:Palantir555,项目名称:ecos-mars-zx3,代码行数:40,代码来源:io.c
示例8: MCI_TaskInit
BOOL MCI_TaskInit(VOID) // MCI_MEDIA_PLAY_REQ,
{
diag_printf( "*******************MCI_TaskInit**********************");
mmc_MemInit();
//MMC_LcdWidth=MMC_GetLcdWidth();
//MMC_LcdHeight=MMC_GetLcdHeight();
/*
HANDLE hTask;
hTask = COS_CreateTask((PTASK_ENTRY)MMCTask,
NULL, NULL,
MMC_TASK_STACK_SIZE,
MMC_TASK_PRIORITY,
COS_CREATE_DEFAULT, 0, "MMC Task");
//ASSERT(hTask != HNULL);
SetMCITaskHandle(MBOX_ID_MMC, hTask);
// creat asyn fs task.
g_hAsynFsTask = COS_CreateTask(BAL_AsynFsTask,
NULL, NULL,
ASYNFS_TASK_STACK_SIZE,
ASYNFS_TASK_PRIORITY,
COS_CREATE_DEFAULT, 0, "ASYNFS Task");
*/
/*
hTask = COS_CreateTask(MMCTask,
NULL, NULL,
USB_TASK_STACK_SIZE,
USB_TASK_PRIORITY,
COS_CREATE_DEFAULT, 0, "USB Task");
ASSERT(hTask != HNULL);
SetMCITaskHandle(MBOX_ID_MMC, hTask);*/
return TRUE;
}
开发者ID:BarryChen,项目名称:RDA,代码行数:38,代码来源:mci.c
示例9: _net_io_getc_nonblock
static cyg_bool
_net_io_getc_nonblock(void* __ch_data, cyg_uint8* ch)
{
if (in_buflen == 0) {
__tcp_poll();
if (tcp_sock.state == _CLOSE_WAIT) {
// This connection is breaking
if (tcp_sock.data_bytes == 0 && tcp_sock.rxcnt == 0) {
__tcp_close(&tcp_sock);
return false;
}
}
if (tcp_sock.state == _CLOSED) {
// The connection is gone
net_io_revert_console();
*ch = '\n';
return true;
}
in_buflen = __tcp_read(&tcp_sock, in_buf, sizeof(in_buf));
in_bufp = in_buf;
#ifdef DEBUG_TCP
if (show_tcp && (in_buflen > 0)) {
int old_console;
old_console = start_console();
diag_printf("%s:%d\n", __FUNCTION__, __LINE__);
diag_dump_buf(in_buf, in_buflen);
end_console(old_console);
}
#endif // DEBUG_TCP
}
if (in_buflen) {
*ch = *in_bufp++;
in_buflen--;
return true;
} else {
return false;
}
}
开发者ID:perryhg,项目名称:terkos,代码行数:38,代码来源:net_io.c
示例10: __udp_recvfrom_handler
static void
__udp_recvfrom_handler(udp_socket_t * skt, char *buf, int len,
ip_route_t * src_route, word src_port)
{
if (recvfrom_server == NULL || recvfrom_buf == NULL)
return;
if (recvfrom_server->sin_port
&& recvfrom_server->sin_port != htons(src_port))
return;
// Move data to waiting buffer
recvfrom_len = len;
memcpy(recvfrom_buf, buf, len);
if (recvfrom_server) {
recvfrom_server->sin_port = htons(src_port);
memcpy(&recvfrom_server->sin_addr, &src_route->ip_addr,
sizeof(src_route->ip_addr));
recvfrom_buf = (char *)0; // Tell reader we got a packet
} else {
diag_printf("udp_recvfrom - dropped packet of %d bytes\n", len);
}
}
开发者ID:KublaikhanGeek,项目名称:dd-wrt,代码行数:23,代码来源:udp.c
示例11: diag_CreateLogBuf
VOS_UINT32 diag_CreateLogBuf(DIAG_BUF_CTRL_STRU *pstBufCtrl, VOS_INT32 lBufSize)
{
/* 参数检测 外部保证了不为空*/
pstBufCtrl->lAlloc = 0;
pstBufCtrl->lRelease = 0;
pstBufCtrl->lPadding = 0;
pstBufCtrl->lBufSize = lBufSize;
/*申请uncache的动态内存区*/
pstBufCtrl->pucBuf = diag_BuffPhyToVirt(pstBufCtrl->pucRealBuf,(VOS_UINT8*)DIAG_MEM_ADDR_BASE,(VOS_UINT8*)g_DiagMemVirt,(VOS_UINT32)(pstBufCtrl->lBufSize));
/* 分配内存失败 */
if (VOS_NULL_PTR == pstBufCtrl->pucBuf)
{
g_stDiagToHsoErrRecord.usNoMemErr++;
return ERR_MSP_MALLOC_FAILUE;
}
diag_printf("diag_CreateLogBuf: real addr=%p, virt addr==%p\n", pstBufCtrl->pucRealBuf, pstBufCtrl->pucBuf);
return ERR_MSP_SUCCESS;
}
开发者ID:debbiche,项目名称:android_kernel_huawei_p8,代码行数:23,代码来源:diag_buf_ctrl.c
示例12: quicc2pro_serial_init
// Function to initialize the device. Called at bootstrap time.
static bool
quicc2pro_serial_init(struct cyg_devtab_entry *tab)
{
serial_channel *chan = (serial_channel *)tab->priv;
quicc2pro_serial_info *quicc2pro_chan = (quicc2pro_serial_info *)chan->dev_priv;
#ifdef CYGDBG_IO_INIT
diag_printf("QUICC2PRO SERIAL init - dev: %x.%d\n", quicc2pro_chan->base, quicc2pro_chan->int_num);
#endif
(chan->callbacks->serial_init)(chan); // Really only required for interrupt driven devices
if (chan->out_cbuf.len != 0) {
cyg_drv_interrupt_create(quicc2pro_chan->int_num,
0, // can change IRQ0 priority
(cyg_addrword_t)chan, // Data item passed to interrupt handler
quicc2pro_serial_ISR,
quicc2pro_serial_DSR,
&quicc2pro_chan->serial_interrupt_handle,
&quicc2pro_chan->serial_interrupt);
cyg_drv_interrupt_attach(quicc2pro_chan->serial_interrupt_handle);
cyg_drv_interrupt_unmask(quicc2pro_chan->int_num);
}
quicc2pro_serial_config_port(chan, &chan->config, true);
return true;
}
开发者ID:edgargrimberg,项目名称:eCos_MPC8313,代码行数:24,代码来源:ser_quicc2pro.c
示例13: time0
static void time0(register cyg_uint32 stride)
{
register cyg_uint32 j,k;
cyg_tick_count_t count0, count1;
cyg_ucount32 t;
register char c;
count0 = cyg_current_time();
k = 0;
if ( cyg_test_is_simulator )
k = 3960;
for(; k<4000;k++) {
for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) {
c=m[stride*j];
}
}
count1 = cyg_current_time();
t = count1 - count0;
diag_printf("stride=%d, time=%d\n", stride, t);
}
开发者ID:lijinlei,项目名称:Kernel_BOOX60,代码行数:23,代码来源:kcache1.c
示例14: synth_disk_write
static Cyg_ErrNo
synth_disk_write(disk_channel *chan,
const void *buf,
cyg_uint32 len,
cyg_uint32 block_num)
{
synth_disk_info_t *synth_info = (synth_disk_info_t *)chan->dev_priv;
#ifdef DEBUG
diag_printf("synth disk write block %d\n", block_num);
#endif
if (synth_info->filefd >= 0)
{
cyg_hal_sys_lseek(synth_info->filefd,
block_num * chan->info->block_size,
CYG_HAL_SYS_SEEK_SET);
cyg_hal_sys_write(synth_info->filefd, buf, len*512);
// cyg_hal_sys_fdatasync(synth_info->filefd);
return ENOERR;
}
return -EIO;
}
开发者ID:KarenHung,项目名称:ecosgit,代码行数:23,代码来源:synthdisk.c
示例15: wlan_get_region_cfp_table
/**
* @brief This function finds the CFP in
* region_cfp_table based on region and band parameter.
*
* @param region The region code
* @param band The band
* @param cfp_no A pointer to CFP number
* @return A pointer to CFP
*/
CHANNEL_FREQ_POWER *
wlan_get_region_cfp_table(cyg_uint8 region, cyg_uint8 band, int *cfp_no)
{
int i;
ENTER();
for (i = 0; i < sizeof(region_cfp_table) / sizeof(region_cfp_table_t);
i++) {
diag_printf("region_cfp_table[i].region=%d\n",
region_cfp_table[i].region);
if (region_cfp_table[i].region == region) {
{
*cfp_no = region_cfp_table[i].cfp_no_BG;
LEAVE();
return region_cfp_table[i].cfp_BG;
}
}
}
LEAVE();
return NULL;
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:32,代码来源:wlan_main.c
示例16: wlan_tx_timeout
/**
* @brief This function handles the timeout of packet
* transmission
*
* @param dev A pointer to net_device structure
* @return n/a
*/
static void
wlan_tx_timeout(struct net_device *dev)
{
wlan_private *priv = (wlan_private *) dev->priv;
ENTER();
diag_printf("tx watch dog timeout!\n");
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
UpdateTransStart(dev);
if (priv->adapter->CurrentTxSkb) {
//wake_up_interruptible(&priv->MainThread.waitQ);
cyg_flag_setbits( &priv->MainThread.waitQ_flag_q, 1 );
} else {
//os_start_queue(priv);
}
LEAVE();
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:30,代码来源:wlan_main.c
示例17: get_numberofentries
static uint32_t
get_numberofentries()
{
FILE* fd;
char line[1024];
int32_t n_entries = 0, i = 0;
boolean isfound = FALSE;
if ((fd = fopen(DB_FILE_PATH, "r")) == NULL) {
diag_printf("[Error] : While opening the file\n",
0, 4, goptionflag, 0, NULL);
return 0;
}
while ( fgets (line, sizeof(line), fd) != NULL ) {
n_entries++;
}
/* Decrement 1 for version and the last line /r/n */
n_entries-= 2;
/* check if n_entries is prime number else change to prime number */
while (1) {
for (i = 2; i<n_entries; i++) {
if ( n_entries % i == 0 ) {
/* n_entries is divisible, break for loop */
isfound = TRUE;
break;
}
}
if (!isfound && n_entries > 2)
break;
isfound = FALSE;
/* Increment n_entries and check is it prime number */
n_entries++;
}
fclose(fd);
debug_printf( "Number of entries is %d\n", n_entries);
return n_entries;
}
开发者ID:handelxh,项目名称:ONEPLUS2RAZOR,代码行数:37,代码来源:cld-diag-parser.c
示例18: ebsa285_serial_init
// Function to initialize the device. Called at bootstrap time.
static bool
ebsa285_serial_init(struct cyg_devtab_entry *tab)
{
serial_channel *chan = (serial_channel *)tab->priv;
ebsa285_serial_info *ebsa285_chan = (ebsa285_serial_info *)chan->dev_priv;
#ifdef CYGDBG_IO_INIT
diag_printf("EBSA285 SERIAL init - dev: %x\n", ebsa285_chan);
#endif
(chan->callbacks->serial_init)(chan); // Really only required for interrupt driven devices
if (chan->out_cbuf.len != 0) {
// first for rx
cyg_drv_interrupt_create(ebsa285_chan->rx.int_num,
99, // Priority - unused
(cyg_addrword_t)chan, // Data item passed to interrupt handler
ebsa285_serial_rx_ISR,
ebsa285_serial_rx_DSR,
&ebsa285_chan->rx.serial_interrupt_handle,
&ebsa285_chan->rx.serial_interrupt);
cyg_drv_interrupt_attach(ebsa285_chan->rx.serial_interrupt_handle);
cyg_drv_interrupt_unmask(ebsa285_chan->rx.int_num);
// then for tx
cyg_drv_interrupt_create(ebsa285_chan->tx.int_num,
99, // Priority - unused
(cyg_addrword_t)chan, // Data item passed to interrupt handler
ebsa285_serial_tx_ISR,
ebsa285_serial_tx_DSR,
&ebsa285_chan->tx.serial_interrupt_handle,
&ebsa285_chan->tx.serial_interrupt);
cyg_drv_interrupt_attach(ebsa285_chan->tx.serial_interrupt_handle);
// DO NOT cyg_drv_interrupt_unmask(ebsa285_chan->tx.int_num);
ebsa285_chan->tx_active = 0;
}
(void)ebsa285_serial_config_port(chan, &chan->config, true);
return true;
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:38,代码来源:ebsa285_serial.c
示例19: SetWlanHostSleepCfg
BOOL SetWlanHostSleepCfg(const char *pcInterface, int nGPIO)
{
int rt;
int fd;
unsigned long ipaddr;
struct iwreq wrq;
char buf[32];
int ret = WLAN_STATUS_SUCCESS;
memset(buf, 0, sizeof(buf));
if (pcInterface == NULL)
{
fprintf(stderr, "illegal call function SetWlanChannel!\n");
return FALSE;
}
ipaddr = GetIPAddress(pcInterface);
if ((fd = socket(AF_INET,SOCK_DGRAM,0)) < 0) return FALSE;
memset(&wrq, 0, sizeof(wrq));
strcpy(wrq.ifr_name, pcInterface);
/* broadcast=1 ; unicast=2 ; multicast=3 */
sprintf(buf, "03 %02x 0xa0 %08x", nGPIO, ipaddr);//set criteria/gpio/gap
// sprintf(buf, "02 %02x 0xa0", nGPIO);//set criteria/gpio/gap
wrq.u.data.pointer = buf;
wrq.u.essid.length = strlen(buf) + 1;
rt = ioctl(fd, WLANHOSTSLEEPCFG, &wrq);
close(fd);
if(rt >= 0)
diag_printf("set host sleep config success %s\n", buf);
return (rt >= 0 ? TRUE : FALSE);
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:36,代码来源:wlan0.c
示例20: function
int
function(int n, ...)
{
va_list args;
int c = 11 * n;
int i = 1;
int res = 1;
CYG_ASSERT(n >= 0 && n < 8, "Invalid count argument");
va_start(args, n);
for (i = 1; i <= n; c++, i++) {
int v = va_arg(args, int);
if (v != c) {
diag_printf("FAIL:<Bad argument: index %d expected %d got %d>\n", i, c, v);
res = 0;
}
}
va_end(args);
return res;
}
开发者ID:KarenHung,项目名称:ecosgit,代码行数:24,代码来源:vaargs.c
注:本文中的diag_printf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论