changeset 234:09f0a502745e

l1tm_func.c: l1tm_misc_param_read() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jan 2017 07:02:44 +0000
parents a3ca660219a1
children 02de4cb4c573
files chipsetsw/layer1/tm_cfile/l1tm_func.c
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/tm_cfile/l1tm_func.c	Sun Jan 15 06:49:27 2017 +0000
+++ b/chipsetsw/layer1/tm_cfile/l1tm_func.c	Sun Jan 15 07:02:44 2017 +0000
@@ -1155,17 +1155,35 @@
   switch (prim->u.tm_params.index) {
   case ADC_ENA_FLAG:
     l1_config.adc_enable = prim->u.tm_params.value;
-    tm_return->status = E_OK;
     break;
   default:
     Cust_tm_misc_param_write(tm_return, prim->u.tm_params.index,
                              prim->u.tm_params.value);
+    return;
   }
+  tm_return->status = E_OK;
 }
 
+/* TCS211 function missing in LoCosto, reconstructed from disassembly */
 void l1tm_misc_param_read(T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return)
 {
-/* TCS211 function missing in LoCosto, to be reconstructed from disasm */
+  UWORD16 value;
+
+  tm_return->index = prim->u.tm_params.index;
+  switch (prim->u.tm_params.index) {
+  case ADC_ENA_FLAG:
+    value = l1_config.adc_enable;
+    break;
+  case CURRENT_TM_MODE:
+    value = l1_config.TestMode;
+    break;
+  default:
+    Cust_tm_misc_param_read(tm_return, prim->u.tm_params.index);
+    return;
+  }
+  memcpy(tm_return->result, &value, 2);
+  tm_return->size = 2;
+  tm_return->status = E_OK;
 }
 
 void l1tm_misc_enable(T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return)