Adding adc2 & new temperature calibration proceedures. [WiP] (#361)
* Add rough calls to ADC2 [untested] * Using dual ADC injected modes * Start both ADCs * Move some IRQ's to ram exec * Stabilize PID a bit more * Add in ideas for tip type selection * Add tiptype formula / settings struct * Add function ids to the settings menu * Rough tip selection * Rough out new cal routine for simple tips * Hardware test is fairly close for first pass * Add Simple calibration case [UNTESTED] This adds the calibration option that uses boiling water to the calibration menu. This is untested, and may need gain adjustments before use. * Simple Cal Roughly working * Rough out advanced cal
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#define SETTINGS_H_
|
||||
#include <stdint.h>
|
||||
#include "stm32f1xx_hal.h"
|
||||
#define SETTINGSVERSION 0x14 /*Change this if you change the struct below to prevent people getting out of sync*/
|
||||
#define SETTINGSVERSION 0x15 /*Change this if you change the struct below to prevent people getting out of sync*/
|
||||
|
||||
/*
|
||||
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
|
||||
@@ -38,6 +38,8 @@ typedef struct {
|
||||
uint8_t PID_I; //PID I Term
|
||||
uint8_t PID_D; //PID D Term
|
||||
uint8_t version; //Used to track if a reset is needed on firmware upgrade
|
||||
uint8_t customTipGain; // Tip gain value if custom tuned, or 0 if using a tipType param
|
||||
uint8_t tipType;
|
||||
uint32_t padding; //This is here for in case we are not an even divisor so that nothing gets cut off
|
||||
} systemSettingsType;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ extern "C" {
|
||||
#include "stm32f1xx_hal.h"
|
||||
|
||||
extern ADC_HandleTypeDef hadc1;
|
||||
extern ADC_HandleTypeDef hadc2;
|
||||
extern DMA_HandleTypeDef hdma_adc1;
|
||||
|
||||
extern DMA_HandleTypeDef hdma_i2c1_rx;
|
||||
|
||||
@@ -17,8 +17,8 @@ enum ShortNameType {
|
||||
* use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
|
||||
*/
|
||||
extern const enum ShortNameType SettingsShortNameType;
|
||||
extern const char* SettingsShortNames[17][2];
|
||||
extern const char* SettingsDescriptions[17];
|
||||
extern const char* SettingsShortNames[20][2];
|
||||
extern const char* SettingsDescriptions[20];
|
||||
extern const char* SettingsMenuEntries[4];
|
||||
extern const char* SettingsMenuEntriesDescriptions[4];
|
||||
|
||||
|
||||
@@ -14,11 +14,21 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
enum Orientation {
|
||||
ORIENTATION_LEFT_HAND = 0,
|
||||
ORIENTATION_RIGHT_HAND = 1,
|
||||
ORIENTATION_FLAT = 3
|
||||
ORIENTATION_LEFT_HAND = 0, ORIENTATION_RIGHT_HAND = 1, ORIENTATION_FLAT = 3
|
||||
};
|
||||
/*
|
||||
* Keep in a uint8_t range for the ID's
|
||||
*/
|
||||
enum TipType {
|
||||
TS_B2 = 0,
|
||||
TS_D24 = 1,
|
||||
TS_BC2 = 2,
|
||||
TS_C1 = 3,
|
||||
Tip_MiniWare=4,
|
||||
HAKKO_BC2=4,
|
||||
Tip_Hakko=5,
|
||||
Tip_Custom=5,
|
||||
};
|
||||
|
||||
#define KEY_B_Pin GPIO_PIN_6
|
||||
#define KEY_B_GPIO_Port GPIOA
|
||||
#define TMP36_INPUT_Pin GPIO_PIN_7
|
||||
@@ -54,6 +64,7 @@ uint16_t ftoTipMeasurement(uint16_t temp);
|
||||
uint16_t tipMeasurementToF(uint16_t raw);
|
||||
|
||||
void setCalibrationOffset(int16_t offSet);
|
||||
void setTipType(enum TipType tipType, uint8_t manualCalGain);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <MMA8652FC.hpp>
|
||||
#include "Setup.h"
|
||||
#include "OLED.hpp"
|
||||
|
||||
extern uint16_t currentlyActiveTemperatureTarget;
|
||||
extern OLED lcd;
|
||||
extern MMA8652FC accel;
|
||||
extern uint8_t PCBVersion;
|
||||
@@ -25,6 +25,8 @@ enum ButtonState {
|
||||
|
||||
ButtonState getButtonState();
|
||||
void waitForButtonPressOrTimeout(uint32_t timeout);
|
||||
void waitForButtonPress();
|
||||
void GUIDelay();
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -36,7 +38,8 @@ void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName );
|
||||
void vApplicationStackOverflowHook( xTaskHandle *pxTask,
|
||||
signed portCHAR *pcTaskName);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user