Ejemplo n.º 1
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  #ifdef WIN32
    WSADATA WSAData;
  #endif
  double lon  =  6.9158935; // Longitude
  double lat  = 51.1793436; // Latitude
  int x, y, Zoom;

  GUI_Init();
  #ifdef WIN32
    WSACleanup();
    if (WSAStartup(MAKEWORD(2,0), &WSAData) != 0) {
      return;
    }
  #else
    IP_Init();
    IP_AddLogFilter(IP_MTYPE_APPLICATION);
    _IFaceId = IP_INFO_GetNumInterfaces() - 1;                               // Get the last registered interface ID as this is most likely the interface we want to use in this sample.
    OS_SetPriority(OS_GetTaskID(), TASK_PRIO_IP_TASK);                       // For now, this task has highest prio except IP management tasks.
    OS_CREATETASK(&_IPTCB, "IP_Task", IP_Task, TASK_PRIO_IP_TASK, _IPStack); // Start the IP_Task.
    IP_Connect(_IFaceId);                                                    // Connect the interface if necessary.
    OS_SetPriority(OS_GetTaskID(), TASK_PRIO_IP_CLIENT);                     // Important: Client task priority must be less than priority of IP task!!!
    while (IP_IFaceIsReadyEx(_IFaceId) == 0) {
      OS_Delay(50);
    }
  #endif
  Zoom = 16;
  x = _Long2TileX(lon, Zoom);
  y = _Lat2TileY(lat, Zoom);
  _TileScreen(x, y, Zoom);
  while(1) {
    GUI_Delay(20);
  }
}
Ejemplo n.º 2
0
IP_Connection::IP_Connection(QObject *parent) :
    QObject(parent)
{
    IP_Init();

    connect(socket, SIGNAL(connected()), this, SIGNAL(Connected()));
    connect(socket, SIGNAL(disconnected()), this, SIGNAL(Disconnected()));
    connect(socket, SIGNAL(disconnected()), this, SLOT(sdisconnected()));
    connect(socket, SIGNAL(readyRead()), this, SIGNAL(dataReceived()));
}
Ejemplo n.º 3
0
void MainTask(void) {
  IP_Init();
  OS_SetPriority(OS_GetTaskID(), 255);                                 // This task has highest prio for real-time application
  OS_CREATETASK(&_TCB,       "IP_Task", IP_Task, 150, _Stack);         // Start the IP task
  OS_CREATETASK(&_TCBMailer, "Mailer",  _Mailer, 100, _StackMailer);   // Start the mailer
  while (1) {
    BSP_ToggleLED(1);
    if (IP_GetCurrentLinkSpeed() == 0) {
      OS_Delay(50);
    } else {
      OS_Delay (200);
    }
  }
}
Ejemplo n.º 4
0
void MainTask(void) {
  BSP_ClrLED(0);
  BSP_ClrLED(1);
  BSP_ClrLED(2);
  IP_Init();
  OS_SetPriority(OS_GetTaskID(), 255);
  OS_CREATETASK(&_TCBIP       , "IP_Task"  , IP_Task  , 150, _StackIP);
#if USE_RX_TASK
  OS_CREATETASK(&_TCBIPRx     , "IP_RxTask", IP_RxTask, 250, _StackIPRx);
#endif
  OS_CREATETASK_EX(&_TCBClient, "Client"   ,  _Client , 100, _StackClient, NULL);
  while (1) {
    BSP_ToggleLED(2);
    OS_Delay (200);
  }
}
Ejemplo n.º 5
0
void MainTask(void) {
  IP_Init();
  OS_SetPriority(OS_GetTaskID(), 255);                                      // This task has highest prio for real-time application
  OS_CREATETASK(&_TCB     , "IP_Task"  , IP_Task       , 150, _Stack);      // Start the IP task
#if USE_RX_TASK
  OS_CREATETASK(&_IPRxTCB , "IP_RxTask", IP_RxTask     , 140, _IPRxStack);  // Start the IP_RxTask, optional.
#endif
  OS_CREATETASK(&_TCBShell, "Shell"    , IP_ShellServer, 100, _StackShell); // Start the shell server

  while (IP_IFaceIsReady() == 0) {
    OS_Delay(50);
  }
  while (1) {
    BSP_ToggleLED(1);
    OS_Delay (200);
  }
}