Touch events ignored without ethernet cable pluggged in

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
ChuckR
Posts: 34
Joined: 26 Feb 2014 21:30

Touch events ignored without ethernet cable pluggged in

#1 Post by ChuckR » 15 Jan 2017 21:01

Code works if the Ethernet cable is connected, I'm trying to figure out how to make it run without the Ethernet cable.

Code: Select all

   Net_Ethernet_Intern_Set_Default_PHY()  
    Net_Ethernet_Intern_stackInitTCP()
    Net_Ethernet_Intern_Init(@myMacAddr, @myIpAddr, Net_Eth_Int_AUTO_NEGOTIATION and Net_Eth_Int_DEFAULT_MAC )  'init ethernet board
    Net_Ethernet_Intern_confNetwork(@ipMask, @gwIpAddr, @dnsIpAddr)
while(i <> 1)
      i = Net_Ethernet_Intern_connectTCP(@remoteIpAddr, 3000, 3000, @socketTCP)
    wend
I've tried different ways around the while loop like just letting it run once and capturing the result to set a variable which can be used to skip the code that sends TCP data. When it appears to work, I have a heartbeat on my display generated by half second interrupts of the RTCC. This continues to work but no touch events on my screen work until I plug in the Ethernet cable.
(Using Visual TFT with FTDI's version of connect eve, resistive touch)
If I comment out these lines it will work without the Ethernet cable.

Code: Select all

 Net_Ethernet_Intern_confNetwork(@ipMask, @gwIpAddr, @dnsIpAddr)
while(i <> 1)
      i = Net_Ethernet_Intern_connectTCP(@remoteIpAddr, 3000, 3000, @socketTCP)
    wend
Is there a way to test for the cable connection and then run these lines of code?

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Touch events ignored without ethernet cable pluggged in

#2 Post by lana.arsic » 16 Jan 2017 17:53

Hi Chuck,

I gave you one suggestion here:

http://forum.mikroe.com/viewtopic.php?f ... 53#p278817

Maybe some our users can give you some ideas,
also try to search for some projects on our forum or Libstock website.

Best regards,
Lana

Post Reply

Return to “mikroBasic PRO for PIC32 General”