Advertisement
Guest User

Untitled

a guest
May 5th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. void new_command( int n, char *argv[]){
  2. xTaskCreate(vTask1,(signed portCHAR *)"newTask",1024,NULL,0, NULL);
  3.  
  4. int handle;
  5. int error;
  6. handle = host_action(SYS_SYSTEM, "mkdir -p output");
  7. handle = host_action(SYS_SYSTEM, "touch output/syslog");
  8. handle = host_action(SYS_OPEN, "output/syslog", 8);
  9. if(handle == -1) {
  10. fio_printf(1, "Open file error!\n\r");
  11. return;
  12. }
  13. char *buffer = "\n\rName State Priority Stack Num\n\r\n";
  14. error = host_action(SYS_WRITE, handle, (void *)buffer, strlen(buffer));
  15. char *buffer_line = "*******************************************\n\r";
  16. error = host_action(SYS_WRITE, handle, (void *)buffer_line, strlen(buffer_line));
  17. char buff[1024];
  18. vTaskList((signed char *)buff);
  19. error = host_action(SYS_WRITE, handle, (void *)buff, strlen(buff));
  20. if(error != 0) {
  21. fio_printf(1, "Write file error! Remain %d bytes didn't write in the file.\n\r", error);
  22. host_action(SYS_CLOSE, handle);
  23. return;
  24.  
  25. }
  26. host_action(SYS_CLOSE, handle);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement