Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t buf[256] = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl";
- /*
- * Main loop, does nothing except spawn a shell when the old one was terminated
- */
- while (TRUE) {
- if (!shelltp && isUsbActive())
- {
- shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
- while(1){
- chSequentialStreamWrite(chp, buf, 256);
- }
- }
- else if (chThdTerminated(shelltp)) {
- chThdRelease(shelltp); /* Recovers memory of the previous shell. */
- shelltp = NULL; /* Triggers spawning of a new shell. */
- }
- chThdSleepMilliseconds(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment