Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/18/03 12:56
Read: times


 
#58887 - Problem when I split Source Code
Hello Everyone,
Im not sure if its off-topic but here is my problem with Keil C. I have written a program which consists of 6 functions, two ISRs and a few global variables as given below. Initially, I had everything into a single file TEST_IO.C and it was working fine. Yesterday, while going through the User Pages of 8052, I came across Stephane Reys home page which talks of a C coding Standard, in which he emphasises that the program, if broken into individual files, has a definate edge in re-usability. Accordingly, I split my file into 7 .C files and 2 .H files. I put each function into one file like this:

MAIN.c	- Has the Main Function which calls other functions and has the infinite while loop.
INIT.c	- This file has the General SFR and Structure Initialization Routines
INP.c	- Has the Function that Captures the Input, Bytewise, splits it and accordingly updates the STATUS field in the Structure.
PROC.c 	- This has a function that picks up the Status of each alarm and processes it to see if an alarm has to be generated and sets appropriate bits of the structure.
OUT.c	- Checks the alarm bits, groups them into bytes and signals the LED's.
EXT0.c	- This contains the ISR for External Interrupt 0 connected to the ACK button.
TMR0.c	- This contains the ISR for Timer 0 Interrupt (that expires every 50mSec and sets a bit every 500mSec).

SUPP.h	- Contains a support function (used by the function in OUT.c).
VARS.h	- Contains the definition of the Structure, the I/O Variables (at locations 0xf002) and the bit.

Now, Once I split the file into the above, all of them are compiling individually when I use #include"VARS.h". But I get so many ERRORS when the Linker Starts and finally the target is not created.

Can you please have a look at the files and let me know what is going wrong when I split the functions into different files?

The Link to the Source Code along with the Circuit Diagram is : Tank Levels Alarm Panel

Regards,
Harsha.

PS: The ZIP archive contains a file: ABOUT.DOC that explains the project. I would also like to hear comments, in general, about the approach and suggestions for improving the same.

List of 20 messages in thread
TopicAuthorDate
Problem when I split Source Code            01/01/70 00:00      
   RE: Problem when I split Source Code            01/01/70 00:00      
      Downloading the File...            01/01/70 00:00      
         RE: Downloading the File...            01/01/70 00:00      
         aaaaaaaaaaarrrrrrrrrgggggggggghhhhhhhhhh            01/01/70 00:00      
            RE: aaaaaaaaaaarrrrrrrrrgggggggggghhhhhhhhhh            01/01/70 00:00      
               RE: aaaaaaaaaaarrrrrrrrrgggggggggghhhhhhhhhh            01/01/70 00:00      
   RE: Problem when I split Source Code            01/01/70 00:00      
      RE: Problem when I split Source Code            01/01/70 00:00      
   RE: Problem when I split Source Code            01/01/70 00:00      
   RE: Header Files            01/01/70 00:00      
      RE to SUSHIL and THE SOLUTION            01/01/70 00:00      
         RE: RE to SUSHIL and THE SOLUTION            01/01/70 00:00      
            RE: RE to SUSHIL and THE SOLUTION            01/01/70 00:00      
         RE: static            01/01/70 00:00      
            Thanks Donald and Andy            01/01/70 00:00      
               Important Lesson            01/01/70 00:00      
            Structure Still not working !!            01/01/70 00:00      
               RE: Structure Still not working !!            01/01/70 00:00      
                  Eureka.. :)            01/01/70 00:00      

Back to Subject List