Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.

Dependencies:   MaximTinyTester MAX11131 CmdLine MAX541 USBDevice

Revision:
20:b156b328349d
Parent:
19:8e81fd761a62
Child:
21:58de1593e2ca
--- a/main.cpp	Thu Jul 18 18:39:50 2019 -0700
+++ b/main.cpp	Fri Aug 02 15:05:34 2019 -0700
@@ -3112,8 +3112,9 @@
 //--------------------------------------------------
 #if HAS_SPI2_MAX541
 MAX541 max541(spi2_max541, spi2_max541_cs);
-#endif
+#endif // HAS_SPI2_MAX541
 //--------------------------------------------------
+#if HAS_SPI2_MAX541
 bool SelfTest_MAX541_Voltage(CmdLine & cmdLine, MAX541 &max541, double voltageV)
 {
     max541.Set_Voltage(voltageV);
@@ -3145,6 +3146,7 @@
     tinyTester.err_threshold = 0.100;
     return tinyTester.AnalogIn0_Read_Expect_voltageV(voltageV);
 }
+#endif // HAS_SPI2_MAX541
 //--------------------------------------------------
 void SelfTest(CmdLine & cmdLine)
 {
@@ -3633,6 +3635,7 @@
     cmdLine.serial().printf("\r\n");
     cmdLine.serial().printf("\r\n      2.0: Test Fixture: MAX541 connected to spi2 (P2.4 P2.5 P2.7)?");
     bool SelfTest_has_max541 = false;
+#if HAS_SPI2_MAX541
     // Check actual MAX541 reference voltage
     cmdLine.serial().printf("\r\n      Test Fixture: MAX541 midscale voltage measure with MAX32625MBED AIN0/4");
     max541.Set_Code(0x8000); // we don't know the fullscale voltage yet, so set code to midscale
@@ -3681,6 +3684,7 @@
         voltageV = 1.0f;
         SelfTest_has_max541 = SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
     }
+#endif // HAS_SPI2_MAX541
     if (SelfTest_has_max541 == false) {
         // don't fail just because we're missing the test fixture...
         cmdLine.serial().printf("\r\n      Test Fixture: MAX541 not present");