changeset 232:3061759abe6a

l1tm_func.c: l1tm_codec_read() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jan 2017 06:24:22 +0000
parents 28734e076576
children a3ca660219a1
files chipsetsw/layer1/tm_cfile/l1tm_func.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/tm_cfile/l1tm_func.c	Sun Jan 15 06:06:31 2017 +0000
+++ b/chipsetsw/layer1/tm_cfile/l1tm_func.c	Sun Jan 15 06:24:22 2017 +0000
@@ -1132,9 +1132,19 @@
   tm_return->size = 0;
 }
 
+/* TCS211 function missing in LoCosto, reconstructed from disassembly */
 void l1tm_codec_read(T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return)
 {
-/* TCS211 function missing in LoCosto, to be reconstructed from disasm */
+  UWORD16 page, reg;
+  UWORD16 value;
+
+  page = (prim->u.tm_params.index >> 5) & 1;
+  reg = prim->u.tm_params.index & 0x1F;
+  value = ABB_Read_Register_on_page(page + 1, reg << 1);
+  memcpy(tm_return->result, &value, 2);
+  tm_return->size = 2;
+  tm_return->status = E_OK;
+  tm_return->index = 0;
 }
 
 void l1tm_misc_param_write(T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return)