Notify again

This commit is contained in:
Oleg Mazurov 2013-06-11 21:06:13 -06:00
parent 7d981b4361
commit 1c3b6b79eb
2 changed files with 11 additions and 11 deletions

View file

@ -48,13 +48,13 @@ void HexDumper<BASE_CLASS, LEN_TYPE, OFFSET_TYPE>::Parse(const LEN_TYPE len, con
for(LEN_TYPE j = 0; j < len; j++, byteCount++, byteTotal++) {
if(!byteCount) {
PrintHex<OFFSET_TYPE > (byteTotal, 0x80);
Notify(PSTR(": "), 0x80);
E_Notify(PSTR(": "), 0x80);
}
PrintHex<uint8_t > (pbuf[j], 0x80);
Notify(PSTR(" "), 0x80);
E_Notify(PSTR(" "), 0x80);
if(byteCount == 15) {
Notify(PSTR("\r\n"), 0x80);
E_Notify(PSTR("\r\n"), 0x80);
byteCount = 0xFF;
}
}

View file

@ -27,7 +27,7 @@ void E_Notifyc(char c, int lvl);
template <class T>
void PrintHex(T val, int lvl) {
#ifdef DEBUG
//#ifdef DEBUG
int num_nibbles = sizeof(T) * 2;
do {
@ -35,23 +35,23 @@ void PrintHex(T val, int lvl) {
if(v > 57) v += 7;
E_Notifyc(v, lvl);
} while(--num_nibbles);
#endif
//#endif
}
template <class T>
void PrintBin(T val, int lvl) {
#ifdef DEBUG
//#ifdef DEBUG
for(T mask = (((T) 1) << ((sizeof(T) << 3) - 1)); mask; mask >>= 1)
if(val & mask)
E_Notifyc('1', lvl);
else
E_Notifyc('0', lvl);
#endif
//#endif
}
template <class T>
void SerialPrintHex(T val) {
#ifdef DEBUG
//#ifdef DEBUG
int num_nibbles = sizeof(T) * 2;
do {
@ -59,12 +59,12 @@ void SerialPrintHex(T val) {
if(v > 57) v += 7;
Serial.print(v);
} while(--num_nibbles);
#endif
//#endif
}
template <class T>
void PrintHex2(Print *prn, T val) {
#ifdef DEBUG
//#ifdef DEBUG
T mask = (((T) 1) << (((sizeof(T) << 1) - 1) << 2));
while(mask > 1) {
@ -74,7 +74,7 @@ void PrintHex2(Print *prn, T val) {
mask >>= 4;
}
prn->print((T) val, HEX);
#endif
//#endif
}
#endif // __PRINTHEX_H__