本文整理汇总了C++中cyg_thread_resume函数的典型用法代码示例。如果您正苦于以下问题:C++ cyg_thread_resume函数的具体用法?C++ cyg_thread_resume怎么用?C++ cyg_thread_resume使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cyg_thread_resume函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: igd_start
/* Initialize IGD */
void
igd_start(void)
{
char *value;
/*
* Stop igd_mainloop anyway,
* if not enabled.
*/
value = nvram_get("upnp_enable");
if (value == 0 || atoi(value) == 0) {
igd_stop_handler();
return;
}
if (igd_running == 0) {
igd_down = 0;
cyg_thread_create(
IGD_PRIORITY,
(cyg_thread_entry_t *)&igd_main,
0,
"IGD",
igd_main_stack,
sizeof(igd_main_stack),
&igd_main_tid,
&igd_main_thread);
cyg_thread_resume(igd_main_tid);
/* Wait until thread scheduled */
while (!igd_running && !igd_down)
cyg_thread_delay(1);
}
return;
}
开发者ID:jameshilliard,项目名称:broadcom-hnd,代码行数:36,代码来源:igd_ecos_main.c
示例2: nasd_start
void
nasd_start(void)
{
int wait_time = 1 * 100; /* 1 second */
if (!_nas_pid ||
!oslib_waitpid(_nas_pid, NULL)) {
cyg_thread_create(7,
(cyg_thread_entry_t *)nas_main,
(cyg_addrword_t)NULL,
"NAS",
(void *)nas_main_stack,
sizeof(nas_main_stack),
&nas_main_hdl,
&nas_thread);
cyg_thread_resume(nas_main_hdl);
/* Make sure nas stared and initial completed. Otherwise,
* it may lost some wireless driver events.
*/
while (_nas_ready == 0 && wait_time > 0) {
cyg_thread_delay(10);
wait_time -= 10;
}
NASMSG("NAS task started\n");
}
}
开发者ID:NieHao,项目名称:Tomato-RAF,代码行数:28,代码来源:nas_ecos.c
示例3: kbd_init
void
kbd_init(void)
{
// Initialize environment, setup interrupt handler
cyg_drv_interrupt_create(CYGNUM_HAL_INTERRUPT_KBDINT,
99, // Priority - what goes here?
0, // Data item passed to interrupt handler
(cyg_ISR_t *)keyboard_isr,
(cyg_DSR_t *)keyboard_dsr,
&kbd_interrupt_handle,
&kbd_interrupt);
cyg_drv_interrupt_attach(kbd_interrupt_handle);
cyg_drv_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_KBDINT);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_KBDINT);
// Set up the mbox for keyboard data
cyg_mbox_create(&kbd_events_mbox_handle, &kbd_events_mbox);
// This semaphore is set when there is a keypress
cyg_semaphore_init(&kbd_sem, 0);
// Create a thread whose job it is to de-bounce the keyboard and
// actually process the input, turning it into a series of events
cyg_thread_create(10, // Priority - just a number
kbd_server, // entry
0, // initial parameter
"KBD_server", // Name
&kbd_server_stack[0], // Stack
STACK_SIZE, // Size
&kbd_server_thread_handle, // Handle
&kbd_server_thread_data // Thread data structure
);
cyg_thread_resume(kbd_server_thread_handle); // Start it
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:31,代码来源:kbd_support.c
示例4: cyg_start
void
cyg_start(void)
{
CYG_TEST_INIT();
//
// open CAN device driver
//
if (ENOERR != cyg_io_lookup("/dev/can0", &hCAN0))
{
CYG_TEST_FAIL_FINISH("Error opening /dev/can0");
}
//
// create the thread that accesses the CAN device driver
//
cyg_thread_create(4, can0_thread,
(cyg_addrword_t) 0,
"can0_thread",
(void *) can0_thread_data.stack,
1024 * sizeof(long),
&can0_thread_data.hdl,
&can0_thread_data.obj);
cyg_thread_resume(can0_thread_data.hdl);
cyg_scheduler_start();
}
开发者ID:DavionKnight,项目名称:GT873M_4F,代码行数:28,代码来源:can_extended_cfg.c
示例5: cyg_sc_lpe_init
bool
cyg_sc_lpe_init(struct cyg_netdevtab_entry *tab)
{
struct eth_drv_sc *sc = (struct eth_drv_sc *)tab->device_instance;
dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
struct cf_slot* slot;
cf_init(); // Make sure Compact Flash subsystem is initialized
slot = dp->plf_priv = (void*)cf_get_slot(0);
dp->tab = tab;
#ifdef CYGPKG_KERNEL
// Create card handling [background] thread
cyg_thread_create(CYGPKG_NET_THREAD_PRIORITY-1, // Priority
sc_lpe_card_handler, // entry
(cyg_addrword_t)sc, // entry parameter
"SC LP-E card support", // Name
&sc_lpe_card_handler_stack[0], // Stack
STACK_SIZE, // Size
&sc_lpe_card_handler_thread_handle, // Handle
&sc_lpe_card_handler_thread_data // Thread data structure
);
cyg_thread_resume(sc_lpe_card_handler_thread_handle); // Start it
// Initialize environment, setup interrupt handler
// eth_drv_dsr is used to tell the fast net thread to run the deliver funcion.
cf_register_handler(slot, eth_drv_dsr, sc);
return false; // Device is not ready until inserted, powered up, etc.
#else
// Initialize card
return sc_lpe_card_handler((cyg_addrword_t)sc);
#endif
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:34,代码来源:if_sc_lpe.c
示例6: cyg_start
void
cyg_start(void)
{
CYG_TEST_INIT();
//
// open CAN device driver
//
if (ENOERR != cyg_io_lookup("/dev/can0", &hCAN0))
{
CYG_TEST_FAIL_FINISH("Error opening /dev/can0");
}
//
// create the two threads which access the CAN device driver
// a reader thread with a higher priority and a writer thread
// with a lower priority
//
cyg_thread_create(4, can0_thread,
(cyg_addrword_t) 0,
"can0_thread",
(void *) can0_thread_data.stack,
1024 * sizeof(long),
&can0_thread_data.hdl,
&can0_thread_data.obj);
cyg_thread_resume(can0_thread_data.hdl);
cyg_scheduler_start();
}
开发者ID:Palantir555,项目名称:ecos-mars-zx3,代码行数:31,代码来源:can_filter.c
示例7: tftpd_start
//
// This function is used to create a new server [thread] which supports
// the TFTP protocol on the given port. A server 'id' will be returned
// which can later be used to destroy the server.
//
// Note: all [memory] resources for the server thread will be allocated
// dynamically. If there are insufficient resources, an error will be
// returned.
//
int
tftpd_start(int port, struct tftpd_fileops *ops)
{
struct tftp_server *server;
#ifdef CYGSEM_TFTP_SERVER_MULTITHREADED
static char init = 0;
if ( 0 == init ) {
init++;
cyg_semaphore_init( &tftp_server_sem, 0 );
}
#endif
if ((server = malloc(sizeof(struct tftp_server)))) {
server->tag = TFTP_tag;
server->port = port;
server->ops = ops;
cyg_thread_create(CYGPKG_NET_TFTPD_THREAD_PRIORITY, // Priority
tftpd_server, // entry
(cyg_addrword_t)server, // entry parameter
"TFTP server", // Name
&server->stack[0], // Stack
STACK_SIZE, // Size
&server->thread_handle, // Handle
&server->thread_data // Thread data structure
);
cyg_thread_resume(server->thread_handle); // Start it
}
return (int)server;
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:39,代码来源:tftp_server.c
示例8: TestNet_ThreadInit
static BOOL TestNet_ThreadInit(unsigned short usPort)
{
if (g_pWirelessTest != NULL)
goto error_alread_inited;
g_pWirelessTest = (WIRELESS_TEST_T *) malloc(sizeof(WIRELESS_TEST_T));
if (g_pWirelessTest == NULL)
goto error_malloc;
/* Create listening socket. */
g_pWirelessTest->fd_listen = create_listen_socket( usPort );
if ( g_pWirelessTest->fd_listen == -1 )
goto error_listen;
cyg_thread_create(PTD_PRIORITY-3, WirelessTest_Test_Entry, (cyg_addrword_t)g_pWirelessTest, "test_net",
g_pWirelessTest->datathread_stack, sizeof(g_pWirelessTest->datathread_stack),
&g_pWirelessTest->datathread_handle, &g_pWirelessTest->datathread_thread);
cyg_thread_resume(g_pWirelessTest->datathread_handle);
return TRUE;
error_listen:
free(g_pWirelessTest);
error_malloc:
error_alread_inited:
return FALSE;
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:28,代码来源:TestNetServer.c
示例9: create_preResampling_thread
/**
creates preResampling sw thread.
*/
void create_preResampling_thread(){
// create sw threads variables
sw_thread_preResampling = (cyg_thread *) malloc (sizeof(cyg_thread));
// create sw thread stacks
sw_thread_preResampling_stack = (char **) malloc (sizeof (char *));
sw_thread_preResampling_stack[0] = (char *) malloc (STACK_SIZE * sizeof(char));
// create sw handles
sw_thread_preResampling_handle = (cyg_handle_t *) malloc (sizeof(cyg_handle_t));
// create and resume sw resampling switch thread in eCos
// create sw resampling threads
cyg_thread_create(PRIO, // scheduling info (eg pri)
preResampling_thread, // entry point function
0, // entry data
"PRERESAMPLING", // optional thread name
sw_thread_preResampling_stack[0], // stack base
STACK_SIZE, // stack size,
sw_thread_preResampling_handle, // returned thread handle
sw_thread_preResampling // put thread here
);
// resume threads
cyg_thread_resume(sw_thread_preResampling_handle[0]);
}
开发者ID:notooth,项目名称:reconos,代码行数:33,代码来源:preResampling.c
示例10: cyg_user_start
/****************************************************************************
Function: cyg_user_start
Description: This routine is the entry point of the application task.
Inputs: none
Returns: none
****************************************************************************/
void cyg_user_start(void)
{
/* Turn all led's on */
P4205_LED_ON(P4205_BOARD_CNTL_STATUS, P4205_FP_LED_ALL);
#ifdef CYGPKG_KERNEL /* Using eCos kernel */
/* Create a ssbMode Thread */
cyg_thread_create(10, /* Thread priority */
(cyg_thread_entry_t *)TskFunc_ssbMode, /* Entry function */
0, /* Thread function arg */
"ssbMode", /* Thread name */
stThread_ssbMode, /* Thread Stack Base */
CYGNUM_HAL_STACK_SIZE_TYPICAL, /* Thread Stack Size */
&hThread_ssbMode, /* Thread Handle */
&oThread_ssbMode); /* Thread Housekeeping Info */
/* Take thread out of suspended state */
cyg_thread_resume(hThread_ssbMode);
#else /* No eCos kernel */
/* Enable Processor Interrupts - not required but enables gdb/insight
* for stopping an executing program using the stop button or Ctrl-C.
*/
HAL_ENABLE_INTERRUPTS();
/* Invoke application directly */
TskFunc_ssbMode();
#endif
} /* end cyg_user_start() */
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:40,代码来源:ssbmode.c
示例11: cyg_start
void
cyg_start(void)
{
CYG_TEST_INIT();
cyg_thread_create(MAIN_THREAD_PRIORITY, // Priority
tcp_server, // entry
0, // entry parameter
"TCP loopback server", // Name
&stack_server[0], // Stack
STACK_SIZE, // Size
&server_thread_handle, // Handle
&server_thread_data // Thread data structure
);
cyg_thread_resume(server_thread_handle); // Start it
cyg_thread_create(MAIN_THREAD_PRIORITY, // Priority
tcp_client, // entry
0, // entry parameter
"TCP loopback client", // Name
&stack_client[0], // Stack
STACK_SIZE, // Size
&client_thread_handle, // Handle
&client_thread_data // Thread data structure
);
cyg_scheduler_start();
}
开发者ID:Palantir555,项目名称:ecos-mars-zx3,代码行数:27,代码来源:tcp_lo_test.c
示例12: nc_slave_main
void
nc_slave_main(void)
{
int i;
CYG_TEST_INIT();
// Create the idle thread environment
cyg_semaphore_init(&idle_thread_sem, 0);
cyg_thread_create(IDLE_THREAD_PRIORITY, // Priority
net_idle, // entry
0, // entry parameter
"Network idle", // Name
&idle_thread_stack[0], // Stack
STACK_SIZE, // Size
&idle_thread_handle, // Handle
&idle_thread_data // Thread data structure
);
cyg_thread_resume(idle_thread_handle); // Start it
// Create the load threads and their environment(s)
for (i = 0; i < NUM_LOAD_THREADS; i++) {
cyg_semaphore_init(&load_thread_sem[i], 0);
cyg_thread_create(LOAD_THREAD_PRIORITY, // Priority
net_load, // entry
i, // entry parameter
"Background load", // Name
&load_thread_stack[i][0], // Stack
STACK_SIZE, // Size
&load_thread_handle[i], // Handle
&load_thread_data[i] // Thread data structure
);
cyg_thread_resume(load_thread_handle[i]); // Start it
}
// Create a main thread, so we can run the scheduler and have time 'pass'
cyg_thread_create(10, // Priority - just a number
tmain, // entry
0, // entry parameter
"socket echo test", // Name
&stack[0], // Stack
STACK_SIZE, // Size
&thread_handle, // Handle
&thread_data // Thread data structure
);
cyg_thread_resume(thread_handle); // Start it
cyg_scheduler_start();
CYG_TEST_FAIL_FINISH("Not reached");
}
开发者ID:houzhenggang,项目名称:mt7688_mips_ecos,代码行数:46,代码来源:nc_test_slave.c
示例13: cyg_httpd_init
static void cyg_httpd_init(cyg_addrword_t arg)
{
int i;
int err = 0;
/* Delay for a configurable length of time to give the application
* a chance to get going, or even complete, without interference
* from the HTTPD.
*/
if( CYGNUM_HTTPD_SERVER_DELAY > 0 )
{
cyg_thread_delay( CYGNUM_HTTPD_SERVER_DELAY );
}
server_address.sin_family = AF_INET;
server_address.sin_len = sizeof(server_address);
server_address.sin_addr.s_addr = INADDR_ANY;
server_address.sin_port = htons(CYGNUM_HTTPD_SERVER_PORT);
/* Get the network going. This is benign if the application has
* already done this.
*/
init_all_network_interfaces();
/* Create and bind the server socket.
*/
server_socket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
CYG_ASSERT( server_socket > 0, "Socket create failed");
err = bind( server_socket, (struct sockaddr *)&server_address,
sizeof(server_address) );
CYG_ASSERT( err == 0, "bind() returned error");
err = listen( server_socket, SOMAXCONN );
CYG_ASSERT( err == 0, "listen() returned error" );
/* If we are configured to have more than one server thread,
* create them now.
*/
for( i = 1; i < CYGNUM_HTTPD_THREAD_COUNT; i++ )
{
cyg_thread_create( CYGNUM_HTTPD_THREAD_PRIORITY,
cyg_httpd_server,
0,
"HTTPD",
&httpd_stacks[i][0],
sizeof(httpd_stacks[i]),
&httpd_thread[i],
&httpd_thread_object[i]
);
cyg_thread_resume( httpd_thread[i] );
}
/* Now go be a server ourself.
*/
cyg_httpd_server(arg);
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:58,代码来源:httpd.c
示例14: cyg_start
void
cyg_start(void *n)
{
int i;
// Create processing threads
for (i = 0; i < CYGHWR_NET_DRIVERS; i++) {
cyg_thread_create(MAIN_THREAD_PRIORITY, // Priority
net_test, // entry
i, // entry parameter
"Network test", // Name
&main_thread_stack[i][0], // Stack
STACK_SIZE, // Size
&main_thread_handle[i], // Handle
&main_thread_data[i] // Thread data structure
);
}
cyg_thread_resume(main_thread_handle[0]); // Start first one
// Create the idle thread environment
cyg_semaphore_init(&idle_thread_sem, 0);
cyg_thread_create(IDLE_THREAD_PRIORITY, // Priority
net_idle, // entry
0, // entry parameter
"Network idle", // Name
&idle_thread_stack[0], // Stack
STACK_SIZE, // Size
&idle_thread_handle, // Handle
&idle_thread_data // Thread data structure
);
cyg_thread_resume(idle_thread_handle); // Start it
// Create the load threads and their environment(s)
for (i = 0; i < NUM_LOAD_THREADS; i++) {
cyg_semaphore_init(&load_thread_sem[i], 0);
cyg_thread_create(LOAD_THREAD_PRIORITY, // Priority
net_load, // entry
i, // entry parameter
"Background load", // Name
&load_thread_stack[i][0], // Stack
STACK_SIZE, // Size
&load_thread_handle[i], // Handle
&load_thread_data[i] // Thread data structure
);
cyg_thread_resume(load_thread_handle[i]); // Start it
}
cyg_scheduler_start();
}
开发者ID:houzhenggang,项目名称:mt7688_mips_ecos,代码行数:45,代码来源:nc_test_slave.c
示例15: cyg_user_start
void
cyg_user_start(void)
{
cyg_thread_create(4, thread_prog, (cyg_addrword_t) 0,
"Thread 1", (void *) stack, STACKSIZE,
&thread_h, &thread_s);
cyg_thread_resume(thread_h);
}
开发者ID:mambrus,项目名称:bitfire,代码行数:9,代码来源:lua_tests.c
示例16: threads
/**
creates observation SW threads (an delete old 'SW' threads)
@param number_of_threads: number of threads for observation step
*/
void set_observe_sw (unsigned int number_of_threads){
int i;
// terminate old sw threads if needed
if (sw_number_of_threads_o > 0){
observation_sw_delete();
// free all variables
for (i=0; i<sw_number_of_threads_o;i++){
free(sw_thread_o_stack[i]);
}
free(sw_thread_o);
free(sw_thread_o_stack);
free(sw_thread_o_handle);
}
// set number of sw threads
sw_number_of_threads_o = number_of_threads;
// create sw threads variables
sw_thread_o = (cyg_thread *) malloc (number_of_threads * sizeof(cyg_thread));
// create sw thread stacks
sw_thread_o_stack = (char **) malloc (number_of_threads * sizeof (char *));
for (i=0; i<number_of_threads; i++){
sw_thread_o_stack[i] = (char *) malloc (STACK_SIZE * sizeof(char));
}
// create sw handles
sw_thread_o_handle = (cyg_handle_t *) malloc (number_of_threads * sizeof(cyg_handle_t));
// create and resume sw importance threads in eCos
for (i = 0; i < number_of_threads; i++){
// create sw sampling threads
cyg_thread_create(PRIO, // scheduling info (eg pri)
observation_sw_thread, // entry point function
( cyg_addrword_t ) i, // entry data
"OBSERVATION_SW", // optional thread name
sw_thread_o_stack[i], // stack base
STACK_SIZE, // stack size,
&sw_thread_o_handle[i], // returned thread handle
&sw_thread_o[i] // put thread here
);
// resume threads
cyg_thread_resume(sw_thread_o_handle[i]);
}
}
开发者ID:notooth,项目名称:reconos,代码行数:62,代码来源:observation.c
示例17: test_ecos_simple_program
/* we install our own startup routine which sets up threads */
void test_ecos_simple_program(void)
{
printf("Entering twothreads' cyg_user_start() function\n");
#if 1
cyg_mutex_init(&cliblock);
#endif
cyg_thread_create(4, simple_program, (cyg_addrword_t) 0,
"Thread A", (void *) stack[0], 4096,
&simple_threadA, &thread_s[0]);
cyg_thread_create(4, simple_program, (cyg_addrword_t) 1,
"Thread B", (void *) stack[1], 4096,
&simple_threadB, &thread_s[1]);
cyg_thread_resume(simple_threadA);
cyg_thread_resume(simple_threadB);
}
开发者ID:magic-gjh,项目名称:NT96655_FHD6600,代码行数:19,代码来源:twothreads.c
示例18: cyg_start
void
cyg_start(void)
{
int i;
// Create a main thread which actually runs the test
cyg_thread_create(MAIN_THREAD_PRIORITY, // Priority
net_test, // entry
0, // entry parameter
"Network test", // Name
&stack[0], // Stack
STACK_SIZE, // Size
&thread_handle, // Handle
&thread_data // Thread data structure
);
cyg_thread_resume(thread_handle); // Start it
// Create the idle thread environment
cyg_semaphore_init(&idle_thread_sem, 0);
cyg_thread_create(IDLE_THREAD_PRIORITY, // Priority
net_idle, // entry
0, // entry parameter
"Network idle", // Name
&idle_thread_stack[0], // Stack
STACK_SIZE, // Size
&idle_thread_handle, // Handle
&idle_thread_data // Thread data structure
);
cyg_thread_resume(idle_thread_handle); // Start it
// Create the load threads and their environment(s)
for (i = 0; i < NUM_LOAD_THREADS; i++) {
cyg_semaphore_init(&load_thread_sem[i], 0);
cyg_thread_create(LOAD_THREAD_PRIORITY, // Priority
net_load, // entry
i, // entry parameter
"Background load", // Name
&load_thread_stack[i][0], // Stack
STACK_SIZE, // Size
&load_thread_handle[i], // Handle
&load_thread_data[i] // Thread data structure
);
cyg_thread_resume(load_thread_handle[i]); // Start it
}
cyg_scheduler_start();
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:43,代码来源:tcp_echo.c
示例19: kcache2_main
void kcache2_main( void )
{
CYG_TEST_INIT();
cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kcache1",
(void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]);
cyg_thread_resume(thread[0]);
cyg_scheduler_start();
}
开发者ID:lijinlei,项目名称:Kernel_BOOX60,代码行数:10,代码来源:kcache1.c
示例20: cyg_user_start
void cyg_user_start(void){
ezs_dac_init();
/* Thread erzeugen ... */
diag_printf("Entering cyg_user_start() function\n");
cyg_thread_create(PRIORITY, &test_thread, 0, "thread 1", my_stack, STACKSIZE, &handle, &threaddata);
/* Thread starten ... */
cyg_thread_resume(&handle);
}
开发者ID:fbinder,项目名称:EZS_UE,代码行数:10,代码来源:hello.c
注:本文中的cyg_thread_resume函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论