void Run( ) // this task gets called as soon as we boot up. { Usb_SetActive(true); // turn on USB TaskCreate( Blink, "Blink", 1000, 0, 1 ); Network_SetActive(true); // turn on the network TaskCreate( HttpGetTask, "GET", 2000, 0, 3 ); }
/*---------------------------------------------------------------------------------------------- * 函数: tftpd_dispatcher() * * 说明: TFTP数据包处理(启动处理任务) * * 输入: 1) ip_pkt IP数据包 * 2) pkt_len 数据包大小 **--------------------------------------------------------------------------------------------*/ void apical tftpd_dispatcher(INT08S *ip_pkt, INT16S pkt_len) { static HANDLE tftpd_task = InvalidHandle-1; static INT08S * rx_buf = NULL; void __daemon tftpd_daemon(void * data); if(!ip_pkt)return; if(!rx_buf) allocate_buffer(rx_buf, INT08S *, (INT32U)TFTP_RX_BUF_SIZE, return); if(pkt_len > TFTP_RX_BUF_SIZE){ pkt_len = TFTP_RX_BUF_SIZE; } if(tftp_packet_lock){ return; } DispatchLock(); MEMCPY(rx_buf, ip_pkt, pkt_len); tftp_packet_received = 1; DispatchUnlock(); if(tftpd_task == InvalidHandle-1){ tftpd_task=TaskCreate(tftpd_daemon, (void *)rx_buf, "tftpd", NULL, 2048, PRIO_NET, TASK_CREATE_OPT_NONE); } else { TaskAwake(tftpd_task); } }
//TIC开启 int fnTICOn(void) { init_tic(); // 初始化采样间隔定时器 statusL &= ~0x40; TaskCreate(ModeNull); return ModeTicOn; }
// TIC关闭 int fnTICOff(void) { dis_tic(); statusL |= 0x40; TaskCreate(ModeNull); return ModeTicOff; }
/** Sets whether the Usb subsystem is active. @param state An integer specifying the active state of the Usb system - 1 (on) or 0 (off). @return Zero on success. */ int Usb_SetActive( int state ) { if ( state ) { if ( Usb_Users++ == 0 ) { // Create the USB task. Usb = MallocWait( sizeof( Usb_ ), 100 ); TaskCreate( vUSBCDCTask, "USB", mainUSB_TASK_STACK, NULL, mainUSB_PRIORITY ); while ( !Usb_Running ) Sleep( 100 ); } } else { if ( Usb_Users ) { if ( --Usb_Users == 0 ) { /* kill the task, someday */ } } } return CONTROLLER_OK; }
void Run( ) // this task gets called as soon as we boot up. { TaskCreate( BlinkTask, "Blink", 400, 0, 1 ); // Do this right quick after booting up - otherwise we won't be recognised Usb_SetActive( 1 ); // Fire up the OSC system and register the subsystems you want to use Osc_SetActive( true ); // make sure OSC_SUBSYSTEM_COUNT (osc.h) is large enough to accomodate them all Osc_RegisterSubsystem( AppLedOsc_GetName(), AppLedOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DipSwitchOsc_GetName(), DipSwitchOsc_ReceiveMessage, DipSwitchOsc_Async ); Osc_RegisterSubsystem( ServoOsc_GetName(), ServoOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( AnalogInOsc_GetName(), AnalogInOsc_ReceiveMessage, AnalogInOsc_Async ); Osc_RegisterSubsystem( DigitalOutOsc_GetName(), DigitalOutOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DigitalInOsc_GetName(), DigitalInOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( MotorOsc_GetName(), MotorOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( PwmOutOsc_GetName(), PwmOutOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( LedOsc_GetName(), LedOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DebugOsc_GetName(), DebugOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( SystemOsc_GetName(), SystemOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( NetworkOsc_GetName(), NetworkOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( SerialOsc_GetName(), SerialOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( IoOsc_GetName(), IoOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( StepperOsc_GetName(), StepperOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( XBeeOsc_GetName(), XBeeOsc_ReceiveMessage, XBeeOsc_Async ); Osc_RegisterSubsystem( XBeeConfigOsc_GetName(), XBeeConfigOsc_ReceiveMessage, NULL ); // Starts the network up. Will not return until a network is found... Network_SetActive( true ); }
void Run( ) { TaskCreate( BlinkTask, "Blink", 400, 0, 1 ); Usb_SetActive( 1 ); Osc_SetActive( true ); Osc_RegisterSubsystem( AppLedOsc_GetName(), AppLedOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DipSwitchOsc_GetName(), DipSwitchOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( ServoOsc_GetName(), ServoOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( AnalogInOsc_GetName(), AnalogInOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DigitalOutOsc_GetName(), DigitalOutOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DigitalInOsc_GetName(), DigitalInOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( MotorOsc_GetName(), MotorOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( PwmOutOsc_GetName(), PwmOutOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( LedOsc_GetName(), LedOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DebugOsc_GetName(), DebugOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( SystemOsc_GetName(), SystemOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( NetworkOsc_GetName(), NetworkOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( SerialOsc_GetName(), SerialOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( IoOsc_GetName(), IoOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( StepperOsc_GetName(), StepperOsc_ReceiveMessage, NULL ); // also include our testing subsystems Osc_RegisterSubsystem( CTesteeOsc_GetName(), CTesteeOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( ATesteeOsc_GetName(), ATesteeOsc_ReceiveMessage, NULL ); Network_SetActive( true ); }
//---------------------------------------------------------------------------- // Function: // void Task1() // // Description: // 先闪烁4个LED灯一次,并建立Task2的运行上下文环境(context)。 // 之后进入死循环,LED1闪烁3次后,切换到任务2。 // // Parameters: // n/a // // Return Value: // n/a // void Task1() { int i = 0; int j = 0; GPBDAT &= ~(0xf<<5); // 点亮LED1-4 for(i=0; i<150000; i++); // 延时循环 GPBDAT |= (0xf<<5); // 关闭LED1-4 for(i=0; i<150000; i++); // 延时循环 TaskCreate(Task2, TASK2_SP, TASK2_STK_PTR); while(1) { GPBDAT |= (0xf<<5); // 关闭LED1-4 GPBDAT &= ~(1<<5); // 点亮LED1 for(i=0; i<150000; i++); // 延时循环 GPBDAT |= (1<<5); // 关闭LED1 for(i=0; i<150000; i++); // 延时循环 if (++j>2) { j = 0; Task_Sw_1To2(); // 从Task1切换到Task2 } } }
// 采集流量 int fnCollection(void) { // WatchDogFeet(); adkz(); // 测量流量,压力,电池电压,温度(其内已KA=0) // TaskCreate(ModeComm); TaskCreate(ModeNull); return ModeCj; }
// 电机正调 int fnMotoP(void) { statusL &= ~0x20; //置位正调状态 STOP(x) TURN_P(x) TaskCreate(ModeNull); return ModeZt; }
// 电机反调 int fnMotoN(void) { statusL &= ~0x10; //置位反调状态 STOP(x) TURN_N(x) TaskCreate(ModeNull); return ModeFt; }
static void createLogoTask(Sprite *logo, int delay) { StkMakeFrame(); StkPushP(logo); sTaskBody *body = TaskCreate("TitleLogo", TASK_PRI_03, logoProc, 0, 0); if(delay > 0) TaskSleep(body, delay); StkDelFrame(); }
static void NetworkOpen() { hSendRaw = TaskCreate( nullsrv, "TxRawEthTsk", OS_TASKPRINORM, 0x1400, 0, 0, 0 ); //hEcho = DaemonNew( SOCK_STREAMNC, 0, 7, nullsrv, // OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 ); }
static void createSpriteTask(Sprite *obj, char *id_str, sParam *param, int delay) { StkMakeFrame(); StkPushP(id_str); StkPushP(obj); StkPushP(param); StkPushI(delay); TaskCreate("TitleSprite", TASK_PRI_03, spriteProc, 0, 0); StkDelFrame(); }
//============================================================== void ObjInit(void) //-------------------------------------------------------------- // 初期化 //-------------------------------------------------------------- // in: なし //-------------------------------------------------------------- // out: なし //============================================================== { TaskCreate("sys_obj", TASK_PRI_SYS, objTask, 0, 0); }
void RankingStart(BOOL playend, int score, int boss, int weapon) { RankingInfo info; info.score = score; info.boss = boss; info.weapon = weapon; StkMakeFrame(); StkPushP(&info); TaskCreate("Ranking", TASK_PRI_02, mainProc, playend, 0); StkDelFrame(); }
void System_StackAudit( int on_off ) { System_SetActive( 1 ); if( System->StackAuditPtr == NULL && on_off ) System->StackAuditPtr = TaskCreate( StackAuditTask, "StackAudit", 700, 0, 5 ); if( System->StackAuditPtr != NULL && !on_off ) { TaskDelete( System->StackAuditPtr ); System->StackAuditPtr = NULL; } }
// 电机停止 int fnMotoST(void) { STOP(x) statusL |= 0x20; // 清正调状态 statusL |= 0x10; // 清反调状态 statusH |= 0x04; // 清开臂标志 statusH |= 0x08; // 清收臂标志 zbFlag = ModeNull; STOP(x) if(Task[0] == ModeST) TaskCreate(ModeNull); return ModeST; }
void Make( ) { TaskCreate( BlinkTask, "Blink", 400, 0, 1 ); // Do this right quick after booting up - otherwise we won't be recognised Usb_SetActive( 1 ); // Fire up the OSC system Osc_SetActive( true ); // Add all the subsystems (make sure OSC_SUBSYSTEM_COUNT is large enough to accomodate them all) Osc_RegisterSubsystem( 0, AnalogInOsc_GetName(), AnalogInOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( 1, DebugOsc_GetName(), DebugOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( 2, SystemOsc_GetName(), SystemOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( 3, NetworkOsc_GetName(), NetworkOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( 4, SerialOsc_GetName(), SerialOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( 5, IoOsc_GetName(), IoOsc_ReceiveMessage, NULL ); // Starts the network up. Will not return until a network is found... Network_SetActive( true ); // Start the example webserver TaskCreate( vBasicWEBServer, "WebServ", 300, NULL, 4 ); }
/** Sets whether the Poly subsystem is active. @param value An integer specifying the active state of the subsystem - 1 (on) or 0 (off). @return CONTROLLER_OK (0) on success. */ int Poly_SetActive( int value ) { if ( value ) { if ( !Poly.running ) { Poly.running = true; // Poly.readConstants = false; Poly.mode0 = -1; Poly.mode1 = -1; TaskCreate( PolyTask, "Poly", 400, NULL, 2 ); } } else Poly.running = false; return CONTROLLER_OK; }
// 开臂动作 int fnKB(void) { unsigned char xdata n = 0; if(FK) { // afk: statusH &= ~0x04; TURN_P(x) n = 0; // while(FK&&(Task[0] != ModeST)) while(Task[0] != ModeST) { if(!FK) if(n++ > 6) break; (*pFunc[ModeMTc])(); WatchDogFeet(); (*pFunc[ModeCable])(); ReadZhibi(x) } STOP(x) // while(n ++ < 250) // WatchDogFeet(); // if(FK&&(Task[0] != ModeST)) // { // n = 0; // goto afk; // } statusH |= 0x04; // 清开臂标志 } ReadZhibi(x) if(Task[0] == ModeKb) TaskCreate(ModeNull); return ModeKb; // if(FK) // { // statusH &= ~0x04; // STOP(x) // TURN_N(x) // zbFlag = ModeKb; // } // TaskCreate(ModeNull); // return ModeKb; }
// 收臂动作 int fnSL(void) { unsigned int xdata n = 0; if(SL) { // asl: statusH &= ~0x08; TURN_N(x) while(Task[0] != ModeST) { if(!SL) if(n++ > 6) break; (*pFunc[ModeMTc])(); WatchDogFeet(); (*pFunc[ModeCable])(); ReadZhibi(x) } STOP(x) // while(n ++ < 250) // WatchDogFeet(); // if(SL && (Task[0] != ModeST)) // { // n = 0; // goto asl; // } statusH |= 0x08; // 清开臂标志 } ReadZhibi(x) if(Task[0] == ModeSl) TaskCreate(ModeNull); return ModeSl; // if(SL) // { // statusH &= ~0x08; // STOP(x) // TURN_N(x) // zbFlag = ModeSl; // } // TaskCreate(ModeNull); // return ModeSl; }
void Run( ) { TaskCreate( BlinkTask, "Blink", 400, 0, 1 ); // Do this right quick after booting up - otherwise we won't be recognised Usb_SetActive( 1 ); // Fire up the OSC system Osc_SetActive( true, true, true, true ); // Add all the subsystems (make sure OSC_SUBSYSTEM_COUNT is large enough to accomodate them all) Osc_RegisterSubsystem( AnalogInOsc_GetName(), AnalogInOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( DebugOsc_GetName(), DebugOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( SystemOsc_GetName(), SystemOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( NetworkOsc_GetName(), NetworkOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( SerialOsc_GetName(), SerialOsc_ReceiveMessage, NULL ); Osc_RegisterSubsystem( IoOsc_GetName(), IoOsc_ReceiveMessage, NULL ); // Starts the network up. Will not return until a network is found... Network_SetActive( true ); }
static struct IDBase *idev_Init(struct IDBase *IDBase, UINT32 *segList, struct SysBase *SysBase) { IDBase->SysBase = SysBase; NewList(&IDBase->Unit.unit_MsgPort.mp_MsgList); IDBase->Unit.unit_MsgPort.mp_Node.ln_Type = NT_MSGPORT; IDBase->Unit.unit_MsgPort.mp_Node.ln_Name = (STRPTR)name; /* ID_QUALMASK EQU $00FF ID_KEYMASK EQU $07FF ID_MOUSEMASK EQU $F000 */ if (OpenDevice("timer.device", UNIT_VBLANK, (struct IORequest*)&IDBase->id_RIOR, 0) == 0) { IDBase->id_TIOR.tr_node.io_Device = IDBase->id_RIOR.tr_node.io_Device; IDBase->id_TIOR.tr_node.io_Unit = IDBase->id_RIOR.tr_node.io_Unit; if (OpenDevice("keyboard.device", 0, (struct IORequest*)&IDBase->id_K1IOR, 0) == 0) { IDBase->id_K2IOR.io_Device = IDBase->id_K1IOR.io_Device; IDBase->id_K2IOR.io_Unit = IDBase->id_K1IOR.io_Unit; NewList(&IDBase->id_HandlerList); IDBase->id_BootTask = FindTask(NULL); IDBase->id_Task = TaskCreate(name, idev_InputTask, IDBase, 8192, 20); Wait(SIGF_SINGLE); return IDBase; } CloseDevice((struct IORequest*)&IDBase->id_TIOR); DPrintF("Error opening keyboard.dev\n"); return NULL; } DPrintF("Error opening timer.dev\n"); return NULL; //INT32 lib_OpenDevice(struct SysBase *SysBase, STRPTR devName, UINT32 unitNum, struct IORequest *iORequest, UINT32 flags) // return IDBase; }
void TitleStart(BOOL sound, BOOL skiped) { TaskCreate("Title", TASK_PRI_02, mainProc, sound, !skiped); }
/** * @b Description * @n * The function creates a V6 Daemon. * * @param[in] Type * This is the type of socket being opened through the daemon. In * the case of IPv6 the following types are supported * - SOCK_STREAM * Use this for TCP Sockets. * - SOCK_DGRAM * Use this for UDP Sockets. * @param[in] LocalAddress * This is the Local Address to which the socket will be bound to. * In most cases this is typically passed as IPV6_UNSPECIFIED_ADDRESS * @param[in] LocalPort * This is the Local Port to serve (cannot be NULL) * @param[in] pCb * Call back function which is to be invoked. * @param[in] Priority * Priority of new task to create for callback function * @param[in] StackSize * Stack size of new task to create for callback function * @param[in] Argument * Argument (besides socket) to pass to callback function * @param[in] MaxSpawn * Maximum number of callback function instances (must be 1 for UDP) * * @retval * Success - Handle to the spawned Daemon. * @retval * Error - 0 */ HANDLE Daemon6New (uint Type, IP6N LocalAddress, uint LocalPort, int (*pCb)(SOCKET,UINT32), uint Priority, uint StackSize, UINT32 Argument, uint MaxSpawn ) { int i; DREC *pdr = 0; // Sanity check the arguments if( Type==SOCK_DGRAM ) MaxSpawn=1; else if( Type!=SOCK_STREAM) return(0); if( !LocalPort || !pCb || Priority<1 || Priority>15 || !StackSize || !MaxSpawn ) return(0); // We'll borrow the stack's kernel mode for a temp exclusion method llEnter(); if( !hDSem6 ) { hDSem6 = SemCreate( 1 ); bzero( drec6, sizeof(drec6) ); RequestedRecords6 = 0; } llExit(); // At this point we must have a semaphore if( !hDSem6 ) return(0); // Enter our own lock SemPend( hDSem6, SEM_FOREVER ); // Scan the list for a free slot for( i=0; i<DAEMON_MAXRECORD; i++ ) if( !drec6[i].Type && !drec6[i].TasksSpawned ) break; // Break out if no free records if(i==DAEMON_MAXRECORD) goto errorout; // Build the new record pdr = &drec6[i]; pdr->Type = Type; pdr->LocalV6Address = LocalAddress; pdr->LocalPort = LocalPort; pdr->pCb = pCb; pdr->Priority = Priority; pdr->StackSize = StackSize; pdr->Argument = Argument; pdr->MaxSpawn = MaxSpawn; pdr->s = INVALID_SOCKET; // If the Deamon task exists, ping it, otherwise create it if( hDTask6 ) fdSelectAbort( hDTask6 ); else { hDTask6 = TaskCreate(daemon6,"daemon6",OS_TASKPRINORM,OS_TASKSTKLOW,0,0,0); if( hDTask6 ) fdOpenSession(hDTask6); else { pdr->Type = 0; pdr = 0; goto errorout; } } RequestedRecords6++; errorout: // Exit our lock SemPost( hDSem6 ); return( pdr ); }
void Run( ) // this task gets called as soon as we boot up. { TaskCreate( BlinkTask, "Get", 1000, 0, 3 ); }
/*------------------------------------------------------------------------------------ * 函数: start() * * 描述: 应用程序启始例程 **----------------------------------------------------------------------------------*/ void __task start(void * data) { data = data; /* TaskCreate(demo_task, (void *)1, "demo1", NULL, 512, 1, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)2, "demo2", NULL, 512, 2, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)3, "demo3", NULL, 512, 3, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)4, "demo4", NULL, 512, 4, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)5, "demo5", NULL, 512, 5, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)6, "demo6", NULL, 512, 6, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)7, "demo7", NULL, 512, 7, TASK_CREATE_OPT_NONE); TaskCreate(demo_task, (void *)8, "demo8", NULL, 512, 8, TASK_CREATE_OPT_NONE); */ demo_init_gui(); TaskCreate(refresh_task, NULL, "refresh", NULL, 2048, 8, TASK_CREATE_OPT_NONE); OpenConsole(); RegisterSpecialKey('x', move_button); for(;;){ KEYCODE key; char buf[64] = {0, }; key = gui_edit_input(test, buf, 32, 0); /* use superkey alt-x-k to quit! */ switch(key){ case UP: gui_view_move_up(view); break; case DOWN: gui_view_move_down(view); break; case PGUP: gui_view_page_up(view); break; case PGDN: gui_view_page_down(view); break; } switch(buf[0]){ default: break; case 'c': case 'C': color = atoi(&buf[1]); gui_set_widget_color(edit, color); break; case 'b': case 'B': bkcolor = atoi(&buf[1]); gui_set_widget_bkcolor(edit, bkcolor); break; case 's': case 'S': style = STRtoINT16(&buf[1], 0); gui_set_widget_style(edit, style); break; case 'p': case 'P': /* gui_progress_set_value(progress1, atoi(&buf[1])); */ break; case 'a': case 'A': { struct student * t; t = mem_alloc(sizeof(*t)); if(!t) break; sprintf(t->name, "Name"); t->sex = '-'; t->old = 0; sprintf(t->comment, ""); lock_kernel(); t->next = all_students; all_students = t; unlock_kernel(); } break; case 'd': case 'D': /*gui_show_window(window2);*/ input_dialog_method(&abcde, dialog_prepare, dialog_finish, NULL, 1); { static COLOR tmp = 67; gui_desktop_set_color(tmp); tmp += 77; } TaskSleep(10); /*gui_hide_window(window2);*/ break; case 'h': case 'H': gui_hide_window(window3); break; case 'f': case 'F': gui_show_window(window3); break; case 'm': case 'M': while (1) { gui_window_t * w; KEYCODE move; if (buf[0] == 'm') w = window2; else w = window3; move = getkey(); switch (move) { case ESC: goto out_while; case LEFT: gui_window_move(w, -23, 0); break; case RIGHT: gui_window_move(w, 13, 0); break; case UP: gui_window_move(w, 0, -11); break; case DOWN: gui_window_move(w, 0, 23); break; case CTRL_LEFT: gui_window_resize(w, -23, 0); break; case CTRL_RIGHT: gui_window_resize(w, 13, 0); break; case CTRL_UP: gui_window_resize(w, 0, -11); break; case CTRL_DOWN: gui_window_resize(w, 0, 23); break; } } out_while: break; case 'e': case 'E': while(1){ key = gui_view_editing(view, 0); if(key == ESC) break; switch(key){ case UP: gui_view_move_up(view); break; case DOWN: gui_view_move_down(view); break; default: break; } } break; } } }
//***************************************************************************** // //***************************************************************************** void main() { // // Initialize Board configurations // BoardInit(); // // Do Pin mux // PinMuxConfig(); // // Enable and configure DMA // UDMAInit(); // // Initialize the display // InitTerm(); // // Initialize the buttons // Button_IF_Init(OnPressSW2Handler,OnPressSW3Handler); Button_IF_DisableInterrupt(SW3); // // Initialize OTA // pvOtaApp = sl_extLib_OtaInit(RUN_MODE_NONE_OS | RUN_MODE_BLOCKING,0); // // Initialize the global flag // g_ulSysState = SYS_STATE_RUN; // // Create sync object to signal Sl_Start and Wlan Connect complete // TaskSyncObjCreate(&g_NetStatSyncObj); // // Create sync object to signal OTA start // TaskSyncObjCreate(&g_OTAStatSyncObj); // // Create sync object to signal display refresh // TaskSyncObjCreate(&g_DispRefreshSyncObj); // // Create sync object to signal Factory reset event // TaskSyncObjCreate(&g_FactResetSyncObj); // // Initialize Display Info // memset(&sDisplayInfo,0,sizeof(tDisplayInfo)); sDisplayInfo.ucLocalTime[0] = '-'; sDisplayInfo.ucUTCTime[0] = '-'; sprintf(sDisplayInfo.ucTimeZone,"%+03d:%02d", (char)GMT_DIFF_TIME_HRS, (char)GMT_DIFF_TIME_MINS); sprintf(sDisplayInfo.ucAppVersion,"%d.%d.%d", APP_VER_MAJOR, APP_VER_MINOR, APP_VER_BUILD); // // Start the Print task // TaskCreate(DisplayTask, NULL); // // Start the GetNTPTime task // TaskCreate(GetNTPTimeTask, NULL); // // OTA Update Task // TaskCreate(OTAUpdateTask, NULL); // // SL main loop task; // TaskCreate(NonOSMainLoopTask, NULL); // // Factory Reset Task // TaskCreate(FactoryResetTask,NULL); // // Start the task scheduler // TaskMainLoopStart(); // // Infinite loop. Control Should never reach here // while(1) { } }
int fnNULL(void) { TaskCreate(ModeNull); return ModeNull; }