|
|
@ -73,27 +73,109 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
void IRQHandler();
|
|
|
|
void IRQHandler();
|
|
|
|
|
|
|
|
|
|
|
|
void print(const char value[]) { printf("%s" , value); }
|
|
|
|
#define DEC 10
|
|
|
|
void print(char value, int = 0) { printf("%c" , value); }
|
|
|
|
#define HEX 16
|
|
|
|
void print(unsigned char value, int = 0) { printf("%u" , value); }
|
|
|
|
#define OCT 8
|
|
|
|
void print(int value, int = 0) { printf("%d" , value); }
|
|
|
|
#define BIN 2
|
|
|
|
void print(unsigned int value, int = 0) { printf("%u" , value); }
|
|
|
|
#define BYTE 0
|
|
|
|
void print(long value, int = 0) { printf("%ld" , value); }
|
|
|
|
|
|
|
|
void print(unsigned long value, int = 0) { printf("%lu" , value); }
|
|
|
|
|
|
|
|
|
|
|
|
void print_bin(uint32_t value, uint8_t num_digits) {
|
|
|
|
void print(float value, int round = 6) { printf("%f" , value); }
|
|
|
|
uint32_t mask = 1 << (num_digits -1);
|
|
|
|
void print(double value, int round = 6) { printf("%f" , value ); }
|
|
|
|
for (uint8_t i = 0; i < num_digits; i++) {
|
|
|
|
|
|
|
|
if (!(i % 4) && i) printf(" ");
|
|
|
|
void println(const char value[]) { printf("%s\n" , value); }
|
|
|
|
if (!(i % 16) && i) printf(" ");
|
|
|
|
void println(char value, int = 0) { printf("%c\n" , value); }
|
|
|
|
if (value & mask) printf("1");
|
|
|
|
void println(unsigned char value, int = 0) { printf("%u\r\n" , value); }
|
|
|
|
else printf("0");
|
|
|
|
void println(int value, int = 0) { printf("%d\n" , value); }
|
|
|
|
value <<= 1;
|
|
|
|
void println(unsigned int value, int = 0) { printf("%u\n" , value); }
|
|
|
|
}
|
|
|
|
void println(long value, int = 0) { printf("%ld\n" , value); }
|
|
|
|
}
|
|
|
|
void println(unsigned long value, int = 0) { printf("%lu\n" , value); }
|
|
|
|
|
|
|
|
void println(float value, int round = 6) { printf("%f\n" , value ); }
|
|
|
|
void print(const char value[]) {
|
|
|
|
void println(double value, int round = 6) { printf("%f\n" , value ); }
|
|
|
|
printf("%s" , value);
|
|
|
|
void println(void) { print('\n'); }
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(char value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
if (nbase == BIN) print_bin(value,8);
|
|
|
|
|
|
|
|
else if (nbase == OCT) printf("%3o", value);
|
|
|
|
|
|
|
|
else if (nbase == HEX) printf("%2X", value);
|
|
|
|
|
|
|
|
else if (nbase == DEC ) printf("%d", value);
|
|
|
|
|
|
|
|
else printf("%c" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(unsigned char value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
if (nbase == BIN) print_bin(value,8);
|
|
|
|
|
|
|
|
else if (nbase == OCT) printf("%3o", value);
|
|
|
|
|
|
|
|
else if (nbase == HEX) printf("%2X", value);
|
|
|
|
|
|
|
|
else printf("%u" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(int value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
if (nbase == BIN) print_bin(value,16);
|
|
|
|
|
|
|
|
else if (nbase == OCT) printf("%6o", value);
|
|
|
|
|
|
|
|
else if (nbase == HEX) printf("%4X", value);
|
|
|
|
|
|
|
|
else printf("%d", value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(unsigned int value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
if (nbase == BIN) print_bin(value,16);
|
|
|
|
|
|
|
|
else if (nbase == OCT) printf("%6o", value);
|
|
|
|
|
|
|
|
else if (nbase == HEX) printf("%4X", value);
|
|
|
|
|
|
|
|
else printf("%u" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(long value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
if (nbase == BIN) print_bin(value,32);
|
|
|
|
|
|
|
|
else if (nbase == OCT) printf("%11o", value);
|
|
|
|
|
|
|
|
else if (nbase == HEX) printf("%8X", value);
|
|
|
|
|
|
|
|
else printf("%ld" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(unsigned long value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
if (nbase == BIN) print_bin(value,32);
|
|
|
|
|
|
|
|
else if (nbase == OCT) printf("%11o", value);
|
|
|
|
|
|
|
|
else if (nbase == HEX) printf("%8X", value);
|
|
|
|
|
|
|
|
else printf("%lu" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(float value, int round = 6) {
|
|
|
|
|
|
|
|
printf("%f" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(double value, int round = 6) {
|
|
|
|
|
|
|
|
printf("%f" , value );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void println(const char value[]) {
|
|
|
|
|
|
|
|
printf("%s\n" , value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(char value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
print(value, nbase);
|
|
|
|
|
|
|
|
println();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(unsigned char value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
print(value, nbase);
|
|
|
|
|
|
|
|
println();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(int value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
print(value, nbase);
|
|
|
|
|
|
|
|
println();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(unsigned int value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
print(value, nbase);
|
|
|
|
|
|
|
|
println();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(long value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
print(value, nbase);
|
|
|
|
|
|
|
|
println();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(unsigned long value, int nbase = BYTE) {
|
|
|
|
|
|
|
|
print(value, nbase);
|
|
|
|
|
|
|
|
println();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(float value, int round = 6) {
|
|
|
|
|
|
|
|
printf("%f\n" , value );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(double value, int round = 6) {
|
|
|
|
|
|
|
|
printf("%f\n" , value );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void println(void) {
|
|
|
|
|
|
|
|
print('\n');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|