Skip to content

Commit 30310d9

Browse files
committed
[ppctty] tweak debug printf
1 parent cf53860 commit 30310d9

File tree

1 file changed

+13
-6
lines changed
  • iop/debug/ppctty/src

1 file changed

+13
-6
lines changed

iop/debug/ppctty/src/tty.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ IOP->PPC TTY
1313
#include <intrman.h>
1414
#include <ioman.h>
1515
#include <thsemap.h>
16+
17+
#ifdef DEBUG
18+
#define DPRINTF(fmt, x...) printf("ppctty: "fmt, ##x)
19+
#else
20+
#define DPRINTF(x...)
21+
#endif
22+
1623
static int tty_sema = -1;
1724

1825
extern void tty_puts(const char *str);
@@ -21,7 +28,7 @@ static int ttyfs_error() { return -1; }
2128

2229
static int ttyfs_init()
2330
{
24-
//DBG_puts("SIOTTY: FS Init()\n");
31+
DPRINTF("FS Init()\n");
2532
if ((tty_sema = CreateMutex(IOP_MUTEX_UNLOCKED)) < 0)
2633
{
2734
DPRINTF("Failed to create mutex\n");
@@ -32,7 +39,7 @@ static int ttyfs_init()
3239

3340
static int ttyfs_deinit()
3441
{
35-
//DBG_puts("SIOTTY: FS Deinit()\n");
42+
DPRINTF("FS Deinit()\n");
3643
DeleteSema(tty_sema);
3744
return 0;
3845
}
@@ -43,7 +50,7 @@ static int ttyfs_open(iop_file_t *file, const char *name, int flags)
4350
(void)name;
4451
(void)flags;
4552

46-
//DBG_puts("SIOTTY: FS Open()\n");
53+
DPRINTF("FS Open()\n");
4754
return 0;
4855
}
4956

@@ -52,15 +59,15 @@ static int ttyfs_dopen(iop_file_t *file, const char *name)
5259
(void)file;
5360
(void)name;
5461

55-
//DBG_puts("SIOTTY: FS Dopen()\n");
62+
DPRINTF("FS Dopen()\n");
5663
return 0;
5764
}
5865

5966
static int ttyfs_close(iop_file_t *file)
6067
{
6168
(void)file;
6269

63-
//DBG_puts("SIOTTY: FS Close()\n");
70+
DPRINTF("FS Close()\n");
6471
return(0);
6572
}
6673

@@ -70,7 +77,7 @@ static int ttyfs_write(iop_file_t *file, void *ptr, int size) {
7077

7178
(void)file;
7279

73-
//DBG_puts("SIOTTY: FS Write()\n");
80+
DPRINTF("FS Write()\n");
7481

7582
WaitSema(tty_sema);
7683
while(bCount < size)

0 commit comments

Comments
 (0)