minimalist hardware testing support

Dependents:   MAX5715BOB_Tester MAX11131BOB_Tester MAX5171BOB_Tester MAX11410BOB_Tester ... more

Revision:
2:9b20cadbfa15
Parent:
1:f98ddb04f9e0
Child:
3:080aa1bb1bc0
--- a/MaximTinyTester.cpp	Fri Jun 21 10:52:47 2019 +0000
+++ b/MaximTinyTester.cpp	Wed Jul 10 11:01:58 2019 +0000
@@ -240,6 +240,14 @@
 bool MaximTinyTester::AnalogIn0_Read_Expect_voltageV(double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[0];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs
@@ -291,6 +299,14 @@
 bool MaximTinyTester::AnalogIn1_Read_Expect_voltageV(double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[1];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs
@@ -342,6 +358,14 @@
 bool MaximTinyTester::AnalogIn2_Read_Expect_voltageV(double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[2];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs
@@ -393,6 +417,14 @@
 bool MaximTinyTester::AnalogIn3_Read_Expect_voltageV(double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[3];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs
@@ -444,6 +476,14 @@
 bool MaximTinyTester::AnalogIn4_Read_Expect_voltageV(double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[4];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs
@@ -495,6 +535,14 @@
 bool MaximTinyTester::AnalogIn5_Read_Expect_voltageV(double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[5];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs
@@ -535,6 +583,14 @@
 bool MaximTinyTester::AnalogIn_Read_Expect_voltageV(AnalogIn& analogInPin, double expect_result)
 {
     float adc_full_scale_voltage = analogInPin_fullScaleVoltage[0];
+    // skip if expect_result exceeds ADC full scale
+    if (adc_full_scale_voltage < expect_result)
+    {
+        // print a warning message that we can't perform the measurement
+        associatedCmdLine.serial().printf("\r\n..... AIN full scale %1.3fV < expect %6.6f cannot perform measurement",
+                                adc_full_scale_voltage, expect_result);
+        return true; // ignore, test conditions are invalid; do not call PASS() or FAIL()
+    }
 
     // TODO: tinyTester.Analog_Input_Expect_V replaces SelfTest_AnalogInput_Expect_ch_V
     // Platform board uses simple analog inputs