int eth_init (bd_t * bd) { int rc; char *s, *e; int i; s = getenv ("ethaddr"); for (i = 0; i < 6; ++i) { bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0; if (s) s = (*e) ? e + 1 : e; } printf ("\tHW MAC address: " "%02X:%02X:%02X:%02X:%02X:%02X\n", bd->bi_enetaddr[0], bd->bi_enetaddr[1], bd->bi_enetaddr[2], bd->bi_enetaddr[3], bd->bi_enetaddr[4], bd->bi_enetaddr[5] ); rc = HWInit(bd); // De-init if an error occurred if (rc == 0) { printf ("ENET init failure\n"); HWDeInit(); return -1; } return 0; }
/**************************************************************************** MAIN APPLICATION ENTRY POINT ****************************************************************************/ int main(void) { // Queue creation - will be used for communication between the stack and other tasks xQueue = xQueueCreate(3, sizeof (int)); xSemFrontEnd = xSemaphoreCreateMutex(); // Initialize application specific hardware HWInit(HWDEFAULT); UARTInit(1,19200); UARTOn(1); // RTOS starting if (xSemFrontEnd != NULL) { // Creates the task to handle all HiLo functions xTaskCreate(GSMTask, (signed char*) "GSM", STACK_SIZE_GSM, NULL, tskIDLE_PRIORITY + 1, &hGSMTask); // Start of the RTOS scheduler, this function should never return vTaskStartScheduler(); } #if defined (STACK_USE_UART) UARTWrite(1, "Unexpected end of program...\r\n"); #endif while(1); return -1; }
/**************************************************************************** MAIN APPLICATION ENTRY POINT ****************************************************************************/ int main(void) { // Initialize application specific hardware HWInit(HWDEFAULT); // Initializing the UART for the debug #if defined (STACK_USE_UART) UARTInit(1, UART_DBG_DEF_BAUD); UARTOn(1); _dbgwrite("Flyport starting..."); #endif // Queue creation - will be used for communication between the stack and other tasks xQueue = xQueueCreate(3, sizeof (int)); xSemFrontEnd = xSemaphoreCreateMutex(); // RTOS starting if (xSemFrontEnd != NULL) { // Creates the task to handle all TCPIP functions xTaskCreate(TCPIPTask, (signed char*) "TCP", STACK_SIZE_TCPIP, NULL, tskIDLE_PRIORITY + 1, &hTCPIPTask); // Start of the RTOS scheduler, this function should never return vTaskStartScheduler(); } _dbgwrite("Unexpected end of program...\r\n"); while(1); return -1; }