1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Merge branch 'esp8266' of https://github.com/Links2004/Arduino into Links2004-esp8266

This commit is contained in:
Ivan Grokhotkov
2015-05-14 02:34:21 +03:00
3 changed files with 48 additions and 0 deletions

View File

@ -229,6 +229,9 @@ long random(long, long);
void randomSeed(unsigned int);
long map(long, long, long, long, long);
// Debugging functions
void hexdump(uint8_t *mem, uint32_t len, uint8_t cols = 16);
#endif
#include "pins_arduino.h"

21
cores/esp8266/debug.cpp Normal file
View File

@ -0,0 +1,21 @@
/*
* debug.c
*
* Created on: 13.05.2015
* Author: Markus Sattler
*/
#include "Arduino.h"
void ICACHE_RAM_ATTR hexdump(uint8_t *mem, uint32_t len, uint8_t cols) {
os_printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", mem, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
os_printf("\n[0x%08X] 0x%08X: ", mem, i);
}
os_printf("%02X ", *mem);
mem++;
}
os_printf("\n");
}