utility.cpp
来自「用于机器人自动低分辨路的地图测绘程序。用于机器人控制测绘。分为远端控制端和本地控」· C++ 代码 · 共 41 行
CPP
41 行
/*
Robot Interface
(C) 2006 Jason Hunt
nulluser@gmail.com
File: utility.cpp
*/
#include <windows.h>
#include <stdio.h>
#include "display.h"
CRITICAL_SECTION debug_lock;
/* Add a byte to a buffer */
void append_byte(unsigned char *buffer, unsigned int &index, unsigned char data)
{
buffer[index++] = data;
}
/* End of append_byte */
void debug_start(void)
{
InitializeCriticalSection(&debug_lock);
}
void debug(char *s)
{
// return;
add_line(s);
EnterCriticalSection(&debug_lock);
FILE *f = fopen("debug.txt", "at");
fprintf(f, "%s\n", s);
fclose(f);
LeaveCriticalSection(&debug_lock);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?