master/module.c
changeset 1586 eb9185dfa8ac
parent 1581 e51cf2af3ff9
parent 1584 cd9a68fd5b89
child 1814 23fcca9ef1fb
equal deleted inserted replaced
1581:e51cf2af3ff9 1586:eb9185dfa8ac
   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 {
   328     EC_DBG("");
   330     EC_DBG("");
   329     for (i = 0; i < size; i++) {
   331     for (i = 0; i < size; i++) {
   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");
       
   335             EC_DBG("");
       
   336         }
       
   337         if (i+1 == 128 && size > 256)
       
   338         {
       
   339             printk("dropped %d bytes\n",size-128-i);
       
   340             i = size - 128;
   333             EC_DBG("");
   341             EC_DBG("");
   334         }
   342         }
   335     }
   343     }
   336     printk("\n");
   344     printk("\n");
   337 }
   345 }