Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL2

Dependencies:   mbed

Revision:
11:01dcfb29fbc4
Parent:
10:6c3233b03658
Child:
12:fd1fd1857628
--- a/inc/globals.h	Fri Dec 07 17:39:01 2018 +0000
+++ b/inc/globals.h	Fri Dec 07 20:42:41 2018 +0000
@@ -51,35 +51,6 @@
 #define UPDATE_REFRESH_DELAY_US 500000.0
 const unsigned int LOOP_COUNTER = 500000.0/500;
 
-#define ADC_MAX_VALUE 65536
-const unsigned int ADC_SCALE_FACTOR = ADC_MAX_VALUE/2;
-#define MAX_LUT_ENTRIES 1024
-const unsigned int ADC_RESULT_SCALE_FACTOR = ADC_MAX_VALUE/MAX_LUT_ENTRIES;
-
-#define VOLTAGE_TARG_VALUE 1.65
-#define VOLTAGE_48_ACTUAL_VALUE 1.51
-#define VOLTAGE_24_ACTUAL_VALUE 1.55
-#define VOLTAGE_12_ACTUAL_VALUE 1.53
-const double VOLTAGE_48_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_48_ACTUAL_VALUE/ADC_SCALE_FACTOR;
-const double VOLTAGE_24_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_24_ACTUAL_VALUE/ADC_SCALE_FACTOR;
-const double VOLTAGE_12_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_12_ACTUAL_VALUE/ADC_SCALE_FACTOR;
-const double VOLTAGE_48_FACTOR = 48.0*VOLTAGE_48_CORRECTION;
-const double VOLTAGE_24_FACTOR = 24.0*VOLTAGE_24_CORRECTION;
-const double VOLTAGE_12_FACTOR = 12.0*VOLTAGE_12_CORRECTION;
-
-#define CURRENT_ACTUAL_VALUE 1.7091
-#define CURRENT_TARG_VALUE 1.65
-//const double CURRENT_OFFSET = (CURRENT_ACTUAL_VALUE/CURRENT_TARG_VALUE)*ADC_SCALE_FACTOR;
-const double CURRENT_48_OFFSET = 33940;
-const double CURRENT_24_OFFSET = 33580;
-const double CURRENT_12_OFFSET = 33380;
-//#define CURRENT_OFFSET 33940
-//#define CURRENT_DIV_FACTOR -390
-#define CURRENT_48_DIV_FACTOR -368
-#define CURRENT_24_DIV_FACTOR -308
-#define CURRENT_12_DIV_FACTOR -324
-#define CURRENT_CONTROL_OFFSET 0.25
-
 #define DATA_ROW 1
 
 #define BOARD_ENABLE_DELAY_MS 50
@@ -95,10 +66,30 @@
 #define WEIGHT_BIN_WIDTH 5
 #define BOARDS_THERMCODE_WIDTH 12
 
+#define CURRENT_CONTROL_OFFSET 0.25
+
 extern int menuLevel;
 
 #define LEVEL_MAIN 0
 
+struct adcValues{
+    unsigned short v48;
+    unsigned short v24;
+    unsigned short v12;
+    unsigned short i48;
+    unsigned short i24;
+    unsigned short i12;
+};
+
+struct displayValues{
+    double v48f;
+    double v24f;
+    double v12f;
+    double i48f;
+    double i24f;
+    double i12f;
+};
+
 extern void processCommand(void);
 
 #endif