Made a bool for error and high temp
This commit is contained in:
parent
8e58925dd1
commit
24190f1f15
@ -7,6 +7,11 @@
|
||||
<itemPath>eeprom.h</itemPath>
|
||||
<itemPath>themistor-temp.h</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="true">
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="LinkerScript"
|
||||
displayName="Linker Files"
|
||||
projectFiles="true">
|
||||
@ -18,11 +23,6 @@
|
||||
<itemPath>eeprom.c</itemPath>
|
||||
<itemPath>thermistor-temp.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="false">
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
@ -34,7 +34,7 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>nEdbgTool</platformTool>
|
||||
<languageToolchain>XC8</languageToolchain>
|
||||
<languageToolchainVersion>2.45</languageToolchainVersion>
|
||||
<languageToolchainVersion>2.46</languageToolchainVersion>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<packs>
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <float.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@ -26,7 +28,7 @@ extern "C" {
|
||||
// Returns the thermistor themperature
|
||||
float calculate_thermistor_temp(float readValue);
|
||||
|
||||
|
||||
bool error_message(float thermistor_temp);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#include "themistor-temp.h"
|
||||
|
||||
|
||||
float calculate_thermistor_temp(float readValue){
|
||||
float R_therm;
|
||||
float V_1;
|
||||
@ -26,3 +25,13 @@ float calculate_thermistor_temp(float readValue){
|
||||
|
||||
return T_therm;
|
||||
}
|
||||
|
||||
bool error_message(float thermistor_temp){
|
||||
int high_temp = 0;
|
||||
if (thermistor_temp > high_temp){
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user