mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Updated cold junction temp curve
* Disabled the hack off on temp as we dont need it for MHP30 * faster ADC on MHP30
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "Setup.h"
|
||||
#include "TipThermoModel.h"
|
||||
#include "Utils.h"
|
||||
#include "configuration.h"
|
||||
#include "history.hpp"
|
||||
#include "main.hpp"
|
||||
#include <IRQ.h>
|
||||
@@ -22,20 +23,167 @@ void resetWatchdog() { HAL_IWDG_Refresh(&hiwdg); }
|
||||
// Lookup table for the NTC
|
||||
// Stored as ADCReading,Temp in degC
|
||||
static const uint16_t NTCHandleLookup[] = {
|
||||
// ADC Reading , Temp in C
|
||||
11292, 600, //
|
||||
12782, 550, //
|
||||
14380, 500, //
|
||||
16061, 450, //
|
||||
17793, 400, //
|
||||
19541, 350, //
|
||||
21261, 300, //
|
||||
22915, 250, //
|
||||
24465, 200, //
|
||||
25882, 150, //
|
||||
27146, 100, //
|
||||
28249, 50, //
|
||||
29189, 0, //
|
||||
// ADC Reading , Temp in Cx10
|
||||
808, 1600, //
|
||||
832, 1590, //
|
||||
848, 1580, //
|
||||
872, 1570, //
|
||||
888, 1560, //
|
||||
912, 1550, //
|
||||
936, 1540, //
|
||||
960, 1530, //
|
||||
984, 1520, //
|
||||
1008, 1510, //
|
||||
1032, 1500, //
|
||||
1056, 1490, //
|
||||
1080, 1480, //
|
||||
1112, 1470, //
|
||||
1136, 1460, //
|
||||
1168, 1450, //
|
||||
1200, 1440, //
|
||||
1224, 1430, //
|
||||
1256, 1420, //
|
||||
1288, 1410, //
|
||||
1328, 1400, //
|
||||
1360, 1390, //
|
||||
1392, 1380, //
|
||||
1432, 1370, //
|
||||
1464, 1360, //
|
||||
1504, 1350, //
|
||||
1544, 1340, //
|
||||
1584, 1330, //
|
||||
1632, 1320, //
|
||||
1672, 1310, //
|
||||
1720, 1300, //
|
||||
1760, 1290, //
|
||||
1808, 1280, //
|
||||
1856, 1270, //
|
||||
1912, 1260, //
|
||||
1960, 1250, //
|
||||
2016, 1240, //
|
||||
2072, 1230, //
|
||||
2128, 1220, //
|
||||
2184, 1210, //
|
||||
2248, 1200, //
|
||||
2304, 1190, //
|
||||
2368, 1180, //
|
||||
2440, 1170, //
|
||||
2504, 1160, //
|
||||
2576, 1150, //
|
||||
2648, 1140, //
|
||||
2720, 1130, //
|
||||
2792, 1120, //
|
||||
2872, 1110, //
|
||||
2952, 1100, //
|
||||
3040, 1090, //
|
||||
3128, 1080, //
|
||||
3216, 1070, //
|
||||
3304, 1060, //
|
||||
3400, 1050, //
|
||||
3496, 1040, //
|
||||
3592, 1030, //
|
||||
3696, 1020, //
|
||||
3800, 1010, //
|
||||
3912, 1000, //
|
||||
4024, 990, //
|
||||
4136, 980, //
|
||||
4256, 970, //
|
||||
4376, 960, //
|
||||
4504, 950, //
|
||||
4632, 940, //
|
||||
4768, 930, //
|
||||
4904, 920, //
|
||||
5048, 910, //
|
||||
5192, 900, //
|
||||
5336, 890, //
|
||||
5488, 880, //
|
||||
5648, 870, //
|
||||
5808, 860, //
|
||||
5976, 850, //
|
||||
6144, 840, //
|
||||
6320, 830, //
|
||||
6504, 820, //
|
||||
6688, 810, //
|
||||
6872, 800, //
|
||||
7072, 790, //
|
||||
7264, 780, //
|
||||
7472, 770, //
|
||||
7680, 760, //
|
||||
7896, 750, //
|
||||
8112, 740, //
|
||||
8336, 730, //
|
||||
8568, 720, //
|
||||
8800, 710, //
|
||||
9040, 700, //
|
||||
9288, 690, //
|
||||
9536, 680, //
|
||||
9792, 670, //
|
||||
10056, 660, //
|
||||
10320, 650, //
|
||||
10592, 640, //
|
||||
10872, 630, //
|
||||
11152, 620, //
|
||||
11440, 610, //
|
||||
11728, 600, //
|
||||
12024, 590, //
|
||||
12320, 580, //
|
||||
12632, 570, //
|
||||
12936, 560, //
|
||||
13248, 550, //
|
||||
13568, 540, //
|
||||
13888, 530, //
|
||||
14216, 520, //
|
||||
14544, 510, //
|
||||
14880, 500, //
|
||||
15216, 490, //
|
||||
15552, 480, //
|
||||
15888, 470, //
|
||||
16232, 460, //
|
||||
16576, 450, //
|
||||
16920, 440, //
|
||||
17272, 430, //
|
||||
17616, 420, //
|
||||
17968, 410, //
|
||||
18320, 400, //
|
||||
18664, 390, //
|
||||
19016, 380, //
|
||||
19368, 370, //
|
||||
19712, 360, //
|
||||
20064, 350, //
|
||||
20408, 340, //
|
||||
20752, 330, //
|
||||
21088, 320, //
|
||||
21432, 310, //
|
||||
21768, 300, //
|
||||
22096, 290, //
|
||||
22424, 280, //
|
||||
22752, 270, //
|
||||
23072, 260, //
|
||||
23392, 250, //
|
||||
23704, 240, //
|
||||
24008, 230, //
|
||||
24312, 220, //
|
||||
24608, 210, //
|
||||
24904, 200, //
|
||||
25192, 190, //
|
||||
25472, 180, //
|
||||
25744, 170, //
|
||||
26016, 160, //
|
||||
26280, 150, //
|
||||
26536, 140, //
|
||||
26784, 130, //
|
||||
27024, 120, //
|
||||
27264, 110, //
|
||||
27496, 100, //
|
||||
27720, 90, //
|
||||
27936, 80, //
|
||||
28144, 70, //
|
||||
28352, 60, //
|
||||
28544, 50, //
|
||||
28736, 40, //
|
||||
28920, 30, //
|
||||
29104, 20, //
|
||||
29272, 10, //
|
||||
};
|
||||
const int NTCHandleLookupItems = sizeof(NTCHandleLookup) / (2 * sizeof(uint16_t));
|
||||
#endif
|
||||
|
||||
@@ -15,12 +15,15 @@
|
||||
* runs again
|
||||
*/
|
||||
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) {
|
||||
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
static uint8_t counter = 0;
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
if (hadc == &hadc1) {
|
||||
if (pidTaskNotification) {
|
||||
vTaskNotifyGiveFromISR(pidTaskNotification, &xHigherPriorityTaskWoken);
|
||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||
counter++;
|
||||
if (counter % 4 == 0) {
|
||||
if (pidTaskNotification) {
|
||||
vTaskNotifyGiveFromISR(pidTaskNotification, &xHigherPriorityTaskWoken);
|
||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user