Subversion Repositories testOled

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #include "jtest_fw.h"
  2.  
  3. /**
  4.  *  Dump the JTEST_FW.str_buffer the Keil framework in pieces.
  5.  *
  6.  *  The JTEST_FW.str_buffer contains more characters than the Keil framework can
  7.  *  dump at once. This function dumps them in blocks.
  8.  */
  9. void jtest_dump_str_segments(void)
  10. {
  11.     uint32_t seg_idx      = 0;
  12.     uint32_t memmove_idx = 0;
  13.     uint32_t seg_cnt  =
  14.         (strlen(JTEST_FW.str_buffer) / JTEST_STR_MAX_OUTPUT_SIZE) + 1;
  15.  
  16.     for( seg_idx = 0; seg_idx < seg_cnt; ++seg_idx)
  17.     {
  18.         JTEST_TRIGGER_ACTION(dump_str);
  19.  
  20.         if (seg_idx < JTEST_STR_MAX_OUTPUT_SEGMENTS)
  21.         {
  22.             memmove_idx = 0;
  23.             while (memmove_idx < (seg_cnt - seg_idx -1) )
  24.             {
  25.                 memmove(
  26.                     JTEST_FW.str_buffer+
  27.                     (memmove_idx* JTEST_STR_MAX_OUTPUT_SIZE),
  28.                     JTEST_FW.str_buffer+
  29.                     ((memmove_idx+1)*JTEST_STR_MAX_OUTPUT_SIZE),
  30.                     JTEST_BUF_SIZE);
  31.                 ++memmove_idx;
  32.             }
  33.         }
  34.     }
  35.     return;
  36. }
  37.