int cmd_process_demo(int argc, char *argv[], FILE *ostrm) { #else int cmd_process_demo(int argc, char *argv[]) { #endif uint32_t pid; char msg[64]; flash_orange_led_pid = svc_spawn(flash_orange_led); sprintf(msg, "spawned PID: %d\r\n", (int) flash_orange_led_pid); efputs(msg, STDOUT); pid = svc_spawn(openFiles); sprintf(msg, "spawned PID: %d\r\n", (int) pid); efputs(msg, STDOUT); pid = svc_spawn(cmd_touch2led); sprintf(msg, "spawned PID: %d\r\n", (int) pid); efputs(msg, STDOUT); pid = svc_spawn(cmd_pot2ser); sprintf(msg, "spawned PID: %d\r\n", (int) pid); efputs(msg, STDOUT); return 0; }
int main(int argc,char *argv[]) /* * main function of the shell program, calls process_input(). As process_input() * does all the error reporting and does not propagate errors out of it * and shell program does not have to return any failure exit status * to its parent shell, main() simply retuns 0 */ { //Bootstrap bootstrap(); //flexTimer0Start(); //process input //process_input(); uint32_t pid; struct spawnArgs args; args.argc = 1; args.argv = NULL; args.spawnedPidptr = &pid; args.stackSize = STACK_SIZE; args.funcPtr = runShell; svc_spawn(&args); sysTickStart(); privUnprivileged(); while(1); return 0; }