Sync changes and added func for both voltages
This commit is contained in:
parent
1b6294b04b
commit
b862266362
@ -1,3 +1,4 @@
|
||||
<<<<<<< Updated upstream
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="65">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true">
|
||||
@ -178,3 +179,192 @@
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
=======
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="65">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true">
|
||||
<logicalFolder name="HeaderFiles"
|
||||
displayName="Header Files"
|
||||
projectFiles="true">
|
||||
<itemPath>themistor-temp.h</itemPath>
|
||||
<itemPath>uart.h</itemPath>
|
||||
<itemPath>voltage.h</itemPath>
|
||||
<itemPath>fan_speeeed.h</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="true">
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="LinkerScript"
|
||||
displayName="Linker Files"
|
||||
projectFiles="true">
|
||||
</logicalFolder>
|
||||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>main.c</itemPath>
|
||||
<itemPath>thermistor-temp.c</itemPath>
|
||||
<itemPath>uart.c</itemPath>
|
||||
<itemPath>voltage.c</itemPath>
|
||||
<itemPath>fan_speeeed.c</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>.</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="default" type="2">
|
||||
<toolsSet>
|
||||
<developmentServer>localhost</developmentServer>
|
||||
<targetDevice>AVR128DB48</targetDevice>
|
||||
<targetHeader></targetHeader>
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>nEdbgTool</platformTool>
|
||||
<languageToolchain>XC8</languageToolchain>
|
||||
<languageToolchainVersion>2.46</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<packs>
|
||||
<pack name="AVR-Dx_DFP" vendor="Microchip" version="2.3.272"/>
|
||||
</packs>
|
||||
<ScriptingSettings>
|
||||
</ScriptingSettings>
|
||||
<compileType>
|
||||
<linkerTool>
|
||||
<linkerLibItems>
|
||||
</linkerLibItems>
|
||||
</linkerTool>
|
||||
<archiverTool>
|
||||
</archiverTool>
|
||||
<loading>
|
||||
<useAlternateLoadableFile>false</useAlternateLoadableFile>
|
||||
<parseOnProdLoad>false</parseOnProdLoad>
|
||||
<alternateLoadableFile></alternateLoadableFile>
|
||||
</loading>
|
||||
<subordinates>
|
||||
</subordinates>
|
||||
</compileType>
|
||||
<makeCustomizationType>
|
||||
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
|
||||
<makeUseCleanTarget>false</makeUseCleanTarget>
|
||||
<makeCustomizationPreStep></makeCustomizationPreStep>
|
||||
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
|
||||
<makeCustomizationPostStep></makeCustomizationPostStep>
|
||||
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
|
||||
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
|
||||
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
|
||||
</makeCustomizationType>
|
||||
<HI-TECH-COMP>
|
||||
<property key="additional-warnings" value="true"/>
|
||||
<property key="asmlist" value="true"/>
|
||||
<property key="call-prologues" value="false"/>
|
||||
<property key="default-bitfield-type" value="true"/>
|
||||
<property key="default-char-type" value="true"/>
|
||||
<property key="define-macros" value=""/>
|
||||
<property key="disable-optimizations" value="false"/>
|
||||
<property key="extra-include-directories" value=""/>
|
||||
<property key="favor-optimization-for" value="-speed,+space"/>
|
||||
<property key="garbage-collect-data" value="true"/>
|
||||
<property key="garbage-collect-functions" value="true"/>
|
||||
<property key="identifier-length" value="255"/>
|
||||
<property key="local-generation" value="false"/>
|
||||
<property key="operation-mode" value="free"/>
|
||||
<property key="opt-xc8-compiler-strict_ansi" value="false"/>
|
||||
<property key="optimization-assembler" value="true"/>
|
||||
<property key="optimization-assembler-files" value="true"/>
|
||||
<property key="optimization-debug" value="false"/>
|
||||
<property key="optimization-invariant-enable" value="false"/>
|
||||
<property key="optimization-invariant-value" value="16"/>
|
||||
<property key="optimization-level" value="-O1"/>
|
||||
<property key="optimization-speed" value="false"/>
|
||||
<property key="optimization-stable-enable" value="false"/>
|
||||
<property key="preprocess-assembler" value="true"/>
|
||||
<property key="short-enums" value="true"/>
|
||||
<property key="tentative-definitions" value="-fno-common"/>
|
||||
<property key="undefine-macros" value=""/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="verbose" value="false"/>
|
||||
<property key="warning-level" value="-3"/>
|
||||
<property key="what-to-do" value="ignore"/>
|
||||
</HI-TECH-COMP>
|
||||
<HI-TECH-LINK>
|
||||
<property key="additional-options-checksum" value=""/>
|
||||
<property key="additional-options-code-offset" value=""/>
|
||||
<property key="additional-options-command-line" value=""/>
|
||||
<property key="additional-options-errata" value=""/>
|
||||
<property key="additional-options-extend-address" value="false"/>
|
||||
<property key="additional-options-trace-type" value=""/>
|
||||
<property key="additional-options-use-response-files" value="false"/>
|
||||
<property key="backup-reset-condition-flags" value="false"/>
|
||||
<property key="calibrate-oscillator" value="false"/>
|
||||
<property key="calibrate-oscillator-value" value="0x3400"/>
|
||||
<property key="clear-bss" value="true"/>
|
||||
<property key="code-model-external" value="wordwrite"/>
|
||||
<property key="code-model-rom" value=""/>
|
||||
<property key="create-html-files" value="false"/>
|
||||
<property key="data-model-ram" value=""/>
|
||||
<property key="data-model-size-of-double" value="24"/>
|
||||
<property key="data-model-size-of-double-gcc" value="no-short-double"/>
|
||||
<property key="data-model-size-of-float" value="24"/>
|
||||
<property key="data-model-size-of-float-gcc" value="no-short-float"/>
|
||||
<property key="display-class-usage" value="false"/>
|
||||
<property key="display-hex-usage" value="false"/>
|
||||
<property key="display-overall-usage" value="true"/>
|
||||
<property key="display-psect-usage" value="false"/>
|
||||
<property key="extra-lib-directories" value=""/>
|
||||
<property key="fill-flash-options-addr" value=""/>
|
||||
<property key="fill-flash-options-const" value=""/>
|
||||
<property key="fill-flash-options-how" value="0"/>
|
||||
<property key="fill-flash-options-inc-const" value="1"/>
|
||||
<property key="fill-flash-options-increment" value=""/>
|
||||
<property key="fill-flash-options-seq" value=""/>
|
||||
<property key="fill-flash-options-what" value="0"/>
|
||||
<property key="format-hex-file-for-download" value="false"/>
|
||||
<property key="initialize-data" value="true"/>
|
||||
<property key="input-libraries" value="libm"/>
|
||||
<property key="keep-generated-startup.as" value="false"/>
|
||||
<property key="link-in-c-library" value="true"/>
|
||||
<property key="link-in-c-library-gcc" value=""/>
|
||||
<property key="link-in-peripheral-library" value="false"/>
|
||||
<property key="managed-stack" value="false"/>
|
||||
<property key="opt-xc8-linker-file" value="false"/>
|
||||
<property key="opt-xc8-linker-link_startup" value="false"/>
|
||||
<property key="opt-xc8-linker-serial" value=""/>
|
||||
<property key="program-the-device-with-default-config-words" value="false"/>
|
||||
<property key="remove-unused-sections" value="true"/>
|
||||
</HI-TECH-LINK>
|
||||
<Tool>
|
||||
<property key="debugoptions.useswbreakpoints" value="true"/>
|
||||
</Tool>
|
||||
<XC8-CO>
|
||||
<property key="coverage-enable" value=""/>
|
||||
<property key="stack-guidance" value="false"/>
|
||||
</XC8-CO>
|
||||
<XC8-config-global>
|
||||
<property key="advanced-elf" value="true"/>
|
||||
<property key="constdata-progmem" value="true"/>
|
||||
<property key="gcc-opt-driver-new" value="true"/>
|
||||
<property key="gcc-opt-std" value="-std=c99"/>
|
||||
<property key="gcc-output-file-format" value="dwarf-3"/>
|
||||
<property key="mapped-progmem" value="false"/>
|
||||
<property key="omit-pack-options" value="false"/>
|
||||
<property key="omit-pack-options-new" value="1"/>
|
||||
<property key="output-file-format" value="-mcof,+elf"/>
|
||||
<property key="smart-io-format" value=""/>
|
||||
<property key="stack-size-high" value="auto"/>
|
||||
<property key="stack-size-low" value="auto"/>
|
||||
<property key="stack-size-main" value="auto"/>
|
||||
<property key="stack-type" value="compiled"/>
|
||||
<property key="user-pack-device-support" value=""/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</XC8-config-global>
|
||||
<nEdbgTool>
|
||||
<property key="debugoptions.useswbreakpoints" value="true"/>
|
||||
</nEdbgTool>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
@ -1,23 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
<name>prosjekt</name>
|
||||
<creation-uuid>928a6534-8606-496e-8a74-8a6544316339</creation-uuid>
|
||||
<make-project-type>0</make-project-type>
|
||||
<sourceEncoding>ISO-8859-1</sourceEncoding>
|
||||
<make-dep-projects/>
|
||||
<sourceRootList/>
|
||||
<confList>
|
||||
<confElem>
|
||||
<name>default</name>
|
||||
<type>2</type>
|
||||
</confElem>
|
||||
</confList>
|
||||
<formatting>
|
||||
<project-formatting-style>false</project-formatting-style>
|
||||
</formatting>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
<name>prosjekt</name>
|
||||
<creation-uuid>928a6534-8606-496e-8a74-8a6544316339</creation-uuid>
|
||||
<make-project-type>0</make-project-type>
|
||||
<sourceEncoding>ISO-8859-1</sourceEncoding>
|
||||
<make-dep-projects/>
|
||||
<sourceRootList>
|
||||
<sourceRootElem>.</sourceRootElem>
|
||||
</sourceRootList>
|
||||
<confList>
|
||||
<confElem>
|
||||
<name>default</name>
|
||||
<type>2</type>
|
||||
</confElem>
|
||||
</confList>
|
||||
<formatting>
|
||||
<project-formatting-style>false</project-formatting-style>
|
||||
</formatting>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
#include "voltage.h"
|
||||
#include "uart.h"
|
||||
|
||||
void sensor_init(void) {
|
||||
/* Disable digital input buffer */
|
||||
|
||||
}
|
||||
|
||||
void ADC0_init(void) {
|
||||
/* Initializing ADC0 pin*/
|
||||
PORTD.PIN6CTRL &= ~PORT_ISC_gm;
|
||||
@ -32,9 +27,15 @@ uint16_t ADC0_read(void) {
|
||||
return ADC0.RES;
|
||||
}
|
||||
|
||||
uint16_t voltage_values(void) {
|
||||
/* Gets values */
|
||||
uint16_t adcVal = ADC0_read();
|
||||
VREF.ADC0REF = VREF_REFSEL_VDD_gc;
|
||||
uint16_t diode_voltage_read(void){
|
||||
/* Gets value for the diode */
|
||||
uint8_t adcVal = ADC0_read();
|
||||
|
||||
return adcVal;
|
||||
}
|
||||
uint16_t internal_voltage_read(void) {
|
||||
/* Gets value for the internal voltage reffreance*/
|
||||
|
||||
VREF.ADC0REF = VREF_REFSEL_VDD_gc;
|
||||
|
||||
}
|
||||
@ -44,16 +44,17 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
// Initializing of the sensor pins
|
||||
void sensor_init(void);
|
||||
|
||||
// Initializing of the ADC0 pins
|
||||
|
||||
void ADC0_init(void);
|
||||
//
|
||||
//void ADC0_start(void);
|
||||
//Start ADC conversion
|
||||
uint16_t ADC0_read(void);
|
||||
// Gets the value from sensor and internal voltage
|
||||
uint16_t voltage_values(void);
|
||||
uint16_t internal_voltage_read(void);
|
||||
uint16_t diode_voltage_read(void)
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user