View previous topic :: View next topic |
Author |
Message |
SeeCwriter Guest
|
Using Microchip source code |
Posted: Fri Sep 14, 2007 12:18 pm |
|
|
I am interested in using a C source file from Microchip to implement a TCP/IP stack. Their app note says it's written for the C18 and Hi-Tech PICC 18 compilers. I'm guessing that these compilers are case sensitive, as every other C compiler in the world is, except for CCS. Am I asking for trouble to try to use this C library with CCS? Are there other options I'm not aware of? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Sep 14, 2007 12:25 pm |
|
|
I'm guessing that these compilers are case sensitive, as every other C
compiler in the world is, except for CCS.
Download the CCS compiler manual.
http://www.ccsinfo.com/downloads/CReferenceManual.pdf
Look in the Preprocessor Directives section, specifically at
the Compiler control section.
You will find the directive to do what you need. |
|
|
SeeCwriter Guest
|
|
Posted: Fri Sep 14, 2007 12:33 pm |
|
|
I know that you can configure the CCS compiler to be case sensitive. But the manual also says that none of the CCS libraries have been tested in case-sensitive mode, so proceed at your own risk. I have no desire to debug CCS's libraries. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Sep 14, 2007 1:05 pm |
|
|
By "libraries" they mean the C source files in:
Quote: | c:\Program Files\Picc\Examples
c:\Program Files\Picc\Drivers |
Those files aren't involved in compiling code that has been ported
from C18. |
|
|
SeeCwriter Guest
|
|
Posted: Wed Sep 19, 2007 1:51 pm |
|
|
The documentation says that case sensitivity is not tested with example programs, drivers, and headers. I believe headers are compiled into your code.
I saw on the CCS download page a download for TCP/IP. I downloaded it and read the readme file, and it says that it's a port of the Microchip TCP/IP package for the version 3 CCS compiler. It also says that when version 4 of the CCS compiler is released (I guess this port is quite old) that the Microchip TCP/IP package will be able to be used almost "as is" with it since version 4 will have a linker and compatible pointers. Has anyone tried to use Microchip's TCP/IP package with version 4 of the CCS compiler? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 19, 2007 2:06 pm |
|
|
I just looked at 18F452.H and almost everything in it is a constant, and
they are all in upper case, which is the C standard.
There are few #define statements which provide aliases for functions,
but they're all in lower case, which is also the C standard.
These two lines could conceivably be a problem, but these are the only ones:
Code: | #define BYTE int
#define BOOLEAN short int |
Quote: | I saw on the CCS download page a download for TCP/IP. |
Here's the link to the download page. I don't see a TCP/IP download
on there. What page did you see it on ?
http://www.ccsinfo.com/downloads.php |
|
|
SeeCwriter Guest
|
|
Posted: Wed Sep 19, 2007 2:09 pm |
|
|
Click on the "Go to the Compiler Updates page" link. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 19, 2007 4:28 pm |
|
|
I downloaded it. I did a text search, and Darren does use #case in
these files. I did a further search for "stacktsk.h", and it looks like
almost every file in TCP-IP directory #includes it. So that means
#case is likely used everywhere in that code.
Quote: | c:\program files\picc\tcp-ip\pic examples source\tcpip\stacktsk.h
Line 51: #case
c:\program files\picc\tcp-ip\pic examples source\fat\fat_pic.c
Line 63: #case
c:\program files\picc\tcp-ip\pic examples source\fat\fat_spi.c
Line 66: #case |
|
|
|
|