Searching \ for '[PIC] PIC-MAXI-WEB c-code syntax queries' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'PIC-MAXI-WEB c-code syntax queries'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] PIC-MAXI-WEB c-code syntax queries'
2009\06\05@024035 by Justin Richards

face picon face
Hi All,

I have a PIC-MAXI-WEB device from olimex and want to tailor the demo code to
initially use NTP to update/set the RTC.

As NTP uses UDP I am trying to decipher some of the c code as follows:-

1.    if(BUTTON0_IO == 0u)
   {
       #if defined(MPFS_USE_EEPROM) && defined(STACK_USE_MPFS)
       // Invalidate the EEPROM contents if BUTTON0 is held down for more
than 4 seconds
       *TICK StartTime = TickGet();*

       while(BUTTON0_IO == 0u)
       {


My assumption here is that StartTime is declared a type TICK and is
immediately initialised with the current Tick Time. So it would be the same
as

TICK StartTime;
StartTime = TickGet();

Is this correct.


2.     #define TCP_RX_FIFO_SIZE    (*200ul)*
   #define MAX_UDP_SOCKETS     (*6ul*)


What is *6ul or 0u* as in 1. above.

3. Sadly after reading the manual for the 18f97j60 I discover that it is
only good for approx 100 flash updates.  As I am in an aggressive
learning/development phase I will be making lots of mistakes.  Any there any
tricks that can be used to increase this number of flash updates.

It seems in some ways to defeat the advantage of icsp as 'yes' you can make
changes very quickly, just dont make too many or you render the device
unusable.

Any help greatly appreciated.

Cheers Justin

2009\06\05@035218 by cdb

flavicon
face


:: What is *6ul or 0u*

I'm not sure about the * as I can't see why it'd be a pointer, but the
ul means unsigned long and the u unsigned. It is used with constants
to ensure the compiler uses the correct amount of byte widths (so if
the compiler is playing with 32 bit systems a long might be a
different size to a 16 bit system) when it performs maths functions.

:: My assumption here is that StartTime is declared a type TICK and is
:: immediately initialised with the current Tick Time. So it would be
:: the same
:: as
::
:: TICK StartTime;
:: StartTime = TickGet();

Yes, it would be worthwhile looking in the header file to find out
exactly what a TICK type comprises. I assume the * is not part of the
syntax?

Colin
--
cdb, spam_OUTcolinTakeThisOuTspambtech-online.co.uk on 5/06/2009

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359






2009\06\05@043859 by Justin Richards

face picon face
Thanks Colin,

Yes, you are correct, there are no * in my Gmail post, however I did
*bold*the sections where I think you now see *xxx*.  I wont do that
again.

TICK as it turns out is   typedef unsigned long TICK;

Thanks again.

Cheers Justin


2009/6/5 cdb <.....colinKILLspamspam@spam@btech-online.co.uk>

{Quote hidden}

> -

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...