View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
Multiple compilation unit project using command line i-face |
Posted: Sun Oct 04, 2015 2:40 am |
|
|
Hi, I am trying to build a simple multiple compilation unit project using command line interface (please don't ask me why). For simplicity I will post part of the project.
This is the main file:
Code: | #include <16F628A.h>
#fuses NOWDT, NOPUT, INTRC_IO, NOMCLR, NOBROWNOUT, NOLVP, PROTECT
#use delay(clock = 4000000)
#include "start_button.h"
void main()
{
starter_state_1();
}
|
This is the start_button.c:
Code: | #include <16f628A.h>
#include "start_button_conf.h"
#include "start_button.h"
static unsigned char button_permition_flag = 1;
void starter_state_1(void)
{
output_high(ACC);
output_low(IGN1);
output_low(IGN2);
output_low(STARTER);
}
|
This is start_button.h:
Code: | #ifndef _START_
#define _START_
#define STARTER_ON_SECS(x) (x*100) //resolution 10ms
#define OPTION (*((unsigned char *) 0x181))
#define BUTTON_PRESSED (!(input(BUTTON)))
#define IMMO_IN (input(IMMO))
#define BREAKS_ON (input(BREAKS))
#define DINAMO_LAMP_IS_OFF (!input(DINAMO))
#define AFTER_PRESS 45
#define DEBOUNCE_TIME 20
#define BEFORE_START_DELAY 20
void starter_state_1(void);
#endif |
This is start_button_conf.h:
Code: | #ifndef _START_CONF_
#define _START_CONF_
#define CONTACT_LED PIN_A7
#define STARTER_LED PIN_A6
#define IMMO PIN_B0
#define BUTTON PIN_B5
#define IGN1 PIN_A1
#define IGN2 PIN_A0
#define ACC PIN_B6
#define STARTER PIN_B7
#define BREAKS PIN_B3
#define DINAMO PIN_B2
#endif
|
Again this is not the entire project, but this is enough information to build a project and to test it for yourself (if necessary).
This is the .bat file that I have made to try building this project. Of course it doesn't work. It is far from a makefile or another build system that suppose to handle such a project. So this is it:
Code: | echo off:
echo Hello Riko!
SET CCSC_path="C:\Program Files\PICC\Ccsc"
SET WINDOW_OPEN=+P
SET show_messages=+EA
SET PCM=+FM
SET MAIN=StartButton_main.c
echo on:
%CCSC_path% %WINDOW_OPEN% %show_messages% %PCM% %start_button% %MAIN%
pause
end |
It compiles the Start_button_main.c. But it has some prerequisites like start_button.c. Of course the error is Quote: | function starter_state_1() not defined | .
My question is: What is the "make" procedure to build multiple compilation unit project using command line interface?
One more thing, the flag +EA doesn't output any messages on the cmd prompt. May be I am not structuring the command correct?
Thank you in advance! _________________ A person who never made a mistake never tried anything new. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Oct 04, 2015 10:35 am |
|
|
CCS has a 6-page PDF called "Using Multiple Compilation Units Guide".
It has a section on page 2, called "Building the project from the command line".
This PDF file is in mcu.zip, which should be in your CCS Examples directory. |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Sun Oct 04, 2015 11:55 am |
|
|
I found it. Thank you! _________________ A person who never made a mistake never tried anything new. |
|
|
|