mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Initial Arduino IDE based on Processing.
This commit is contained in:
55
build/shared/lib/avrlib/ccrma/debug.c
Executable file
55
build/shared/lib/avrlib/ccrma/debug.c
Executable file
@ -0,0 +1,55 @@
|
||||
|
||||
#include <io.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "lcd.h"
|
||||
#include "rprintf.h"
|
||||
#include "timer.h"
|
||||
#include "osc.h"
|
||||
|
||||
|
||||
u08 debugMode = 0;
|
||||
u08 lcdDebugX;
|
||||
u08 lcdDebugY;
|
||||
|
||||
void debugInitLCD(u08 x, u08 y) {
|
||||
lcdInit();
|
||||
lcdClear();
|
||||
|
||||
lcdDebugX = x;
|
||||
lcdDebugY = y;
|
||||
|
||||
debugMode |= DEBUG_MODE_LCD;
|
||||
|
||||
debug(PSTR("LCD Debug init()"));
|
||||
}
|
||||
|
||||
void debugInitOSC(void) {
|
||||
oscInit();
|
||||
debugMode |= DEBUG_MODE_OSC;
|
||||
}
|
||||
|
||||
void debug(const char PROGMEM *fmt) {
|
||||
int code;
|
||||
|
||||
if (debugMode & DEBUG_MODE_OSC) {
|
||||
oscSendMessageString("/debug",fmt);
|
||||
}
|
||||
if (debugMode & DEBUG_MODE_LCD) {
|
||||
rprintfInit(&lcdDataWrite);
|
||||
lcdGotoXY(lcdDebugX,lcdDebugY);
|
||||
rprintf1RamRom(STRING_IN_ROM, fmt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// debugFlush assumes that timerInit() have been called already
|
||||
void debugFlash(const u08 port, const u08 pin) {
|
||||
sbi(DDR(port), pin);
|
||||
cbi(port, pin);
|
||||
timerPause(500);
|
||||
sbi(port, pin);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user