work on submodule integration

This commit is contained in:
Wolfgang Hottgenroth 2016-09-18 17:04:47 +02:00
parent 8f5d767d7e
commit fe8fb9ce58
5 changed files with 70 additions and 177 deletions

View File

@ -25,10 +25,20 @@
<option defaultValue="dk.xpg.msp430eclipse.compiler.option.optimization.level.none" id="dk.xpg.msp430eclipse.compiler.option.optimization.level.925149145" name="Optimization Level" superClass="dk.xpg.msp430eclipse.compiler.option.optimization.level" valueType="enumerated"/>
<option defaultValue="dk.xpg.msp430eclipse.compiler.option.debugging.level.default" id="dk.xpg.msp430eclipse.compiler.option.debugging.level.154569899" name="Debugging Level" superClass="dk.xpg.msp430eclipse.compiler.option.debugging.level" valueType="enumerated"/>
<option id="dk.xpg.msp430eclipse.compiler.option.language.standard.1380069728" name="Standard" superClass="dk.xpg.msp430eclipse.compiler.option.language.standard" value="dk.xpg.msp430eclipse.compiler.option.language.standard.gnu99" valueType="enumerated"/>
<option id="dk.xpg.msp430eclipse.compiler.option.includes.paths.1500718177" name="Include paths (-I)" superClass="dk.xpg.msp430eclipse.compiler.option.includes.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislibformsp430}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/src}&quot;"/>
</option>
<inputType id="dk.xpg.msp430eclipse.tool.compiler.gcc.input.1393043846" name="C Source File" superClass="dk.xpg.msp430eclipse.tool.compiler.gcc.input"/>
<inputType id="dk.xpg.msp430eclipse.tool.compiler.gcc.input.cc.1115664253" name="C++ Source File" superClass="dk.xpg.msp430eclipse.tool.compiler.gcc.input.cc"/>
</tool>
<tool id="dk.xpg.msp430eclipse.tool.assembler.gcc.423309473" name="MSP430 Assembler" superClass="dk.xpg.msp430eclipse.tool.assembler.gcc">
<option id="dk.xpg.msp430eclipse.assembler.option.general.include.497233956" name="Include Paths (-I)" superClass="dk.xpg.msp430eclipse.assembler.option.general.include" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislibformsp430}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/src}&quot;"/>
</option>
<inputType id="dk.xpg.msp430eclipse.tool.assembler.input.1627828012" name="Assembler Files" superClass="dk.xpg.msp430eclipse.tool.assembler.input"/>
</tool>
<tool id="dk.xpg.msp430eclipse.tool.linker.gcc.1414250393" name="MSP430 Linker" superClass="dk.xpg.msp430eclipse.tool.linker.gcc">
@ -38,7 +48,9 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="hottislibformsp430|hottislib|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="hottislib"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="hottislibformsp430"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
@ -68,10 +80,20 @@
<tool id="dk.xpg.msp430eclipse.tool.compiler.gcc.1604096089" name="MSP430 C Compiler" superClass="dk.xpg.msp430eclipse.tool.compiler.gcc">
<option defaultValue="dk.xpg.msp430eclipse.compiler.option.optimization.level.most" id="dk.xpg.msp430eclipse.compiler.option.optimization.level.957179260" name="Optimization Level" superClass="dk.xpg.msp430eclipse.compiler.option.optimization.level" valueType="enumerated"/>
<option defaultValue="dk.xpg.msp430eclipse.compiler.option.debugging.level.none" id="dk.xpg.msp430eclipse.compiler.option.debugging.level.1445781415" name="Debugging Level" superClass="dk.xpg.msp430eclipse.compiler.option.debugging.level" valueType="enumerated"/>
<option id="dk.xpg.msp430eclipse.compiler.option.includes.paths.1393153740" name="Include paths (-I)" superClass="dk.xpg.msp430eclipse.compiler.option.includes.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislibformsp430}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/src}&quot;"/>
</option>
<inputType id="dk.xpg.msp430eclipse.tool.compiler.gcc.input.2129325944" name="C Source File" superClass="dk.xpg.msp430eclipse.tool.compiler.gcc.input"/>
<inputType id="dk.xpg.msp430eclipse.tool.compiler.gcc.input.cc.2128986642" name="C++ Source File" superClass="dk.xpg.msp430eclipse.tool.compiler.gcc.input.cc"/>
</tool>
<tool id="dk.xpg.msp430eclipse.tool.assembler.gcc.1072807233" name="MSP430 Assembler" superClass="dk.xpg.msp430eclipse.tool.assembler.gcc">
<option id="dk.xpg.msp430eclipse.assembler.option.general.include.905243057" name="Include Paths (-I)" superClass="dk.xpg.msp430eclipse.assembler.option.general.include" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/hottislibformsp430}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/teathermotimerng/src}&quot;"/>
</option>
<inputType id="dk.xpg.msp430eclipse.tool.assembler.input.20110081" name="Assembler Files" superClass="dk.xpg.msp430eclipse.tool.assembler.input"/>
</tool>
<tool id="dk.xpg.msp430eclipse.tool.linker.gcc.2090938199" name="MSP430 Linker" superClass="dk.xpg.msp430eclipse.tool.linker.gcc">
@ -92,9 +114,21 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="TeaThermoTimer.dk.xpg.msp430eclipse.project.gcc.elf.2012413821" name="MSP430 Cross Target Application" projectType="dk.xpg.msp430eclipse.project.gcc.elf"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="dk.xpg.msp430eclipse.configuration.app.release.1716607718;dk.xpg.msp430eclipse.configuration.app.release.1716607718.;dk.xpg.msp430eclipse.tool.compiler.gcc.1604096089;dk.xpg.msp430eclipse.tool.compiler.gcc.input.cc.2128986642">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="dk.xpg.msp430eclipse.MSP430GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="dk.xpg.msp430eclipse.configuration.app.debug.1048602252;dk.xpg.msp430eclipse.configuration.app.debug.1048602252.;dk.xpg.msp430eclipse.tool.compiler.gcc.1489133124;dk.xpg.msp430eclipse.tool.compiler.gcc.input.1393043846">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="dk.xpg.msp430eclipse.MSP430GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="dk.xpg.msp430eclipse.configuration.app.debug.1048602252;dk.xpg.msp430eclipse.configuration.app.debug.1048602252.;dk.xpg.msp430eclipse.tool.compiler.gcc.1489133124;dk.xpg.msp430eclipse.tool.compiler.gcc.input.cc.1115664253">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="dk.xpg.msp430eclipse.MSP430GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="dk.xpg.msp430eclipse.configuration.app.release.1716607718;dk.xpg.msp430eclipse.configuration.app.release.1716607718.;dk.xpg.msp430eclipse.tool.compiler.gcc.1604096089;dk.xpg.msp430eclipse.tool.compiler.gcc.input.2129325944">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="dk.xpg.msp430eclipse.MSP430GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/Debug/

View File

@ -1,106 +0,0 @@
/*
* gpio.c
*
* Created on: 29.08.2016
* Author: wn
*/
#include <msp430g2553.h>
#include <stdint.h>
#define GPIO_C
#include "gpio.h"
#undef GPIO_C
extern tPinCfg pinCfg[];
void gpioInitPins() {
P1OUT = 0;
P1DIR = 0;
P1REN = 0;
P2OUT = 0;
P2DIR = 0;
P2REN = 0;
for (tPin p = PINS_FIRST; p < PINS_END; p += 1) {
tPinCfg pin = pinCfg[p];
if (pin.portId == PORT1) {
if (pin.direction == PIN_OUT) {
P1DIR |= pin.bit;
P1SEL &= ~pin.bit;
P1SEL2 &= ~pin.bit;
gpioSetPin(p, pin.defaultOut);
} else if (pin.direction == PIN_IN) {
P1DIR &= ~pin.bit;
P1SEL &= ~pin.bit;
P1SEL2 &= ~pin.bit;
P1REN &= ~pin.bit;
} else if (pin.direction == PIN_IN_PULLUP) {
P1DIR &= ~pin.bit;
P1SEL &= ~pin.bit;
P1SEL2 &= ~pin.bit;
P1REN |= pin.bit;
P1OUT |= pin.bit;
}
} else if (pin.portId == PORT2) {
if (pin.direction == PIN_OUT) {
P2DIR |= pin.bit;
P2SEL &= ~pin.bit;
P2SEL2 &= ~pin.bit;
gpioSetPin(p, pin.defaultOut);
} else if (pin.direction == PIN_IN) {
P2DIR &= ~pin.bit;
P2SEL &= ~pin.bit;
P2SEL2 &= ~pin.bit;
P2REN &= ~pin.bit;
} else if (pin.direction == PIN_IN_PULLUP) {
P2DIR &= ~pin.bit;
P2SEL &= ~pin.bit;
P2SEL2 &= ~pin.bit;
P2REN |= pin.bit;
P2OUT |= pin.bit;
}
}
}
}
void gpioSetPin(tPin p, tPinState v) {
tPinCfg pin = pinCfg[p];
if (v == HIGH) {
if (pin.portId == PORT1) {
P1OUT |= pin.bit;
} else if (pin.portId == PORT2) {
P2OUT |= pin.bit;
}
} else {
if (pin.portId == PORT1) {
P1OUT &= ~pin.bit;
} else if (pin.portId == PORT2) {
P2OUT &= ~pin.bit;
}
}
}
void gpioTogglePin(tPin p) {
tPinCfg pin = pinCfg[p];
if (pin.portId == PORT1) {
P1OUT ^= pin.bit;
} else if (pin.portId == PORT2) {
P2OUT ^= pin.bit;
}
}
tPinState gpioGetPin(tPin p) {
tPinCfg pin = pinCfg[p];
uint16_t pinValue = 0;
if (pin.portId == PORT1) {
pinValue = P1IN;
} else if (pin.portId == PORT2) {
pinValue = P2IN;
}
return (pinValue & pin.bit) ? HIGH : LOW;
}

View File

@ -1,67 +0,0 @@
/*
* gpio.h
*
* Created on: 29.08.2016
* Author: wn
*/
#ifndef GPIO_H_
#define GPIO_H_
#include <msp430g2553.h>
#include <stdint.h>
typedef enum {
PORT1,
PORT2
} tPort;
typedef enum {
LOW,
HIGH,
} tPinState;
typedef enum {
PIN_OUT,
PIN_IN,
PIN_IN_PULLUP
} tPinDirection;
typedef struct {
tPort portId;
uint16_t bit;
tPinDirection direction;
tPinState defaultOut;
} tPinCfg;
typedef enum {
PINS_FIRST,
SEG_A = PINS_FIRST,
SEG_B,
SEG_C,
SEG_D,
SEG_E,
SEG_F,
SEG_G,
DIGIT_0,
DIGIT_1,
DIGIT_2,
BUTTON_1,
LED_1,
PINS_END
} tPin;
void gpioInitPins();
void gpioSetPin(tPin p, tPinState v);
void gpioTogglePin(tPin p);
tPinState gpioGetPin(tPin p);
#endif /* GPIO_H_ */

31
src/gpioCfg.h Normal file
View File

@ -0,0 +1,31 @@
/*
* gpioCfg.h
*
* Created on: 18.09.2016
* Author: wn
*/
#ifndef GPIOCFG_H_
#define GPIOCFG_H_
#include "gpio.h"
typedef enum {
PINS_FIRST,
SEG_A = PINS_FIRST,
SEG_B,
SEG_C,
SEG_D,
SEG_E,
SEG_F,
SEG_G,
DIGIT_0,
DIGIT_1,
DIGIT_2,
BUTTON_1,
LED_1,
PINS_END
} tPin;
#endif /* GPIOCFG_H_ */