Fork of the official library for the FRDM-TFC shield to add measurement of H-bridge sense currents

Dependents:   telemetry_demo_FRDM-TFC

Fork of FRDM-TFC by Eli Hughes

Files at this revision

API Documentation at this revision

Comitter:
Overdrivr
Date:
Mon Feb 22 13:40:03 2016 +0000
Parent:
10:86c5fc9a53d9
Commit message:
Bugfix - library fully functionnal, Hbridges current sense can be read correctly

Changed in this revision

TFC.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 86c5fc9a53d9 -r 787a9a24dbfb TFC.cpp
--- a/TFC.cpp	Wed Feb 17 20:42:32 2016 +0000
+++ b/TFC.cpp	Mon Feb 22 13:40:03 2016 +0000
@@ -218,14 +218,6 @@
 #define PGAG_32            0x05
 #define PGAG_64            0x06
 
-
-#define ADC_STATE_INIT                            0
-#define ADC_STATE_CAPTURE_POT_0                   1
-#define ADC_STATE_CAPTURE_POT_1                   2
-#define ADC_STATE_CAPTURE_BATTERY_LEVEL           3
-#define ADC_STATE_CAPTURE_LINE_SCAN               4
-
-
 /////////// The above values fit into the structure below to select ADC/PGA
 /////////// configuration desired:
 
@@ -796,8 +788,8 @@
             PotADC_Value[1] = ADC0->R[0];
             
             CurrentADC_State = ADC_STATE_CAPTURE_I_HBRIDGE_A; 
+            ADC0->CFG2  &= ~ADC_CFG2_MUXSEL_MASK; //Select the A side of the mux
             ADC0->SC1[0]  =  TFC_I_HBRIDGE_0_SENSE_ADC_CHANNEL | ADC_SC1_AIEN_MASK; // HBRIDGE channel
-            ADC0->CFG2  &= ~ADC_CFG2_MUXSEL_MASK; //Select the A side of the mux
             break;