added via accelerant, a copy of skeleton driver yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13609 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b6f37046ce
commit
50d1478622
34
src/add-ons/accelerants/via/engine/support.c
Normal file
34
src/add-ons/accelerants/via/engine/support.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* Some commmon support functions */
|
||||
/* Mark Watson 2/2000;
|
||||
* Rudolf Cornelissen 1/2004 */
|
||||
|
||||
#define MODULE_BIT 0x00000800
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "std.h"
|
||||
|
||||
/*delays in multiple of microseconds*/
|
||||
void delay(bigtime_t i)
|
||||
{
|
||||
bigtime_t start=system_time();
|
||||
while(system_time()-start<i);
|
||||
}
|
||||
|
||||
/*debug logging*/
|
||||
void eng_log(char *fmt, ...)
|
||||
{
|
||||
char buffer[1024];
|
||||
char fname[64];
|
||||
FILE *myhand;
|
||||
va_list args;
|
||||
|
||||
sprintf (fname, "/boot/home/" DRIVER_PREFIX ".accelerant.%d.log", accelerantIsClone);
|
||||
myhand=fopen(fname,"a+");
|
||||
|
||||
if (myhand == NULL) return;
|
||||
|
||||
va_start(args,fmt);
|
||||
vsprintf (buffer, fmt, args);
|
||||
fprintf(myhand, "%s", buffer);
|
||||
fclose(myhand);
|
||||
}
|
Loading…
Reference in New Issue
Block a user