blob: 2cc6bef772cc993612523fc17d6b9b2b68f24870 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include <stdlib.hch>
#include "pal_master.hch"
#include "debug.hch"
void print_hex_value(unsigned value)
{
unsigned 8 ch;
unsigned 4 i;
unsigned 32 tempvalue;
tempvalue = 0 @ value;
for(i = 0;i < 8;i++)
{
ch = 0 @ (tempvalue\\28);
tempvalue <<= 4;
ch += (ch > 9) ? 0x37 : 0x30;
PalDataPortWrite(PalRS232PortCT(0), ch);
}
PalDataPortWrite(PalRS232PortCT(0), 0x0A);
PalDataPortWrite(PalRS232PortCT(0), 0x0D);
}
void print_string(unsigned 8 s[16]) {
unsigned 4 i;
for(i = 0;('\0' != s[i]) || (0 < i);i++) {
PalDataPortWrite(PalRS232PortCT(0), s[i] +0x30);
}
}
|