/* * ======== Power_Module_startup ======== */ Int Power_Module_startup(status) { /* use template-based function for conditional init & symbol references */ Power_init(); return (Startup_DONE); }
/* * ======== Board_initPower ======== */ void Board_initPower(void) { Power_setConstraint(PowerCC3200_DISALLOW_DEEPSLEEP); Power_setConstraint(PowerCC3200_DISALLOW_LPDS); // Power_registerNotify(&slNotify, PowerCC3200_AWAKE_LPDS|PowerCC3200_AWAKE_DEEPSLEEP, (Power_NotifyFxn)simpleLinkWakupCallback, NULL); Power_init(); }
/* * ======== Processor_init ======== */ Void Processor_init(Void) { if (curInit != TRUE) { curInit = TRUE; GT_create(&curTrace, Processor_GTNAME); /* Semaphore with count 0, will be posted when a command is present */ dcmd.cmdPresent = Sem_create(CMDKEY, 0); /* Semaphore with count 0, will be posted when reply is ready */ dcmd.replyPresent = Sem_create(REPLYKEY, 0); /* * Create lock to allow only one thread at a time to send command * to the daemon. */ dcmd.gate = Lock_create(NULL); if ((dcmd.cmdPresent == NULL) || (dcmd.replyPresent == NULL) || (dcmd.gate == NULL)) { // TODO: Shouldn't we abort? GT_0trace(curTrace, GT_7CLASS, "Processor_init> ERROR: cannot" " create semaphores or lock\n"); } if ((dcmd.dproc = Thread_create((Fxn)daemon, NULL)) == NULL) { GT_0trace(curTrace, GT_7CLASS, "Processor_init> " "ERROR: cannot create DSP daemon\n"); } Power_init(); Global_atexit((Fxn)cleanup); } }
/* * ======== Board_initPower ======== */ void Board_initPower(void) { Power_init(); }
int main(int argc, char** argv) { pspDebugScreenInit(); pspDebugScreenEnableBackColor(0); SetupCallbacks(); char* scriptFilename = "script.lua"; lua_State *L; L = lua_open(); luaL_openlibs(L); Aalib_init(L); Color_init(L); g2D_init(L); intraFont_init(L); Ctrl_init(L); Power_init(L); Time_init(L); Timer_init(L); Savedata_init(L); sceIo_init(L); Utility_init(L); USB_init(L); Xtream_init(L); SceCtrlData keys, oldkeys; int status = 0, i; while (1) { status = luaL_loadfile(L, scriptFilename); if (status == 0) status = lua_pcall(L, 0, LUA_MULTRET, 0); if (status != 0) //If an error has occured { sceCtrlReadBufferPositive(&oldkeys, 1); pspDebugScreenInit(); pspDebugScreenEnableBackColor(1); while (1) { sceCtrlReadBufferPositive(&keys, 1); pspDebugScreenSetXY(0,0); printf("Lua Error:\n%s\n", lua_tostring(L, -1)); printf("Press Start to reset.\n"); if ((keys.Buttons &PSP_CTRL_START) && !(oldkeys.Buttons &PSP_CTRL_START)) break; oldkeys = keys; for (i = 0; i < 10; i++) sceDisplayWaitVblankStart(); } pspDebugScreenInit(); pspDebugScreenEnableBackColor(0); lua_pop(L, 1); } } lua_close(L); intraFontShutdown(); g2dTerm(); cleanUSBDrivers(); sceKernelExitGame(); return 0; }
/* * ======== MSP_EXP432P401R_initGeneral ======== */ void MSP_EXP432P401R_initGeneral(void) { Power_init(); }