CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Multiple compilation unit project using command line i-face

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

Multiple compilation unit project using command line i-face
PostPosted: Sun Oct 04, 2015 2:40 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Oct 04, 2015 10:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Oct 04, 2015 11:55 am     Reply with quote

I found it. Thank you!
_________________
A person who never made a mistake never tried anything new.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group