Line 14... |
Line 14... |
// Author(s): //
|
// Author(s): //
|
// - Conor Santifort, csantifort.amber@gmail.com //
|
// - Conor Santifort, csantifort.amber@gmail.com //
|
// //
|
// //
|
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
// //
|
// //
|
// Copyright (C) 2011 Authors and OPENCORES.ORG //
|
// Copyright (C) 2011-2013 Authors and OPENCORES.ORG //
|
// //
|
// //
|
// This source file may be used and distributed without //
|
// This source file may be used and distributed without //
|
// restriction provided that this copyright statement is not //
|
// restriction provided that this copyright statement is not //
|
// removed from the file and that any derivative work contains //
|
// removed from the file and that any derivative work contains //
|
// the original copyright notice and the associated disclaimer. //
|
// the original copyright notice and the associated disclaimer. //
|
Line 51... |
Line 51... |
#include "telnet.h"
|
#include "telnet.h"
|
#include "serial.h"
|
#include "serial.h"
|
|
|
|
|
int main ( void ) {
|
int main ( void ) {
|
socket_t* socket;
|
|
|
|
/* Enable the serial debug port */
|
/* Enable the serial debug port */
|
init_serial();
|
init_serial();
|
print_serial("Amber debug port\n\r");
|
print_serial("Amber debug port\n\r");
|
|
|
|
|
Line 68... |
Line 66... |
init_timer();
|
init_timer();
|
|
|
/* Create a timer to flash a led periodically */
|
/* Create a timer to flash a led periodically */
|
init_led();
|
init_led();
|
|
|
/* initialize the tftp stuff */
|
|
init_tftp();
|
|
|
|
|
|
/* create a tcp socket for listening */
|
|
first_socket_g = new_socket(NULL);
|
|
socket = first_socket_g;
|
|
|
|
/* initialize the PHY and MAC and listen for connections
|
/* initialize the PHY and MAC and listen for connections
|
This is the last init because packets will be received from this point
|
This is the last init because packets will be received from this point
|
onwards. */
|
onwards. */
|
init_ethmac();
|
init_ethmac();
|
|
|
|
/* create a tcp socket for listening on port 23 */
|
|
listen_telnet();
|
|
|
|
/* initialize the tftp stuff */
|
|
init_tftp();
|
|
|
|
|
/* Process loop. Everything is timer, interrupt and queue driven from here on down */
|
/* Process loop. Everything is timer, interrupt and queue driven from here on down */
|
while (1) {
|
while (1) {
|
|
|
/* flash an led */
|
/* flash an led */
|
process_led();
|
process_led();
|
|
|
/* Check for received tftp files and reboot */
|
/* Check for received tftp files and reboot */
|
process_tftp();
|
process_tftp();
|
|
|
/* handle tcp connections and process buffers */
|
/* Process all socket traffic */
|
/* Poll all sockets in turn for activity */
|
process_sockets();
|
if (socket->next == NULL)
|
|
socket = first_socket_g;
|
|
else
|
|
socket = socket->next;
|
|
|
|
process_tcp(socket);
|
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|