Project

General

Profile

Revision 78c254a7

ID78c254a789591a562eb29ad4e17e3d49298bf359
Parent 3af6e333
Child ec7caeb1

Added by RicardoSilva91 almost 7 years ago

config e make file

View differences:

tpf/Makefile
1
CC = gcc
2
CFLAGS = -Wall 
3
LIBS = -lm
4

  
5
BIN = microwave
6
OBJS = mainTest.o config.o display.o power.o tempo.o 
7

  
8
all:: 	$(BIN)
9

  
10
$(BIN):: $(OBJS)
11
	$(CC) $(CFLAGS) -o $(BIN) $(OBJS) $(LIBS)
12

  
13
config.o:: config.h
14

  
15
power.o:: power.h
16

  
17
display.o:: display.h
18

  
19
tempo.o:: tempo.h
20

  
21
mainTest.o:: tempo.h display.h power.h config.h
22

  
23
clean::
24
	/bin/rm -f *~ *.o
tpf/config.c
1
/*
2
 * blink.c:
3
 *	Standard "blink" program in wiringPi. Blinks an LED connected
4
 *	to the first GPIO pin.
5
 *
6
 * Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net>
7
 ***********************************************************************
8
 * This file is part of wiringPi:
9
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
10
 *
11
 *    wiringPi is free software: you can redistribute it and/or modify
12
 *    it under the terms of the GNU Lesser General Public License as published by
13
 *    the Free Software Foundation, either version 3 of the License, or
14
 *    (at your option) any later version.
15
 *
16
 *    wiringPi is distributed in the hope that it will be useful,
17
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *    GNU Lesser General Public License for more details.
20
 *
21
 *    You should have received a copy of the GNU Lesser General Public License
22
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
23
 ***********************************************************************
24
 */
25

  
26
#include <stdio.h>
27
#include <stdint.h>
28
#include <wiringPi.h>
29
#include "config.h"
30

  
31

  
32
uint8_t initBoard(){
33
    
34
    wiringPiSetup () ;
35
    
36
    /**
37
     * inputs
38
     */
39
    //power button
40
    pinMode (POWER_BTN, INPUT);
41
    //time button
42
    pinMode (TIME_BTN, INPUT);
43
    //+ button
44
    pinMode (PLUS_BTN, INPUT);
45
    //- button
46
    pinMode (MINUS_BTN, INPUT);
47
    //door switch (open/closed)
48
    pinMode (DOOR_SWITCH, INPUT);
49
    //on/off switch
50
    pinMode (ON_OF_SWITCH, INPUT);
51
    
52
    /**
53
     * outputs 
54
     */
55
    pinMode (WAVE_LED, OUTPUT);
56
    
57
}
tpf/config.h
1
#ifndef CONFIG_H
2
#define CONFIG_H
3

  
4
#include <stdint.h>
5

  
6

  
7
/**
8
 *  macro values used to define wich pins to connect in the raspberry gpio
9
 * 
10
 */
11
#define POWER_BTN 0
12
#define TIME_BTN 1
13
#define PLUS_BTN 2
14
#define MINUS_BTN 3
15
#define DOOR_SWITCH 4
16
#define WAVE_LED 5
17
#define ON_OF_SWITCH 6
18

  
19

  
20
/**
21
 * 
22
 * defines the state(INPUT/OUTPUT) of the phisical pins in the raspberry gpio
23
 * @return 0 if success
24
 *         !0 if error
25
 * 
26
 */
27
uint8_t initBoard();
28

  
29

  
30

  
31

  
32
#endif
tpf/mainTest.c
4 4

  
5 5

  
6 6

  
7

  
7 8
int timeSet = 0;	//Apenas quando estas duas variáveis
8 9
int powerSet = 0;	//estiverem a 1 é que se pode dar Start
9 10

  
tpf/nbproject/configurations.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<configurationDescriptor version="95">
3
  <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
4
    <df root="." name="0">
5
      <in>config.c</in>
6
      <in>display.c</in>
7
      <in>mainTest.c</in>
8
    </df>
9
    <logicalFolder name="ExternalFiles"
10
                   displayName="Important Files"
11
                   projectFiles="false"
12
                   kind="IMPORTANT_FILES_FOLDER">
13
      <itemPath>Makefile</itemPath>
14
    </logicalFolder>
15
  </logicalFolder>
16
  <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
17
  <sourceRootList>
18
    <Elem>.</Elem>
19
  </sourceRootList>
20
  <projectmakefile>Makefile</projectmakefile>
21
  <confs>
22
    <conf name="Default" type="0">
23
      <toolsSet>
24
        <compilerSet>default</compilerSet>
25
        <dependencyChecking>false</dependencyChecking>
26
        <rebuildPropChanged>false</rebuildPropChanged>
27
      </toolsSet>
28
      <codeAssistance>
29
      </codeAssistance>
30
      <makefileType>
31
        <makeTool>
32
          <buildCommandWorkingDir>.</buildCommandWorkingDir>
33
          <buildCommand>${MAKE} -f Makefile</buildCommand>
34
          <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
35
          <executablePath></executablePath>
36
        </makeTool>
37
      </makefileType>
38
      <item path="config.c" ex="false" tool="0" flavor2="0">
39
      </item>
40
      <item path="display.c" ex="false" tool="0" flavor2="0">
41
      </item>
42
      <item path="mainTest.c" ex="false" tool="0" flavor2="0">
43
      </item>
44
    </conf>
45
  </confs>
46
</configurationDescriptor>
tpf/nbproject/private/CodeAssistancePathMapper.properties
1
# Automatic path mapper. CRC = 1
tpf/nbproject/private/Default-build.log
1
gcc -Wall    -c -o mainTest.o mainTest.c
2
mainTest.c: In function ‘main’:
3
mainTest.c:34:25: warning: implicit declaration of function ‘isspace’ [-Wimplicit-function-declaration]
4
   do{c=getchar();}while(isspace(c));
5
                         ^
6
gcc -Wall    -c -o display.o display.c
7
display.c:3:20: error: unknown type name ‘String’
8
 uint8_t setDisplay(String toDisplay)
9
                    ^
10
display.c: In function ‘clear’:
11
display.c:11:1: warning: control reaches end of non-void function [-Wreturn-type]
12
 }
13
 ^
14
<builtin>: recipe for target 'display.o' failed
15
make: *** [display.o] Error 1
tpf/nbproject/private/Default-exec.log
1
called: gcc
2
	/home/rofler/D/Google Drive/ua/PSE/git_code_ua/pse-2015-16-grupo-3/tpf
3
	gcc
4
	-Wall
5
	-c
6
	-o
7
	mainTest.o
8
	mainTest.c
9

  
10
called: gcc
11
	/home/rofler/D/Google Drive/ua/PSE/git_code_ua/pse-2015-16-grupo-3/tpf
12
	gcc
13
	-Wall
14
	-c
15
	-o
16
	display.o
17
	display.c
18

  
tpf/nbproject/private/Default.properties
1
/home/rofler/D/Google Drive/ua/PSE/git_code_ua/pse-2015-16-grupo-3/tpf/display.c=/home/rofler/D/Google Drive/ua/PSE/git_code_ua/pse-2015-16-grupo-3/tpf#gcc -Wall    -c -o display.o display.c
2
/home/rofler/D/Google Drive/ua/PSE/git_code_ua/pse-2015-16-grupo-3/tpf/mainTest.c=/home/rofler/D/Google Drive/ua/PSE/git_code_ua/pse-2015-16-grupo-3/tpf#gcc -Wall    -c -o mainTest.o mainTest.c
tpf/nbproject/private/configurations.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<configurationDescriptor version="95">
3
  <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
4
    <df root="." name="0">
5
      <in>config.c</in>
6
      <in>config.h</in>
7
      <in>display.c</in>
8
      <in>display.h</in>
9
      <in>mainTest.c</in>
10
      <in>power.c</in>
11
      <in>power.h</in>
12
      <in>tempo.c</in>
13
      <in>tempo.h</in>
14
    </df>
15
  </logicalFolder>
16
  <projectmakefile>Makefile</projectmakefile>
17
  <confs>
18
    <conf name="Default" type="0">
19
      <toolsSet>
20
        <developmentServer>localhost</developmentServer>
21
        <platform>2</platform>
22
      </toolsSet>
23
      <compile>
24
        <compiledirpicklist>
25
          <compiledirpicklistitem>.</compiledirpicklistitem>
26
          <compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
27
        </compiledirpicklist>
28
        <compiledir>${AUTO_FOLDER}</compiledir>
29
        <compilecommandpicklist>
30
          <compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
31
          <compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
32
        </compilecommandpicklist>
33
        <compilecommand>${AUTO_COMPILE}</compilecommand>
34
      </compile>
35
      <dbx_gdbdebugger version="1">
36
        <gdb_pathmaps>
37
        </gdb_pathmaps>
38
        <gdb_interceptlist>
39
          <gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
40
        </gdb_interceptlist>
41
        <gdb_options>
42
          <DebugOptions>
43
          </DebugOptions>
44
        </gdb_options>
45
        <gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
46
      </dbx_gdbdebugger>
47
      <nativedebugger version="1">
48
        <engine>gdb</engine>
49
      </nativedebugger>
50
      <runprofile version="9">
51
        <runcommandpicklist>
52
          <runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
53
        </runcommandpicklist>
54
        <runcommand>"${OUTPUT_PATH}"</runcommand>
55
        <rundir>.</rundir>
56
        <buildfirst>false</buildfirst>
57
        <terminal-type>0</terminal-type>
58
        <remove-instrumentation>0</remove-instrumentation>
59
        <environment>
60
        </environment>
61
      </runprofile>
62
    </conf>
63
  </confs>
64
</configurationDescriptor>
tpf/nbproject/private/launcher.properties
1
# Launchers File syntax:
2
#
3
# [Must-have property line] 
4
# launcher1.runCommand=<Run Command>
5
# [Optional extra properties] 
6
# launcher1.displayName=<Display Name, runCommand by default>
7
# launcher1.buildCommand=<Build Command, Build Command specified in project properties by default>
8
# launcher1.runDir=<Run Directory, ${PROJECT_DIR} by default>
9
# launcher1.symbolFiles=<Symbol Files loaded by debugger, ${OUTPUT_PATH} by default>
10
# launcher1.env.<Environment variable KEY>=<Environment variable VALUE>
11
# (If this value is quoted with ` it is handled as a native command which execution result will become the value)
12
# [Common launcher properties]
13
# common.runDir=<Run Directory>
14
# (This value is overwritten by a launcher specific runDir value if the latter exists)
15
# common.env.<Environment variable KEY>=<Environment variable VALUE>
16
# (Environment variables from common launcher are merged with launcher specific variables)
17
# common.symbolFiles=<Symbol Files loaded by debugger>
18
# (This value is overwritten by a launcher specific symbolFiles value if the latter exists)
19
#
20
# In runDir, symbolFiles and env fields you can use these macroses:
21
# ${PROJECT_DIR}    -   project directory absolute path
22
# ${OUTPUT_PATH}    -   linker output path (relative to project directory path)
23
# ${OUTPUT_BASENAME}-   linker output filename
24
# ${TESTDIR}        -   test files directory (relative to project directory path)
25
# ${OBJECTDIR}      -   object files directory (relative to project directory path)
26
# ${CND_DISTDIR}    -   distribution directory (relative to project directory path)
27
# ${CND_BUILDDIR}   -   build directory (relative to project directory path)
28
# ${CND_PLATFORM}   -   platform name
29
# ${CND_CONF}       -   configuration name
30
# ${CND_DLIB_EXT}   -   dynamic library extension
31
#
32
# All the project launchers must be listed in the file!
33
#
34
# launcher1.runCommand=...
35
# launcher2.runCommand=...
36
# ...
37
# common.runDir=...
38
# common.env.KEY=VALUE
39

  
40
# launcher1.runCommand=<type your run command here>
tpf/nbproject/private/private.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3
    <code-assistance-data xmlns="http://www.netbeans.org/ns/make-project-private/1">
4
        <code-model-enabled>true</code-model-enabled>
5
    </code-assistance-data>
6
    <data xmlns="http://www.netbeans.org/ns/make-project-private/1">
7
        <activeConfTypeElem>0</activeConfTypeElem>
8
        <activeConfIndexElem>0</activeConfIndexElem>
9
    </data>
10
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
11
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
12
        <group/>
13
    </open-files>
14
</project-private>
tpf/nbproject/project.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://www.netbeans.org/ns/project/1">
3
    <type>org.netbeans.modules.cnd.makeproject</type>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/make-project/1">
6
            <name>tpf</name>
7
            <c-extensions>c</c-extensions>
8
            <cpp-extensions/>
9
            <header-extensions>h</header-extensions>
10
            <sourceEncoding>UTF-8</sourceEncoding>
11
            <make-dep-projects/>
12
            <sourceRootList>
13
                <sourceRootElem>.</sourceRootElem>
14
            </sourceRootList>
15
            <confList>
16
                <confElem>
17
                    <name>Default</name>
18
                    <type>0</type>
19
                </confElem>
20
            </confList>
21
            <formatting>
22
                <project-formatting-style>false</project-formatting-style>
23
            </formatting>
24
        </data>
25
    </configuration>
26
</project>

Also available in: Unified diff