diff --git a/PressureWrapper/.cproject b/PressureWrapper/.cproject
new file mode 100644
index 0000000..e5bf1c0
--- /dev/null
+++ b/PressureWrapper/.cproject
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <?xml version="1.0" encoding="UTF-8"?>
+<TargetConfig>
+<Properties property_2="LPC15xx_256K.cfx" property_3="NXP" property_4="LPC1549" property_count="5" version="100300"/>
+<infoList vendor="NXP">
+<info chip="LPC1549" connectscript="LPC15RunBootRomConnect.scp" flash_driver="LPC15xx_256K.cfx" match_id="0x0" name="LPC1549" resetscript="LPC15RunBootRomReset.scp" stub="crt_emu_cm3_gen">
+<chip>
+<name>LPC1549</name>
+<family>LPC15xx</family>
+<vendor>NXP (formerly Philips)</vendor>
+<reset board="None" core="Real" sys="Real"/>
+<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
+<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
+<memory id="RAM" type="RAM"/>
+<memory id="Periph" is_volatile="true" type="Peripheral"/>
+<memoryInstance derived_from="Flash" id="MFlash256" location="0x0" size="0x40000"/>
+<memoryInstance derived_from="RAM" id="Ram0_16" location="0x2000000" size="0x4000"/>
+<memoryInstance derived_from="RAM" id="Ram1_16" location="0x2004000" size="0x4000"/>
+<memoryInstance derived_from="RAM" id="Ram2_4" location="0x2008000" size="0x1000"/>
+</chip>
+<processor>
+<name gcc_name="cortex-m3">Cortex-M3</name>
+<family>Cortex-M</family>
+</processor>
+</info>
+</infoList>
+</TargetConfig>
+
+
+
+ LPCXpresso1549
+
+
\ No newline at end of file
diff --git a/PressureWrapper/.project b/PressureWrapper/.project
new file mode 100644
index 0000000..0fcacea
--- /dev/null
+++ b/PressureWrapper/.project
@@ -0,0 +1,28 @@
+
+
+ PressureWrapper
+
+
+ lpc_chip_15xx
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/PressureWrapper/Debug/makefile b/PressureWrapper/Debug/makefile
new file mode 100644
index 0000000..9c68353
--- /dev/null
+++ b/PressureWrapper/Debug/makefile
@@ -0,0 +1,78 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+-include ../makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include src/subdir.mk
+-include subdir.mk
+-include objects.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(strip $(CC_DEPS)),)
+-include $(CC_DEPS)
+endif
+ifneq ($(strip $(C++_DEPS)),)
+-include $(C++_DEPS)
+endif
+ifneq ($(strip $(C_UPPER_DEPS)),)
+-include $(C_UPPER_DEPS)
+endif
+ifneq ($(strip $(CXX_DEPS)),)
+-include $(CXX_DEPS)
+endif
+ifneq ($(strip $(CPP_DEPS)),)
+-include $(CPP_DEPS)
+endif
+ifneq ($(strip $(C_DEPS)),)
+-include $(C_DEPS)
+endif
+endif
+
+-include ../makefile.defs
+
+OPTIONAL_TOOL_DEPS := \
+$(wildcard ../makefile.defs) \
+$(wildcard ../makefile.init) \
+$(wildcard ../makefile.targets) \
+
+
+BUILD_ARTIFACT_NAME := PressureWrapper
+BUILD_ARTIFACT_EXTENSION := a
+BUILD_ARTIFACT_PREFIX := lib
+BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),)
+
+# Add inputs and outputs from these tool invocations to the build variables
+
+# All Target
+all:
+ +@$(MAKE) --no-print-directory main-build && $(MAKE) --no-print-directory post-build
+
+# Main-build Target
+main-build: libPressureWrapper.a
+
+# Tool invocations
+libPressureWrapper.a: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS)
+ @echo 'Building target: $@'
+ @echo 'Invoking: MCU Archiver'
+ arm-none-eabi-ar -r "libPressureWrapper.a" $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+# Other Targets
+clean:
+ -$(RM) $(CC_DEPS)$(C++_DEPS)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(ARCHIVES)$(CPP_DEPS)$(C_DEPS) libPressureWrapper.a
+ -@echo ' '
+
+post-build:
+ -@echo 'Performing post-build steps'
+ -arm-none-eabi-size "libPressureWrapper.a" ; # arm-none-eabi-objdump -h -S "libPressureWrapper.a" >"libPressureWrapper.lss"
+ -@echo ' '
+
+.PHONY: all clean dependents post-build
+
+-include ../makefile.targets
diff --git a/PressureWrapper/Debug/objects.mk b/PressureWrapper/Debug/objects.mk
new file mode 100644
index 0000000..742c2da
--- /dev/null
+++ b/PressureWrapper/Debug/objects.mk
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+USER_OBJS :=
+
+LIBS :=
+
diff --git a/PressureWrapper/Debug/sources.mk b/PressureWrapper/Debug/sources.mk
new file mode 100644
index 0000000..8687df8
--- /dev/null
+++ b/PressureWrapper/Debug/sources.mk
@@ -0,0 +1,28 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+C_UPPER_SRCS :=
+CXX_SRCS :=
+C++_SRCS :=
+OBJ_SRCS :=
+S_SRCS :=
+CC_SRCS :=
+ASM_SRCS :=
+CPP_SRCS :=
+C_SRCS :=
+S_UPPER_SRCS :=
+O_SRCS :=
+CC_DEPS :=
+C++_DEPS :=
+C_UPPER_DEPS :=
+CXX_DEPS :=
+OBJS :=
+ARCHIVES :=
+CPP_DEPS :=
+C_DEPS :=
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+src \
+
diff --git a/PressureWrapper/Debug/src/I2C.su b/PressureWrapper/Debug/src/I2C.su
new file mode 100644
index 0000000..bfb4475
--- /dev/null
+++ b/PressureWrapper/Debug/src/I2C.su
@@ -0,0 +1,14 @@
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/iocon_15xx.h:95:20:void Chip_IOCON_PinMuxSet(LPC_IOCON_T*, uint8_t, uint8_t, uint32_t) 24 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/i2c_common_15xx.h:238:20:void Chip_I2C_SetClockDiv(LPC_I2C_T*, uint32_t) 16 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/i2cm_15xx.h:126:20:void Chip_I2CM_Enable(LPC_I2C_T*) 16 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/i2cm_15xx.h:160:20:void Chip_I2CM_ClearStatus(LPC_I2C_T*, uint32_t) 16 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/i2cm_15xx.h:172:20:bool Chip_I2CM_IsMasterPending(LPC_I2C_T*) 16 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/i2cm_15xx.h:197:20:void Chip_I2CM_SendStart(LPC_I2C_T*) 16 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/i2cm_15xx.h:237:20:void Chip_I2CM_WriteByte(LPC_I2C_T*, uint8_t) 16 static
+../src/I2C.cpp:43:1:I2C::I2C(const I2C_config&) 16 static
+../src/I2C.cpp:72:1:I2C::~I2C() 16 static
+../src/I2C.cpp:72:1:virtual I2C::~I2C() 16 static
+../src/I2C.cpp:76:6:bool I2C::write(uint8_t, uint8_t*, uint16_t) 32 static
+../src/I2C.cpp:81:6:bool I2C::read(uint8_t, uint8_t*, uint16_t) 32 static
+../src/I2C.cpp:87:6:bool I2C::transaction(uint8_t, uint8_t*, uint16_t, uint8_t*, uint16_t) 40 static
+../src/I2C.cpp:118:10:static uint32_t I2C::I2CM_XferBlocking(LPC_I2C_T*, I2CM_XFER_T*) 24 static
diff --git a/PressureWrapper/Debug/src/PressureWrapper.su b/PressureWrapper/Debug/src/PressureWrapper.su
new file mode 100644
index 0000000..377a487
--- /dev/null
+++ b/PressureWrapper/Debug/src/PressureWrapper.su
@@ -0,0 +1,8 @@
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc/core_cm3.h:1335:22:void NVIC_DisableIRQ(IRQn_Type) 16 static
+/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/PressureWrapper/inc/I2C.h:18:2:I2C_config::I2C_config() 16 static
+../src/PressureWrapper.cpp:10:16:uint8_t crc8(uint8_t*, size_t) 24 static
+../src/PressureWrapper.cpp:24:1:PressureWrapper::PressureWrapper() 40 static
+../src/PressureWrapper.cpp:32:1:PressureWrapper::~PressureWrapper() 16 static
+../src/PressureWrapper.cpp:32:1:virtual PressureWrapper::~PressureWrapper() 16 static
+../src/PressureWrapper.cpp:37:5:int PressureWrapper::getPressure() 16 static
+../src/PressureWrapper.cpp:41:16:PRESSURE_DATA* PressureWrapper::getRawPressure() 32 static
diff --git a/PressureWrapper/Debug/src/subdir.mk b/PressureWrapper/Debug/src/subdir.mk
new file mode 100644
index 0000000..11187f5
--- /dev/null
+++ b/PressureWrapper/Debug/src/subdir.mk
@@ -0,0 +1,27 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+CPP_SRCS += \
+../src/I2C.cpp \
+../src/PressureWrapper.cpp
+
+OBJS += \
+./src/I2C.o \
+./src/PressureWrapper.o
+
+CPP_DEPS += \
+./src/I2C.d \
+./src/PressureWrapper.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/%.o: ../src/%.cpp src/subdir.mk
+ @echo 'Building file: $<'
+ @echo 'Invoking: MCU C++ Compiler'
+ arm-none-eabi-c++ -DDEBUG -D__CODE_RED -D__NEWLIB__ -DCORE_M3 -D__USE_LPCOPEN -D__LPC15XX__ -I"/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/PressureWrapper/inc" -I"/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_board_nxp_lpcxpresso_1549/inc" -I"/home/tylen/Desktop/Programming/Projects_Metropolia/ESP-Ventilation/lpc_chip_15xx/inc" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fmerge-constants -fmacro-prefix-map="$(
#define ADDRESS 0x40
#define READADD 0x81
diff --git a/PressureWrapper/liblinks.xml b/PressureWrapper/liblinks.xml
new file mode 100644
index 0000000..1dc1803
--- /dev/null
+++ b/PressureWrapper/liblinks.xml
@@ -0,0 +1,32 @@
+
+
+
+
+ ${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd}
+
+
+ ${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd}
+
+
+ ${ProjName}
+
+
+ ${MacroStart}workspace_loc:/${ProjName}/Debug${MacroEnd}
+
+
+ ${MacroStart}workspace_loc:/${ProjName}/Release${MacroEnd}
+
+
+ ${ProjName}
+
+
+
diff --git a/esp-vent-main/src/I2C.cpp b/PressureWrapper/src/I2C.cpp
similarity index 100%
rename from esp-vent-main/src/I2C.cpp
rename to PressureWrapper/src/I2C.cpp
diff --git a/esp-vent-main/src/PressureWrapper.cpp b/PressureWrapper/src/PressureWrapper.cpp
similarity index 100%
rename from esp-vent-main/src/PressureWrapper.cpp
rename to PressureWrapper/src/PressureWrapper.cpp
diff --git a/esp-vent-main/.cproject b/esp-vent-main/.cproject
index dc71f86..c86297d 100644
--- a/esp-vent-main/.cproject
+++ b/esp-vent-main/.cproject
@@ -47,6 +47,7 @@
+
@@ -77,6 +78,7 @@
+
@@ -97,7 +99,7 @@
-
+
@@ -131,6 +133,7 @@
+
@@ -207,6 +211,7 @@
+
@@ -237,6 +242,7 @@
+
@@ -257,6 +263,7 @@
+
@@ -290,6 +297,7 @@
+
diff --git a/esp-vent-main/.project b/esp-vent-main/.project
index 02d3d3f..d101839 100644
--- a/esp-vent-main/.project
+++ b/esp-vent-main/.project
@@ -11,6 +11,7 @@
StateHandler
Timer
SwitchController
+ PressureWrapper
diff --git a/esp-vent-main/src/esp-vent-main.cpp b/esp-vent-main/src/esp-vent-main.cpp
index 4f6422e..6e8783a 100644
--- a/esp-vent-main/src/esp-vent-main.cpp
+++ b/esp-vent-main/src/esp-vent-main.cpp
@@ -72,14 +72,7 @@ main (void)
SwitchController sw_toggle (&b_toggle, &glob_time, &ventMachine,
BUTTON_CONTROL_TOG_MODE);
-// NVIC_DisableIRQ(I2C0_IRQn);
-
- I2C_config config;
- I2C i2c(config);
- PressureWrapper sens(&i2c);
-
- PRESSURE_DATA *pressure;
- pressure = sens.getPressure();
+ PressureWrapper sens();
while (1)
{
@@ -91,7 +84,7 @@ main (void)
* TODO:
* - Update current pressure to eTick
*/
- ventMachine.HandleState (Event (Event::eTick, pressure));
+ ventMachine.HandleState (Event (Event::eTick, 0));
glob_time.tickCounter (1);
}