Quick fix for multiple definition of structs (#33)

This commit is contained in:
mkninc
2017-07-26 01:18:41 +02:00
committed by Ben V. Brown
parent 56f31b02aa
commit 2e823b6594
6 changed files with 20 additions and 8 deletions

View File

@@ -17,7 +17,7 @@
#include "Settings.h" #include "Settings.h"
#include "Analog.h" #include "Analog.h"
#include <string.h> #include <string.h>
enum { typedef enum {
STARTUP, //we are sitting on the prompt to push a button STARTUP, //we are sitting on the prompt to push a button
SOLDERING, //Normal operating mode SOLDERING, //Normal operating mode
TEMP_ADJ, //Adjust the set temperature TEMP_ADJ, //Adjust the set temperature
@@ -29,10 +29,10 @@ enum {
DCINDISP, //Disp the input voltage && Cal the DCin voltage divider DCINDISP, //Disp the input voltage && Cal the DCin voltage divider
TEMPCAL, //Cal tip temp offset TEMPCAL, //Cal tip temp offset
} operatingMode; } operatingModeEnum;
#define SETTINGSOPTIONSCOUNT 10 /*Number of settings in the settings menu*/ #define SETTINGSOPTIONSCOUNT 10 /*Number of settings in the settings menu*/
enum { typedef enum {
UVCO = 0, UVCO = 0,
SLEEP_TEMP, SLEEP_TEMP,
SLEEP_TIME, SLEEP_TIME,
@@ -44,7 +44,7 @@ enum {
LEFTY, LEFTY,
BOOSTMODE, BOOSTMODE,
BOOSTTEMP, BOOSTTEMP,
} settingsPage; } settingsPageEnum;
void ProcessUI(); void ProcessUI();
void DrawUI(); void DrawUI();

View File

@@ -12,9 +12,9 @@
#include "Analog.h" #include "Analog.h"
#include "Interrupt.h" #include "Interrupt.h"
struct { typedef struct {
uint32_t kp, ki, kd; //PID values uint32_t kp, ki, kd; //PID values
} pidSettings; } pidSettingsType;
int32_t computePID(uint16_t setpoint); int32_t computePID(uint16_t setpoint);
void setupPID(void); void setupPID(void);

View File

@@ -25,7 +25,7 @@
/* /*
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks * This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
*/ */
struct { typedef struct {
uint16_t SolderingTemp; //current set point for the iron uint16_t SolderingTemp; //current set point for the iron
uint32_t SleepTemp; //temp to drop to in sleep uint32_t SleepTemp; //temp to drop to in sleep
uint8_t version; //Used to track if a reset is needed on firmware upgrade uint8_t version; //Used to track if a reset is needed on firmware upgrade
@@ -42,7 +42,9 @@ struct {
uint16_t tempCalibration; //Temperature calibration value uint16_t tempCalibration; //Temperature calibration value
uint16_t voltageDiv; //Voltage divisor factor uint16_t voltageDiv; //Voltage divisor factor
uint16_t BoostTemp; //Boost mode set point for the iron uint16_t BoostTemp; //Boost mode set point for the iron
} systemSettings; } systemSettingsType;
extern systemSettingsType systemSettings;
void saveSettings(); void saveSettings();
void restoreSettings(); void restoreSettings();

View File

@@ -17,6 +17,10 @@ const char *SettingsLongNames[] = {
" Temperature when in boost mode" }; " Temperature when in boost mode" };
uint8_t StatusFlags = 0; uint8_t StatusFlags = 0;
uint32_t temporaryTempStorage = 0; uint32_t temporaryTempStorage = 0;
operatingModeEnum operatingMode;
settingsPageEnum settingsPage;
//This does the required processing and state changes //This does the required processing and state changes
void ProcessUI() { void ProcessUI() {
uint8_t Buttons = getButtons(); //read the buttons status uint8_t Buttons = getButtons(); //read the buttons status

View File

@@ -7,6 +7,9 @@
#include "PID.h" #include "PID.h"
#define MAXPIDOUTPUT 50000 #define MAXPIDOUTPUT 50000
pidSettingsType pidSettings;
//This function computes the new value for the ON time of the system //This function computes the new value for the ON time of the system
//This is the return value from this function //This is the return value from this function
int32_t computePID(uint16_t setpoint) { int32_t computePID(uint16_t setpoint) {

View File

@@ -10,6 +10,9 @@
#include "Settings.h" #include "Settings.h"
#define FLASH_ADDR (0x8000000|0xBC00)/*Flash start OR'ed with the maximum amount of flash - 1024 bytes*/ #define FLASH_ADDR (0x8000000|0xBC00)/*Flash start OR'ed with the maximum amount of flash - 1024 bytes*/
#define FLASH_LOGOADDR (0x8000000|0xB800) /*second last page of flash set aside for logo image*/ #define FLASH_LOGOADDR (0x8000000|0xB800) /*second last page of flash set aside for logo image*/
systemSettingsType systemSettings;
void saveSettings() { void saveSettings() {
//First we erase the flash //First we erase the flash
FLASH_Unlock(); //unlock flash writing FLASH_Unlock(); //unlock flash writing