Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1549 → Rev 1550

/demos/trunk/tftptest/initfile.c
108,7 → 108,6
 
device_drivers_close();
sys_shutdown_message("-- S.Ha.R.K. Closed --\n");
sys_abort_shutdown(0);
 
return NULL;
}
125,7 → 124,7
shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL);
if (shutdown_task_PID == NIL) {
sys_shutdown_message("Error: Cannot create shutdown task\n");
sys_end();
exit(1);
}
 
}
/demos/trunk/tftptest/tftptest.c
28,7 → 28,7
{
sys_shutdown_message("Exit from the program...\n");
sys_shutdown_message("Ctrl-C pressed!\n");
sys_end();
exit(1);
}
 
void augprog(KEY_EVT *k)
136,8 → 136,7
cprintf("Net Init from %s to %s\n", LOCAL_HOST_IP, REMOTE_HOST_IP);
} else {
cprintf("Net Init Failed...\n");
sys_end();
return(err);
exit(1);
}
 
sem_init(&m1, 0, 1);
145,8 → 144,7
 
if ((handle = tftp_open("test.txt")) == -1) {
cprintf("No slots available. Program aborted...\n");
sys_end();
return(1);
exit(1);
}
 
cprintf("Ctrl-A to proceed *** Ctrl-C to stop\n");
157,8 → 155,7
 
if ((err = tftp_upload(handle, 4096, &m1)) != 0) {
cprintf("Error %d calling tftp_upload(). Program aborted...\n", err);
sys_end();
return(1);
exit(1);
}
 
/* First we set the sender's task properties...*/
168,13 → 165,11
 
if ((p1 = task_create("test_upload", test_upload, &hard_m, NULL)) == NIL) {
cprintf("Error creating test_upload task. Program aborted...\n");
sys_end();
return(1);
exit(1);
}
if (task_activate(p1) == -1) {
cprintf("Error activating test_upload task. Program aborted...\n");
sys_end();
return(1);
exit(1);
}
 
 
182,8 → 177,7
 
if ((handle2 = tftp_open("test2.txt")) == -1) {
cprintf("No second slot available. Program aborted...\n");
sys_end();
return(1);
exit(1);
}
 
 
192,8 → 186,7
 
if ((err = tftp_upload(handle2, 4096, &m2)) != 0) {
cprintf("Error %d calling tftp_upload(). Program aborted...\n", err);
sys_end();
return(1);
exit(1);
}
 
/* First we set the sender's task properties...*/
203,13 → 196,11
 
if ((p2 = task_create("test_upload2", test_upload2, &hard_m, NULL)) == NIL) {
cprintf("Error creating test_upload2 task. Program aborted...\n");
sys_end();
return(1);
exit(1);
}
if (task_activate(p2) == -1) {
cprintf("Error activating test_upload2 task. Program aborted...\n");
sys_end();
return(1);
exit(1);
}
 
 
220,7 → 211,8
tftp_close(handle2, TFTP_STOP_NOW);
 
cprintf("\nProgram terminated correctly.\n");
sys_end();
 
exit(0);
 
return(0);
}