Depot Pertamina / Mbed 2 deprecated SPBU_PRINTER_LPC_4x3

Dependencies:   mbed mbed-rtos Printer EthernetInterface TextLCD keypad Audio TMU220

Committer:
mauuuuul
Date:
Fri Feb 07 08:25:06 2020 +0000
Revision:
0:0d3826561161
Versi trawas dengan LPC

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mauuuuul 0:0d3826561161 1 #ifndef CONST_DEFINES_H
mauuuuul 0:0d3826561161 2 #define CONST_DEFINES_H
mauuuuul 0:0d3826561161 3
mauuuuul 0:0d3826561161 4 extern Serial dbg;
mauuuuul 0:0d3826561161 5
mauuuuul 0:0d3826561161 6 //delays
mauuuuul 0:0d3826561161 7 #define delay(n) wait_ms(n) // in milisecond
mauuuuul 0:0d3826561161 8 #define delay_us(n) wait_us(n) // in microsecond
mauuuuul 0:0d3826561161 9
mauuuuul 0:0d3826561161 10 // colored terminal output using ANSI escape sequences
mauuuuul 0:0d3826561161 11 #if 1
mauuuuul 0:0d3826561161 12 #define COL(c) "\033[" c
mauuuuul 0:0d3826561161 13 #else
mauuuuul 0:0d3826561161 14 #define COL(c)
mauuuuul 0:0d3826561161 15 #endif
mauuuuul 0:0d3826561161 16 #define DEF COL("39m")
mauuuuul 0:0d3826561161 17 #define BLA COL("30m")
mauuuuul 0:0d3826561161 18 #define RED COL("31m")
mauuuuul 0:0d3826561161 19 #define GRE COL("32m")
mauuuuul 0:0d3826561161 20 #define YEL COL("33m")
mauuuuul 0:0d3826561161 21 #define BLU COL("34m")
mauuuuul 0:0d3826561161 22 #define MAG COL("35m")
mauuuuul 0:0d3826561161 23 #define CYA COL("36m")
mauuuuul 0:0d3826561161 24 #define WHY COL("37m")
mauuuuul 0:0d3826561161 25
mauuuuul 0:0d3826561161 26 void _debugPrint(const char* color, const char* format, ...)
mauuuuul 0:0d3826561161 27 {
mauuuuul 0:0d3826561161 28 va_list args;
mauuuuul 0:0d3826561161 29 va_start (args, format);
mauuuuul 0:0d3826561161 30 if (color) dbg.printf(color);
mauuuuul 0:0d3826561161 31 dbg.vprintf(format, args);
mauuuuul 0:0d3826561161 32 if (color) dbg.printf(DEF);
mauuuuul 0:0d3826561161 33 va_end (args);
mauuuuul 0:0d3826561161 34 }
mauuuuul 0:0d3826561161 35
mauuuuul 0:0d3826561161 36 #define ERROR(...) _debugPrint(RED, __VA_ARGS__)
mauuuuul 0:0d3826561161 37 #define INFO(...) _debugPrint(GRE, __VA_ARGS__)
mauuuuul 0:0d3826561161 38 #define TRACE(...) _debugPrint(DEF, __VA_ARGS__)
mauuuuul 0:0d3826561161 39 #define TEST(...) _debugPrint(CYA, __VA_ARGS__)
mauuuuul 0:0d3826561161 40 #define FLOW(...) _debugPrint(YEL, __VA_ARGS__)
mauuuuul 0:0d3826561161 41 //==============================================================================
mauuuuul 0:0d3826561161 42
mauuuuul 0:0d3826561161 43 #endif // CONST_DEFINES_H
mauuuuul 0:0d3826561161 44