Mode1 Optical Validation

Dependencies:   max32630fthr

Revision:
59:ce898ecd8275
Parent:
58:33af4ccb8220
Child:
60:fdccd048489b
diff -r 33af4ccb8220 -r ce898ecd8275 main.cpp
--- a/main.cpp	Fri May 20 02:11:17 2022 +0000
+++ b/main.cpp	Fri May 20 02:24:47 2022 +0000
@@ -1145,14 +1145,6 @@
     mfio = 1; mfio = 0; wait_us(300);
     pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
 
-    // configure LED Range
-    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x2A; cmd[3] = 0x3F;
-    sh_i2c.write(SH_ADDR, cmd, 4);
-    mfio = 1; thread_sleep_for(2); mfio = 0; wait_us(300);
-    sh_i2c.read(SH_ADDR, rsp, 1);
-    mfio = 1; mfio = 0; wait_us(300);
-    pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
-
 #if defined(MAXM86161_OPT_VALIDATION_GRN)
     // Set Green current to 1uA, 10uA or 30uA
     cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x23; cmd[3] = 0xA7;
@@ -1255,6 +1247,16 @@
     mfio = 1; mfio = 0; wait_us(300);
     pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
 #endif
+
+    // configure LED Range
+    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x2A; cmd[3] = 0x3F;
+    sh_i2c.write(SH_ADDR, cmd, 4);
+    mfio = 1; thread_sleep_for(2); mfio = 0; wait_us(300);
+    sh_i2c.read(SH_ADDR, rsp, 1);
+    mfio = 1; mfio = 0; wait_us(300);
+    pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
+
+
 }