master/module.c
changeset 1584 cd9a68fd5b89
parent 1583 017fa8fd9ac1
child 1586 eb9185dfa8ac
equal deleted inserted replaced
1583:017fa8fd9ac1 1584:cd9a68fd5b89
   316 }
   316 }
   317 
   317 
   318 /*****************************************************************************/
   318 /*****************************************************************************/
   319 
   319 
   320 /** Outputs frame contents for debugging purposes.
   320 /** Outputs frame contents for debugging purposes.
       
   321  * If the data block is larger than 256 bytes, only the first 128
       
   322  * and the last 128 bytes will be shown
   321  */
   323  */
   322 void ec_print_data(const uint8_t *data, /**< pointer to data */
   324 void ec_print_data(const uint8_t *data, /**< pointer to data */
   323                    size_t size /**< number of bytes to output */
   325                    size_t size /**< number of bytes to output */
   324                    )
   326                    )
   325 {
   327 {
   330         printk("%02X ", data[i]);
   332         printk("%02X ", data[i]);
   331         if ((i + 1) % 16 == 0 && i < size - 1) {
   333         if ((i + 1) % 16 == 0 && i < size - 1) {
   332             printk("\n");
   334             printk("\n");
   333             EC_DBG("");
   335             EC_DBG("");
   334         }
   336         }
   335         if (i == 128 && size > 256)
   337         if (i+1 == 128 && size > 256)
   336         {
   338         {
   337             EC_DBG("dropped %d bytes\n",size-128-i);
   339             printk("dropped %d bytes\n",size-128-i);
   338             i = size - 128;
   340             i = size - 128;
       
   341             EC_DBG("");
   339         }
   342         }
   340     }
   343     }
   341     printk("\n");
   344     printk("\n");
   342 }
   345 }
   343 
   346